From 2b5c1055e49f5c3598f218f99e447895848b6637 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 28 Mar 2012 15:07:00 +0200 Subject: Disable the cancel button in case we uninstall. Change-Id: I246fca40b571e9f7b482ae81e040b952deb5ba39 Reviewed-by: Alexander Lenhardt --- src/libs/installer/packagemanagergui.cpp | 20 ++++++++++++++++++-- src/libs/installer/packagemanagergui.h | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 6e0909517..ede8cb12d 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -1722,9 +1722,11 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core) connect(m_performInstallationForm, SIGNAL(showDetailsChanged()), this, SLOT(toggleDetailsWereChanged())); connect(core, SIGNAL(installationStarted()), this, SLOT(installationStarted())); - connect(core, SIGNAL(uninstallationStarted()), this, SLOT(installationStarted())); connect(core, SIGNAL(installationFinished()), this, SLOT(installationFinished())); - connect(core, SIGNAL(uninstallationFinished()), this, SLOT(installationFinished())); + + connect(core, SIGNAL(uninstallationStarted()), this, SLOT(uninstallationStarted())); + connect(core, SIGNAL(uninstallationFinished()), this, SLOT(uninstallationFinished())); + connect(core, SIGNAL(titleMessageChanged(QString)), this, SLOT(setTitleMessage(QString))); connect(this, SIGNAL(setAutomatedPageSwitchEnabled(bool)), core, SIGNAL(setAutomatedPageSwitchEnabled(bool))); @@ -1802,6 +1804,20 @@ void PerformInstallationPage::installationFinished() } } +void PerformInstallationPage::uninstallationStarted() +{ + m_performInstallationForm->startUpdateProgress(); + if (QAbstractButton *cancel = gui()->button(QWizard::CancelButton)) + cancel->setEnabled(false); +} + +void PerformInstallationPage::uninstallationFinished() +{ + installationFinished(); + if (QAbstractButton *cancel = gui()->button(QWizard::CancelButton)) + cancel->setEnabled(false); +} + void PerformInstallationPage::toggleDetailsWereChanged() { emit setAutomatedPageSwitchEnabled(isAutoSwitching()); diff --git a/src/libs/installer/packagemanagergui.h b/src/libs/installer/packagemanagergui.h index b3f1bdf88..68a54eff2 100644 --- a/src/libs/installer/packagemanagergui.h +++ b/src/libs/installer/packagemanagergui.h @@ -364,6 +364,10 @@ Q_SIGNALS: private Q_SLOTS: void installationStarted(); void installationFinished(); + + void uninstallationStarted(); + void uninstallationFinished(); + void toggleDetailsWereChanged(); private: -- cgit v1.2.3