From 1c618af70de66f304481efe05b8ebcc0d5d8d4f6 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 21 Nov 2013 01:34:25 +0100 Subject: Add progress bar to logout status dialog This resolves Bug 1667 --- ksmserver/shutdown.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'ksmserver/shutdown.cpp') diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index 12743e892..a463c37d2 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -817,11 +817,14 @@ void KSMServer::completeShutdownOrCheckpoint() } } } + KSMShutdownIPDlg *shutdownNotifierDlg=static_cast(shutdownNotifierIPDlg); + shutdownNotifierDlg->setProgressBarTotalSteps(initialClientCount); + shutdownNotifierDlg->setProgressBarProgress(initialClientCount-clients.count()); if (nextClientToKill == "") { - static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount)); + shutdownNotifierDlg->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount)); } else { - static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill)); + shutdownNotifierDlg->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill)); } } if( waitForKNotify ) { @@ -886,12 +889,15 @@ void KSMServer::completeKilling() } if( wait ) { if (shutdownNotifierIPDlg) { - static_cast(shutdownNotifierIPDlg)->show(); + KSMShutdownIPDlg *shutdownNotifierDlg=static_cast(shutdownNotifierIPDlg); + shutdownNotifierDlg->setProgressBarTotalSteps(initialClientCount); + shutdownNotifierDlg->setProgressBarProgress(initialClientCount-clients.count()); + shutdownNotifierDlg->show(); if (nextClientToKill == "") { - static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount)); + shutdownNotifierDlg->setStatusMessage(i18n("Closing applications (%1/%2)...").arg(initialClientCount-clients.count()).arg(initialClientCount)); } else { - static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill)); + shutdownNotifierDlg->setStatusMessage(i18n("Closing applications (%1/%2, %3)...").arg(initialClientCount-clients.count()).arg(initialClientCount).arg(nextClientToKill)); } } return; -- cgit v1.2.1