diff options
author | Niels Weber <niels.2.weber@nokia.com> | 2012-05-22 12:10:24 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-05-24 17:12:18 +0200 |
commit | 4fc262a5bd06ceae38fa33e2a7993937a43fe139 (patch) | |
tree | d12cd6a02c781a5b7f3490f98900613d9ae70f2b /src/libs/installer/fsengineclient.cpp | |
parent | 143d6a9f77f0f42485105103b66302aeff9524dd (diff) |
After failing admin authorization, allow retrying by hand
Change-Id: If05f1c6359c2667e0094721540415b5293856370
Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'src/libs/installer/fsengineclient.cpp')
-rw-r--r-- | src/libs/installer/fsengineclient.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libs/installer/fsengineclient.cpp b/src/libs/installer/fsengineclient.cpp index beed6d32d..3221b9f29 100644 --- a/src/libs/installer/fsengineclient.cpp +++ b/src/libs/installer/fsengineclient.cpp @@ -33,6 +33,7 @@ #include "fsengineclient.h" #include "adminauthorization.h" +#include "messageboxhandler.h" #include <QtCore/QCoreApplication> #include <QtCore/QMutex> @@ -778,6 +779,23 @@ void FSEngineClientHandler::Private::maybeStartServer() if (startServerAsAdmin) { AdminAuthorization auth; serverStarted = auth.authorize() && auth.execute(0, serverCommand, serverArguments); + + if (!serverStarted) { + // something went wrong with authorizing, either user pressed cancel or entered + // wrong password + const QString fallback = serverCommand + QLatin1String(" ") + serverArguments.join(QLatin1String(" ")); + + const QMessageBox::Button res = + QInstaller::MessageBoxHandler::critical(QInstaller::MessageBoxHandler::currentBestSuitParent(), + QObject::tr("Authorization Error"), QObject::tr("Couldn't get authorization."), + QObject::tr("Couldn't get authorization that is needed for continuing the installation.\n" + "Either abort the installation or use the fallback solution by running\n" + "%1\nas root and then clicking ok.").arg(fallback), + QMessageBox::Abort | QMessageBox::Ok, QMessageBox::Ok); + + if (res == QMessageBox::Ok) + serverStarted = true; + } } else { serverStarted = QProcess::startDetached(serverCommand, serverArguments); } |