From ebe0ab1b6442c34e9fb95c8ab24f6dfb7e6ea296 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 8 Jun 2020 16:01:45 +0100 Subject: [PATCH] When running process as root, show error dialogs. Closes #1932 * Error logs are less likely to be noticed by users when things go wrong. --- qrenderdoc/Code/QRDUtils.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 6037f7d7c..ce15aa201 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -2148,8 +2148,11 @@ bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &par if(sudo.isEmpty()) { - qCritical() << "Couldn't find graphical or terminal sudo program!\n" - << "Please run " << fullExecutablePath << "with args" << params << "manually."; + RDDialog::critical(parent, lit("Error running program as root"), + lit("Couldn't find graphical or terminal sudo program!\n" + "Please run '%1' with args '%2' manually.") + .arg(fullExecutablePath) + .arg(params.join(QLatin1Char(' ')))); return false; } @@ -2182,8 +2185,11 @@ bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &par return true; } - qCritical() << "Couldn't find graphical or terminal emulator to launch sudo.\n" - << "Please run " << fullExecutablePath << "with args" << params << "manually."; + RDDialog::critical(parent, lit("Error running program as root"), + lit("Couldn't find graphical or terminal emulator to launch sudo!\n" + "Please manually run: sudo \"%1\" %2") + .arg(fullExecutablePath) + .arg(params.join(QLatin1Char(' ')))); return false; #endif