diff options
author | kh1 <qt-info@nokia.com> | 2011-06-20 15:54:09 +0200 |
---|---|---|
committer | kh1 <qt-info@nokia.com> | 2011-06-20 15:54:09 +0200 |
commit | 306363710d38c521c60e4e8496bbe17a143c89ce (patch) | |
tree | 15e59bf5b9f0758256e9fdab12777c7887efe7b0 /installerbuilder/libinstaller/packagemanagergui.cpp | |
parent | d3c9a33c403a61665328521a3a9689c902d4c25c (diff) |
No need to keep the initital text arround.
Once we finish the installation and notice that there
is no auto switch we are still able to switch the text.
Set the details visibility on entering and not in the
constructor, as we might start as uninstaller and then
never will see the details widget.
Diffstat (limited to 'installerbuilder/libinstaller/packagemanagergui.cpp')
-rw-r--r-- | installerbuilder/libinstaller/packagemanagergui.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/installerbuilder/libinstaller/packagemanagergui.cpp b/installerbuilder/libinstaller/packagemanagergui.cpp index 38dff0b0b..1ecdf786d 100644 --- a/installerbuilder/libinstaller/packagemanagergui.cpp +++ b/installerbuilder/libinstaller/packagemanagergui.cpp @@ -1462,8 +1462,6 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core) m_performInstallationForm->setupUi(this); - m_performInstallationForm->setDetailsWidgetVisible(core->isInstaller() || core->isPackageManager() - || core->isUpdater()); connect(ProgressCoordninator::instance(), SIGNAL(detailTextChanged(QString)), m_performInstallationForm, SLOT(appendProgressDetails(QString))); connect(ProgressCoordninator::instance(), SIGNAL(detailTextResetNeeded()), @@ -1498,23 +1496,21 @@ void PerformInstallationPage::entering() setComplete(false); setCommitPage(true); + const QString productName = packageManagerCore()->value(QLatin1String("ProductName")); if (packageManagerCore()->isUninstaller()) { - m_commitBtnText = tr("&Uninstall"); - setButtonText(QWizard::CommitButton, m_commitBtnText); - setTitle(tr("Uninstalling %1").arg(packageManagerCore()->value(QLatin1String("ProductName")))); - + setTitle(tr("Uninstalling %1").arg(productName)); + setButtonText(QWizard::CommitButton, tr("&Uninstall")); + m_performInstallationForm->setDetailsWidgetVisible(false); QTimer::singleShot(30, packageManagerCore(), SLOT(runUninstaller())); } else if (packageManagerCore()->isPackageManager() || packageManagerCore()->isUpdater()) { - m_commitBtnText = tr ("&Update"); - setButtonText(QWizard::CommitButton, m_commitBtnText); - setTitle(tr("Updating components of %1").arg(packageManagerCore()->value(QLatin1String("ProductName")))); - + setButtonText(QWizard::CommitButton, tr("&Update")); + m_performInstallationForm->setDetailsWidgetVisible(true); + setTitle(tr("Updating components of %1").arg(productName)); QTimer::singleShot(30, packageManagerCore(), SLOT(runPackageUpdater())); } else { - m_commitBtnText = tr("&Install"); - setButtonText(QWizard::CommitButton, m_commitBtnText); - setTitle(tr("Installing %1").arg(packageManagerCore()->value(QLatin1String("ProductName")))); - + setTitle(tr("Installing %1").arg(productName)); + setButtonText(QWizard::CommitButton, tr("&Install")); + m_performInstallationForm->setDetailsWidgetVisible(true); QTimer::singleShot(30, packageManagerCore(), SLOT(runInstaller())); } @@ -1555,10 +1551,7 @@ void PerformInstallationPage::installationFinished() void PerformInstallationPage::toggleDetailsWereChanged() { - const bool needAutoSwitching = isAutoSwitching(); - setButtonText(QWizard::CommitButton, needAutoSwitching ? m_commitBtnText - : gui()->defaultButtonText(QWizard::NextButton)); - emit setAutomatedPageSwitchEnabled(needAutoSwitching); + emit setAutomatedPageSwitchEnabled(isAutoSwitching()); } |