summaryrefslogtreecommitdiffstats
path: root/ksmserver
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2013-11-21 01:34:25 +0100
committerSlávek Banko <[email protected]>2013-11-21 01:34:25 +0100
commit1c618af70de66f304481efe05b8ebcc0d5d8d4f6 (patch)
tree40b749d4e687065f2b32cfecbfe92a66b303366e /ksmserver
parentc4083c1d476f6dfd575599ffce4434e534251fd2 (diff)
downloadtdebase-1c618af70de66f304481efe05b8ebcc0d5d8d4f6.tar.gz
tdebase-1c618af70de66f304481efe05b8ebcc0d5d8d4f6.zip
Add progress bar to logout status dialog
This resolves Bug 1667
Diffstat (limited to 'ksmserver')
-rw-r--r--ksmserver/shutdown.cpp16
-rw-r--r--ksmserver/shutdowndlg.cpp16
-rw-r--r--ksmserver/shutdowndlg.h5
3 files changed, 32 insertions, 5 deletions
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<KSMShutdownIPDlg*>(shutdownNotifierIPDlg);
+ shutdownNotifierDlg->setProgressBarTotalSteps(initialClientCount);
+ shutdownNotifierDlg->setProgressBarProgress(initialClientCount-clients.count());
if (nextClientToKill == "") {
- static_cast<KSMShutdownIPDlg*>(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<KSMShutdownIPDlg*>(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<KSMShutdownIPDlg*>(shutdownNotifierIPDlg)->show();
+ KSMShutdownIPDlg *shutdownNotifierDlg=static_cast<KSMShutdownIPDlg*>(shutdownNotifierIPDlg);
+ shutdownNotifierDlg->setProgressBarTotalSteps(initialClientCount);
+ shutdownNotifierDlg->setProgressBarProgress(initialClientCount-clients.count());
+ shutdownNotifierDlg->show();
if (nextClientToKill == "") {
- static_cast<KSMShutdownIPDlg*>(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<KSMShutdownIPDlg*>(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;
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index fde31d223..9cf0f3c32 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -1250,10 +1250,26 @@ void KSMShutdownIPDlg::setNotificationActionButtonsSkipText(TQString text)
m_button1->setText(text);
}
+void KSMShutdownIPDlg::setProgressBarTotalSteps(int total_steps)
+{
+ m_progressbar->setTotalSteps(total_steps);
+}
+
+void KSMShutdownIPDlg::setProgressBarProgress(int step)
+{
+ m_progressbar->setProgress(step);
+}
+
KSMShutdownIPDlg::KSMShutdownIPDlg(TQWidget* parent)
: KSMModalDialog( parent )
{
+ m_progressbar = new TQProgressBar(this);
+ m_progressbar->show();
+ m_gridlayout->expand(4,3);
+ m_gridlayout->addMultiCellWidget( m_progressbar, 3, 3, 0, 2);
+ setFixedSize(sizeHint());
+
setStatusMessage(i18n("Saving your settings..."));
setNotificationActionButtonsSkipText(i18n("Skip Notification"));
diff --git a/ksmserver/shutdowndlg.h b/ksmserver/shutdowndlg.h
index 270979182..d8f6b9d3b 100644
--- a/ksmserver/shutdowndlg.h
+++ b/ksmserver/shutdowndlg.h
@@ -18,6 +18,7 @@ Copyright (C) 2000 Matthias Ettrich <[email protected]>
#include <kguiitem.h>
#include <tqtoolbutton.h>
#include <krootpixmap.h>
+#include <ntqprogressbar.h>
class TQPushButton;
class TQVButtonGroup;
@@ -175,6 +176,8 @@ public:
void showNotificationActionButtons();
void hideNotificationActionButtons();
void setNotificationActionButtonsSkipText(TQString text);
+ void setProgressBarTotalSteps(int total_steps);
+ void setProgressBarProgress(int step);
signals:
void abortLogoutClicked();
@@ -185,6 +188,8 @@ protected:
private:
KSMShutdownIPDlg( TQWidget* parent );
+
+ TQProgressBar *m_progressbar;
};
class KSMDelayedPushButton : public KPushButton