Hello community, here is the log from the commit of package kdebase3 checked in at Wed Oct 11 11:54:34 CEST 2006. -------- --- KDE/kdebase3/kdebase3.changes 2006-10-09 11:53:38.000000000 +0200 +++ /mounts/work_src_done/STABLE/kdebase3/kdebase3.changes 2006-10-10 15:36:51.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Oct 10 15:36:15 CEST 2006 - coolo@suse.de + +- add patch to provide a timed logout mode to ksmserver + +------------------------------------------------------------------- New: ---- ksmserver-timed.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdebase3.spec ++++++ --- /var/tmp/diff_new_pack.pYZtAe/_old 2006-10-11 11:53:40.000000000 +0200 +++ /var/tmp/diff_new_pack.pYZtAe/_new 2006-10-11 11:53:40.000000000 +0200 @@ -51,7 +51,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://www.kde.org/ Version: 3.5.5 -Release: 4 +Release: 5 %define kde_version 3.5.5 Source0: kdebase-%{kde_version}.tar.bz2 Source3: startkde.suse.sh @@ -159,12 +159,13 @@ Patch157: kcmsamba_log.diff Patch160: khelpcenter-localindices.patch Patch161: switch-applet-lock-logout.diff -# svn diff -r551296:HEAD . +# svn di -r594132:HEAD . Patch162: kickoff.diff Patch163: xinerama.patch Patch164: kdm-path.diff Patch165: optional-compmgr.diff Patch166: lowdiskspace.patch +Patch167: ksmserver-timed.diff Provides: kdebase %description @@ -354,7 +355,7 @@ Summary: Set and list fileshares Group: System/Management Version: 2.0 -Release: 133 +Release: 134 %description -n fileshareset This package contains the the fileshareset utility to allow users to @@ -489,6 +490,7 @@ %patch162 %patch165 %patch166 +%patch167 tar xvfj %SOURCE20 %endif %patch163 -p1 @@ -1440,6 +1442,8 @@ %endif %changelog -n kdebase3 +* Tue Oct 10 2006 - coolo@suse.de +- add patch to provide a timed logout mode to ksmserver * Mon Oct 09 2006 - coolo@suse.de - update 3_5 branch diff to include - show all user mountable devices in fstab (#204376) ++++++ ksmserver-timed.diff ++++++ diff -ru ksmserver.orig/KSMServerInterface.h ksmserver/KSMServerInterface.h --- ksmserver.orig/KSMServerInterface.h 2006-08-27 13:21:04.000000000 +0200 +++ ksmserver/KSMServerInterface.h 2006-10-09 23:01:42.000000000 +0200 @@ -22,6 +22,8 @@ virtual void suspendStartup( QCString ) = 0; virtual void resumeStartup( QCString ) = 0; + + virtual void logoutTimed( int, int ) = 0; }; #endif diff -ru ksmserver.orig/Makefile.am ksmserver/Makefile.am --- ksmserver.orig/Makefile.am 2006-10-07 19:37:47.000000000 +0200 +++ ksmserver/Makefile.am 2006-10-10 09:58:49.000000000 +0200 @@ -28,7 +28,7 @@ # Order is important for --enable-final! ksmserver_la_SOURCES = main.cpp server.cpp shutdowndlg.cpp \ legacy.cpp startup.cpp shutdown.cpp client.cpp \ - KSMServerInterface.skel server.skel + KSMServerInterface.skel server.skel timed.ui ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module ksmserver_la_LIBADD = ../kdmlib/libdmctl.la $(LIB_KDEUI) -lpowersave_dbus -lpowersave $(DBUS_LIBS) diff -ru ksmserver.orig/server.h ksmserver/server.h --- ksmserver.orig/server.h 2006-10-07 19:26:45.000000000 +0200 +++ ksmserver/server.h 2006-10-09 23:01:31.000000000 +0200 @@ -85,6 +85,7 @@ // public API void restoreSession( QString sessionName ); void startDefaultSession(); + void shutdown( KApplication::ShutdownConfirm confirm, KApplication::ShutdownType sdtype, KApplication::ShutdownMode sdmode ); @@ -92,6 +93,11 @@ virtual void suspendStartup( QCString app ); virtual void resumeStartup( QCString app ); + bool checkStatus( bool &logoutConfirmed, bool &maysd, + KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, + KApplication::ShutdownMode sdmode ); + public slots: void cleanUp(); @@ -138,6 +144,10 @@ bool defaultSession() const; // empty session void setupXIOErrorHandler(); + void shutdownInternal( KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, + KApplication::ShutdownMode sdmode ); + void performLegacySessionSave(); void storeLegacySession( KConfig* config ); void restoreLegacySession( KConfig* config ); @@ -153,6 +163,7 @@ // public dcop interface void logout( int, int, int ); + virtual void logoutTimed( int, int ); QStringList sessionList(); QString currentSession(); void saveCurrentSession(); diff -ru ksmserver.orig/shutdown.cpp ksmserver/shutdown.cpp --- ksmserver.orig/shutdown.cpp 2006-10-07 19:26:45.000000000 +0200 +++ ksmserver/shutdown.cpp 2006-10-10 09:51:31.000000000 +0200 @@ -93,14 +93,16 @@ (KApplication::ShutdownMode)sdmode ); } -void KSMServer::shutdown( KApplication::ShutdownConfirm confirm, - KApplication::ShutdownType sdtype, KApplication::ShutdownMode sdmode ) +bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, + KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, + KApplication::ShutdownMode sdmode ) { pendingShutdown.stop(); if( dialogActive ) - return; + return false; if( state >= Shutdown ) // already performing shutdown - return; + return false; if( state != Idle ) // performing startup { // perform shutdown as soon as startup is finished, in order to avoid saving partial session @@ -111,25 +113,43 @@ pendingShutdown_sdtype = sdtype; pendingShutdown_sdmode = sdmode; } - return; + return false; } KConfig *config = KGlobal::config(); config->reparseConfiguration(); // config may have changed in the KControl module config->setGroup("General" ); - bool logoutConfirmed = + logoutConfirmed = (confirm == KApplication::ShutdownConfirmYes) ? false : - (confirm == KApplication::ShutdownConfirmNo) ? true : - !config->readBoolEntry( "confirmLogout", true ); - bool maysd = false; + (confirm == KApplication::ShutdownConfirmNo) ? true : + !config->readBoolEntry( "confirmLogout", true ); + maysd = false; if (config->readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) maysd = true; if (!maysd) { if (sdtype != KApplication::ShutdownTypeNone && sdtype != KApplication::ShutdownTypeDefault && logoutConfirmed) - return; /* unsupported fast shutdown */ + return false; /* unsupported fast shutdown */ + } + + return true; +} + +void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, + KApplication::ShutdownMode sdmode ) +{ + bool maysd = false; + bool logoutConfirmed = false; + if ( !checkStatus( logoutConfirmed, maysd, confirm, sdtype, sdmode ) ) + return; + + KConfig *config = KGlobal::config(); + + config->setGroup("General" ); + if (!maysd) { sdtype = KApplication::ShutdownTypeNone; } else if (sdtype == KApplication::ShutdownTypeDefault) sdtype = (KApplication::ShutdownType) @@ -204,6 +224,26 @@ dialogActive = false; } +void KSMServer::shutdown( KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, KApplication::ShutdownMode sdmode ) +{ + shutdownInternal( confirm, sdtype, sdmode ); +} + +#include <kmessagebox.h> + +void KSMServer::logoutTimed( int sdtype, int sdmode ) +{ + KSMShutdownFeedback::start(); // make the screen gray + bool result = KSMDelayedMessageBox::showTicker( (KApplication::ShutdownType)sdtype ); + KSMShutdownFeedback::stop(); // make the screen become normal again + + if ( result ) + shutdownInternal( KApplication::ShutdownConfirmNo, + (KApplication::ShutdownType)sdtype, + (KApplication::ShutdownMode)sdmode ); +} + void KSMServer::pendingShutdownTimeout() { shutdown( pendingShutdown_confirm, pendingShutdown_sdtype, pendingShutdown_sdmode ); diff -ru ksmserver.orig/shutdowndlg.cpp ksmserver/shutdowndlg.cpp --- ksmserver.orig/shutdowndlg.cpp 2006-10-07 19:33:04.000000000 +0200 +++ ksmserver/shutdowndlg.cpp 2006-10-10 09:23:02.000000000 +0200 @@ -426,3 +426,59 @@ popt->stop(); setDown(false); } + +KSMDelayedMessageBox::KSMDelayedMessageBox( KApplication::ShutdownType sdtype ) + : TimedLogoutDlg( 0, 0, true, WType_Popup ) +{ + if ( sdtype == KApplication::ShutdownTypeHalt ) + { + m_title->setText( i18n( "Would you like to turn off your computer?" ) ); + m_template = i18n( "If you do not act, your computer will turn off\n" + "after %1 seconds automatically." ); + m_logo->setPixmap( BarIcon( "exit", 48 ) ); + m_remaining = 120; + } else if ( sdtype == KApplication::ShutdownTypeReboot ) + { + m_title->setText( i18n( "Would you like to reboot your computer?" ) ); + m_template = i18n( "If you do not act, your computer will reboot\n" + "after %1 seconds automatically." ); + m_logo->setPixmap( BarIcon( "reload", 48 ) ); + m_remaining = 60; + } else { + m_title->setText( i18n( "Would you like to end your current session?" ) ); + m_template = i18n( "If you do not act, your session will be stopped\n" + "after %1 seconds automatically." ); + m_logo->setPixmap( BarIcon( "previous", 48 ) ); + m_remaining = 30; + } + updateText(); + QTimer *timer = new QTimer( this ); + timer->start( 1000 ); + connect( timer, SIGNAL( timeout() ), SLOT( updateText() ) ); +} + +void KSMDelayedMessageBox::updateText() +{ + m_remaining--; + if ( m_remaining == 0 ) + { + accept(); + return; + } + m_text->setText( m_template.arg( m_remaining ) ); +} + +bool KSMDelayedMessageBox::showTicker( KApplication::ShutdownType sdtype ) +{ + kapp->enableStyles(); + KSMDelayedMessageBox msg( sdtype ); + QSize sh = msg.sizeHint(); + QRect rect = KGlobalSettings::desktopGeometry(QCursor::pos()); + + msg.move(rect.x() + (rect.width() - sh.width())/2, + rect.y() + (rect.height() - sh.height())/2); + bool result = msg.exec(); + + kapp->disableStyles(); + return result; +} diff -ru ksmserver.orig/shutdowndlg.h ksmserver/shutdowndlg.h --- ksmserver.orig/shutdowndlg.h 2006-10-07 19:33:04.000000000 +0200 +++ ksmserver/shutdowndlg.h 2006-10-09 23:01:08.000000000 +0200 @@ -17,6 +17,7 @@ class QPopupMenu; class QTimer; +#include "timed.h" #include <kapplication.h> // The (singleton) widget that makes the desktop gray. @@ -93,4 +94,22 @@ QTimer *popt; }; +class QLabel; + +class KSMDelayedMessageBox : public TimedLogoutDlg +{ + Q_OBJECT + +public: + KSMDelayedMessageBox( KApplication::ShutdownType sdtype ); + static bool showTicker( KApplication::ShutdownType sdtype ); + +protected slots: + void updateText(); + +private: + QString m_template; + int m_remaining; +}; + #endif diff -ru ksmserver.orig/test.cpp ksmserver/test.cpp --- ksmserver.orig/test.cpp 2005-12-14 19:40:23.000000000 +0100 +++ ksmserver/test.cpp 2006-10-09 23:01:31.000000000 +0200 @@ -14,11 +14,16 @@ a.iconLoader()->addAppDir("ksmserver"); KSMShutdownFeedback::start(); + // ShutdownTypeNone == Logout == 0 + // ShutdownTypeReboot == 1 + // ShutdownTypeHalt == 2 KApplication::ShutdownType sdtype = KApplication::ShutdownTypeNone; QString bopt; + KSMDelayedMessageBox::showTicker( sdtype ); + /* (void)KSMShutdownDlg::confirmShutdown( true, sdtype, - bopt ); + bopt );*/ /* (void)KSMShutdownDlg::confirmShutdown( false, sdtype, bopt ); */ diff -ru ksmserver.orig/timed.ui ksmserver/timed.ui --- ksmserver.orig/timed.ui 2006-10-09 22:59:35.000000000 +0200 +++ ksmserver/timed.ui 2006-10-10 09:23:57.000000000 +0200 @@ -0,0 +1,238 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>TimedLogoutDlg</class> +<widget class="QDialog"> + <property name="name"> + <cstring>TimedLogoutDlg</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>7</y> + <width>474</width> + <height>166</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="caption"> + <string>Form1</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout6</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget" row="0" column="1"> + <property name="name"> + <cstring>layout7</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>10</number> + </property> + <property name="spacing"> + <number>11</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>m_title</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <bold>1</bold> + </font> + </property> + <property name="text"> + <string>Would you like to shutdown your computer?</string> + </property> + <property name="textFormat"> + <enum>PlainText</enum> + </property> + <property name="alignment"> + <set>AlignVCenter|AlignLeft</set> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>m_text</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>1</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>If you do not act, your computer will shutdown +after X automatically.</string> + </property> + <property name="textFormat"> + <enum>PlainText</enum> + </property> + <property name="alignment"> + <set>WordBreak|AlignTop</set> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>2</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>pushButton1</cstring> + </property> + <property name="text"> + <string>Confirm</string> + </property> + <property name="on"> + <bool>false</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>pushButton2</cstring> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>layout5</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>10</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>m_logo</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>48</width> + <height>48</height> + </size> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>2</height> + </size> + </property> + </spacer> + </vbox> + </widget> + </grid> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>pushButton1</sender> + <signal>clicked()</signal> + <receiver>TimedLogoutDlg</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>pushButton2</sender> + <signal>clicked()</signal> + <receiver>TimedLogoutDlg</receiver> + <slot>reject()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org