diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -32,6 +32,7 @@ target_link_libraries(KF5KIOGui PUBLIC KF5::KIOCore + KF5::WidgetsAddons KF5::WindowSystem Qt5::Gui PRIVATE diff --git a/src/gui/kprocessrunner.cpp b/src/gui/kprocessrunner.cpp --- a/src/gui/kprocessrunner.cpp +++ b/src/gui/kprocessrunner.cpp @@ -27,6 +27,7 @@ #include "krecentdocument.h" #include #include +#include #include #include @@ -54,7 +55,7 @@ const QString realExecutable = execParser.resultingArguments().at(0); if (!QFileInfo::exists(realExecutable) && QStandardPaths::findExecutable(realExecutable).isEmpty()) { - emitDelayedError(i18n("Could not find the program '%1'", realExecutable)); + emitDelayedError(i18n("Could not find an executable program '%1'", realExecutable)); return; } @@ -274,6 +275,12 @@ void KProcessRunner::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) { + if (exitCode != 0) { + KMessageBox::error(nullptr, i18n("The program '%1' terminated abnormally.\n" + "For more details try running it from a terminal emulator (e.g. Konsole).", + m_executable, exitCode), + i18n("Program terminated abnormally")); + } qCDebug(KIO_GUI) << m_executable << "exitCode=" << exitCode << "exitStatus=" << exitStatus; terminateStartupNotification(); deleteLater();