25 #if defined (HAVE_CONFIG_H) 32 #include <QPushButton> 33 #include <QStringList> 38 #include "builtin-defun-decls.h" 59 qRegisterMetaType<octave_value> (
"octave_value");
60 qRegisterMetaType<symbol_scope> (
"symbol_scope");
98 if (! settings || settings->value (
"editor/create_new_file",
false).toBool ())
104 role <<
"YesRole" <<
"RejectRole";
105 btn << tr (
"Create") << tr (
"Cancel");
111 tr (
"File\n%1\ndoes not exist. Do you want to create it?").
112 arg (QDir::currentPath () + QDir::separator ()
114 tr (
"Octave Editor"),
"quest", btn, tr (
"Create"), role);
125 return (answer == tr (
"Create"));
138 QStringList (), QString (),
163 role <<
"ResetRole" <<
"ResetRole" <<
"ResetRole";
194 make_qstring_list (
const std::list<std::string>& lst)
198 for (std::list<std::string>::const_iterator it = lst.begin ();
199 it != lst.end (); it++)
217 for (octave_link::filter_list::const_iterator it = lst.begin ();
218 it != lst.end (); it++)
226 name.replace (QRegExp (
"\\(.*\\)"),
"");
227 ext.replace (
";",
" ");
232 name = ext.toUpper () +
" Files";
241 std::pair<std::list<int>,
int>
244 int width,
int height,
245 const std::list<int>& initial,
247 const std::list<std::string>& prompt,
259 make_qstring_list (prompt),
273 return std::pair<std::list<int>,
int> (selected->toStdList (), ok);
276 std::list<std::string>
279 const std::list<float>& nr,
280 const std::list<float>& nc,
281 const std::list<std::string>& defaults)
283 std::list<std::string>
retval;
290 QFloatList::fromStdList (nr),
291 QFloatList::fromStdList (nc),
292 make_qstring_list (defaults));
303 for (QStringList::const_iterator it = inputLine->begin ();
304 it != inputLine->end (); it++)
306 retval.push_back (it->toStdString ());
312 std::list<std::string>
319 std::list<std::string>
retval;
338 for (QStringList::const_iterator it = inputLine->begin ();
339 it != inputLine->end (); it++)
340 retval.push_back (it->toStdString ());
366 ? 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)
367 : 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));
369 QString title = tr (
"Change Directory or Add Directory to Load Path");
371 QString cd_txt = tr (
"&Change Directory");
372 QString addpath_txt = tr (
"&Add Directory to Load Path");
373 QString cancel_txt = tr (
"Cancel");
382 role <<
"AcceptRole";
385 role <<
"RejectRole";
403 else if (
result == addpath_txt)
421 const symbol_scope& scope,
422 bool update_variable_editor)
424 if (! top_level && !
debug)
429 if (update_variable_editor)
511 bool addpath_option =
true;
521 bool dir_in_load_path = lp.contains_canonical (dir);
525 ?
file.substr (dir.length () + 1)
530 if (dir_in_load_path)
548 addpath_option =
false;
void do_show_doc(const std::string &file)
void change_directory_signal(const QString &dir)
int do_debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
void do_exit_debugger_event(void)
void clear_history_signal(void)
static std::string get_current_directory(void)
void do_append_history(const std::string &hist_entry)
void insert_debugger_pointer_signal(const QString &, int)
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)
bool do_confirm_shutdown(void)
Provides threadsafe access to octave.
void do_clear_history(void)
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 do_set_history(const string_vector &hist)
int do_message_dialog(const std::string &dlg, const std::string &msg, const std::string &title)
void show_doc_signal(const QString &file)
static bool file_in_path(const std::string &file, const std::string &dir)
void register_doc_signal(const QString &file)
void unregister_doc_signal(const QString &file)
identity matrix If supplied two scalar respectively For allows like xample val
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
void do_delete_debugger_pointer(const std::string &file, int line)
void delete_debugger_pointer_signal(const QString &, int)
QString fromStdString(const std::string &s)
bool do_prompt_new_edit_file(const std::string &file)
std::string dirname(const std::string &path)
void do_register_doc(const std::string &file)
void do_pre_input_event(void)
octave_qt_link(QWidget *p, gui_application *app_context)
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 copy_image_to_clipboard_signal(const QString &file, bool remove_file)
void do_execute_command_in_terminal(const std::string &command)
void confirm_shutdown_signal(void)
void do_edit_variable(const std::string &name, const octave_value &val)
void exit_debugger_signal(void)
void refresh_variable_editor_signal(void)
nd deftypefn *std::string name
void edit_file_signal(const QString &file)
void do_show_preferences(void)
bool do_copy_image_to_clipboard(const std::string &file)
void do_insert_debugger_pointer(const std::string &file, int line)
void do_change_directory(const std::string &dir)
void do_set_workspace(bool top_level, bool debug, const symbol_scope &scope, bool update_variable_editor)
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)
void do_unregister_doc(const std::string &file)
void execute_command_in_terminal_signal(const QString &command)
void update_breakpoint_marker_signal(bool insert, const QString &file, int line, const QString &cond)
load_path & __get_load_path__(const std::string &who)
void do_enter_debugger_event(const std::string &file, int line)
void clear_workspace_signal(void)
With real return the complex result
bool do_edit_file(const std::string &file)
void do_set_default_prompts(std::string &ps1, std::string &ps2, std::string &ps4)
void do_post_input_event(void)
void edit_variable_signal(const QString &name, const octave_value &val)
void append_history_signal(const QString &hist_entry)
bool start_gui_p(void) const
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
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)
gui_application * m_app_context
void enter_debugger_signal(void)
void set_workspace_signal(bool top_level, bool debug, const symbol_scope &scope)
OCTAVE_EXPORT octave_value_list Fcd(const octave_value_list &args, int nargout) the current directory is changed to the user 's home directory(@qcode
static QSettings * get_settings(void)
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)
bool m_shutdown_confirm_result
void set_history_signal(const QStringList &hist)
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)
octave_idx_type numel(void) const
Number of elements in the array.
void do_clear_workspace(void)
void do_update_breakpoint(bool insert, const std::string &file, int line, const std::string &cond)
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
std::list< std::pair< std::string, std::string > > filter_list
void show_preferences_signal(void)
QUIWidgetCreator uiwidget_creator
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_execute_in_debugger_event(const std::string &file, int line)