# HG changeset patch # User John Donoghue # Date 1407179115 14400 # Node ID 724fc0a9eeb1c8f67190ee98fd78b3a4b04830b5 # Parent 50fccff7651cbf6d19d4d367a11a18bcf6bf2f55 gui: notify user if custom editor failed to start * libgui/src/m-editor/file-editor.cc (file_editor::call_custom_editor): check status of starting custom file editor, and show message box if it did not start. diff -r 50fccff7651c -r 724fc0a9eeb1 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sun Aug 03 19:39:34 2014 -0400 +++ b/libgui/src/m-editor/file-editor.cc Mon Aug 04 15:05:15 2014 -0400 @@ -261,7 +261,21 @@ editor.replace ("%f", file_name); editor.replace ("%l", QString::number (line)); - QProcess::startDetached (editor); + bool started_ok = QProcess::startDetached (editor); + + if (started_ok != true) + { + QMessageBox *msgBox + = new QMessageBox (QMessageBox::Critical, + tr ("Octave Editor"), + tr ("Could not start custom file editor\n%1"). + arg (editor), + QMessageBox::Ok, this); + + msgBox->setWindowModality (Qt::NonModal); + msgBox->setAttribute (Qt::WA_DeleteOnClose); + msgBox->show (); + } if (line < 0 && ! file_name.isEmpty ()) handle_mru_add_file (QFileInfo (file_name).canonicalFilePath ());