summaryrefslogtreecommitdiffstats
path: root/installerbuilder/installerbase/installerbasecommons.cpp
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-06-29 13:26:05 +0200
committerkh1 <qt-info@nokia.com>2011-06-29 13:26:05 +0200
commit3a8908b0683486b86912ab6ceceb98df32ec7bc9 (patch)
tree273e6e78fa08adecc4bfdb9a7401fd9cf66a43d5 /installerbuilder/installerbase/installerbasecommons.cpp
parent812f60ea11e3c5bbd929c3426ade87917575826a (diff)
Add an error function and display it in the ui.
If there happens to be an error during fetch, set the appropriate installer status and display an error message.
Diffstat (limited to 'installerbuilder/installerbase/installerbasecommons.cpp')
-rw-r--r--installerbuilder/installerbase/installerbasecommons.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/installerbuilder/installerbase/installerbasecommons.cpp b/installerbuilder/installerbase/installerbasecommons.cpp
index 38939fc50..931d67c97 100644
--- a/installerbuilder/installerbase/installerbasecommons.cpp
+++ b/installerbuilder/installerbase/installerbasecommons.cpp
@@ -86,6 +86,11 @@ IntroductionPageImpl::IntroductionPageImpl(QInstaller::PackageManagerCore *core)
layout->addWidget(m_progressBar);
layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));
+
+ m_errorLabel = new QLabel(this);
+ m_errorLabel->setWordWrap(true);
+ layout->addWidget(m_errorLabel);
+
widget->setLayout(layout);
setWidget(widget);
@@ -134,6 +139,19 @@ void IntroductionPageImpl::setMaintenanceToolsEnabled(bool enable)
m_removeAllComponents->setEnabled(enable);
}
+void IntroductionPageImpl::setErrorMessage(const QString &error)
+{
+ QPalette palette;
+ if (packageManagerCore()->status() != PackageManagerCore::Failure) {
+ palette.setColor(QPalette::WindowText, palette.color(QPalette::WindowText));
+ } else {
+ palette.setColor(QPalette::WindowText, Qt::red);
+ }
+
+ m_errorLabel->setText(error);
+ m_errorLabel->setPalette(palette);
+}
+
void IntroductionPageImpl::message(KDJob *job, const QString &msg)
{
Q_UNUSED(job)