summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNiels Weber <niels.weber@digia.com>2014-12-02 12:34:23 +0100
committerNiels Weber <niels.weber@theqtcompany.com>2014-12-09 14:37:17 +0100
commit1ee79d87c49fa9e8398b397ed08c0fd92d52bb11 (patch)
treea9434ad72de9d50d5c0198a70abbef0576d76ac1 /src
parent262797714693d7332174255c67e59da391e64a0e (diff)
Introduce a setting for Wizard default height / width
Setting WizardDefaultWidth / WizardDefaultHeight in config.xml allows to set a default width / height for the wizard window. Minimal size will still be set by the size of the contents. Depending on style, watermark and banner image may override this setting. Default behaviour is unchanged. Task-number: QTIFW-47 Change-Id: I5695d501b2b31ea87ea63e95de454657cfebede6 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs/installer/constants.h2
-rw-r--r--src/libs/installer/packagemanagergui.cpp4
-rw-r--r--src/libs/installer/settings.cpp11
-rw-r--r--src/libs/installer/settings.h2
4 files changed, 19 insertions, 0 deletions
diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h
index 3fe3b8367..8ad1b2f79 100644
--- a/src/libs/installer/constants.h
+++ b/src/libs/installer/constants.h
@@ -85,6 +85,8 @@ static const QLatin1String scRepositorySettingsPageVisible("RepositorySettingsPa
static const QLatin1String scAllowSpaceInPath("AllowSpaceInPath");
static const QLatin1String scWizardStyle("WizardStyle");
static const QLatin1String scTitleColor("TitleColor");
+static const QLatin1String scWizardDefaultWidth("WizardDefaultWidth");
+static const QLatin1String scWizardDefaultHeight("WizardDefaultHeight");
}
#endif // CONSTANTS_H
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 3b7b3b178..ee1ba72de 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -478,6 +478,10 @@ void PackageManagerGui::showEvent(QShowEvent *event)
}
}
setMinimumSize(size());
+ if (minimumWidth() < m_core->settings().wizardDefaultWidth())
+ resize(m_core->settings().wizardDefaultWidth(), height());
+ if (minimumHeight() < m_core->settings().wizardDefaultHeight())
+ resize(width(), m_core->settings().wizardDefaultHeight());
}
QWizard::showEvent(event);
QMetaObject::invokeMethod(this, "dependsOnLocalInstallerBinary", Qt::QueuedConnection);
diff --git a/src/libs/installer/settings.cpp b/src/libs/installer/settings.cpp
index 4ff66a7da..c00cfd794 100644
--- a/src/libs/installer/settings.cpp
+++ b/src/libs/installer/settings.cpp
@@ -251,6 +251,7 @@ Settings Settings::fromFileAndPrefix(const QString &path, const QString &prefix,
<< scRunProgram << scRunProgramArguments << scRunProgramDescription
<< scDependsOnLocalInstallerBinary
<< scAllowSpaceInPath << scAllowNonAsciiCharacters << scWizardStyle << scTitleColor
+ << scWizardDefaultWidth << scWizardDefaultHeight
<< scRepositorySettingsPageVisible << scTargetConfigurationFile
<< scRemoteRepositories << scTranslations;
@@ -370,6 +371,16 @@ QString Settings::titleColor() const
return d->m_data.value(scTitleColor).toString();
}
+int Settings::wizardDefaultWidth() const
+{
+ return d->m_data.value(scWizardDefaultWidth).toInt();
+}
+
+int Settings::wizardDefaultHeight() const
+{
+ return d->m_data.value(scWizardDefaultHeight).toInt();
+}
+
QString Settings::installerApplicationIcon() const
{
return d->absolutePathFromKey(scInstallerApplicationIcon, systemIconSuffix());
diff --git a/src/libs/installer/settings.h b/src/libs/installer/settings.h
index ab74886bb..33f6c0ae1 100644
--- a/src/libs/installer/settings.h
+++ b/src/libs/installer/settings.h
@@ -90,6 +90,8 @@ public:
QString systemIconSuffix() const;
QString wizardStyle() const;
QString titleColor() const;
+ int wizardDefaultWidth() const;
+ int wizardDefaultHeight() const;
QString applicationName() const;
QString applicationVersion() const;