Branch: master

f8558cb3 2014-03-16 13:01:45 Francois Andriot
Use the "confirm logout" option in KSMServer::logoutTimed
M ksmserver/shutdown.cpp
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 5377904..0dda659 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -338,9 +338,10 @@
 
 void KSMServer::logoutTimed( int sdtype, int sdmode, TQString bootOption )
 {
-    int confirmDelay;
+    int confirmDelay = 0;
 
     TDEConfig* config = TDEGlobal::config();
+    config->reparseConfiguration(); // config may have changed in the KControl module
     config->setGroup( "General" );
 
     if ( sdtype == TDEApplication::ShutdownTypeHalt ) {
@@ -350,14 +351,20 @@
         confirmDelay = config->readNumEntry( "confirmRebootDelay", 31 );
     }
     else {
-        confirmDelay = config->readNumEntry( "confirmLogoutDelay", 31 );
+        if(config->readBoolEntry("confirmLogout", true)) {
+            confirmDelay = config->readNumEntry( "confirmLogoutDelay", 31 );
+        }
     }
 
     bool result = true;
-    if (confirmDelay) {
-        KSMShutdownFeedback::start(); // make the screen gray
+    if (confirmDelay > 0) {
+        if(config->readBoolEntry("doFancyLogout", true)) {
+            KSMShutdownFeedback::start(); // make the screen gray
+        }
         result = KSMDelayedMessageBox::showTicker( (TDEApplication::ShutdownType)sdtype, bootOption, confirmDelay );
-        KSMShutdownFeedback::stop(); // make the screen become normal again
+        if(config->readBoolEntry("doFancyLogout", true)) {
+            KSMShutdownFeedback::stop(); // make the screen become normal again
+        }
     }
 
     if ( result )