From f6565bdc455d7b3a10941c29d780b58fc1305ef2 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Fri, 8 May 2020 16:38:15 +0300 Subject: Add a page list widget to installer wizard If an installer is configured with set to true (default), a QListWidget set as a side widget for the wizard will be shown. The list should indicate completed and incomplete pages and the current wizard page. User navigation is not enabled in this change. The page list should honor the visibility of individual pages and update itself dynamically. In addition the visibility of a page in page list widget can be set internally with setShowOnPageList() which overrides other factors when hiding a page. The page item title shown on the list can be set internally with setPageListTitle() for the PackageManagerPage object, or the item can alternatively use the normal page title and the object name. Task-number: QTIFW-1755 Change-Id: I8a792d957a10e2176de5f42f29b1282e8e7667db Reviewed-by: Katja Marttila --- src/libs/installer/settings.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/libs/installer/settings.cpp') diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp index e6395e44c..97c20243d 100644 --- a/src/libs/installer/settings.cpp +++ b/src/libs/installer/settings.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -291,7 +291,7 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix, << scAllowSpaceInPath << scAllowNonAsciiCharacters << scDisableAuthorizationFallback << scDisableCommandLineInterface << scWizardStyle << scStyleSheet << scTitleColor - << scWizardDefaultWidth << scWizardDefaultHeight + << scWizardDefaultWidth << scWizardDefaultHeight << scWizardShowPageList << scRepositorySettingsPageVisible << scTargetConfigurationFile << scRemoteRepositories << scTranslations << scUrlQueryString << QLatin1String(scControlScript) << scCreateLocalRepository << scInstallActionColumnVisible << scSupportsModify << scAllowUnstableComponents @@ -455,7 +455,10 @@ static int lengthToInt(const QVariant &variant) int Settings::wizardDefaultWidth() const { - return lengthToInt(d->m_data.value(scWizardDefaultWidth)); + // Add a bit more sensible default width in case the page list widget is shown + // as it can take quite a lot horizontal space. A vendor can always override + // the default value. + return lengthToInt(d->m_data.value(scWizardDefaultWidth, wizardShowPageList() ? 800 : 0)); } int Settings::wizardDefaultHeight() const @@ -463,6 +466,11 @@ int Settings::wizardDefaultHeight() const return lengthToInt(d->m_data.value(scWizardDefaultHeight)); } +bool Settings::wizardShowPageList() const +{ + return d->m_data.value(scWizardShowPageList, true).toBool(); +} + QString Settings::installerApplicationIcon() const { return d->absolutePathFromKey(scInstallerApplicationIcon, systemIconSuffix()); -- cgit v1.2.3