Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 19175:724fc0a9eeb1 gui-release
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.
author | John Donoghue |
---|---|
date | Mon, 04 Aug 2014 15:05:15 -0400 |
parents | 12462638ab20 |
children | dddffa2ff413 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -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 ());