summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-31 17:05:56 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-31 17:05:56 -0500
commit4a1137459ad32950bdfa0a51f6278cd802ca2cf6 (patch)
treef8381aeddab4fe6ce5b4f6a2fcfe794cec9909e9 /ksmserver
parent7c366d7a44f1028d0a21abf2b840d3cebfbbc748 (diff)
downloadtdebase-4a1137459ad32950bdfa0a51f6278cd802ca2cf6.tar.gz
tdebase-4a1137459ad32950bdfa0a51f6278cd802ca2cf6.zip
Provide more detail in logout dialog during SaveYourself-related tasks
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/server.h1
-rw-r--r--ksmserver/shutdown.cpp51
2 files changed, 52 insertions, 0 deletions
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 5dd97ba7c..9f9630f4d 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -249,6 +249,7 @@ private:
TDEHardwareDevices* hwDevices;
int initialClientCount;
+ int phase2ClientCount;
};
#endif
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 1f44afde2..0eb4ff668 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -438,6 +438,55 @@ void KSMServer::saveYourselfDone( KSMClient* client, bool success )
false );
}
}
+
+// RAJA TEST ONLY
+
+ bool inPhase2 = true;
+ for( KSMClient* c = clients.first(); c; c = clients.next()) {
+ if ( !c->saveYourselfDone && !c->waitForPhase2 ) {
+ inPhase2 = false;
+ }
+ }
+
+ if (shutdownNotifierIPDlg) {
+ int waitingClients = 0;
+ TQString nextClientToKill;
+ TQDateTime currentDateTime = TQDateTime::currentDateTime();
+ TQDateTime oldestFoundDateTime = currentDateTime;
+ for( KSMClient* c = clients.first(); c; c = clients.next()) {
+ if (c->saveYourselfDone) {
+ continue;
+ }
+ if( isWM( c ) || isCM( c ) || isNotifier( c ) ) {
+ continue;
+ }
+ waitingClients++;
+ if (c->program() != "") {
+ if (c->terminationRequestTimeStamp < oldestFoundDateTime) {
+ nextClientToKill = c->program();
+ oldestFoundDateTime = c->terminationRequestTimeStamp;
+ }
+ }
+ }
+ if (inPhase2) {
+ if (phase2ClientCount > 0) {
+ if (nextClientToKill == "") {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Notifying remaining applications of logout request (%1/%2)...").arg(phase2ClientCount-waitingClients).arg(phase2ClientCount));
+ }
+ else {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Notifying remaining applications of logout request (%1/%2, %3)...").arg(phase2ClientCount-waitingClients).arg(phase2ClientCount).arg(nextClientToKill));
+ }
+ }
+ }
+ else {
+ if (nextClientToKill == "") {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Notifying applications of logout request (%1/%2)...").arg(clients.count()-waitingClients).arg(clients.count()));
+ }
+ else {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Notifying applications of logout request (%1/%2, %3)...").arg(clients.count()-waitingClients).arg(clients.count()).arg(nextClientToKill));
+ }
+ }
+ }
}
void KSMServer::interactRequest( KSMClient* client, int /*dialogType*/ )
@@ -612,10 +661,12 @@ void KSMServer::completeShutdownOrCheckpoint()
}
// do phase 2
+ phase2ClientCount = 0;
bool waitForPhase2 = false;
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
if ( !c->saveYourselfDone && c->waitForPhase2 ) {
c->waitForPhase2 = false;
+ phase2ClientCount++;
SmsSaveYourselfPhase2( c->connection() );
waitForPhase2 = true;
}