diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-04-09 09:54:10 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-04-16 09:58:25 +0300 |
commit | e2d03134f81cb88d301954e7a63620edf182ddd8 (patch) | |
tree | 6ade4f87781d4f1ca23a25f5092b0d18c07fc1b5 /src | |
parent | 6a93f37440a3dcc72bb5e496dac90a8f95d63eab (diff) |
Give meaningful default value to messagebox queries
If error occurs in install phase, change the default button to be
cancel/ignore etc. to avoid inifinite loop when installing with CLI.
When using GUI, default button is highlighted but user can choose
otherwise. When using CLI the default button is always chosen if user
don't give option to overwrite the default button values from command
line.
Task-number: QTIFW-1737
Change-Id: I721636d5a23e22ad5eee73b84e250e90eb1a6004
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/component.cpp | 2 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 6 | ||||
-rw-r--r-- | src/libs/installer/remoteclient_p.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 503b9434c..60ec9ae9f 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -1042,7 +1042,7 @@ Operation *Component::createOperation(const QString &operationName, const QStrin const QMessageBox::StandardButton button = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), QLatin1String("OperationDoesNotExistError"), tr("Error"), tr("Error: Operation %1 does not exist.") - .arg(operationName), QMessageBox::Abort | QMessageBox::Ignore); + .arg(operationName), QMessageBox::Abort | QMessageBox::Ignore, QMessageBox::Abort); if (button == QMessageBox::Abort) d->m_operationsCreatedSuccessfully = false; return operation; diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index e408db40e..09aa57650 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -937,7 +937,7 @@ void PackageManagerCorePrivate::stopProcessesForUpdates(const QList<Component*> QLatin1String("stopProcessesForUpdates"), tr("Stop Processes"), tr("These processes " "should be stopped to continue:\n\n%1").arg(QDir::toNativeSeparators(processes .join(QLatin1String("\n")))), QMessageBox::Retry | QMessageBox::Ignore - | QMessageBox::Cancel, QMessageBox::Retry); + | QMessageBox::Cancel, QMessageBox::Cancel); if (button == QMessageBox::Ignore) return; if (button == QMessageBox::Cancel) { @@ -2133,9 +2133,9 @@ void PackageManagerCorePrivate::runUndoOperations(const OperationList &undoOpera while (!ok && !ignoreError && m_core->status() != PackageManagerCore::Canceled) { const QMessageBox::StandardButton button = MessageBoxHandler::warning(MessageBoxHandler::currentBestSuitParent(), - QLatin1String("installationErrorWithRetry"), tr("Installer Error"), + QLatin1String("installationErrorWithIgnore"), tr("Installer Error"), tr("Error during uninstallation process:\n%1").arg(undoOperation->errorString()), - QMessageBox::Retry | QMessageBox::Ignore, QMessageBox::Retry); + QMessageBox::Retry | QMessageBox::Ignore, QMessageBox::Ignore); if (button == QMessageBox::Retry) ok = performOperationThreaded(undoOperation, Undo); diff --git a/src/libs/installer/remoteclient_p.h b/src/libs/installer/remoteclient_p.h index 9b5bfd844..ba60bc7ac 100644 --- a/src/libs/installer/remoteclient_p.h +++ b/src/libs/installer/remoteclient_p.h @@ -135,7 +135,7 @@ public: "Cannot get authorization that is needed for continuing the installation.\n\n" "Please start the setup program as a user with the appropriate rights.\n" "Or accept the elevation of access rights if being asked."), - QMessageBox::Abort | QMessageBox::Retry, QMessageBox::Retry); + QMessageBox::Abort | QMessageBox::Retry, QMessageBox::Abort); if (res == QMessageBox::Retry) started = AdminAuthorization::execute(0, m_serverCommand, m_serverArguments); } |