summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/progressloggergui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/progressloggergui.cpp')
-rw-r--r--rbutil/rbutilqt/progressloggergui.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp
index a96778bc11..0358d75096 100644
--- a/rbutil/rbutilqt/progressloggergui.cpp
+++ b/rbutil/rbutilqt/progressloggergui.cpp
@@ -25,7 +25,7 @@ ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(p
25 downloadProgress->setModal(true); 25 downloadProgress->setModal(true);
26 dp.setupUi(downloadProgress); 26 dp.setupUi(downloadProgress);
27 dp.listProgress->setAlternatingRowColors(true); 27 dp.listProgress->setAlternatingRowColors(true);
28 connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(abort())); 28 setRunning();
29} 29}
30 30
31void ProgressLoggerGui::addItem(const QString &text) 31void ProgressLoggerGui::addItem(const QString &text)
@@ -87,22 +87,39 @@ void ProgressLoggerGui::setProgressVisible(bool b)
87} 87}
88 88
89 89
90void ProgressLoggerGui::abort() 90/** Set logger into "running" state -- the reporting process is still running.
91 * Display "Abort" and emit the aborted() signal on button press.
92 */
93void ProgressLoggerGui::setRunning()
94{
95 dp.buttonAbort->setText(tr("&Abort"));
96 dp.buttonAbort->setIcon(QIcon(QString::fromUtf8(":/icons/process-stop.png")));
97
98 // make sure to not close the window on button press.
99 disconnect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
100 // emit aborted() once button is pressed but not closed().
101 disconnect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(closed()));
102 connect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(aborted()));
103
104}
105
106
107/** Set logger into "finished" state -- the reporting process is finished.
108 * Display "Ok". Don't emit aborted() as there is nothing running left.
109 * Close logger on button press and emit closed().
110 */
111void ProgressLoggerGui::setFinished()
91{ 112{
92 dp.buttonAbort->setText(tr("&Ok")); 113 dp.buttonAbort->setText(tr("&Ok"));
93 dp.buttonAbort->setIcon(QIcon(QString::fromUtf8(":/icons/go-next.png"))); 114 dp.buttonAbort->setIcon(QIcon(QString::fromUtf8(":/icons/go-next.png")));
94 disconnect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(abort())); 115
116 // close the window on button press.
95 connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close())); 117 connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
118 // emit closed() once button is pressed but not aborted().
119 disconnect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(aborted()));
96 connect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(closed())); 120 connect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(closed()));
97 emit aborted();
98} 121}
99 122
100void ProgressLoggerGui::undoAbort()
101{
102 dp.buttonAbort->setText(tr("&Abort"));
103 dp.buttonAbort->setIcon(QIcon(QString::fromUtf8(":/icons/process-stop.png")));
104 connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(abort()));
105}
106 123
107void ProgressLoggerGui::close() 124void ProgressLoggerGui::close()
108{ 125{