summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-02-08 17:10:11 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-02-15 16:37:58 +0100
commit24f2fe2b7412d7a9a896fd8c706b2f187aff4fa4 (patch)
tree77446104bfa1928b7f2fa9f21de3216910407338
parent7917f9f0446f31efca14537e0a9aa3fc0c831641 (diff)
Fix missing redraw while pages are hidden but still existent.
Task-number: QTIFW-206 Fix issue when several pages are hidden, e.g. license and select components page, caused by the fact that we've overwriten the wrong virtual QWizard*::nextId() function. We need to implement the logic inside the wizards page nextId() function, as that one is called by the wizard anyway and by all pages that call either QWizardPage::nextId() or QWizard::nextId(). Change-Id: I377c007be618431d708cb2712a86d61d0d4e104d Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r--src/libs/installer/packagemanagergui.cpp21
-rw-r--r--src/sdk/installerbasecommons.cpp40
-rw-r--r--src/sdk/installerbasecommons.h4
3 files changed, 19 insertions, 46 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 5c672a068..1e01e69ff 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -823,10 +823,27 @@ void PackageManagerPage::setVisible(bool visible)
int PackageManagerPage::nextId() const
{
- return QWizardPage::nextId();
+ const int next = QWizardPage::nextId(); // the page to show next
+ if (next == PackageManagerCore::LicenseCheck) {
+ // calculate the page after the license page
+ const int nextNextId = gui()->pageIds().value(gui()->pageIds().indexOf(next) + 1, -1);
+ const PackageManagerCore *const core = packageManagerCore();
+ if (core->isUninstaller())
+ return nextNextId; // forcibly hide the license page if we run as uninstaller
+
+ core->calculateComponentsToInstall();
+ foreach (Component* component, core->orderedComponentsToInstall()) {
+ if ((core->isPackageManager() || core->isUpdater()) && component->isInstalled())
+ continue; // package manager or updater, hide as long as the component is installed
+
+ if (!component->licenses().isEmpty())
+ return next; // we found a component not installed with a license, need to show the page
+ }
+ return nextNextId; // no component with a license or all components with license installed
+ }
+ return next; // default, show the next page
}
-
// -- IntroductionPage
IntroductionPage::IntroductionPage(PackageManagerCore *core)
diff --git a/src/sdk/installerbasecommons.cpp b/src/sdk/installerbasecommons.cpp
index 4a935356c..6ae1ddc3a 100644
--- a/src/sdk/installerbasecommons.cpp
+++ b/src/sdk/installerbasecommons.cpp
@@ -526,25 +526,6 @@ void InstallerGui::init()
{
}
-int InstallerGui::nextId() const
-{
- const int next = QWizard::nextId();
- if (next == PackageManagerCore::LicenseCheck) {
- PackageManagerCore *const core = packageManagerCore();
- const int nextNextId = pageIds().value(pageIds().indexOf(next)+ 1, -1);
- if (!core->isInstaller())
- return nextNextId;
-
- core->calculateComponentsToInstall();
- foreach (Component* component, core->orderedComponentsToInstall()) {
- if (!component->licenses().isEmpty())
- return next;
- }
- return nextNextId;
- }
- return next;
-}
-
// -- MaintenanceGui
@@ -573,27 +554,6 @@ void MaintenanceGui::init()
{
}
-int MaintenanceGui::nextId() const
-{
- const int next = QWizard::nextId();
- if (next == PackageManagerCore::LicenseCheck) {
- PackageManagerCore *const core = packageManagerCore();
- const int nextNextId = pageIds().value(pageIds().indexOf(next)+ 1, -1);
- if (!core->isPackageManager() && !core->isUpdater())
- return nextNextId;
-
- core->calculateComponentsToInstall();
- foreach (Component* component, core->orderedComponentsToInstall()) {
- if (component->isInstalled())
- continue;
- if (!component->licenses().isEmpty())
- return next;
- }
- return nextNextId;
- }
- return next;
-}
-
void MaintenanceGui::updateRestartPage()
{
wizardPageVisibilityChangeRequested((packageManagerCore()->isUninstaller() ? false : true),
diff --git a/src/sdk/installerbasecommons.h b/src/sdk/installerbasecommons.h
index 67eb3a101..2bcdce3f2 100644
--- a/src/sdk/installerbasecommons.h
+++ b/src/sdk/installerbasecommons.h
@@ -133,9 +133,7 @@ class InstallerGui : public QInstaller::PackageManagerGui
public:
explicit InstallerGui(QInstaller::PackageManagerCore *core);
-
virtual void init();
- virtual int nextId() const;
};
@@ -147,9 +145,7 @@ class MaintenanceGui : public QInstaller::PackageManagerGui
public:
explicit MaintenanceGui(QInstaller::PackageManagerCore *core);
-
virtual void init();
- virtual int nextId() const;
private Q_SLOTS:
void updateRestartPage();