diff -r -u -N kdebase-3.5.6.orig/ksmserver/KSMServerInterface.h kdebase-3.5.6/ksmserver/KSMServerInterface.h --- kdebase-3.5.6.orig/ksmserver/KSMServerInterface.h 2006-05-22 15:12:40.000000000 -0300 +++ kdebase-3.5.6/ksmserver/KSMServerInterface.h 2007-04-26 16:43:46.000000000 -0300 @@ -22,6 +22,8 @@ virtual void suspendStartup( QCString ) = 0; virtual void resumeStartup( QCString ) = 0; + + virtual void logoutTimed( int, int, QString ) = 0; }; #endif diff -r -u -N kdebase-3.5.6.orig/ksmserver/Makefile.am kdebase-3.5.6/ksmserver/Makefile.am --- kdebase-3.5.6.orig/ksmserver/Makefile.am 2006-01-19 15:01:08.000000000 -0200 +++ kdebase-3.5.6/ksmserver/Makefile.am 2007-04-26 16:43:46.000000000 -0300 @@ -17,7 +17,7 @@ SUBDIRS = . -INCLUDES= -I$(top_srcdir)/kdmlib $(all_includes) +INCLUDES= -I$(top_srcdir)/kdmlib $(all_includes) $(DBUS_INCS) bin_PROGRAMS = lib_LTLIBRARIES = @@ -28,10 +28,10 @@ # 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) +ksmserver_la_LIBADD = ../kdmlib/libdmctl.la $(LIB_KDEUI) -llazy $(DBUS_LIBS) picsdir = $(kde_datadir)/ksmserver/pics pics_DATA = shutdownkonq.png @@ -42,9 +42,9 @@ EXTRA_PROGRAMS = testsh -testsh_SOURCES = test.cpp +testsh_SOURCES = test.cpp timed.ui testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH) -testsh_LDADD = $(LIB_KDEUI) shutdowndlg.lo ../kdmlib/libdmctl.la +testsh_LDADD = $(LIB_KDEUI) shutdowndlg.lo ../kdmlib/libdmctl.la -llazy $(DBUS_LIBS) messages: $(XGETTEXT) *.cpp -o $(podir)/ksmserver.pot diff -r -u -N kdebase-3.5.6.orig/ksmserver/server.h kdebase-3.5.6/ksmserver/server.h --- kdebase-3.5.6.orig/ksmserver/server.h 2006-10-01 14:31:46.000000000 -0300 +++ kdebase-3.5.6/ksmserver/server.h 2007-04-26 16:43:46.000000000 -0300 @@ -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,11 @@ bool defaultSession() const; // empty session void setupXIOErrorHandler(); + void shutdownInternal( KApplication::ShutdownConfirm confirm, + KApplication::ShutdownType sdtype, + KApplication::ShutdownMode sdmode, + QString bootOption = QString::null ); + void performLegacySessionSave(); void storeLegacySession( KConfig* config ); void restoreLegacySession( KConfig* config ); @@ -153,6 +164,7 @@ // public dcop interface void logout( int, int, int ); + virtual void logoutTimed( int, int, QString ); QStringList sessionList(); QString currentSession(); void saveCurrentSession(); diff -r -u -N kdebase-3.5.6.orig/ksmserver/shutdown.cpp kdebase-3.5.6/ksmserver/shutdown.cpp --- kdebase-3.5.6.orig/ksmserver/shutdown.cpp 2006-10-01 14:31:46.000000000 -0300 +++ kdebase-3.5.6/ksmserver/shutdown.cpp 2007-04-26 16:43:46.000000000 -0300 @@ -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,44 @@ 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, + QString bopt ) +{ + 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) @@ -138,7 +159,6 @@ sdmode = KApplication::ShutdownModeInteractive; dialogActive = true; - QString bopt; if ( !logoutConfirmed ) { KSMShutdownFeedback::start(); // make the screen gray logoutConfirmed = @@ -204,6 +224,42 @@ 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, QString bootOption ) +{ + int confirmDelay; + + KConfig* config = KGlobal::config(); + config->setGroup( "General" ); + + if ( sdtype == KApplication::ShutdownTypeHalt ) + confirmDelay = config->readNumEntry( "confirmShutdownDelay", 31 ); + else if ( sdtype == KApplication::ShutdownTypeReboot ) + confirmDelay = config->readNumEntry( "confirmRebootDelay", 31 ); + else + confirmDelay = config->readNumEntry( "confirmLogoutDelay", 31 ); + + bool result = true; + if (confirmDelay) { + KSMShutdownFeedback::start(); // make the screen gray + result = KSMDelayedMessageBox::showTicker( (KApplication::ShutdownType)sdtype, bootOption, confirmDelay ); + KSMShutdownFeedback::stop(); // make the screen become normal again + } + + if ( result ) + shutdownInternal( KApplication::ShutdownConfirmNo, + (KApplication::ShutdownType)sdtype, + (KApplication::ShutdownMode)sdmode, + bootOption ); +} + void KSMServer::pendingShutdownTimeout() { shutdown( pendingShutdown_confirm, pendingShutdown_sdtype, pendingShutdown_sdmode ); diff -r -u -N kdebase-3.5.6.orig/ksmserver/shutdowndlg.cpp kdebase-3.5.6/ksmserver/shutdowndlg.cpp --- kdebase-3.5.6.orig/ksmserver/shutdowndlg.cpp 2007-01-15 09:31:35.000000000 -0200 +++ kdebase-3.5.6/ksmserver/shutdowndlg.cpp 2007-04-26 16:43:46.000000000 -0300 @@ -25,6 +25,7 @@ #include <qimage.h> #include <klocale.h> +#include <kconfig.h> #include <kapplication.h> #include <kdebug.h> #include <kpushbutton.h> @@ -37,6 +38,8 @@ #include <kimageeffect.h> #include <kdialog.h> #include <kseparator.h> +#include <kmessagebox.h> +#include <liblazy.h> #include <sys/types.h> #include <sys/utsname.h> @@ -48,6 +51,11 @@ #include "shutdowndlg.moc" + +#define DBUS_HAL_INTERFACE "org.freedesktop.Hal" +#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement" +#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer" + KSMShutdownFeedback * KSMShutdownFeedback::s_pSelf = 0L; KSMShutdownFeedback::KSMShutdownFeedback() @@ -126,22 +134,22 @@ // End session KPushButton* btnLogout = new KPushButton( KGuiItem( i18n("&End Current Session"), "undo"), frame ); QFont btnFont = btnLogout->font(); buttonlay->addWidget( btnLogout ); connect(btnLogout, SIGNAL(clicked()), SLOT(slotLogout())); if (maysd) { - - // Shutdown + + // Shutdown KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame ); btnHalt->setFont( btnFont ); buttonlay->addWidget( btnHalt ); connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt())); - if ( sdtype == KApplication::ShutdownTypeHalt ) + if ( sdtype == KApplication::ShutdownTypeHalt || getenv("KDM_AUTOLOGIN") ) btnHalt->setFocus(); // Reboot KSMDelayedPushButton* btnReboot = new KSMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload"), frame ); btnReboot->setFont( btnFont ); buttonlay->addWidget( btnReboot ); @@ -165,12 +176,57 @@ else targets->insertItem( label, index ); } - + btnReboot->setPopup(targets); connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); + } + + int supported = -1; + liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported); + if (supported == 1) + suspend_ram = true; + else + suspend_ram = false; + liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported); + if (supported == 1) + standby = true; + else + standby = false; + liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported); + if (supported == 1) + suspend_disk = true; + else + suspend_disk = false; + + if (liblazy_polkit_is_user_allowed_by_uid(getuid(), "hal-power-hibernate", NULL) != 1) + suspend_disk = false; + if (liblazy_polkit_is_user_allowed_by_uid(getuid(), "hal-power-suspend", NULL) != 1) + suspend_ram = false; + if (liblazy_polkit_is_user_allowed_by_uid(getuid(), "hal-power-standby", NULL) != 1) + standby = false; + + int sum = standby + suspend_ram + suspend_disk; + if ( sum ) { + QButton *btnSuspend; + if (sum > 1) { + btnSuspend = new KSMDelayedPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame ); + QPopupMenu *suspends = new QPopupMenu(frame); + if (suspend_disk) + suspends->insertItem(i18n("Suspend to Disk"), 1); + if (suspend_ram) + suspends->insertItem(i18n("Suspend to RAM"), 2); + if (standby) + suspends->insertItem(i18n("Standby"), 3); + connect(suspends, SIGNAL(activated(int)), SLOT(slotSuspend(int))); + static_cast<KSMDelayedPushButton*>(btnSuspend)->setPopup(suspends); + } else { + btnSuspend = new KPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame ); + } + btnSuspend->setFont( btnFont ); + buttonlay->addWidget( btnSuspend ); + connect(btnSuspend, SIGNAL(clicked()), SLOT(slotSuspend())); } } - buttonlay->addStretch( 1 ); // Separator @@ -183,6 +240,80 @@ } +void KSMShutdownDlg::slotSuspend() +{ + int error = 0; + int wake = 0; + DBusMessage *reply; + + if (suspend_disk) + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Hibernate", + &reply, + DBUS_TYPE_INVALID); + else if (suspend_ram) + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Suspend", + &reply, + DBUS_TYPE_INT32, + &wake, + DBUS_TYPE_INVALID); + else + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Standby", + &reply, + DBUS_TYPE_INVALID); + + if (error) + KMessageBox::error(this, i18n("Suspend failed")); + + // possibly after resume :) + reject(); +} + +void KSMShutdownDlg::slotSuspend(int id) +{ + int error = 0; + int wake = 0; + DBusMessage *reply; + + if (suspend_disk && id == 1) { + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Hibernate", + &reply, + DBUS_TYPE_INVALID); + } else if (suspend_ram && id == 2) + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Suspend", + &reply, + DBUS_TYPE_INT32, + &wake, + DBUS_TYPE_INVALID); + else if (standby && id == 3) + error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE, + HAL_UDI_COMPUTER, + DBUS_HAL_SYSTEM_POWER_INTERFACE, + "Standby", + &reply, + DBUS_TYPE_INVALID); + else + return; + if (error) + KMessageBox::error(this, i18n("Suspend failed")); + + // possibly after resume :) + reject(); +} void KSMShutdownDlg::slotLogout() { @@ -276,3 +407,67 @@ popt->stop(); setDown(false); } + +KSMDelayedMessageBox::KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay ) + : TimedLogoutDlg( 0, 0, true, WType_Popup ), m_remaining(confirmDelay) +{ + if ( sdtype == KApplication::ShutdownTypeHalt ) + { + m_title->setText( i18n( "Would you like to turn off your computer?" ) ); + m_template = i18n( "This computer will turn off automatically\n" + "after %1 seconds." ); + m_logo->setPixmap( BarIcon( "exit", 48 ) ); + } else if ( sdtype == KApplication::ShutdownTypeReboot ) + { + if (bootOption.isEmpty()) + m_title->setText( i18n( "Would you like to reboot your computer?" ) ); + else + m_title->setText( i18n( "Would you like to reboot to \"%1\"?" ).arg(bootOption) ); + m_template = i18n( "This computer will reboot automatically\n" + "after %1 seconds." ); + m_logo->setPixmap( BarIcon( "reload", 48 ) ); + } else { + m_title->setText( i18n( "Would you like to end your current session?" ) ); + m_template = i18n( "This session will end\n" + "after %1 seconds automatically." ); + m_logo->setPixmap( BarIcon( "previous", 48 ) ); + } + + updateText(); + adjustSize(); + if ( double( height() ) / width() < 0.25 ) + { + setFixedHeight( qRound( width() * 0.3 ) ); + adjustSize(); + } + QTimer *timer = new QTimer( this ); + timer->start( 1000 ); + connect( timer, SIGNAL( timeout() ), SLOT( updateText() ) ); + KDialog::centerOnScreen(this); +} + +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, const QString &bootOption, int confirmDelay ) +{ + kapp->enableStyles(); + KSMDelayedMessageBox msg( sdtype, bootOption, confirmDelay ); + 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 -r -u -N kdebase-3.5.6.orig/ksmserver/shutdowndlg.h kdebase-3.5.6/ksmserver/shutdowndlg.h --- kdebase-3.5.6.orig/ksmserver/shutdowndlg.h 2006-01-19 15:01:08.000000000 -0200 +++ kdebase-3.5.6/ksmserver/shutdowndlg.h 2007-04-26 16:43:46.000000000 -0300 @@ -15,6 +15,7 @@ class QPopupMenu; class QTimer; +#include "timed.h" #include <kapplication.h> // The (singleton) widget that makes the desktop gray. @@ -54,6 +55,8 @@ void slotHalt(); void slotReboot(); void slotReboot(int); + void slotSuspend(); + void slotSuspend(int); protected: ~KSMShutdownDlg() {}; @@ -64,6 +67,7 @@ QString m_bootOption; QPopupMenu *targets; QStringList rebootOptions; + bool suspend_disk, suspend_ram, standby; }; class KSMDelayedPushButton : public KPushButton @@ -85,4 +89,22 @@ QTimer *popt; }; +class QLabel; + +class KSMDelayedMessageBox : public TimedLogoutDlg +{ + Q_OBJECT + +public: + KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay ); + static bool showTicker( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay ); + +protected slots: + void updateText(); + +private: + QString m_template; + int m_remaining; +}; + #endif diff -r -u -N kdebase-3.5.6.orig/ksmserver/test.cpp kdebase-3.5.6/ksmserver/test.cpp --- kdebase-3.5.6.orig/ksmserver/test.cpp 2006-01-19 15:01:08.000000000 -0200 +++ kdebase-3.5.6/ksmserver/test.cpp 2007-04-26 16:43:46.000000000 -0300 @@ -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 -r -u -N kdebase-3.5.6.orig/ksmserver/timed.ui kdebase-3.5.6/ksmserver/timed.ui --- kdebase-3.5.6.orig/ksmserver/timed.ui 1969-12-31 21:00:00.000000000 -0300 +++ kdebase-3.5.6/ksmserver/timed.ui 2007-04-26 16:45:39.000000000 -0300 @@ -0,0 +1,352 @@ +<!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>0</y> + <width>381</width> + <height>131</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="caption"> + <string>Confirmation</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <widget class="QFrame"> + <property name="name"> + <cstring>frame3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <property name="lineWidth"> + <number>2</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="midLineWidth"> + <number>0</number> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout10</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout8</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout6</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>0</number> + </property> + <spacer> + <property name="name"> + <cstring>spacer3_2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>MinimumExpanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>2</height> + </size> + </property> + </spacer> + <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>MinimumExpanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>2</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout7</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>7</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>5</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>RichText</enum> + </property> + <property name="alignment"> + <set>WordBreak|AlignVCenter</set> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Preferred</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </vbox> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout9</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>90</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> + <spacer> + <property name="name"> + <cstring>spacer2_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>90</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>pushButton2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2_2_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>90</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </vbox> + </widget> + </hbox> + </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>