summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
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 /src/libs/installer
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>
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/packagemanagergui.cpp21
1 files changed, 19 insertions, 2 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)