--- ./kcontrol/background/bgadvanced.cpp.ORI 2013-05-09 14:42:39.036269356 +0200 +++ ./kcontrol/background/bgadvanced.cpp 2013-05-09 14:43:12.485581123 +0200 @@ -44,6 +44,7 @@ #include "bgadvanced.h" #include "bgadvanced_ui.h" +#include "KCrossBGRender.h" #include <X11/Xlib.h> /**** BGAdvancedDialog ****/ @@ -63,7 +64,7 @@ } -BGAdvancedDialog::BGAdvancedDialog(KBackgroundRenderer *_r, +BGAdvancedDialog::BGAdvancedDialog(KCrossBGRender *_r, TQWidget *parent, bool m_multidesktop) : KDialogBase(parent, "BGAdvancedDialog", --- ./kcontrol/background/bgdialog.cpp.ORI 2013-05-09 14:46:43.556237673 +0200 +++ ./kcontrol/background/bgdialog.cpp 2013-05-09 14:47:33.054218951 +0200 @@ -63,6 +63,7 @@ #include "bgwallpaper.h" #include "bgadvanced.h" #include "bgdialog.h" +#include "KCrossBGRender.h" #define NR_PREDEF_PATTERNS 6 @@ -194,19 +195,19 @@ int eDesk = i>0 ? i-1 : 0; // Setup the merged-screen renderer - KBackgroundRenderer * r = new KBackgroundRenderer(eDesk, 0, false, _config); + KCrossBGRender * r = new KCrossBGRender(eDesk, 0, false, _config); m_renderer[i].insert( 0, r ); connect( r, TQT_SIGNAL(imageDone(int,int)), TQT_SLOT(slotPreviewDone(int,int)) ); // Setup the common-screen renderer - r = new KBackgroundRenderer(eDesk, 0, true, _config); + r = new KCrossBGRender(eDesk, 0, true, _config); m_renderer[i].insert( 1, r ); connect( r, TQT_SIGNAL(imageDone(int,int)), TQT_SLOT(slotPreviewDone(int,int)) ); // Setup the remaining renderers for each screen for (unsigned j=0; j < m_numScreens; ++j ) { - r = new KBackgroundRenderer(eDesk, j, true, _config); + r = new KCrossBGRender(eDesk, j, true, _config); m_renderer[i].insert( j+2, r ); connect( r, TQT_SIGNAL(imageDone(int,int)), TQT_SLOT(slotPreviewDone(int,int)) ); } @@ -221,14 +222,14 @@ } // set up the common desktop renderer - KBackgroundRenderer * r = new KBackgroundRenderer(0, 0, false, _config); + KCrossBGRender * r = new KCrossBGRender(0, 0, false, _config); m_renderer[0].insert(0, r); connect(r, TQT_SIGNAL(imageDone(int,int)), TQT_SLOT(slotPreviewDone(int,int))); // set up all the other desktop renderers for (unsigned i = 0; i < m_numDesks; ++i) { - r = new KBackgroundRenderer(i, 0, false, _config); + r = new KCrossBGRender(i, 0, false, _config); m_renderer[i+1].insert(0, r); connect(r, TQT_SIGNAL(imageDone(int,int)), TQT_SLOT(slotPreviewDone(int,int))); } @@ -266,7 +267,7 @@ delete m_pGlobals; } -KBackgroundRenderer * BGDialog::eRenderer() +KCrossBGRender * BGDialog::eRenderer() { return m_renderer[m_eDesk][m_eScreen]; } @@ -681,7 +682,7 @@ void BGDialog::updateUI() { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); m_comboDesktop->setCurrentItem(m_eDesk); m_comboScreen->setCurrentItem(m_eScreen); @@ -819,7 +820,7 @@ if (!m_previewUpdates) return; - KBackgroundRenderer * r = m_renderer[m_eDesk][(m_eScreen>1) ? (screen_done+2) : m_eScreen]; + KCrossBGRender * r = m_renderer[m_eDesk][(m_eScreen>1) ? (screen_done+2) : m_eScreen]; if (r->image().isNull()) return; @@ -858,7 +859,7 @@ void BGDialog::slotWallpaperTypeChanged(int i) { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); r->stop(); // No picture @@ -984,7 +985,7 @@ void BGDialog::slotWallpaperPos(int mode) { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); mode++; m_wallpaperPos = mode; @@ -1002,7 +1003,7 @@ void BGDialog::slotSetupMulti() { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); BGMultiWallpaperDialog dlg(r, topLevelWidget()); if (dlg.exec() == TQDialog::Accepted) { @@ -1018,7 +1019,7 @@ void BGDialog::slotPrimaryColor(const TQColor &color) { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); if (color == r->colorA()) return; @@ -1033,7 +1034,7 @@ void BGDialog::slotSecondaryColor(const TQColor &color) { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); if (color == r->colorB()) return; @@ -1048,7 +1049,7 @@ void BGDialog::slotPattern(int pattern) { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); r->stop(); bool bSecondaryEnabled = true; if (pattern < NR_PREDEF_PATTERNS) @@ -1085,7 +1086,7 @@ // Copy stuff for (unsigned desk = 0; desk < m_numDesks+1; ++desk ) { - KBackgroundRenderer *master = m_renderer[desk][1]; + KCrossBGRender *master = m_renderer[desk][1]; for (unsigned screen = 0; screen < m_numScreens; ++screen) { m_renderer[desk][screen+2]->copyConfig(master); @@ -1140,7 +1141,7 @@ // Copy stuff for (unsigned screen = 0; screen < m_renderer[0].size(); ++screen ) { - KBackgroundRenderer *master = m_renderer[0][screen]; + KCrossBGRender *master = m_renderer[0][screen]; for (unsigned desk = 0; desk < m_numDesks; ++desk ) { m_renderer[desk+1][screen]->copyConfig(master); @@ -1179,7 +1180,7 @@ void BGDialog::slotAdvanced() { - KBackgroundRenderer *r = eRenderer(); + KCrossBGRender *r = eRenderer(); m_previewUpdates = false; BGAdvancedDialog dlg(r, topLevelWidget(), m_multidesktop); @@ -1301,7 +1302,7 @@ { for (unsigned j = 0; j < m_renderer[i].size(); ++j ) { - KBackgroundRenderer * r = m_renderer[i][j]; + KCrossBGRender * r = m_renderer[i][j]; if( r->isActive()) r->stop(); r->desktopResized(); --- ./kcontrol/background/bgadvanced.h.ori 2013-05-09 14:49:18.551047531 +0200 +++ ./kcontrol/background/bgadvanced.h 2013-05-09 14:49:23.509945456 +0200 @@ -33,14 +33,14 @@ class TQSpinBox; class BGAdvancedBase; -class KBackgroundRenderer; +class KCrossBGRender; class KBackgroundProgram; class BGAdvancedDialog : public KDialogBase { Q_OBJECT public: - BGAdvancedDialog(KBackgroundRenderer *_r, TQWidget *parent, bool m_multidesktop); + BGAdvancedDialog(KCrossBGRender *_r, TQWidget *parent, bool m_multidesktop); void setCacheSize(int s); int cacheSize(); @@ -79,7 +79,7 @@ void slotEnableProgram(bool b); private: - KBackgroundRenderer *r; + KCrossBGRender *r; BGAdvancedBase *dlg; --- ./kcontrol/background/bgdialog.h.ORI 2013-05-09 14:49:59.223210319 +0200 +++ ./kcontrol/background/bgdialog.h 2013-05-09 14:50:40.215366483 +0200 @@ -28,6 +28,7 @@ #include "bgrender.h" #include "bgsettings.h" #include "bgdefaults.h" +#include "KCrossBGRender.h" class BGMonitorArrangement; class KStandardDirs; @@ -53,7 +54,7 @@ protected: void initUI(); void updateUI(); - KBackgroundRenderer * eRenderer(); + KCrossBGRender * eRenderer(); void setWallpaper(const TQString &); @@ -95,7 +96,7 @@ int m_screen; int m_eDesk; int m_eScreen; - TQValueVector< TQPtrVector<KBackgroundRenderer> > m_renderer; // m_renderer[desk][screen] + TQValueVector< TQPtrVector<KCrossBGRender> > m_renderer; // m_renderer[desk][screen] TQMap<TQString,int> m_wallpaper; TQStringList m_patterns; int m_slideShowRandom; // Remembers last Slide Show setting --- ./kcontrol/background/bgwallpaper.h.ORI 2013-05-09 14:51:55.150823830 +0200 +++ ./kcontrol/background/bgwallpaper.h 2013-05-09 14:52:37.513949453 +0200 @@ -27,6 +27,7 @@ #include <tqstringlist.h> #include <kdialogbase.h> +#include <kdebug.h> class BGMultiWallpaperBase; class KBackgroundSettings; @@ -55,12 +56,16 @@ void slotMoveDown(); void slotOk(); void slotItemSelected( TQListBoxItem * ); + void slotCheckScheduled(bool); + void slotChangedXML(const TQString&); + private: void setEnabledMoveButtons(); KBackgroundSettings *m_pSettings; BGMultiWallpaperBase *dlg; + TQString lastXml; }; #endif --- ./kcontrol/background/bgwallpaper.cpp.ORI 2013-05-09 14:53:01.461452198 +0200 +++ ./kcontrol/background/bgwallpaper.cpp 2013-05-09 14:57:27.712924157 +0200 @@ -26,12 +26,14 @@ #include <tqevent.h> #include <tqpushbutton.h> #include <tqspinbox.h> +#include <tqgroupbox.h> #include <kfiledialog.h> #include <kimageio.h> #include <klocale.h> #include <kstandarddirs.h> #include <kurldrag.h> +#include <kurlrequester.h> #include "bgsettings.h" #include "bgwallpaper.h" @@ -119,10 +121,41 @@ connect(dlg->m_buttonMoveUp, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp())); connect(dlg->m_buttonMoveDown, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown())); connect(dlg->m_listImages, TQT_SIGNAL(clicked ( TQListBoxItem * )), TQT_SLOT(slotItemSelected( TQListBoxItem *))); + connect(dlg->chkScheduled, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotCheckScheduled(bool))); + connect(dlg->kurlXmlFile, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChangedXML(const TQString &))); + dlg->m_buttonRemove->setEnabled( false ); dlg->m_buttonMoveUp->setEnabled( false ); dlg->m_buttonMoveDown->setEnabled( false ); + // XML Stuffs + dlg->kurlXmlFile->setFilter("*.xml"); + if (m_pSettings->wallpaperList()[0].endsWith("xml",false)) { + dlg->kurlXmlFile->setURL(m_pSettings->wallpaperList()[0]); + dlg->chkScheduled->setChecked(true); + dlg->m_listImages->removeItem(0); + lastXml = m_pSettings->wallpaperList()[0]; + } else { + dlg->kurlXmlFile->setURL("/usr/share/mdk/backgrounds/Mandriva.xml"); + dlg->chkScheduled->setChecked(false); + slotCheckScheduled(false); + } +} + +void BGMultiWallpaperDialog::slotCheckScheduled(bool state) +{ + if ( state == true ) { + dlg->grpNormalShow->setEnabled(false); + dlg->kurlXmlFile->setEnabled(true); + } else { + dlg->grpNormalShow->setEnabled(true); + dlg->kurlXmlFile->setEnabled(false); + } +} + +void BGMultiWallpaperDialog::slotChangedXML(const TQString & file) +{ + lastXml = file; } void BGMultiWallpaperDialog::slotItemSelected( TQListBoxItem * ) @@ -222,15 +255,38 @@ void BGMultiWallpaperDialog::slotOk() { + bool useXml = false; + // Looking to XML + if (dlg->chkScheduled->isChecked() && lastXml.endsWith("xml",false)) { + useXml = true; + kdDebug() << "Adding XML" << lastXml; + dlg->m_listImages->insertItem(lastXml,0); + } + + kdDebug() << dlg->m_listImages << endl; + TQStringList lst; - for (unsigned i=0; i < dlg->m_listImages->count(); i++) + for (unsigned i=0; i < dlg->m_listImages->count(); i++) { - lst.append(dlg->m_listImages->text(i)); + lst.append(dlg->m_listImages->text(i)); + } m_pSettings->setWallpaperList(lst); m_pSettings->setWallpaperChangeInterval(dlg->m_spinInterval->value()); - if (dlg->m_cbRandom->isChecked()) + if (dlg->m_cbRandom->isChecked()) { m_pSettings->setMultiWallpaperMode(KBackgroundSettings::Random); - else + } else { m_pSettings->setMultiWallpaperMode(KBackgroundSettings::InOrder); + } + + if(useXml) { + m_pSettings->changeWallpaper(); + m_pSettings->setWallpaper(lastXml); + m_pSettings->changeWallpaper(); + } else { + m_pSettings->changeWallpaper(); + m_pSettings->setWallpaper(lst[0]); + m_pSettings->changeWallpaper(); + } + accept(); } --- kdebase-3.5.9/kcontrol/background/bgwallpaper_ui.ui.kbg_trans 2008-03-17 11:06:49.000000000 -0300 +++ kdebase-3.5.9/kcontrol/background/bgwallpaper_ui.ui 2008-03-17 11:07:13.000000000 -0300 @@ -1,4 +1,4 @@ -<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>BGMultiWallpaperBase</class> <widget class="TQWidget"> <property name="name"> @@ -8,155 +8,209 @@ <rect> <x>0</x> <y>0</y> - <width>410</width> - <height>196</height> + <width>499</width> + <height>526</height> </rect> </property> - <grid> + <property name="caption"> + <string>BGMultiWallPaperBase</string> + </property> + <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <property name="margin"> <number>0</number> </property> - <widget class="TQLabel" row="2" column="0"> - <property name="name"> - <cstring>textLabel2</cstring> - </property> - <property name="text"> - <string>Show the following pictures:</string> - </property> - </widget> - <widget class="TQCheckBox" row="1" column="0"> - <property name="name"> - <cstring>m_cbRandom</cstring> - </property> - <property name="text"> - <string>&Show pictures in random order</string> - </property> - </widget> - <widget class="TQLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>layout8</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="TQLabel"> + <widget class="TQCheckBox"> <property name="name"> - <cstring>textLabel1</cstring> + <cstring>chkScheduled</cstring> </property> <property name="text"> - <string>Change &picture after:</string> - </property> - <property name="buddy" stdset="0"> - <cstring>m_spinInterval</cstring> + <string>Scheduled Slide Show</string> </property> </widget> - <widget class="TQSpinBox"> + <widget class="KURLRequester"> <property name="name"> - <cstring>m_spinInterval</cstring> + <cstring>kurlXmlFile</cstring> </property> </widget> - <spacer> - <property name="name"> - <cstring>spacer4</cstring> - </property> - <property name="orientation"> - <enum>Horizontal</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> </hbox> </widget> - <widget class="TQLayoutWidget" row="3" column="0"> + <widget class="QGroupBox"> <property name="name"> - <cstring>layout4</cstring> + <cstring>grpNormalShow</cstring> </property> - <grid> + <property name="title"> + <string></string> + </property> + <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="BGMultiWallpaperList" row="0" column="0" rowspan="5" colspan="1"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>m_listImages</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>3</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>100</height> - </size> + <cstring>layout3</cstring> </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel"> + <property name="name"> + <cstring>textLabel1_2</cstring> + </property> + <property name="text"> + <string>Change &picture after:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>m_spinInterval</cstring> + </property> + </widget> + <widget class="TQSpinBox"> + <property name="name"> + <cstring>m_spinInterval</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> </widget> - <widget class="TQPushButton" row="0" column="1"> + <widget class="TQCheckBox"> <property name="name"> - <cstring>m_buttonAdd</cstring> + <cstring>m_cbRandom</cstring> </property> <property name="text"> - <string>&Add...</string> - </property> - </widget> - <spacer row="4" column="1"> - <property name="name"> - <cstring>spacer5</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> + <string>&Show pictures in random order</string> </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - <widget class="TQPushButton" row="1" column="1"> - <property name="name"> - <cstring>m_buttonRemove</cstring> - </property> - <property name="text"> - <string>&Remove</string> + <property name="accel"> + <string>Alt+S</string> </property> </widget> - <widget class="TQPushButton" row="3" column="1"> + <widget class="TQLabel"> <property name="name"> - <cstring>m_buttonMoveDown</cstring> + <cstring>textLabel2</cstring> </property> <property name="text"> - <string>Move &Down</string> + <string>Show the following pictures:</string> </property> </widget> - <widget class="TQPushButton" row="2" column="1"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>m_buttonMoveUp</cstring> - </property> - <property name="text"> - <string>Move &Up</string> + <cstring>layout4</cstring> </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="BGMultiWallpaperList" row="0" column="0" rowspan="5" colspan="1"> + <property name="name"> + <cstring>m_listImages</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>300</width> + <height>100</height> + </size> + </property> + </widget> + <widget class="TQPushButton" row="0" column="1"> + <property name="name"> + <cstring>m_buttonAdd</cstring> + </property> + <property name="text"> + <string>&Add...</string> + </property> + <property name="accel"> + <string>Alt+A</string> + </property> + </widget> + <spacer row="4" column="1"> + <property name="name"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQPushButton" row="1" column="1"> + <property name="name"> + <cstring>m_buttonRemove</cstring> + </property> + <property name="text"> + <string>&Remove</string> + </property> + <property name="accel"> + <string>Alt+R</string> + </property> + </widget> + <widget class="TQPushButton" row="3" column="1"> + <property name="name"> + <cstring>m_buttonMoveDown</cstring> + </property> + <property name="text"> + <string>Move &Down</string> + </property> + <property name="accel"> + <string>Alt+D</string> + </property> + </widget> + <widget class="TQPushButton" row="2" column="1"> + <property name="name"> + <cstring>m_buttonMoveUp</cstring> + </property> + <property name="text"> + <string>Move &Up</string> + </property> + <property name="accel"> + <string>Alt+U</string> + </property> + </widget> + </grid> </widget> - </grid> + </vbox> </widget> - </grid> + </vbox> </widget> <includes> <include location="local" impldecl="in declaration">bgwallpaper.h</include> @@ -164,4 +218,9 @@ </includes> <layoutdefaults spacing="3" margin="6"/> <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +<includehints> + <includehint>kurlrequester.h</includehint> + <includehint>klineedit.h</includehint> + <includehint>kpushbutton.h</includehint> +</includehints> </UI>