diff options
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); } |