diff options
Diffstat (limited to 'src/libs/installer/packagemanagergui.cpp')
-rw-r--r-- | src/libs/installer/packagemanagergui.cpp | 241 |
1 files changed, 94 insertions, 147 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 1e01e69ff..25b4cafac 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -46,7 +46,6 @@ #include "fileutils.h" #include "messageboxhandler.h" #include "packagemanagercore.h" -#include "qinstallerglobal.h" #include "progresscoordinator.h" #include "performinstallationform.h" #include "settings.h" @@ -134,6 +133,7 @@ public: setObjectName(QLatin1String("Dynamic") + widget->objectName()); setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); + setPixmap(QWizard::BannerPixmap, QPixmap()); setLayout(new QVBoxLayout); setSubTitle(QString()); @@ -244,7 +244,7 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent) setWindowTitle(tr("Maintain %1").arg(m_core->value(scTitle))); #ifndef Q_OS_MAC - setWindowIcon(QIcon(m_core->settings().icon())); + setWindowIcon(QIcon(m_core->settings().installerWindowIcon())); #else setPixmap(QWizard::BackgroundPixmap, m_core->settings().background()); #endif @@ -461,7 +461,6 @@ bool PackageManagerGui::event(QEvent *event) void PackageManagerGui::showEvent(QShowEvent *event) { -#ifndef Q_OS_LINUX if (!event->spontaneous()) { foreach (int id, pageIds()) { const QString subTitle = page(id)->subTitle(); @@ -472,7 +471,6 @@ void PackageManagerGui::showEvent(QShowEvent *event) } } } -#endif QWizard::showEvent(event); QMetaObject::invokeMethod(this, "dependsOnLocalInstallerBinary", Qt::QueuedConnection); } @@ -692,6 +690,9 @@ PackageManagerPage::PackageManagerPage(PackageManagerCore *core) , m_core(core) , validatorComponent(0) { + setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); + setPixmap(QWizard::BannerPixmap, bannerPixmap()); + setPixmap(QWizard::LogoPixmap, logoPixmap()); } PackageManagerCore *PackageManagerPage::packageManagerCore() const @@ -699,44 +700,14 @@ PackageManagerCore *PackageManagerPage::packageManagerCore() const return m_core; } -QVariantHash PackageManagerPage::elementsForPage(const QString &pageName) const -{ - const QVariant variant = m_core->settings().value(pageName); - - QVariantHash hash; - if (variant.canConvert<QVariantHash>()) - hash = variant.value<QVariantHash>(); - return hash; -} - -QString PackageManagerPage::titleForPage(const QString &pageName, const QString &value) const -{ - return titleFromHash(m_core->settings().titlesForPage(pageName), value); -} - -QString PackageManagerPage::subTitleForPage(const QString &pageName, const QString &value) const -{ - return titleFromHash(m_core->settings().subTitlesForPage(pageName), value); -} - -QString PackageManagerPage::titleFromHash(const QVariantHash &hash, const QString &value) const +QPixmap PackageManagerPage::watermarkPixmap() const { - QString defaultValue = hash.value(QLatin1String("Default")).toString(); - if (defaultValue.isEmpty()) - defaultValue = value; - - if (m_core->isUpdater()) - return hash.value(QLatin1String("Updater"), defaultValue).toString(); - if (m_core->isInstaller()) - return hash.value(QLatin1String("Installer"), defaultValue).toString(); - if (m_core->isPackageManager()) - return hash.value(QLatin1String("PackageManager"), defaultValue).toString(); - return hash.value(QLatin1String("Uninstaller"), defaultValue).toString(); + return QPixmap(m_core->value(QLatin1String("WatermarkPixmap"))); } -QPixmap PackageManagerPage::watermarkPixmap() const +QPixmap PackageManagerPage::bannerPixmap() const { - return QPixmap(m_core->value(QLatin1String("WatermarkPixmap"))); + return QPixmap(m_core->value(QLatin1String("BannerPixmap"))); } QPixmap PackageManagerPage::logoPixmap() const @@ -851,16 +822,12 @@ IntroductionPage::IntroductionPage(PackageManagerCore *core) , m_widget(0) { setObjectName(QLatin1String("IntroductionPage")); - setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("IntroductionPage"))); - setTitle(titleForPage(QLatin1String("IntroductionPage"), tr("Setup - %1")).arg(productName())); + setTitle(tr("Setup - %1").arg(productName())); m_msgLabel = new QLabel(this); m_msgLabel->setWordWrap(true); m_msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("IntroductionPage")); - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Welcome to the %1 " - "Setup Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Welcome to the %1 Setup Wizard.").arg(productName())); QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); @@ -916,10 +883,9 @@ private: LicenseAgreementPage::LicenseAgreementPage(PackageManagerCore *core) : PackageManagerPage(core) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("LicenseAgreementPage")); - setTitle(titleForPage(QLatin1String("LicenseAgreementPage"), tr("License Agreement"))); + setTitle(tr("License Agreement")); m_licenseListWidget = new QListWidget(this); m_licenseListWidget->setObjectName(QLatin1String("LicenseListWidget")); @@ -1046,11 +1012,10 @@ void LicenseAgreementPage::updateUi() rejectButtonText = tr("I do not accept the licenses."); } - setSubTitle(subTitleForPage(QLatin1String("LicenseAgreementPage"), subTitleText)); + setSubTitle(subTitleText); - const QVariantHash hash = elementsForPage(QLatin1String("LicenseAgreementPage")); - m_acceptLabel->setText(hash.value(QLatin1String("AcceptLicenseLabel"), acceptButtonText).toString()); - m_rejectLabel->setText(hash.value(QLatin1String("RejectLicenseLabel"), rejectButtonText).toString()); + m_acceptLabel->setText(acceptButtonText); + m_rejectLabel->setText(rejectButtonText); } @@ -1072,8 +1037,10 @@ public: { m_treeView->setObjectName(QLatin1String("ComponentsTreeView")); - connect(m_allModel, SIGNAL(defaultCheckStateChanged(bool)), q, SLOT(setModified(bool))); - connect(m_updaterModel, SIGNAL(defaultCheckStateChanged(bool)), q, SLOT(setModified(bool))); + connect(m_allModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), this, + SLOT(onCheckStateChanged(QInstaller::ComponentModel::ModelState))); + connect(m_updaterModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), this, + SLOT(onCheckStateChanged(QInstaller::ComponentModel::ModelState))); QHBoxLayout *hlayout = new QHBoxLayout; hlayout->addWidget(m_treeView, 3); @@ -1099,18 +1066,15 @@ public: m_checkDefault = new QPushButton; connect(m_checkDefault, SIGNAL(clicked()), this, SLOT(selectDefault())); - connect(m_allModel, SIGNAL(defaultCheckStateChanged(bool)), m_checkDefault, SLOT(setEnabled(bool))); - const QVariantHash hash = q->elementsForPage(QLatin1String("ComponentSelectionPage")); if (m_core->isInstaller()) { m_checkDefault->setObjectName(QLatin1String("SelectDefaultComponentsButton")); m_checkDefault->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+A", "select default components"))); - m_checkDefault->setText(hash.value(QLatin1String("SelectDefaultComponentsButton"), ComponentSelectionPage::tr("Def&ault")) - .toString()); + m_checkDefault->setText(ComponentSelectionPage::tr("Def&ault")); } else { m_checkDefault->setEnabled(false); m_checkDefault->setObjectName(QLatin1String("ResetComponentsButton")); m_checkDefault->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+R", "reset to already installed components"))); - m_checkDefault->setText(hash.value(QLatin1String("ResetComponentsButton"), ComponentSelectionPage::tr("&Reset")).toString()); + m_checkDefault->setText(ComponentSelectionPage::tr("&Reset")); } hlayout = new QHBoxLayout; hlayout->addWidget(m_checkDefault); @@ -1120,15 +1084,14 @@ public: connect(m_checkAll, SIGNAL(clicked()), this, SLOT(selectAll())); m_checkAll->setObjectName(QLatin1String("SelectAllComponentsButton")); m_checkAll->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+S", "select all components"))); - m_checkAll->setText(hash.value(QLatin1String("SelectAllComponentsButton"), ComponentSelectionPage::tr("&Select All")).toString()); + m_checkAll->setText(ComponentSelectionPage::tr("&Select All")); m_uncheckAll = new QPushButton; hlayout->addWidget(m_uncheckAll); connect(m_uncheckAll, SIGNAL(clicked()), this, SLOT(deselectAll())); m_uncheckAll->setObjectName(QLatin1String("DeselectAllComponentsButton")); m_uncheckAll->setShortcut(QKeySequence(ComponentSelectionPage::tr("Alt+D", "deselect all components"))); - m_uncheckAll->setText(hash.value(QLatin1String("DeselectAllComponentsButton"), ComponentSelectionPage::tr("&Deselect All")) - .toString()); + m_uncheckAll->setText(ComponentSelectionPage::tr("&Deselect All")); hlayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); @@ -1139,10 +1102,10 @@ public: { m_checkDefault->setVisible(m_core->isInstaller() || m_core->isPackageManager()); if (m_treeView->selectionModel()) { - disconnect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(currentChanged(QModelIndex))); disconnect(m_currentModel, SIGNAL(checkStateChanged(QModelIndex)), this, - SLOT(currentChanged(QModelIndex))); + SLOT(currentCheckedChanged(QModelIndex))); + disconnect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), + this, SLOT(currentSelectedChanged(QModelIndex))); } m_currentModel = m_core->isUpdater() ? m_updaterModel : m_allModel; @@ -1165,62 +1128,69 @@ public: hasChildren = m_currentModel->hasChildren(m_currentModel->index(row, 0)); m_treeView->setRootIsDecorated(hasChildren); - connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(currentChanged(QModelIndex))); connect(m_currentModel, SIGNAL(checkStateChanged(QModelIndex)), this, - SLOT(currentChanged(QModelIndex))); + SLOT(currentCheckedChanged(QModelIndex))); + connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), + this, SLOT(currentSelectedChanged(QModelIndex))); m_treeView->setCurrentIndex(m_currentModel->index(0, 0)); } public slots: - void currentChanged(const QModelIndex ¤t) + void currentCheckedChanged(const QModelIndex ¤t) + { + if (m_treeView->selectionModel()->currentIndex() == current) + currentSelectedChanged(current); + } + + void currentSelectedChanged(const QModelIndex ¤t) { - // if there is not selection or the current selected node didn't change, return - if (!current.isValid() || current != m_treeView->selectionModel()->currentIndex()) + if (!current.isValid()) return; + m_sizeLabel->setText(QString()); m_descriptionLabel->setText(m_currentModel->data(m_currentModel->index(current.row(), ComponentModelHelper::NameColumn, current.parent()), Qt::ToolTipRole).toString()); - m_sizeLabel->clear(); - if (!m_core->isUninstaller()) { - Component *component = m_currentModel->componentFromIndex(current); - if (component && component->updateUncompressedSize() > 0) { - const QVariantHash hash = q->elementsForPage(QLatin1String("ComponentSelectionPage")); - m_sizeLabel->setText(hash.value(QLatin1String("ComponentSizeLabel"), - ComponentSelectionPage::tr("This component will occupy approximately %1 on your hard disk drive.")).toString() - .arg(m_currentModel->data(m_currentModel->index(current.row(), - ComponentModelHelper::UncompressedSizeColumn, current.parent())).toString())); - } + Component *component = m_currentModel->componentFromIndex(current); + if ((m_core->isUninstaller()) || (!component)) + return; + + if ((component->checkState() != Qt::Unchecked) && (component->updateUncompressedSize() > 0)) { + m_sizeLabel->setText(ComponentSelectionPage::tr("This component " + "will occupy approximately %1 on your hard disk drive.") + .arg(humanReadableSize(component->value(scUncompressedSizeSum).toLongLong()))); } } - // TODO: all *select* function ignore the fact that components can be selected inside the tree view as - // well, which will result in e.g. a disabled button state as long as "ALL" components not - // unchecked again. void selectAll() { - m_currentModel->selectAll(); - - m_checkAll->setEnabled(false); - m_uncheckAll->setEnabled(true); + m_currentModel->setCheckedState(ComponentModel::AllChecked); } void deselectAll() { - m_currentModel->deselectAll(); - - m_checkAll->setEnabled(true); - m_uncheckAll->setEnabled(false); + m_currentModel->setCheckedState(ComponentModel::AllUnchecked); } void selectDefault() { - m_currentModel->selectDefault(); + m_currentModel->setCheckedState(ComponentModel::DefaultChecked); + } + + void onCheckStateChanged(QInstaller::ComponentModel::ModelState state) + { + q->setModified(state != ComponentModel::DefaultChecked); + + // If all components in the checked list are only checkable when run without forced installation, set + // ComponentModel::AllUnchecked as well, as we cannot uncheck anything. Helps to keep the UI correct. + if ((!m_core->noForceInstallation()) && (m_currentModel->checked() == m_currentModel->uncheckable())) + state |= ComponentModel::AllUnchecked; - m_checkAll->setEnabled(true); - m_uncheckAll->setEnabled(true); + // enable the button if the corresponding flag is not set + m_checkAll->setEnabled(state.testFlag(ComponentModel::AllChecked) == false); + m_uncheckAll->setEnabled(state.testFlag(ComponentModel::AllUnchecked) == false); + m_checkDefault->setEnabled(state.testFlag(ComponentModel::DefaultChecked) == false); } public: @@ -1248,10 +1218,9 @@ ComponentSelectionPage::ComponentSelectionPage(PackageManagerCore *core) : PackageManagerPage(core) , d(new Private(this, core)) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("ComponentSelectionPage")); - setTitle(titleForPage(QLatin1String("ComponentSelectionPage"), tr("Select Components"))); + setTitle(tr("Select Components")); } ComponentSelectionPage::~ComponentSelectionPage() @@ -1273,7 +1242,7 @@ void ComponentSelectionPage::entering() if (core->isInstaller()) index = 1; if (core->isUninstaller()) index = 2; if (core->isPackageManager()) index = 3; - setSubTitle(subTitleForPage(QLatin1String("ComponentSelectionPage"), tr(strings[index]))); + setSubTitle(tr(strings[index])); d->updateTreeView(); setModified(isComplete()); @@ -1331,8 +1300,8 @@ void ComponentSelectionPage::setModified(bool modified) bool ComponentSelectionPage::isComplete() const { if (packageManagerCore()->isInstaller() || packageManagerCore()->isUpdater()) - return d->m_currentModel->hasCheckedComponents(); - return !d->m_currentModel->defaultCheckState(); + return d->m_currentModel->checked().count(); + return d->m_currentModel->checkedState() != ComponentModel::DefaultChecked; } @@ -1341,20 +1310,16 @@ bool ComponentSelectionPage::isComplete() const TargetDirectoryPage::TargetDirectoryPage(PackageManagerCore *core) : PackageManagerPage(core) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("TargetDirectoryPage")); - setSubTitle(subTitleForPage(QLatin1String("TargetDirectoryPage"))); - setTitle(titleForPage(QLatin1String("TargetDirectoryPage"), tr("Installation Folder"))); + setTitle(tr("Installation Folder")); QVBoxLayout *layout = new QVBoxLayout(this); QLabel *msgLabel = new QLabel(this); msgLabel->setWordWrap(true); msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); - msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Please specify the folder " - "where %1 will be installed.")).toString().arg(productName())); + msgLabel->setText(tr("Please specify the folder where %1 will be installed.").arg(productName())); layout->addWidget(msgLabel); QHBoxLayout *hlayout = new QHBoxLayout; @@ -1368,8 +1333,7 @@ TargetDirectoryPage::TargetDirectoryPage(PackageManagerCore *core) browseButton->setObjectName(QLatin1String("BrowseDirectoryButton")); connect(browseButton, SIGNAL(clicked()), this, SLOT(dirRequested())); browseButton->setShortcut(QKeySequence(tr("Alt+R", "browse file system to choose a file"))); - browseButton->setText(hash.value(QLatin1String("BrowseDirectoryButton"), tr("B&rowse...")) - .toString()); + browseButton->setText(tr("B&rowse...")); hlayout->addWidget(browseButton); layout->addLayout(hlayout); @@ -1403,12 +1367,10 @@ void TargetDirectoryPage::initializePage() bool TargetDirectoryPage::validatePage() { - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); if (targetDir().isEmpty()) { MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("EmptyTargetDirectoryMessage"), tr("Error"), hash - .value(QLatin1String("EmptyTargetDirectoryMessage"), tr("The install directory cannot be " - "empty, please specify a valid folder.")).toString(), QMessageBox::Ok); + QLatin1String("EmptyTargetDirectoryMessage"), tr("Error"), tr("The install directory cannot be " + "empty, please specify a valid folder."), QMessageBox::Ok); return false; } @@ -1421,9 +1383,8 @@ bool TargetDirectoryPage::validatePage() // it exists, but is not empty if (dir == QDir::root()) { MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("ForbiddenTargetDirectoryMessage"), tr("Error"), hash - .value(QLatin1String("ForbiddenTargetDirectoryMessage"), tr("As the install directory is " - "completely deleted, installing in %1 is forbidden.")).toString().arg(QDir::rootPath()), + QLatin1String("ForbiddenTargetDirectoryMessage"), tr("Error"), tr("As the install directory " + "is completely deleted on uninstall, installing in %1 is forbidden.").arg(QDir::rootPath()), QMessageBox::Ok); return false; } @@ -1432,11 +1393,10 @@ bool TargetDirectoryPage::validatePage() return true; return MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("OverwriteTargetDirectoryMessage"), tr("Warning"), hash - .value(QLatin1String("OverwriteTargetDirectoryMessage"), tr("You have selected an existing, " + QLatin1String("OverwriteTargetDirectoryMessage"), tr("Warning"), tr("You have selected an existing, " "non-empty folder for installation. Note that it will be completely wiped on uninstallation of " "this application. It is not advisable to install into this folder as installation might fail. " - "Do you want to continue?")).toString(), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes; + "Do you want to continue?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes; } return true; } @@ -1456,9 +1416,7 @@ void TargetDirectoryPage::targetDirSelected() void TargetDirectoryPage::dirRequested() { - const QVariantHash hash = elementsForPage(QLatin1String("TargetDirectoryPage")); - const QString newDirName = QFileDialog::getExistingDirectory(this, hash - .value(QLatin1String("SelectInstallationFolderCaption"), tr("Select Installation Folder")).toString(), + const QString newDirName = QFileDialog::getExistingDirectory(this, tr("Select Installation Folder"), targetDir()); if (newDirName.isEmpty() || newDirName == targetDir()) return; @@ -1471,12 +1429,11 @@ void TargetDirectoryPage::dirRequested() StartMenuDirectoryPage::StartMenuDirectoryPage(PackageManagerCore *core) : PackageManagerPage(core) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("StartMenuDirectoryPage")); - setTitle(titleForPage(QLatin1String("StartMenuDirectoryPage"), tr("Start Menu shortcuts"))); - setSubTitle(subTitleForPage(QLatin1String("StartMenuDirectoryPage"), tr("Select the Start Menu in which " - "you would like to create the program's shortcuts. You can also enter a name to create a new folder."))); + setTitle(tr("Start Menu shortcuts")); + setSubTitle(tr("Select the Start Menu in which you would like to create the program's shortcuts. You can " + "also enter a name to create a new folder.")); m_lineEdit = new QLineEdit(this); m_lineEdit->setObjectName(QLatin1String("LineEdit")); @@ -1561,10 +1518,8 @@ ReadyForInstallationPage::ReadyForInstallationPage(PackageManagerCore *core) : PackageManagerPage(core) , m_msgLabel(new QLabel) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("ReadyForInstallationPage")); - setSubTitle(subTitleForPage(QLatin1String("ReadyForInstallationPage"))); QVBoxLayout *baseLayout = new QVBoxLayout(); baseLayout->setObjectName(QLatin1String("BaseLayout")); @@ -1612,7 +1567,7 @@ void ReadyForInstallationPage::entering() m_taskDetailsButton->setVisible(false); m_taskDetailsBrowser->setVisible(false); setButtonText(QWizard::CommitButton, tr("U&ninstall")); - setTitle(titleForPage(objectName(), tr("Ready to Uninstall"))); + setTitle(tr("Ready to Uninstall")); m_msgLabel->setText(tr("Setup is now ready to begin removing %1 from your computer.<br>" "<font color=\"red\">The program directory %2 will be deleted completely</font>, " "including all content in that directory!") @@ -1622,12 +1577,12 @@ void ReadyForInstallationPage::entering() return; } else if (packageManagerCore()->isPackageManager() || packageManagerCore()->isUpdater()) { setButtonText(QWizard::CommitButton, tr("U&pdate")); - setTitle(titleForPage(objectName(), tr("Ready to Update Packages"))); + setTitle(tr("Ready to Update Packages")); m_msgLabel->setText(tr("Setup is now ready to begin updating your installation.")); } else { Q_ASSERT(packageManagerCore()->isInstaller()); setButtonText(QWizard::CommitButton, tr("&Install")); - setTitle(titleForPage(objectName(), tr("Ready to Install"))); + setTitle(tr("Ready to Install")); m_msgLabel->setText(tr("Setup is now ready to begin installing %1 on your computer.") .arg(productName())); } @@ -1791,10 +1746,8 @@ PerformInstallationPage::PerformInstallationPage(PackageManagerCore *core) : PackageManagerPage(core) , m_performInstallationForm(new PerformInstallationForm(this)) { - setPixmap(QWizard::LogoPixmap, logoPixmap()); setPixmap(QWizard::WatermarkPixmap, QPixmap()); setObjectName(QLatin1String("PerformInstallationPage")); - setSubTitle(subTitleForPage(QLatin1String("PerformInstallationPage"))); m_performInstallationForm->setupUi(this); @@ -1836,17 +1789,17 @@ void PerformInstallationPage::entering() if (packageManagerCore()->isUninstaller()) { setButtonText(QWizard::CommitButton, tr("&Uninstall")); - setTitle(titleForPage(objectName(), tr("Uninstalling %1")).arg(productName())); + setTitle(tr("Uninstalling %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runUninstaller())); } else if (packageManagerCore()->isPackageManager() || packageManagerCore()->isUpdater()) { setButtonText(QWizard::CommitButton, tr("&Update")); - setTitle(titleForPage(objectName(), tr("Updating components of %1")).arg(productName())); + setTitle(tr("Updating components of %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runPackageUpdater())); } else { setButtonText(QWizard::CommitButton, tr("&Install")); - setTitle(titleForPage(objectName(), tr("Installing %1")).arg(productName())); + setTitle(tr("Installing %1").arg(productName())); QTimer::singleShot(30, packageManagerCore(), SLOT(runInstaller())); } @@ -1913,21 +1866,16 @@ FinishedPage::FinishedPage(PackageManagerCore *core) , m_commitButton(0) { setObjectName(QLatin1String("FinishedPage")); - setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("FinishedPage"))); - setTitle(titleForPage(QLatin1String("FinishedPage"), tr("Completing the %1 Wizard")).arg(productName())); + setTitle(tr("Completing the %1 Wizard").arg(productName())); m_msgLabel = new QLabel(this); m_msgLabel->setWordWrap(true); m_msgLabel->setObjectName(QLatin1String("MessageLabel")); - const QVariantHash hash = elementsForPage(QLatin1String("FinishedPage")); #ifdef Q_OS_MAC - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Click Done to exit the %1 " - "Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Click Done to exit the %1 Wizard.").arg(productName())); #else - m_msgLabel->setText(hash.value(QLatin1String("MessageLabel"), tr("Click Finish to exit the " - "%1 Wizard.")).toString().arg(productName())); + m_msgLabel->setText(tr("Click Finish to exit the %1 Wizard.").arg(productName())); #endif m_runItCheckBox = new QCheckBox(this); @@ -2012,11 +1960,13 @@ void FinishedPage::leaving() void FinishedPage::handleFinishClicked() { const QString program = packageManagerCore()->replaceVariables(packageManagerCore()->value(scRunProgram)); + const QStringList args = packageManagerCore()->replaceVariables( + packageManagerCore()->value(scRunProgramArguments)).split(QLatin1Char(' ')); if (!m_runItCheckBox->isChecked() || program.isEmpty()) return; - qDebug() << "starting" << program; - QProcess::startDetached(program); + qDebug() << "starting" << program << args; + QProcess::startDetached(program, args); } @@ -2026,10 +1976,7 @@ RestartPage::RestartPage(PackageManagerCore *core) : PackageManagerPage(core) { setObjectName(QLatin1String("RestartPage")); - setPixmap(QWizard::WatermarkPixmap, watermarkPixmap()); - setSubTitle(subTitleForPage(QLatin1String("RestartPage"))); - setTitle(titleForPage(QLatin1String("RestartPage"), tr("Completing the %1 Setup Wizard")) - .arg(productName())); + setTitle(tr("Completing the %1 Setup Wizard").arg(productName())); setFinalPage(false); setCommitPage(false); |