Skip to content

Commit d440419

Browse files
authored
Merge pull request #28 from hjaltisan/EO11387
EO-11387
2 parents 186c985 + 06c3c12 commit d440419

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

src/libs/installer/packagemanagercoredata.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <QDesktopServices>
3636
#include <QDir>
3737
#include <QRegExp>
38+
#include <QSettings>
3839

3940
#ifdef Q_OS_WIN
4041
# include <windows.h>
@@ -79,17 +80,27 @@ PackageManagerCoreData::PackageManagerCoreData(const QHash<QString, QString> &va
7980
m_variables.insert(QLatin1String("WatermarkPixmap"), m_settings.watermark());
8081
m_variables.insert(QLatin1String("BannerPixmap"), m_settings.banner());
8182

82-
// fill in start menu location
83-
QString startMenuPath;
84-
if (m_variables.value(scAllUsers, scFalse) == scTrue)
83+
// When showing the custom introduction page, we need to have the start menu path complete
84+
// from the start. When showing the regular intro, we don't want the entire path at the start
85+
QSettings confInternal(QLatin1String(":/config/config-internal.ini"), QSettings::IniFormat);
86+
if (confInternal.value(QLatin1String("customIntroductionPage"), false).toBool())
8587
{
86-
startMenuPath = m_variables.value(QLatin1String("AllUserStartMenuProgramsPath"));
88+
// fill in start menu location
89+
QString startMenuPath;
90+
if (m_variables.value(scAllUsers, scFalse) == scTrue)
91+
{
92+
startMenuPath = m_variables.value(QLatin1String("AllUserStartMenuProgramsPath"));
93+
}
94+
else
95+
{
96+
startMenuPath = m_variables.value(QLatin1String("UserStartMenuProgramsPath"));
97+
}
98+
m_variables.insert(scStartMenuDir, startMenuPath + QDir::separator() + m_settings.startMenuDir());
8799
}
88100
else
89101
{
90-
startMenuPath = m_variables.value(QLatin1String("UserStartMenuProgramsPath"));
102+
m_variables.insert(scStartMenuDir, m_settings.startMenuDir());
91103
}
92-
m_variables.insert(scStartMenuDir, startMenuPath + QDir::separator() + m_settings.startMenuDir());
93104

94105
const QString description = m_settings.runProgramDescription();
95106
if (!description.isEmpty())

src/sdk/installerbasecommons.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,23 @@ InstallerGui::InstallerGui(PackageManagerCore *core)
5555
}
5656
else
5757
{
58-
setPage(PackageManagerCore::Introduction, new IntroductionPage(core));
58+
setPage(PackageManagerCore::Introduction, new IntroductionPage(core));
59+
// We don't want the target directory and component selection pages if using the custom introduction page
60+
setPage(PackageManagerCore::TargetDirectory, new TargetDirectoryPage(core));
61+
setPage(PackageManagerCore::ComponentSelection, new ComponentSelectionPage(core));
5962
}
60-
61-
setPage(PackageManagerCore::TargetDirectory, new TargetDirectoryPage(core));
62-
setPage(PackageManagerCore::ComponentSelection, new ComponentSelectionPage(core));
63+
6364
setPage(PackageManagerCore::LicenseCheck, new LicenseAgreementPage(core));
65+
66+
// We also don't want the start menu and ready pages if using the custom introduction page
67+
if (!core->useCustomIntroductionPage())
68+
{
6469
#ifdef Q_OS_WIN
65-
setPage(PackageManagerCore::StartMenuSelection, new StartMenuDirectoryPage(core));
70+
setPage(PackageManagerCore::StartMenuSelection, new StartMenuDirectoryPage(core));
6671
#endif
67-
setPage(PackageManagerCore::ReadyForInstallation, new ReadyForInstallationPage(core));
72+
setPage(PackageManagerCore::ReadyForInstallation, new ReadyForInstallationPage(core));
73+
}
74+
6875
setPage(PackageManagerCore::PerformInstallation, new PerformInstallationPage(core));
6976
setPage(PackageManagerCore::InstallationFinished, new FinishedPage(core));
7077

@@ -118,7 +125,12 @@ MaintenanceGui::MaintenanceGui(PackageManagerCore *core)
118125
core->setCompleteUninstallation(true);
119126
}
120127

121-
setPage(PackageManagerCore::ReadyForInstallation, new ReadyForInstallationPage(core));
128+
// We don't want the ready page if using the custom introduction page
129+
if (!core->useCustomIntroductionPage())
130+
{
131+
setPage(PackageManagerCore::ReadyForInstallation, new ReadyForInstallationPage(core));
132+
}
133+
122134
setPage(PackageManagerCore::PerformInstallation, new PerformInstallationPage(core));
123135
setPage(PackageManagerCore::InstallationFinished, new FinishedPage(core));
124136

0 commit comments

Comments
 (0)