26 #if defined (HAVE_CONFIG_H)
30 #include <QMessageBox>
42 :
QWidget (p), m_octave_qobj (oct_qobj)
55 if (editor.isEmpty ())
59 editor.replace (
"%f", file);
60 editor.replace (
"%l", QString::number (
line));
62 QStringList arguments;
65 bool started_ok = QProcess::startDetached (editor, arguments);
67 if (started_ok !=
true)
71 tr (
"Could not start custom file editor\n%1").
75 msgBox->setWindowModality (Qt::NonModal);
76 msgBox->setAttribute (Qt::WA_DeleteOnClose);
92 const QString&,
int line,
113 if (editor.trimmed ().isEmpty ())
117 tr (
"Octave Editor"),
118 tr (
"There is no custom editor configured yet.\n"
119 "Do you want to open the preferences?"),
120 QMessageBox::No | QMessageBox::Yes);
121 msgBox->setDefaultButton (QMessageBox::Yes);
122 msgBox->setAttribute (Qt::WA_DeleteOnClose);
124 int button = msgBox->exec ();
126 if (button == QMessageBox::Yes)
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
QString external_editor(void)
void request_new_file(const QString &)
base_qobject & m_octave_qobj
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="")
bool call_custom_editor(const QString &file=QString(), int line=-1)
external_editor_interface(QWidget *main_win, base_qobject &oct_qobj)
void handle_edit_file_request(const QString &file)
void request_settings_dialog(const QString &)
gui_settings * get_settings(void) const
const gui_pref global_custom_editor("customFileEditor", QVariant("emacs +%l %f"))