29 #include <QStringList>
57 p, SLOT (handle_octave_ready ()));
121 if (settings->value (
"editor/create_new_file",
false).toBool ())
127 role <<
"YesRole" <<
"RejectRole";
128 btn << tr (
"Create") << tr (
"Cancel");
134 tr (
"File\n%1\ndoes not exist. Do you want to create it?").
135 arg (QDir::currentPath () + QDir::separator ()
137 tr (
"Octave Editor"),
"quest", btn, tr (
"Create"), role );
148 return (answer == tr (
"Create"));
153 const std::string& msg,
154 const std::string& title)
162 QStringList (), QString (),
179 const std::string& title,
180 const std::string& btn1,
181 const std::string& btn2,
182 const std::string& btn3,
183 const std::string& btndef)
187 role <<
"AcceptRole" <<
"AcceptRole" <<
"AcceptRole";
199 QString::fromStdString (title),
202 QString::fromStdString (btndef),
222 for (std::list<std::string>::const_iterator it = lst.begin ();
223 it != lst.end (); it++)
241 for (octave_link::filter_list::const_iterator it = lst.begin ();
242 it != lst.end (); it++)
250 name.replace (QRegExp (
"\\(.*\\)"),
"");
251 ext.replace (
";",
" ");
253 if (name.length () == 0)
256 name = ext.toUpper () +
" Files";
259 retval.append (name +
" (" + ext +
")");
265 std::pair<std::list<int>,
int>
267 const std::string& mode,
268 int width,
int height,
269 const std::list<int>& initial,
270 const std::string& name,
271 const std::list<std::string>& prompt,
272 const std::string& ok_string,
273 const std::string& cancel_string)
297 return std::pair<std::list<int>,
int> (selected->toStdList (), ok);
300 std::list<std::string>
302 const std::string& title,
303 const std::list<float>& nr,
304 const std::list<float>& nc,
305 const std::list<std::string>& defaults)
307 std::list<std::string> retval;
314 QFloatList::fromStdList (nr),
315 QFloatList::fromStdList (nc),
327 for (QStringList::const_iterator it = inputLine->begin ();
328 it != inputLine->end (); it++)
330 retval.push_back (it->toStdString ());
336 std::list<std::string>
338 const std::string& title,
339 const std::string& filename,
340 const std::string& dirname,
341 const std::string& multimode)
343 std::list<std::string> retval;
362 for (QStringList::const_iterator it = inputLine->begin ();
363 it != inputLine->end (); it++)
364 retval.push_back (it->toStdString ());
367 retval.push_back ((QString (
"%1").
arg (
377 const std::string& dir,
387 ? 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)
388 : 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));
390 QString title = tr (
"Change Directory or Add Directory to Load Path");
392 QString cd_txt = tr (
"Change Directory");
393 QString addpath_txt = tr (
"Add Directory to Load Path");
394 QString cancel_txt = tr (
"Cancel");
399 role <<
"AcceptRole";
403 role <<
"AcceptRole";
406 role <<
"AcceptRole";
422 if (result == cd_txt)
424 else if (result == addpath_txt)
452 const std::list<workspace_element>& ws)
454 if (! top_level && ! debug)
462 QStringList class_names;
463 QStringList dimensions;
467 for (std::list<workspace_element>::const_iterator it = ws.begin ();
468 it != ws.end (); it++)
470 scopes.append (it->scope ());
475 complex_flags.append (it->complex_flag ());
479 dimensions, values, complex_flags);
543 const std::string& file,
int line)
577 bool addpath_option =
true;
590 if (dir_in_load_path)
608 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 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)
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)
void do_set_default_prompts(std::string &ps1, std::string &ps2, std::string &ps4)
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 update_breakpoint_marker_signal(bool insert, const QString &file, int line)
void do_execute_in_debugger_event(const std::string &file, int line)
void clear_history_signal(void)
void change_directory_signal(const QString &dir)
bool _shutdown_confirm_result
void set_history_signal(const QStringList &hist)
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
octave_qt_link(QWidget *p)
void do_update_breakpoint(bool insert, const std::string &file, int line)
void do_clear_workspace(void)
static std::string get_current_directory(void)
void show_preferences_signal(void)
void do_post_input_event(void)
MArray< double > filter(MArray< double > &, MArray< double > &, MArray< double > &, int dim)
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 exit_app_signal(int status)
void do_change_directory(const std::string &dir)
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)
static std::string base_pathname(const std::string &s)
octave_idx_type length(void) const
Number of elements in the array.
void execute_interpreter_signal(void)
void delete_debugger_pointer_signal(const QString &, int)
octave_value_list ovl(const octave_value &a0)
void execute_interpreter(void)
void exit_debugger_signal(void)
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)
static bool file_in_path(const std::string &file, const std::string &dir)
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)
void do_execute_command_in_terminal(const std::string &command)
QWaitCondition waitcondition
std::list< std::pair< std::string, std::string > > filter_list
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)