summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/remoteclient_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/remoteclient_p.h')
-rw-r--r--src/libs/installer/remoteclient_p.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/libs/installer/remoteclient_p.h b/src/libs/installer/remoteclient_p.h
index 0afd9dc16..d1e873d43 100644
--- a/src/libs/installer/remoteclient_p.h
+++ b/src/libs/installer/remoteclient_p.h
@@ -59,6 +59,7 @@ public:
, m_active(false)
, m_key(QLatin1String(Protocol::DefaultAuthorizationKey))
, m_mode(Protocol::Mode::Debug)
+ , m_authorizationFallbackDisabled(false)
{
m_thread.setObjectName(QLatin1String("KeepAlive"));
}
@@ -101,6 +102,11 @@ public:
}
}
+ void setAuthorizationFallbackDisabled(bool disabled)
+ {
+ m_authorizationFallbackDisabled = disabled;
+ }
+
void maybeStartServer() {
if (m_mode == Protocol::Mode::Debug)
m_serverStarted = true; // we expect the server to be started by the developer
@@ -118,6 +124,16 @@ public:
started = AdminAuthorization::execute(0, m_serverCommand, m_serverArguments);
if (!started) {
+ if (m_authorizationFallbackDisabled) {
+ MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(),
+ QLatin1String("AuthorizationError"),
+ QCoreApplication::translate("RemoteClient", "Cannot get authorization."),
+ QCoreApplication::translate("RemoteClient",
+ "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."));
+ return;
+ }
// something went wrong with authorizing, either user pressed cancel or entered
// wrong password
const QString fallback = m_serverCommand + QLatin1String(" ") + m_serverArguments
@@ -126,11 +142,11 @@ public:
const QMessageBox::Button res =
MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(),
QLatin1String("AuthorizationError"),
- QCoreApplication::translate("RemoteClient", "Could not get authorization."),
- QCoreApplication::translate("RemoteClient", "Could not get authorization that "
+ QCoreApplication::translate("RemoteClient", "Cannot get authorization."),
+ QCoreApplication::translate("RemoteClient", "Cannot get authorization that "
"is needed for continuing the installation.\n Either abort the "
- "installation or use the fallback solution by running\n\n%1\n\nas root "
- "and then clicking OK.").arg(fallback),
+ "installation or use the fallback solution by running\n\n%1\n\nas a user "
+ "with the appropriate rights and then clicking OK.").arg(fallback),
QMessageBox::Abort | QMessageBox::Ok, QMessageBox::Ok);
if (res == QMessageBox::Ok)
@@ -179,6 +195,7 @@ private:
QString m_key;
QThread m_thread;
Protocol::Mode m_mode;
+ bool m_authorizationFallbackDisabled;
};
} // namespace QInstaller