Mercurial > hg > octave-nkf
changeset 14778:f43916137064 gui
Added debug menu to file editor.
* file-editor-interface.h: Changed interface so debugging on/off can be passed through.
* file-editor.cc: Added debug menu.
* file-editor.h: Added debug menu.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Mon, 18 Jun 2012 15:41:24 +0200 |
parents | dc2a8d66e40b |
children | 8e9f2cfa114d |
files | gui/src/m-editor/file-editor-interface.h gui/src/m-editor/file-editor.cc gui/src/m-editor/file-editor.h gui/src/main-window.cc |
diffstat | 4 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/m-editor/file-editor-interface.h +++ b/gui/src/m-editor/file-editor-interface.h @@ -44,6 +44,9 @@ virtual void request_open_file () = 0; virtual void request_open_file (QString fileName) = 0; + virtual void handle_entered_debug_mode () = 0; + virtual void handle_quit_debug_mode () = 0; + signals: void active_changed (bool active);
--- a/gui/src/m-editor/file-editor.cc +++ b/gui/src/m-editor/file-editor.cc @@ -100,6 +100,18 @@ } void +file_editor::handle_entered_debug_mode () +{ + +} + +void +file_editor::handle_quit_debug_mode () +{ + +} + +void file_editor::request_undo () { file_editor_tab *activeFileEditorTab = active_editor_tab (); @@ -394,6 +406,20 @@ editMenu->addAction (remove_bookmark_action); _menu_bar->addMenu (editMenu); + _debug_menu = new QMenu (tr ("&Debug"), _menu_bar); + QAction * debug_continue = _debug_menu->addAction (tr ("Continue")); + debug_continue->setShortcut (Qt::Key_F5); + QAction * debug_step_into = _debug_menu->addAction (tr ("Step into")); + debug_step_into->setShortcut (Qt::Key_F9); + QAction * debug_step_over = _debug_menu->addAction (tr ("Next")); + debug_step_over->setShortcut (Qt::Key_F10); + QAction * debug_step_out = _debug_menu->addAction (tr ("Step out")); + debug_step_out->setShortcut (Qt::Key_F11); + _debug_menu->addSeparator (); + QAction * debug_quit = _debug_menu->addAction (tr ("Quit")); + debug_quit->setShortcut (Qt::Key_Escape); + _menu_bar->addMenu (_debug_menu); + QMenu *runMenu = new QMenu (tr ("&Run"), _menu_bar); runMenu->addAction (run_action); _menu_bar->addMenu (runMenu);
--- a/gui/src/m-editor/file-editor.h +++ b/gui/src/m-editor/file-editor.h @@ -59,6 +59,9 @@ void request_open_file (); void request_open_file (QString fileName); + void handle_entered_debug_mode (); + void handle_quit_debug_mode (); + void request_undo (); void request_redo (); void request_copy (); @@ -87,6 +90,7 @@ QMenuBar * _menu_bar; QToolBar * _tool_bar; + QMenu * _debug_menu; QAction* _copy_action; QAction* _cut_action; QTabWidget * _tab_widget;
--- a/gui/src/main-window.cc +++ b/gui/src/main-window.cc @@ -207,6 +207,7 @@ main_window::handle_entered_debug_mode () { setWindowTitle ("Octave (Debugging)"); + _file_editor->handle_entered_debug_mode (); _debug_menu->setEnabled (true); } @@ -214,6 +215,7 @@ main_window::handle_quit_debug_mode () { setWindowTitle ("Octave"); + _file_editor->handle_quit_debug_mode (); _debug_menu->setEnabled (false); }