Skip to content

Commit 6ab8f8c

Browse files
committed
EO-11399 - Remove the show/hide details button
1 parent ff45376 commit 6ab8f8c

File tree

8 files changed

+48
-3
lines changed

8 files changed

+48
-3
lines changed

src/libs/installer/packagemanagercore.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,6 +2620,16 @@ bool PackageManagerCore::noCancelButton() const
26202620
return d->noCancelButton();
26212621
}
26222622

2623+
/*!
2624+
Returns \c true if no details should be available in the installer/uninstaller.
2625+
2626+
\sa {installer::noDetails}{installer.noDetails}
2627+
*/
2628+
bool PackageManagerCore::noDetails() const
2629+
{
2630+
return d->noDetails();
2631+
}
2632+
26232633
/*!
26242634
\sa {installer::setUninstaller}{installer.setUninstaller}
26252635
\sa isUninstaller(), setUpdater(), setPackageManager()

src/libs/installer/packagemanagercore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ class INSTALLER_EXPORT PackageManagerCore : public QObject
228228
Q_INVOKABLE bool useCustomIntroductionPage() const;
229229
Q_INVOKABLE bool preloadPackages() const;
230230
Q_INVOKABLE bool noCancelButton() const;
231+
Q_INVOKABLE bool noDetails() const;
231232

232233
Q_INVOKABLE void setUninstaller();
233234
Q_INVOKABLE bool isUninstaller() const;

src/libs/installer/packagemanagercore_p.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ bool PackageManagerCorePrivate::noCancelButton() const
649649
return getConfigValueAsBool(QLatin1String("noCancelButton"));
650650
}
651651

652+
bool PackageManagerCorePrivate::noDetails() const
653+
{
654+
return getConfigValueAsBool(QLatin1String("noDetails"));
655+
}
656+
652657
QString PackageManagerCorePrivate::installerBinaryPath() const
653658
{
654659
return qApp->applicationFilePath();

src/libs/installer/packagemanagercore_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class PackageManagerCorePrivate : public QObject
9090
bool useCustomIntroductionPage() const;
9191
bool preloadPackages() const;
9292
bool noCancelButton() const;
93+
bool noDetails() const;
9394

9495
bool statusCanceledOrFailed() const;
9596
void setStatus(int status, const QString &error = QString());

src/libs/installer/packagemanagergui.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,6 +3431,11 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core)
34313431

34323432
m_performInstallationForm->setupUi(this);
34333433

3434+
if (core->noDetails())
3435+
{
3436+
m_performInstallationForm->noDetails();
3437+
}
3438+
34343439
connect(ProgressCoordinator::instance(), &ProgressCoordinator::detailTextChanged,
34353440
m_performInstallationForm, &PerformInstallationForm::appendProgressDetails);
34363441
connect(ProgressCoordinator::instance(), &ProgressCoordinator::detailTextResetNeeded,
@@ -3453,7 +3458,10 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core)
34533458
connect(this, &PerformInstallationPage::setAutomatedPageSwitchEnabled,
34543459
core, &PackageManagerCore::setAutomatedPageSwitchEnabled);
34553460

3456-
m_performInstallationForm->setDetailsWidgetVisible(true);
3461+
if (!core->noDetails())
3462+
{
3463+
m_performInstallationForm->setDetailsWidgetVisible(true);
3464+
}
34573465

34583466
setCommitPage(true);
34593467
}
@@ -3502,10 +3510,13 @@ void PerformInstallationPage::entering()
35023510
QTimer::singleShot(30, packageManagerCore(), SLOT(runInstaller()));
35033511
}
35043512

3505-
m_performInstallationForm->enableDetails();
3513+
if (!packageManagerCore()->noDetails())
3514+
{
3515+
m_performInstallationForm->enableDetails();
3516+
}
35063517
emit setAutomatedPageSwitchEnabled(true);
35073518

3508-
if (isVerbose())
3519+
if (isVerbose() && !packageManagerCore()->noDetails())
35093520
m_performInstallationForm->toggleDetails();
35103521
}
35113522

src/libs/installer/performinstallationform.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,12 @@ void PerformInstallationForm::onDownloadStatusChanged(const QString &status)
273273
m_downloadStatus->setText(m_downloadStatus->fontMetrics().elidedText(status, Qt::ElideRight,
274274
m_downloadStatus->width()));
275275
}
276+
277+
/*!
278+
Removes the show/hide details button along with the details browser
279+
*/
280+
void PerformInstallationForm::noDetails() const
281+
{
282+
m_detailsButton->setVisible(false);
283+
m_detailsBrowser->setVisible(false);
284+
}

src/libs/installer/performinstallationform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public slots:
6969
void toggleDetails();
7070
void clearDetailsBrowser();
7171
void onDownloadStatusChanged(const QString &status);
72+
void noDetails() const;
7273

7374
private:
7475
QProgressBar *m_progressBar;

tools/binarycreator/binarycreator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ static void printUsage()
661661

662662
std::cout << " -xc|--no-cancel Remove all cancel buttons from the installer/uninstaller" << std::endl;
663663

664+
std::cout << " -xd|--no-details Don't offer any details in installer/uninstaller " << std::endl;
665+
664666
std::cout << " -r|--resources r1,.,rn include the given resource files into the binary" << std::endl;
665667

666668
std::cout << " -v|--verbose Verbose output" << std::endl;
@@ -793,6 +795,7 @@ int main(int argc, char **argv)
793795
bool customIntroductionPage = false;
794796
bool preloadPackages = false;
795797
bool noCancelButton = false;
798+
bool noDetails = false;
796799
QStringList resources;
797800
QStringList filteredPackages;
798801
QInstallerTools::FilterType ftype = QInstallerTools::Exclude;
@@ -859,6 +862,8 @@ int main(int argc, char **argv)
859862
preloadPackages = true;
860863
} else if (*it == QLatin1String("-xc") || *it == QLatin1String("--no-cancel")) {
861864
noCancelButton = true;
865+
} else if (*it == QLatin1String("-xd") || *it == QLatin1String("--no-details")) {
866+
noDetails = true;
862867
} else if (*it == QLatin1String("-t") || *it == QLatin1String("--template")) {
863868
++it;
864869
if (it == args.end()) {
@@ -1006,6 +1011,8 @@ int main(int argc, char **argv)
10061011
confInternal.setValue(QLatin1String("preloadPackages"), preloadPackages);
10071012
// assume cancel button if --no-cancel not set
10081013
confInternal.setValue(QLatin1String("noCancelButton"), noCancelButton);
1014+
// assume details are available if --no-details not set
1015+
confInternal.setValue(QLatin1String("noDetails"), noDetails);
10091016
}
10101017

10111018
#ifdef Q_OS_MACOS

0 commit comments

Comments
 (0)