summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-16 01:23:16 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-19 16:58:17 +0200
commitf6b523312fd9f2457036a5df404cfb70f64297a4 (patch)
tree8c6f3385f3ae0764fe9444eec1f9400a2e648f38
parent43d29f86711890a813c871b2199d6d0f87430cd3 (diff)
downloadtdebase-f6b523312fd9f2457036a5df404cfb70f64297a4.tar.gz
tdebase-f6b523312fd9f2457036a5df404cfb70f64297a4.zip
Add shutdown progress text and next program being terminated to shutdown dialog
(cherry picked from commit 6ce60bdd2376ca5880971218a1a50afc747f3a58)
-rw-r--r--ksmserver/server.h1
-rw-r--r--ksmserver/shutdown.cpp55
2 files changed, 45 insertions, 11 deletions
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 17c72759d..cf7f3da24 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -233,6 +233,7 @@ private:
TQStringList excludeApps;
WindowMap legacyWindows;
+ int initialClientCount;
};
#endif
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 584fa57c1..9b6bc1780 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -561,13 +561,30 @@ void KSMServer::completeShutdownOrCheckpoint()
if( logoutSoundEvent <= 0 ) {
waitForKNotify = false;
}
+ initialClientCount = clients.count();
+ if (shutdownNotifierIPDlg) {
+ TQString nextClientToKill;
+ for( KSMClient* c = clients.first(); c; c = clients.next()) {
+ if( isWM( c ) || isCM( c ) || isNotifier( c ) ) {
+ continue;
+ }
+ nextClientToKill = c->program();
+ }
+ if (nextClientToKill == "") {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount));
+ }
+ else {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill));
+ }
+ }
if( waitForKNotify ) {
state = WaitingForKNotify;
knotifyTimeoutTimer.start( 20000, true );
return;
}
startKilling();
- } else if ( state == Checkpoint ) {
+ }
+ else if ( state == Checkpoint ) {
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
SmsSaveComplete( c->connection());
}
@@ -589,8 +606,7 @@ void KSMServer::startKilling()
SmsDie( c->connection() );
}
- kdDebug( 1218 ) << " We killed all clients. We have now clients.count()=" <<
- clients.count() << endl;
+ kdDebug( 1218 ) << " We killed all clients. We have now clients.count()=" << clients.count() << endl;
completeKilling();
TQTimer::singleShot( 10000, this, TQT_SLOT( timeoutQuit() ) );
}
@@ -598,17 +614,33 @@ void KSMServer::startKilling()
void KSMServer::completeKilling()
{
SHUTDOWN_MARKER("completeKilling");
- kdDebug( 1218 ) << "KSMServer::completeKilling clients.count()=" <<
- clients.count() << endl;
+ kdDebug( 1218 ) << "KSMServer::completeKilling clients.count()=" << clients.count() << endl;
if( state == Killing ) {
bool wait = false;
+ TQString nextClientToKill;
for( KSMClient* c = clients.first(); c; c = clients.next()) {
- if( isWM( c ) || isCM( c ) || isNotifier( c ) )
+ if( isWM( c ) || isCM( c ) || isNotifier( c ) ) {
continue;
+ }
+ nextClientToKill = c->program();
wait = true; // still waiting for clients to go away
}
- if( wait )
+ if( wait ) {
+ if (shutdownNotifierIPDlg) {
+ if (nextClientToKill == "") {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount));
+ }
+ else {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill));
+ }
+ }
return;
+ }
+ else {
+ if (shutdownNotifierIPDlg) {
+ static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->setStatusMessage(i18n("Terminating services..."));
+ }
+ }
killWM();
}
}
@@ -639,18 +671,19 @@ void KSMServer::killWM()
completeKillingWM();
TQTimer::singleShot( 5000, this, TQT_SLOT( timeoutWMQuit() ) );
}
- else
+ else {
killingCompleted();
+ }
}
void KSMServer::completeKillingWM()
{
SHUTDOWN_MARKER("completeKillingWM");
- kdDebug( 1218 ) << "KSMServer::completeKillingWM clients.count()=" <<
- clients.count() << endl;
+ kdDebug( 1218 ) << "KSMServer::completeKillingWM clients.count()=" << clients.count() << endl;
if( state == KillingWM ) {
- if( clients.isEmpty())
+ if( clients.isEmpty()) {
killingCompleted();
+ }
}
}