From 7ac73e0d25190a4b754e1773691f0e6f3f4d4067 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 8 Jun 2009 16:47:53 +0300 Subject: [PATCH] GUI: Show error message when the viewer application cannot be started. --- gui/resultstree.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index ca1e3e990..4679c365a 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -23,6 +23,7 @@ #include #include #include +#include ResultsTree::ResultsTree(QSettings &settings, ApplicationList &list) : mSettings(settings), @@ -398,7 +399,19 @@ void ResultsTree::StartApplication(QStandardItem *target, int application) program.replace("(message)", data["message"].toString(), Qt::CaseInsensitive); program.replace("(severity)", data["severity"].toString(), Qt::CaseInsensitive); - QProcess::startDetached(program); + bool success = QProcess::startDetached(program); + if (!success) + { + QString app = mApplications.GetApplicationName(application); + QString text = tr("Could not start ") + app + "\n\n"; + text += tr("Please check the application path and parameters are correct."); + + QMessageBox msgbox(this); + msgbox.setWindowTitle("Cppcheck"); + msgbox.setText(text); + msgbox.setIcon(QMessageBox::Critical); + msgbox.exec(); + } } }