Fix displaying a progress.

new_installer
ivan 14 years ago
parent a6ceffc4ee
commit e2bced9f45

@ -1,2 +1,4 @@
Congratulations, the instalation is complete!
Press "Next" to exit.

@ -1,5 +1,7 @@
#include "pagefinish.h"
#include <QApplication>
#include <QLabel>
#include <QBoxLayout>
@ -22,5 +24,13 @@ PageFinish::PageFinish(const QString& title) :
bool PageFinish::validate()
{
// last page, need finish
qApp->quit();
return true;
}
void PageFinish::show()
{
emit changePrev(false);
}

@ -11,7 +11,7 @@ public:
bool validate();
public slots:
void show();
};

@ -103,7 +103,7 @@ void PageInstall::showStdErr()
eta = eta_regexp.cap(0);
if ( percent_regexp.indexIn(str) )
progress = percent_regexp.cap(0);
progress = percent_regexp.cap(0).replace(QRegExp("[^0-9]"), " ");
if ( !eta.isEmpty() )
m_LabelEta->setText( tr("Eta: %1").arg(eta) );
@ -122,6 +122,14 @@ void PageInstall::onFinish(int exitCode, QProcess::ExitStatus exitStatus)
emit changeNext(true);
emit changePrev(true);
if (exitCode == 0)
{
// instalation complete
emit changePrev(false);
}
m_LabelEta->setText( tr("Eta: 0:00:00") );
delete m_clProc;
m_clProc = 0;
}

@ -107,12 +107,13 @@ SystemInstaller::SystemInstaller(QWidget *parent) :
m_PageManager->addPage(pageConfiguration);
PageInstall* pageInstall = new PageInstall( tr("Installing"), &m_InstallSettings );
// connect( this, )
connect( pageInstall, SIGNAL(changeNext(bool)), this, SLOT(changedNext(bool)) );
connect( pageInstall, SIGNAL(changePrev(bool)), this, SLOT(changedPrev(bool)) );
m_PageManager->addPage(pageInstall);
PageFinish* pageFinish = new PageFinish( tr("Complete") );
connect( pageFinish, SIGNAL(changeNext(bool)), this, SLOT(changedNext(bool)) );
connect( pageFinish, SIGNAL(changePrev(bool)), this, SLOT(changedPrev(bool)) );
m_PageManager->addPage(pageFinish);
m_PageManager->showFirst();

Loading…
Cancel
Save