summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Loibl <andreas@andreas-loibl.de>2011-10-02 23:53:52 +0200
committerAndreas Loibl <andreas@andreas-loibl.de>2011-10-02 23:53:52 +0200
commit2f15cfa42e133c9d96061e439d671ebd54791d08 (patch)
treec6201c9178cdfea21f8120eca1be665a4651b07f
parent3464bcb4f23e52bf55d7d60b7af91612cef06e2c (diff)
downloadacritoxinstaller-2f15cfa42e133c9d96061e439d671ebd54791d08.zip
acritoxinstaller-2f15cfa42e133c9d96061e439d671ebd54791d08.tar.gz
added installation timer
-rw-r--r--wizard/installation.cpp6
-rw-r--r--wizard/installation.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/wizard/installation.cpp b/wizard/installation.cpp
index 2d5e342..8e9ceb7 100644
--- a/wizard/installation.cpp
+++ b/wizard/installation.cpp
@@ -23,6 +23,7 @@ void wpInstallation::initializePage()
connect(backend, SIGNAL(receivedCommand(QString,QString)), this, SLOT(receivedCommand(QString,QString)));
connect(backend, SIGNAL(finishedCommand(QString)), this, SLOT(finishedCommand(QString)));
backend->exec("do_install");
+ timer.start();
}
void wpInstallation::cleanupPage()
@@ -127,6 +128,11 @@ void wpInstallation::finishedCommand(QString command)
progressCompleted->setValue(100);
progressCurrent->setRange(0,100);
progressCurrent->setValue(100);
+ int elapsed = timer.elapsed()/1000;
+ QString desc = tr("The installation took %1m%2s.").arg(elapsed/60).arg(elapsed % 60, 2, QLatin1Char('0'));
+ QListWidgetItem *item = new ListItem(tr("Finished."), desc, "dialog-ok-apply");
+ listWidget->addItem(item);
+ listWidget->scrollToItem(item);
setComplete(true);
}
diff --git a/wizard/installation.h b/wizard/installation.h
index 0209007..c783b90 100644
--- a/wizard/installation.h
+++ b/wizard/installation.h
@@ -1,6 +1,7 @@
#ifndef installation_H
#define installation_H
+#include <QTime>
#include "ui_installation.h"
#include "../backend.h"
@@ -19,6 +20,7 @@ class wpInstallation : public QWizardPage, Ui::wpInstallation
Backend* backend;
bool complete;
void setComplete(bool c);
+ QTime timer;
private slots:
void setProgress(int percent);