diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2024-06-09 22:04:25 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2024-08-01 13:00:28 +0300 |
commit | d88718ee027e329565d2d97c5cadde4aa1b83166 (patch) | |
tree | a4a471e94c5afcf4d5540961c94df707a707bd24 /ksmserver/shutdowndlg.cpp | |
parent | 352d2ee3da00e402c4d362ab90a031df76d617ad (diff) | |
download | tdebase-d88718ee027e329565d2d97c5cadde4aa1b83166.tar.gz tdebase-d88718ee027e329565d2d97c5cadde4aa1b83166.zip |
KSMServer: improve suspend code
1. Some code deduplication. Suspending is now handled via the public method `suspend(int)` which is DCOP-accessible and maps SuspendType values to corresponding TDEHWLib TDESystemPowerState values, and the internal method `suspendInternal(int)` which performs the chosen suspend and optionally locks the screen beforehand.
2. Options are now read from power-managerrc on startup and stored in memory to avoid reading the configuration file every time a suspend is requested.
3. SuspendType is now a member of KSMServer class (instead of KSMShutdownDlg)
4. A new DCOP-accessible method `suspendOptions()` returns a TQStringList of all available suspend options.
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'ksmserver/shutdowndlg.cpp')
-rw-r--r-- | ksmserver/shutdowndlg.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index 64bf4a407..ed01d30d0 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -11,6 +11,7 @@ Copyright (C) 2000 Matthias Ettrich <ettrich@kde.org> #endif #include "shutdowndlg.h" +#include "server.h" #include <tqapplication.h> #include <tqlayout.h> @@ -804,7 +805,6 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, TDEConfig config("power-managerrc"); bool disableSuspend = config.readBoolEntry("disableSuspend", false); bool disableHibernate = config.readBoolEntry("disableHibernate", false); - m_lockOnResume = config.readBoolEntry("lockOnResume", true); bool canFreeze = false; bool canSuspend = false; @@ -892,7 +892,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, hbuttonbox->addWidget ( btnHybridSuspend ); connect(btnHybridSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotHybridSuspend())); } - + // Separator (within buttonlay) vbox->addWidget( new KSeparator( frame ) ); @@ -1065,7 +1065,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, buttonlay->addWidget( btnHybridSuspend ); connect(btnHybridSuspend, TQ_SIGNAL(clicked()), TQ_SLOT(slotHybridSuspend())); } - + buttonlay->addStretch( 1 ); // Separator |