diff libgui/src/m-editor/file-editor.h @ 16377:8430ea8c1594

open editor tab and insert marker for debugging with gui * file-editor-interface.h (file_editor_interface::request_open_file): New public slot. (file_editor_interface::handle_dbstop_request): New virtual function. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::goto_line): New arg, line, with default value. Don't prompt if line is greater than zero. (file_editor_tab::set_debugger_position): New arg, widget id. (file_editor_tab::add_filename_to_list): New arg, widget id. * file-editor.h, file-editor.cc (file_eidtor::editor_tab_map): New data member. (file_editor::fetFileNames) Delete. (file_editor::~file_editor, file_editor::check_conflict_save, file_editor::handle_add_filename_to_list): Use editor_tab_map instead of fetFileNames. (file_editor::request_open_file): New args, line and set_marker. Optionally position cursor at line and with debug marker. If file is already open in tab, switch to it instead of giving error. (file_editor::construct): Connect fetab_set_debugger_position signal to set_debugger_position slot. * main-window.h, main-window.cc (main_window::dbstop_signal): New signal. (main_window::handle_dbstop_request): New function. * octave-event-listener.h (octave_event_listener::dbstop): New virtual function. * octave-qt-event-listener.h, octave-qt-event-listener.cc (octave_qt_event_listener::dbstop): New function. (octave_qt_event_listener::dbstop_signal): New signal. * octave-link.h, octave-link.cc (octave_link::dbstop, octave_link::do_dbstop, octave_link::dbstop_event_hook_fcn, octave_link::do_dbstop_event_hook_fcn): New functions * octave-main-thread.h, octave-main-thread.cc (dbstop_event_hook_fcn): New function. (octave_main_thread::run): Add it to the list of dbstop event hook functions.
author John W. Eaton <jwe@octave.org>
date Wed, 27 Mar 2013 12:59:12 -0400
parents f482302d81c9
children 3cacd597464d
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h	Wed Mar 27 00:45:49 2013 -0400
+++ b/libgui/src/m-editor/file-editor.h	Wed Mar 27 12:59:12 2013 -0400
@@ -30,6 +30,8 @@
 #include <QCloseEvent>
 #include <QTabWidget>
 
+#include <map>
+
 #include "file-editor-interface.h"
 #include "file-editor-tab.h"
 
@@ -85,7 +87,8 @@
   void fetab_comment_selected_text (const QWidget* ID);
   void fetab_uncomment_selected_text (const QWidget* ID);
   void fetab_find (const QWidget* ID);
-  void fetab_goto_line (const QWidget* ID);
+  void fetab_goto_line (const QWidget* ID, int line = -1);
+  void fetab_set_debugger_position (const QWidget* ID, int line = -1);
   void fetab_set_focus (const QWidget* ID);
 
 public slots:
@@ -120,17 +123,19 @@
   void handle_file_name_changed (const QString& fileName, const QString& toolTip);
   void handle_tab_close_request (int index);
   void handle_tab_remove_request ();
-  void handle_add_filename_to_list (const QString& fileName);
+  void handle_add_filename_to_list (const QString& fileName, QWidget *ID);
   void active_tab_changed (int index);
   void handle_editor_state_changed (bool enableCopy, const QString& fileName);
   void handle_mru_add_file (const QString& file_name);
   void check_conflict_save (const QString& fileName, bool remove_on_success);
 
+  void handle_dbstop_request (const QString& file, int line);
+
   /** Tells the editor to react on changed settings. */
   void notice_settings ();
 
 private slots:
-  void request_open_file (const QString& fileName);
+  void request_open_file (const QString& fileName, int line = -1, bool = false);
 
 private:
   void construct ();
@@ -138,7 +143,8 @@
   void save_file_as (QWidget *fetabID = 0);
   void mru_menu_update ();
 
-  QStringList fetFileNames;
+  std::map<QString, QWidget *> editor_tab_map;
+
   QString ced;
 
   QMenuBar *        _menu_bar;