26 #if defined (HAVE_CONFIG_H)
30 #include <QMessageBox>
42 :
QWidget (p), m_octave_qobj (oct_qobj)
50 if (editor.isEmpty ())
57 editor.replace (
"%f", file);
58 editor.replace (
"%l", QString::number (line));
60 QStringList arguments = editor.split (QRegExp(
"\\s+"));
61 editor = arguments.takeFirst ();
64 bool started_ok = QProcess::startDetached (editor, arguments);
66 if (started_ok !=
true)
70 tr (
"Could not start custom file editor\n%1").
74 msgBox->setWindowModality (Qt::NonModal);
75 msgBox->setAttribute (Qt::WA_DeleteOnClose);
90 const QString&,
int line,
111 if (editor.trimmed ().isEmpty ())
115 tr (
"Octave Editor"),
116 tr (
"There is no custom editor configured yet.\n"
117 "Do you want to open the preferences?"),
118 QMessageBox::No | QMessageBox::Yes);
119 msgBox->setDefaultButton (QMessageBox::Yes);
120 msgBox->setAttribute (Qt::WA_DeleteOnClose);
122 int button = msgBox->exec ();
124 if (button == QMessageBox::Yes)
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
void handle_edit_file_request(const QString &file)
void request_new_file(const QString &)
void request_open_file(const QString &fileName, const QString &encoding=QString(), int line=-1, bool debug_pointer=false, bool breakpoint_marker=false, bool insert=true, const QString &cond="")
void request_settings_dialog(const QString &)
base_qobject & m_octave_qobj
bool call_custom_editor(const QString &file=QString(), int line=-1)
QString external_editor(void)
gui_settings * get_settings(void) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
const gui_pref global_custom_editor("customFileEditor", QVariant("emacs +%l %f"))