summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/tdepartsaver
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-01-26 13:16:15 -0600
committerTimothy Pearson <[email protected]>2013-01-26 13:16:15 -0600
commit7e09b5c2efae58399621a938de26b9675b8ba621 (patch)
treede2c9535e1f4c48ae91910492d298eba1d593fd5 /tdescreensaver/tdepartsaver
parent159f7e147ac33c924b3ce9050c8f03cbc54916ee (diff)
downloadtdeartwork-7e09b5c2efae58399621a938de26b9675b8ba621.tar.gz
tdeartwork-7e09b5c2efae58399621a938de26b9675b8ba621.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'tdescreensaver/tdepartsaver')
-rw-r--r--tdescreensaver/tdepartsaver/CMakeLists.txt33
-rw-r--r--tdescreensaver/tdepartsaver/Makefile.am14
-rw-r--r--tdescreensaver/tdepartsaver/configwidget.ui299
-rw-r--r--tdescreensaver/tdepartsaver/tdepartsaver.cpp387
-rw-r--r--tdescreensaver/tdepartsaver/tdepartsaver.desktop247
-rw-r--r--tdescreensaver/tdepartsaver/tdepartsaver.h103
6 files changed, 1083 insertions, 0 deletions
diff --git a/tdescreensaver/tdepartsaver/CMakeLists.txt b/tdescreensaver/tdepartsaver/CMakeLists.txt
new file mode 100644
index 00000000..e4259969
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/CMakeLists.txt
@@ -0,0 +1,33 @@
+#################################################
+#
+# (C) 2011 Golubev Alexander
+# fatzer2 (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+##### desktop files #############################
+
+install( FILES tdepartsaver.desktop
+ DESTINATION ${APPS_INSTALL_DIR}/System/ScreenSavers )
+
+##### kpart_cde ##################################
+
+tde_add_executable( tdepartsaver.kss AUTOMOC
+ SOURCES tdepartsaver.cpp configwidget.ui
+ LINK tdescreensaver-shared kio-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/tdescreensaver/tdepartsaver/Makefile.am b/tdescreensaver/tdepartsaver/Makefile.am
new file mode 100644
index 00000000..0e759e7e
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/Makefile.am
@@ -0,0 +1,14 @@
+bin_PROGRAMS = tdepartsaver.kss
+INCLUDES = $(all_includes)
+
+tdepartsaver_kss_SOURCES = tdepartsaver.cpp configwidget.ui
+tdepartsaver_kss_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+tdepartsaver_kss_LDADD = $(LIB_KFILE) $(LIB_KPARTS) -ltdescreensaver
+
+METASOURCES = AUTO
+
+desktop_DATA = tdepartsaver.desktop
+desktopdir = $(kde_appsdir)/System/ScreenSavers
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/tdepartsaver.pot
diff --git a/tdescreensaver/tdepartsaver/configwidget.ui b/tdescreensaver/tdepartsaver/configwidget.ui
new file mode 100644
index 00000000..a246d8f4
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/configwidget.ui
@@ -0,0 +1,299 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ConfigWidget</class>
+<author>Stefan Schimanski &lt;[email protected]&gt;</author>
+<widget class="TQDialog">
+ <property name="name">
+ <cstring>ConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>463</width>
+ <height>376</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Media Screen Saver</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Files</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQListBox" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_files</cstring>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>m_down</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Down</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>m_up</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Up</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_add</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="TQPushButton" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_remove</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_single</cstring>
+ </property>
+ <property name="text">
+ <string>Only show one randomly chosen medium</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="TQRadioButton" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_multiple</cstring>
+ </property>
+ <property name="text">
+ <string>Switch to another medium after a delay</string>
+ </property>
+ </widget>
+ <widget class="TQLayoutWidget" row="2" column="1">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="TQLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_delayLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Delay:</string>
+ </property>
+ </widget>
+ <widget class="TQSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>m_delay</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="TQCheckBox" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>m_random</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Choose next medium randomly</string>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="0" column="2">
+ <property name="name">
+ <cstring>m_secondsLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>seconds</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer16</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="TQLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>m_ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="TQPushButton">
+ <property name="name">
+ <cstring>m_cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in declaration">klocale.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/tdescreensaver/tdepartsaver/tdepartsaver.cpp b/tdescreensaver/tdepartsaver/tdepartsaver.cpp
new file mode 100644
index 00000000..a2c0cc40
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/tdepartsaver.cpp
@@ -0,0 +1,387 @@
+/*
+ * Copyright (C) 2001 Stefan Schimanski <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <time.h>
+
+#include <tqwidget.h>
+#include <tqdialog.h>
+#include <tqtimer.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+
+#include <klocale.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klibloader.h>
+#include <kconfig.h>
+#include <kfiledialog.h>
+#include <kurl.h>
+#include <tdeparts/part.h>
+#include <ktrader.h>
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+#include <kmimetype.h>
+
+#include <tdescreensaver.h>
+
+#include "configwidget.h"
+#include "tdepartsaver.h"
+#include <kiconloader.h>
+
+
+TQPtrList<KPartSaver> g_savers;
+bool g_inited = false;
+
+
+extern "C"
+{
+ KDE_EXPORT const char *kss_applicationName = "tdepartsaver";
+ KDE_EXPORT const char *kss_description = I18N_NOOP( "KPart Screen Saver" );
+ KDE_EXPORT const char *kss_version = "1.0";
+
+ KDE_EXPORT KScreenSaver *kss_create( WId d )
+ {
+ TDEGlobal::locale()->insertCatalogue("tdepartsaver");
+ return new KPartSaver( d );
+ }
+
+ KDE_EXPORT TQDialog *kss_setup()
+ {
+ kdDebug() << "kss_setup" << endl;
+ TDEGlobal::locale()->insertCatalogue("tdepartsaver");
+ return new SaverConfig;
+ }
+}
+
+
+void exitHandler( int )
+{
+ kdDebug() << "exitHandler" << endl;
+ g_savers.clear();
+ KLibLoader::self()->cleanUp();
+ exit(0);
+}
+
+
+KPartSaver::KPartSaver( WId id )
+ : KScreenSaver( id ), m_timer(), m_part(0), m_current(-1), m_back(0)
+{
+ // install signal handlers to make sure that nspluginviewer is shutdown correctly
+ // move this into the nspluginviewer kpart code
+ if( !g_inited ) {
+ g_inited = true;
+ g_savers.setAutoDelete( true );
+
+ srand( time(0) );
+
+ // install signal handler
+ signal( SIGINT, exitHandler ); // Ctrl-C will cause a clean exit...
+ signal( SIGTERM, exitHandler ); // "kill"...
+ signal( SIGHUP, exitHandler ); // "kill -HUP" (hangup)...
+ signal( SIGKILL, exitHandler ); // "kill -KILL"
+ //atexit( ( void (*)(void) ) exitHandler );
+ }
+
+ g_savers.append( this );
+
+ closeURL();
+
+ // load config
+ TDEConfig *cfg = kapp->config();
+ cfg->setGroup( "Misc" );
+
+ m_single = cfg->readBoolEntry( "Single", true );
+ m_delay = cfg->readNumEntry( "Delay", 60 );
+ m_random = cfg->readBoolEntry( "Random", false );
+ m_files = cfg->readListEntry( "Files" );
+
+ if( m_files.count()==0 ) {
+
+ // create background widget
+ m_back = new TQLabel( i18n("The screen saver is not configured yet."), this );
+
+ m_back->setAlignment( AlignCenter );
+ embed( m_back );
+ m_back->show();
+
+ } else {
+
+ // queue files
+ for( unsigned int n=0; n<m_files.count(); n++ )
+ queue( KURL::fromPathOrURL( m_files[n] ) );
+
+ // play files
+ if( m_single )
+ next( m_random );
+ else {
+ next( m_random );
+ m_timer = new TQTimer( this );
+ m_timer->start( m_delay*1000, true );
+ connect( m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()) );
+ }
+ }
+}
+
+
+KPartSaver::~KPartSaver()
+{
+ g_savers.take( g_savers.findRef( this ));
+ closeURL();
+}
+
+
+void KPartSaver::closeURL()
+{
+ if( m_part ) {
+ m_part->closeURL();
+ delete m_part;
+ m_part = 0;
+ }
+}
+
+
+bool KPartSaver::openURL( KURL url )
+{
+ closeURL();
+
+ // find mime type
+ TQString mime = KMimeType::findByURL( url )->name();
+
+ // find fitting tdeparts
+ KTrader::OfferList offers;
+ offers = KTrader::self()->query( mime, "'KParts/ReadOnlyPart' in ServiceTypes" );
+ if( offers.count()==0 ) {
+ kdDebug() << "Can't find proper kpart for " << mime << endl;
+ return false;
+ }
+
+ // load kpart library
+ TQString lib = offers.first()->library();
+ KLibFactory *factory = KLibLoader::self()->factory( lib.latin1() );
+ if( !factory ) {
+ kdDebug() << "Library " << lib << " not found." << endl;
+ return false;
+ }
+
+ // create kpart
+ m_part = (KParts::ReadOnlyPart *)factory->create( TQT_TQOBJECT(this), "kpart", "KParts::ReadOnlyPart" );
+ if( !m_part ) {
+ kdDebug() << "Part for " << url.url() << " can't be constructed" << endl;
+ return false;
+ } else
+ embed( m_part->widget() );
+
+ // show kpart
+ delete m_back;
+ m_back = 0;
+
+ show();
+ m_part->widget()->show();
+
+ // load url
+ if( !m_part->openURL( url ) ) {
+ kdDebug() << "Can't load " << url.url() << endl;
+ closeURL();
+ return false;
+ }
+
+
+
+ return true;
+}
+
+
+void KPartSaver::queue( KURL url )
+{
+ Medium medium;
+ medium.url = url;
+ medium.failed = false;
+ m_media.append( medium );
+}
+
+
+void KPartSaver::timeout()
+{
+ next( m_random );
+ m_timer->start( m_delay*1000, true );
+}
+
+
+void KPartSaver::next( bool random )
+{
+ // try to find working media
+ while( m_media.count()>0 ) {
+
+ if( random )
+ m_current = rand() % m_media.count();
+ else
+ m_current++;
+
+ if( m_current>=(int)m_media.count() )
+ m_current = 0;
+
+ kdDebug() << "Trying medium " << m_media[m_current].url.url() << endl;
+
+ // either start immediately or start mimejob first
+ if( !openURL( m_media[m_current].url ) ) {
+ m_media.remove( m_media.at(m_current) );
+ m_current--;
+ } else
+ return;
+
+ }
+
+ // create background widget
+ m_back = new TQLabel( i18n("All of your files are unsupported"), this );
+
+ m_back->setAlignment( AlignCenter );
+ embed( m_back );
+ m_back->show();
+
+ // nothing found, set to invalid
+ m_current = -1;
+}
+
+
+/*******************************************************************************/
+
+
+SaverConfig::SaverConfig( TQWidget* parent, const char* name )
+ : ConfigWidget( parent, name, true )
+{
+ connect( m_ok, TQT_SIGNAL(clicked()), TQT_SLOT(apply()) );
+ connect( m_ok, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) );
+ connect( m_cancel, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) );
+
+ connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_delayLabel, TQT_SLOT(setEnabled(bool)) );
+ connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_delay, TQT_SLOT(setEnabled(bool)) );
+ connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_secondsLabel, TQT_SLOT(setEnabled(bool)) );
+ connect( m_multiple, TQT_SIGNAL(toggled(bool)), m_random, TQT_SLOT(setEnabled(bool)) );
+
+ connect( m_files, TQT_SIGNAL(selectionChanged()), TQT_SLOT(select()) );
+ connect( m_add, TQT_SIGNAL(clicked()), TQT_SLOT(add()) );
+ connect( m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(remove()) );
+ connect( m_up, TQT_SIGNAL(clicked()), TQT_SLOT(up()) );
+ connect( m_down, TQT_SIGNAL(clicked()), TQT_SLOT(down()) );
+
+ m_up->setIconSet( SmallIconSet("up") );
+ m_down->setIconSet( SmallIconSet("down") );
+
+ // load config
+ TDEConfig *cfg = kapp->config();
+ cfg->setGroup( "Misc" );
+
+ bool single = cfg->readBoolEntry( "Single", true );
+ m_single->setChecked( single );
+ m_multiple->setChecked( !single );
+ m_delay->setMinValue( 1 );
+ m_delay->setMaxValue( 10000 );
+ m_delay->setValue( cfg->readNumEntry( "Delay", 60 ) );
+ m_random->setChecked( cfg->readBoolEntry( "Random", false ) );
+ m_files->insertStringList( cfg->readListEntry( "Files" ) );
+
+ // update buttons
+ select();
+}
+
+
+SaverConfig::~SaverConfig()
+{
+}
+
+
+void SaverConfig::apply()
+{
+ kdDebug() << "apply" << endl;
+
+ TDEConfig *cfg = kapp->config();
+ cfg->setGroup( "Misc" );
+
+ cfg->writeEntry( "Single", m_single->isChecked() );
+ cfg->writeEntry( "Delay", m_delay->value() );
+ cfg->writeEntry( "Random", m_random->isChecked() );
+
+ int num = m_files->count();
+ TQStringList files;
+ for( int n=0; n<num; n++ )
+ files << m_files->text(n);
+
+ cfg->writeEntry( "Files", files );
+
+ cfg->sync();
+}
+
+
+void SaverConfig::add()
+{
+ KURL::List files = KFileDialog::getOpenURLs( TQString(), TQString(),
+ this, i18n("Select Media Files") );
+ for( unsigned int n=0; n<files.count(); n++ )
+ m_files->insertItem( files[n].prettyURL(), -1 );
+}
+
+
+void SaverConfig::remove()
+{
+ int current = m_files->currentItem();
+ if( current!=-1 )
+ m_files->removeItem( current );
+}
+
+
+void SaverConfig::select()
+{
+ bool enabled = m_files->currentItem()!=-1;
+ m_remove->setEnabled( enabled );
+ m_up->setEnabled( enabled && m_files->currentItem()!=0 );
+ m_down->setEnabled( enabled && m_files->currentItem()!=(int)m_files->count()-1 );
+}
+
+
+void SaverConfig::up()
+{
+ int current = m_files->currentItem();
+ if ( current>0 ) {
+ TQString txt = m_files->currentText();
+ m_files->removeItem( current );
+ m_files->insertItem( txt, current-1 );
+ m_files->setCurrentItem( current-1 );
+ }
+}
+
+
+void SaverConfig::down()
+{
+ int current = m_files->currentItem();
+ if ( current!=-1 && current<(int)m_files->count()-1 ) {
+ TQString txt = m_files->currentText();
+ m_files->removeItem( current );
+ m_files->insertItem( txt, current+1 );
+ m_files->setCurrentItem( current+1 );
+ }
+}
+
+#include "tdepartsaver.moc"
diff --git a/tdescreensaver/tdepartsaver/tdepartsaver.desktop b/tdescreensaver/tdepartsaver/tdepartsaver.desktop
new file mode 100644
index 00000000..82564b1c
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/tdepartsaver.desktop
@@ -0,0 +1,247 @@
+[Desktop Entry]
+X-TDE-Category=Banners & Pictures
+Name=Media Screen Saver
+Name[af]=Media Skerm Bewaarder
+Name[bg]=Медия
+Name[br]=Damanter skramm media
+Name[bs]=Media screen saver
+Name[ca]=Salvapantalles multimèdia
+Name[cs]=Šetřič obrazovky Media
+Name[cy]=Arbedydd Sgrîn efo Cyfryngau
+Name[da]=Mediepauseskærm
+Name[de]=Medien-Bildschirmschoner
+Name[el]=Προφύλαξη οθόνης πολυμέσων
+Name[es]=Salvapantallas multimedia
+Name[et]=Meedia-ekraanisäästja
+Name[eu]=Multimedia pantaila babeslea
+Name[fa]=محافظ صفحه نمایش رسانه
+Name[fi]=Media näytönsäästäjä
+Name[fr]=Écran de veille multidocument
+Name[fy]=Media skermbefeiliging
+Name[ga]=Spárálaí Scáileáin Meáin
+Name[gl]=Protector de Pantalla multimédia
+Name[he]=מולטימדיה
+Name[hi]=मीडिया स्क्रीन सेवर
+Name[hu]=Média képernyővédő
+Name[is]=Miðilsskjásvæfa
+Name[it]=Salva schermo multimediale
+Name[ja]=メディアスクリーンセーバー
+Name[ka]=მულტიმედია ეკრანმზოგი
+Name[mk]=Мултимедијален екрански чувар
+Name[ms]=Screen Saver Media
+Name[mt]=Screensaver tal-media
+Name[nb]=Media pauseskjerm
+Name[nds]=Medien-Pausschirm
+Name[ne]=मिडिया स्क्रिन सेभर
+Name[nl]=Media schermbeveiliging
+Name[nn]=Mediepauseskjerm
+Name[nso]=Seboloki sa Pontsho ya Media
+Name[pl]=Multimedia
+Name[pt]=Protector de Ecrã Media
+Name[pt_BR]=Protetor de Tela
+Name[ro]=Protecţie de ecran multimedia
+Name[ru]=Просмотр мультимедиа
+Name[sk]=Šetrič obrazovky Media
+Name[sl]=Večpredstavnostni ohranjevalnik zaslona
+Name[sr]=Медија чувар екрана
+Name[sr@Latn]=Medija čuvar ekrana
+Name[sv]=Mediaskärmsläckare
+Name[ta]=ஊடக திரை காப்பாளர்
+Name[tg]=Аз назар гузарондани мултимедия
+Name[tr]=Ekran Koruyucu
+Name[uk]=Мультимедійний зберігач екрана
+Name[ven]=Tshivhulungi tsha tshikirini tsha Media
+Name[vi]=Nêm=Hình ảnh Bảo vệ Màn hình
+Name[zh_CN]=媒体屏幕保护程序
+Name[zh_TW]=媒體螢幕保護程式
+Name[zu]=Umgcini Wesikrini Somculo
+
+Type=Application
+Exec=tdepartsaver.kss
+Icon=tdescreensaver
+Actions=Setup;InWindow;Root;
+
+[Desktop Action Setup]
+Exec=tdepartsaver.kss -setup
+Name=Setup...
+Name[af]=Opstelling...
+Name[bg]=Настройки...
+Name[br]=Kefluniadur ...
+Name[bs]=Postavke...
+Name[ca]=Arranjament...
+Name[cs]=Nastavení...
+Name[cy]=Gosod ...
+Name[da]=Opsætning...
+Name[de]=Einrichtung ...
+Name[el]=Ρύθμιση...
+Name[eo]=Agordo...
+Name[es]=Configuración...
+Name[et]=Seadistamine...
+Name[eu]=Konfiguratu...
+Name[fa]=برپایی...
+Name[fi]=Asetukset...
+Name[fo]=Uppseting...
+Name[fr]=Configuration...
+Name[fy]=Opset...
+Name[ga]=Cumraigh...
+Name[gl]=Configuración...
+Name[he]=הגדרות...
+Name[hi]=सेटअप...
+Name[hu]=Beállítás...
+Name[is]=Stillingar...
+Name[it]=Impostazioni...
+Name[ja]=設定...
+Name[ka]=გამართვა...
+Name[lt]=Sąranka ...
+Name[lv]=Uzstādīšana...
+Name[mk]=Поставување...
+Name[ms]=Setkan...
+Name[mt]=Konfigurazzjoni...
+Name[nb]=Innstillinger …
+Name[nds]=Instellen...
+Name[ne]=सेटअप...
+Name[nl]=Instellingen...
+Name[nn]=Oppsett …
+Name[nso]=Beakanya...
+Name[pa]=ਸੈਟਅੱਪ...
+Name[pl]=Ustawienia...
+Name[pt]=Configurar...
+Name[pt_BR]=Configurar...
+Name[ro]=Setează...
+Name[ru]=Настройка...
+Name[rw]=Iboneza...
+Name[sk]=Nastavenie...
+Name[sl]=Nastavi ...
+Name[sr]=Подеси...
+Name[sr@Latn]=Podesi...
+Name[sv]=Inställningar...
+Name[ta]=அமைப்பு...
+Name[tg]=Барпосозӣ...
+Name[th]=ติดตั้ง...
+Name[tr]=Kurulum...
+Name[uk]=Встановити...
+Name[uz]=Oʻrnatish
+Name[uz@cyrillic]=Ўрнатиш
+Name[ven]=Vhekanya...
+Name[vi]=Thiết lập...
+Name[xh]=Iyacwangciswa...
+Name[zh_CN]=设置...
+Name[zh_TW]=設定...
+Name[zu]=Iyalungiselela...
+Icon=tdescreensaver
+
+[Desktop Action InWindow]
+Exec=tdepartsaver.kss -window-id %w
+Name=Display in Specified Window
+Name[bg]=Стартиране в избран прозорец
+Name[br]=Diskwel er prenestr spisaet
+Name[bs]=Prikaži u navedenom prozoru
+Name[ca]=Mostra a la finestra especificada
+Name[cs]=Zobrazit v určeném okně
+Name[cy]=Dangos mewn Ffenestr Benodol
+Name[da]=Visning i angivet vindue
+Name[de]=In bestimmten Fenster anzeigen
+Name[el]=Προβολή στο καθορισμένο παράθυρο
+Name[eo]=Montri en indikita fenestro
+Name[es]=Mostrar en la ventana especificada
+Name[et]=Määratud aknas näitamine
+Name[eu]=Bistaratu zehaztutako lehioan
+Name[fa]=نمایش در پنجرۀ مشخص‌شده
+Name[fi]=Näytä määrätyssä ikkunassa
+Name[fr]=Affichage dans la fenêtre spécifiée
+Name[fy]=Werjefte yn in definiearre finster
+Name[ga]=Taispeáin san Fhuinneog Sonraithe
+Name[gl]=Mostrar na fiestra indicada
+Name[he]=הצג בחלון המצוין
+Name[hi]=निर्दिष्ट विंडो में प्रदर्शित करें
+Name[hu]=Megjelenítés a megadott ablakban
+Name[is]=Birta í völdum glugga
+Name[it]=Mostra nella finestra specificata
+Name[ja]=特定のウィンドウで表示
+Name[ka]=ჩვენება მითითებულ ფანჯარაში
+Name[lt]=Rodyti nurodytame lange
+Name[mk]=Прикажи во наведениот прозорец
+Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
+Name[nb]=Vis i angitt vindu
+Name[nds]=In utsöcht Finster wiesen
+Name[ne]=निर्दिष्ट सञ्झ्यालमा प्रदर्शन
+Name[nl]=Weergeven in een opgegeven venster
+Name[nn]=Vis i oppgjeve vindauge
+Name[pa]=ਦੱਸੇ ਝਰੋਖੇ ਵਿੱਚ ਵੇਖਾਓ
+Name[pl]=Wyświetl w zadanym oknie
+Name[pt]=Mostrar na Janela Indicada
+Name[pt_BR]=Mostrar em janela especificada
+Name[ro]=Afişează în fereastra specificată
+Name[ru]=Показывать в указанном окне
+Name[rw]=Kwerekana mu Idirishya Ryihariye
+Name[sk]=Zobraziť v zadanom okne
+Name[sl]=Prikaz v določenemu oknu
+Name[sr]=Прикажи у наведеном прозору
+Name[sr@Latn]=Prikaži u navedenom prozoru
+Name[sv]=Visa i angivet fönster
+Name[ta]=குறித்த சாளரத்தில் காட்டு
+Name[tg]=Дар тирезаи нишондода намоиш намоед
+Name[tr]=Belirtilen Pencerede Göster
+Name[uk]=Відобразити у вказаному вікні
+Name[vi]=Hiển thị trong Cửa sổ Đã định
+Name[zh_CN]=在指定的窗口中显示
+Name[zh_TW]=在指定的視窗中顯示
+NoDisplay=true
+
+[Desktop Action Root]
+Exec=tdepartsaver.kss -root
+Name=Display in Root Window
+Name[bg]=Стартиране в главния прозорец
+Name[br]=Diskwel er prenestr gwrizienn
+Name[bs]=Prikaži u korijenskom prozoru
+Name[ca]=Mostra a la finestra arrel
+Name[cs]=Zobrazit na pozadí plochy
+Name[cy]=Dangos mewn Ffenestr Wraidd
+Name[da]=Visning i root-vindue
+Name[de]=In Hintergrundfenster anzeigen
+Name[el]=Προβολή στο βασικό παράθυρο
+Name[eo]=Montri en radika fenestro
+Name[es]=Mostrar en la ventana raíz
+Name[et]=Juuraknas näitamine
+Name[eu]=Bistaratu erro lehioan
+Name[fa]=نمایش در پنجرۀ ریشه
+Name[fi]=Näytä juuri-ikkunassa
+Name[fr]=Affichage dans la fenêtre racine
+Name[fy]=Werjefte yn haadfinster
+Name[ga]=Taispeáin sa bhFréamhfhuinneog
+Name[gl]=Mostrar na fiestra raiz
+Name[he]=הצג בחלון השורש
+Name[hi]=रूट विंडो में प्रदर्शित करें
+Name[hu]=Megjelenítés a gyökérablakban
+Name[is]=Birta í rótarglugganum
+Name[it]=Mostra sullo sfondo
+Name[ja]=ルートウィンドウで表示
+Name[ka]=ჩვენება ძირითად ფანჯარაში
+Name[lt]=Rodyti root lange
+Name[mk]=Прикажи во коренскиот прозорец
+Name[ms]=Papar dalam Tetingkap Root
+Name[nb]=Vis i root-vindu
+Name[nds]=In Hööftfinster wiesen
+Name[ne]=मूल सञ्झ्यालमा प्रदर्शन
+Name[nl]=Weergeven in hoofdvenster
+Name[nn]=Vis i rotvindauget
+Name[pa]=Root ਝਰੋਖੇ ਵਿੱਚ ਵੇਖਾਓ
+Name[pl]=Wyświetl w oknie głównym
+Name[pt]=Mostrar na Janela de Fundo
+Name[pt_BR]=Mostrar na janela raiz
+Name[ro]=Afişează în fereastra rădăcină
+Name[ru]=Показывать в корневом окне
+Name[rw]=Kwerekana mu Idirishya Umuzi
+Name[sk]=Zobraziť v koreňovom okne
+Name[sl]=Prikaz v korenskem oknu
+Name[sr]=Прикажи у главном (root) прозору
+Name[sr@Latn]=Prikaži u glavnom (root) prozoru
+Name[sv]=Visa i rotfönstret
+Name[ta]=ஆரம்ப சாளரத்தில் காட்டு
+Name[tg]=Дар тирезаи решагӣ намоиш намоед
+Name[tr]=Kök Pencerede Göster
+Name[uk]=Відобразити в кореневому вікні
+Name[vi]=Hiển thị trong Cửa sổ Gốc
+Name[zh_CN]=在根窗口中显示
+Name[zh_TW]=在根視窗中顯示
+NoDisplay=true
diff --git a/tdescreensaver/tdepartsaver/tdepartsaver.h b/tdescreensaver/tdepartsaver/tdepartsaver.h
new file mode 100644
index 00000000..5c53e773
--- /dev/null
+++ b/tdescreensaver/tdepartsaver/tdepartsaver.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2001 Stefan Schimanski <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KPARTSAVER_H_INCLUDED
+#define KPARTSAVER_H_INCLUDED
+
+
+#include <tqwidget.h>
+#include <tqtimer.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqdialog.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqspinbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+
+#include <klocale.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kfiledialog.h>
+#include <kurl.h>
+#include <tdeparts/part.h>
+#include <ktrader.h>
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+#include <kmimetype.h>
+
+#include <tdescreensaver.h>
+
+#include "configwidget.h"
+
+
+class SaverConfig : public ConfigWidget {
+Q_OBJECT
+
+
+ public:
+ SaverConfig( TQWidget* parent = 0, const char* name = 0 );
+ ~SaverConfig();
+
+ protected slots:
+ void apply();
+ void add();
+ void remove();
+ void select();
+ void up();
+ void down();
+};
+
+
+class KPartSaver : public KScreenSaver {
+Q_OBJECT
+
+
+ public:
+ KPartSaver( WId id=0 );
+ virtual ~KPartSaver();
+
+ public slots:
+ void next( bool random );
+ void queue( KURL url );
+ void timeout();
+ void closeURL();
+
+ protected:
+ struct Medium {
+ KURL url;
+ bool failed;
+ };
+
+ bool openURL( KURL url );
+
+ TQValueList<Medium> m_media;
+ TQTimer *m_timer;
+ KParts::ReadOnlyPart *m_part;
+ int m_current;
+
+ bool m_single;
+ bool m_random;
+ int m_delay;
+ TQStringList m_files;
+ TQLabel *m_back;
+};
+
+#endif