25 #if defined (HAVE_CONFIG_H)
29 #include <QStringList>
32 #include <QPushButton>
51 m_app_context (app_context),
61 p, SLOT (handle_octave_ready ()));
129 if (! settings || settings->value (
"editor/create_new_file",
false).toBool ())
135 role <<
"YesRole" <<
"RejectRole";
136 btn << tr (
"Create") << tr (
"Cancel");
142 tr (
"File\n%1\ndoes not exist. Do you want to create it?").
143 arg (QDir::currentPath () + QDir::separator ()
145 tr (
"Octave Editor"),
"quest", btn, tr (
"Create"), role);
156 return (answer == tr (
"Create"));
170 QStringList (), QString (),
195 role <<
"AcceptRole" <<
"AcceptRole" <<
"AcceptRole";
207 QString::fromStdString (title),
210 QString::fromStdString (btndef),
230 for (std::list<std::string>::const_iterator it = lst.begin ();
231 it != lst.end (); it++)
249 for (octave_link::filter_list::const_iterator it = lst.begin ();
250 it != lst.end (); it++)
258 name.replace (QRegExp (
"\\(.*\\)"),
"");
259 ext.replace (
";",
" ");
264 name = ext.toUpper () +
" Files";
267 retval.append (name +
" (" + ext +
")");
273 std::pair<std::list<int>,
int>
276 int width,
int height,
277 const std::list<int>& initial,
279 const std::list<std::string>& prompt,
305 return std::pair<std::list<int>,
int> (selected->toStdList (), ok);
308 std::list<std::string>
311 const std::list<float>& nr,
312 const std::list<float>& nc,
313 const std::list<std::string>& defaults)
315 std::list<std::string>
retval;
322 QFloatList::fromStdList (nr),
323 QFloatList::fromStdList (nc),
335 for (QStringList::const_iterator it = inputLine->begin ();
336 it != inputLine->end (); it++)
338 retval.push_back (it->toStdString ());
344 std::list<std::string>
351 std::list<std::string>
retval;
370 for (QStringList::const_iterator it = inputLine->begin ();
371 it != inputLine->end (); it++)
372 retval.push_back (it->toStdString ());
375 retval.push_back ((QString (
"%1").
arg (
399 ? tr (
"The file %1 does not exist in the load path. To run or debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.").arg (qfile).arg (qdir)
400 : tr (
"The file %1 is shadowed by a file with the same name in the load path. To run or debug the function you are editing, change to the directory %2.").arg (qfile).arg (qdir));
402 QString title = tr (
"Change Directory or Add Directory to Load Path");
404 QString cd_txt = tr (
"Change Directory");
405 QString addpath_txt = tr (
"Add Directory to Load Path");
406 QString cancel_txt = tr (
"Cancel");
415 role <<
"AcceptRole";
418 role <<
"RejectRole";
434 if (result == cd_txt)
436 else if (result == addpath_txt)
464 const std::list<workspace_element>& ws)
466 if (! top_level && ! debug)
474 QStringList class_names;
475 QStringList dimensions;
479 for (std::list<workspace_element>::const_iterator it = ws.begin ();
480 it != ws.end (); it++)
482 scopes.append (it->scope ());
487 complex_flags.append (it->complex_flag ());
491 dimensions, values, complex_flags);
591 bool addpath_option =
true;
602 std::string base_file = (file.length () > dir.length ())
603 ? file.substr (dir.length () + 1)
608 if (dir_in_load_path)
626 addpath_option =
false;
static QStringList make_qstring_list(const std::list< std::string > &lst)
std::pair< std::list< int >, int > do_list_dialog(const std::list< std::string > &list, const std::string &mode, int width, int height, const std::list< int > &initial_value, const std::string &name, const std::list< std::string > &prompt, const std::string &ok_string, const std::string &cancel_string)
static std::string get_current_directory(void)
For example cd octave end example noindent changes the current working directory to file
static int debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
bool same_file(const std::string &f, const std::string &g)
void confirm_shutdown_signal(void)
void insert_debugger_pointer_signal(const QString &, int)
void execute_command_in_terminal_signal(const QString &command)
std::list< std::string > do_input_dialog(const std::list< std::string > &prompt, const std::string &title, const std::list< float > &nr, const std::list< float > &nc, const std::list< std::string > &defaults)
The value of lines which begin with a space character are not saved in the history list A value of all commands are saved on the history list
void edit_file_signal(const QString &file)
bool do_copy_image_to_clipboard(const std::string &file)
static void prepend(const std::string &dir, bool warn=false)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
octave_idx_type numel(void) const
Number of elements in the array.
void do_set_default_prompts(std::string &ps1, std::string &ps2, std::string &ps4)
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
static std::string find_file(const std::string &file)
bool do_edit_file(const std::string &file)
void do_set_history(const string_vector &hist)
QString fromStdString(const std::string &s)
void do_execute_in_debugger_event(const std::string &file, int line)
to define functions rather than attempting to enter them directly on the command line The block of commands is executed as soon as you exit the editor To avoid executing any simply delete all the lines from the buffer before leaving the editor When invoked with no edit the previously executed command
void clear_history_signal(void)
void change_directory_signal(const QString &dir)
bool _shutdown_confirm_result
void set_history_signal(const QStringList &hist)
cell array If invoked with two or more scalar integer or a vector of integer values
std::list< std::string > do_file_dialog(const filter_list &filter, const std::string &title, const std::string &filename, const std::string &pathname, const std::string &multimode)
void do_clear_history(void)
bool do_confirm_shutdown(void)
int do_message_dialog(const std::string &dlg, const std::string &msg, const std::string &title)
void do_pre_input_event(void)
QUIWidgetCreator uiwidget_creator
void do_delete_debugger_pointer(const std::string &file, int line)
octave_interpreter * command_interpreter
void do_clear_workspace(void)
void show_preferences_signal(void)
static bool file_in_path(const std::string &file, const std::string &dir)
void do_post_input_event(void)
void update_directory(void)
QString _current_directory
void do_show_doc(const std::string &file)
std::string do_question_dialog(const std::string &msg, const std::string &title, const std::string &btn1, const std::string &btn2, const std::string &btn3, const std::string &btndef)
void do_update_breakpoint(bool insert, const std::string &file, int line, const std::string &cond)
void exit_app_signal(int status)
bool start_gui_p(void) const
void do_change_directory(const std::string &dir)
MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
static std::string base_pathname(const std::string &s)
static bool contains_canonical(const std::string &dir_name)
static QSettings * get_settings(void)
void append_history_signal(const QString &hist_entry)
void copy_image_to_clipboard_signal(const QString &file, bool remove_file)
void show_doc_signal(const QString &file)
With real return the complex result
void update_breakpoint_marker_signal(bool insert, const QString &file, int line, const QString &cond)
void execute_interpreter_signal(void)
void delete_debugger_pointer_signal(const QString &, int)
void execute_interpreter(void)
void exit_debugger_signal(void)
=val(i)}if ode{val(i)}occurs in table i
void clear_workspace_signal(void)
int do_debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
void do_show_preferences(void)
void do_enter_debugger_event(const std::string &file, int line)
octave_qt_link(QWidget *p, octave::gui_application *app_context)
void do_set_workspace(bool top_level, bool debug, const std::list< workspace_element > &ws)
void do_exit_debugger_event(void)
void do_insert_debugger_pointer(const std::string &file, int line)
bool do_prompt_new_edit_file(const std::string &file)
void do_append_history(const std::string &hist_entry)
static QStringList make_filter_list(const octave_link::filter_list &lst)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
void do_execute_command_in_terminal(const std::string &command)
QWaitCondition waitcondition
std::list< std::pair< std::string, std::string > > filter_list
octave::gui_application * m_app_context
void set_workspace_signal(bool top_level, bool debug, const QString &scopes, const QStringList &symbols, const QStringList &class_names, const QStringList &dimensions, const QStringList &values, const QIntList &complex_flags)
void terminal_interrupt(void)
void enter_debugger_signal(void)
OCTINTERP_API octave_value_list Fcd(const octave_value_list &=octave_value_list(), int=0)