Mercurial > octave-antonio
changeset 15106:59175df7dcf6 gui
Created and added debug action icons.
* bp_next.png: Added icon.
* bp_prev.png: Added icon.
* bp_rm_all.png: Added icon.
* bp_toggle.png: Added icon.
* db_cont.png: Added icon.
* db_step.png: Added icon.
* db_step_in.png: Added icon.
* db_step_out.png: Added icon.
* db_stop.png: Added icon.
* file-editor-interface.h: Added method for accessing the editor's toolbar.
* file-editor: Implemented new interface methods. Assigned icons.
* main-window.cc: Now adding debug actions to toolbar.
* resource.qrc: Added new icons to resource file.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Sat, 04 Aug 2012 20:22:26 +0200 |
parents | f4ea22ef2beb |
children | 159f800d1dff |
files | gui/src/icons/bp_next.png gui/src/icons/bp_prev.png gui/src/icons/bp_rm_all.png gui/src/icons/bp_toggle.png gui/src/icons/db_cont.png gui/src/icons/db_step.png gui/src/icons/db_step_in.png gui/src/icons/db_step_out.png gui/src/icons/db_stop.png 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 gui/src/resource.qrc |
diffstat | 14 files changed, 49 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/m-editor/file-editor-interface.h Sat Aug 04 11:18:20 2012 +0200 +++ b/gui/src/m-editor/file-editor-interface.h Sat Aug 04 20:22:26 2012 +0200 @@ -20,6 +20,7 @@ #include <QDockWidget> #include <QMenu> +#include <QToolBar> class QTerminal; class main_window; @@ -43,6 +44,7 @@ virtual ~file_editor_interface () { } virtual QMenu *debug_menu () = 0; + virtual QToolBar *toolbar () = 0; virtual void handle_entered_debug_mode () = 0; virtual void handle_quit_debug_mode () = 0;
--- a/gui/src/m-editor/file-editor.cc Sat Aug 04 11:18:20 2012 +0200 +++ b/gui/src/m-editor/file-editor.cc Sat Aug 04 20:22:26 2012 +0200 @@ -57,6 +57,12 @@ return _debug_menu; } +QToolBar * +file_editor::toolbar () +{ + return _tool_bar; +} + void file_editor::handle_entered_debug_mode () { @@ -337,7 +343,6 @@ _tab_widget = new QTabWidget (widget); _tab_widget->setTabsClosable (true); - // Theme icons with QStyle icons as fallback QAction *new_action = new QAction (QIcon(":/actions/icons/filenew.png"), tr("&New File"), _tool_bar); @@ -371,10 +376,18 @@ QAction *toggle_bookmark_action = new QAction (tr ("Toggle &Bookmark"),_tool_bar); QAction *remove_bookmark_action = new QAction (tr ("&Remove All Bookmarks"),_tool_bar); - QAction *next_breakpoint_action = new QAction (tr ("&Next breakpoint"),_tool_bar); - QAction *previous_breakpoint_action = new QAction (tr ("Pre&vious breakpoint"),_tool_bar); - QAction *toggle_breakpoint_action = new QAction (tr ("Toggle &breakpoint"),_tool_bar); - QAction *remove_breakpoint_action = new QAction (tr ("&Remove All breakpoints"),_tool_bar); + QAction *next_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_next.png"), + tr ("&Next breakpoint"), _tool_bar); + QAction *previous_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_prev.png"), + tr ("Pre&vious breakpoint"), _tool_bar); + QAction *toggle_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_toggle.png"), + tr ("Toggle &breakpoint"), _tool_bar); + QAction *remove_all_breakpoints_action + = new QAction (QIcon (":/actions/icons/bp_rm_all.png"), + tr ("&Remove All breakpoints"), _tool_bar); QAction *comment_selection_action = new QAction (tr ("&Comment Selected Text"),_tool_bar); QAction *uncomment_selection_action = new QAction (tr ("&Uncomment Selected Text"),_tool_bar); @@ -413,10 +426,15 @@ _tool_bar->addAction (redo_action); _tool_bar->addAction (_copy_action); _tool_bar->addAction (_cut_action); + _tool_bar->addAction (paste_action); _tool_bar->addSeparator (); - _tool_bar->addAction (paste_action); _tool_bar->addAction (find_action); _tool_bar->addAction (_run_action); + _tool_bar->addSeparator (); + _tool_bar->addAction (toggle_breakpoint_action); + _tool_bar->addAction (next_breakpoint_action); + _tool_bar->addAction (previous_breakpoint_action); + _tool_bar->addAction (remove_all_breakpoints_action); // menu bar QMenu *fileMenu = new QMenu (tr ("&File"), _menu_bar); @@ -450,7 +468,7 @@ _debug_menu->addAction (toggle_breakpoint_action); _debug_menu->addAction (next_breakpoint_action); _debug_menu->addAction (previous_breakpoint_action); - _debug_menu->addAction (remove_breakpoint_action); + _debug_menu->addAction (remove_all_breakpoints_action); _debug_menu->addSeparator (); // The other debug actions will be added by the main window. _menu_bar->addMenu (_debug_menu); @@ -501,7 +519,7 @@ SIGNAL (triggered ()), this, SLOT (request_next_breakpoint ())); connect (previous_breakpoint_action, SIGNAL (triggered ()), this, SLOT (request_previous_breakpoint ())); - connect (remove_breakpoint_action, + connect (remove_all_breakpoints_action, SIGNAL (triggered ()), this, SLOT (request_remove_breakpoint ())); connect (comment_selection_action, SIGNAL (triggered ()), this, SLOT (request_comment_selected_text ()));
--- a/gui/src/m-editor/file-editor.h Sat Aug 04 11:18:20 2012 +0200 +++ b/gui/src/m-editor/file-editor.h Sat Aug 04 20:22:26 2012 +0200 @@ -50,7 +50,8 @@ QTerminal * terminal (); main_window * get_main_window (); - QMenu * debug_menu(); + QMenu * debug_menu (); + QToolBar * toolbar (); void handle_entered_debug_mode (); void handle_quit_debug_mode ();
--- a/gui/src/main-window.cc Sat Aug 04 11:18:20 2012 +0200 +++ b/gui/src/main-window.cc Sat Aug 04 20:22:26 2012 +0200 @@ -592,32 +592,37 @@ _debug_menu = menuBar ()->addMenu (tr ("De&bug")); - _debug_step_over = _debug_menu->addAction (tr ("Step")); + _debug_step_over = _debug_menu->addAction (QIcon (":/actions/icons/db_step.png"), tr ("Step")); _debug_step_over->setEnabled (false); _file_editor->debug_menu ()->addAction (_debug_step_over); + _file_editor->toolbar ()->addAction (_debug_step_over); _debug_step_over->setShortcut (Qt::Key_F10); - _debug_step_into = _debug_menu->addAction (tr ("Step in")); + _debug_step_into = _debug_menu->addAction (QIcon (":/actions/icons/db_step_in.png"), tr ("Step in")); _debug_step_into->setEnabled (false); _file_editor->debug_menu ()->addAction (_debug_step_into); + _file_editor->toolbar ()->addAction (_debug_step_into); _debug_step_into->setShortcut (Qt::Key_F11); - _debug_step_out = _debug_menu->addAction (tr ("Step out")); + _debug_step_out = _debug_menu->addAction (QIcon (":/actions/icons/db_step_out.png"), tr ("Step out")); _debug_step_out->setEnabled (false); _file_editor->debug_menu ()->addAction (_debug_step_out); + _file_editor->toolbar ()->addAction (_debug_step_out); _debug_step_out->setShortcut (Qt::ShiftModifier + Qt::Key_F11); - _debug_continue = _debug_menu->addAction (tr ("Continue")); + _debug_continue = _debug_menu->addAction (QIcon (":/actions/icons/db_cont.png"), tr ("Continue")); _debug_continue->setEnabled (false); _file_editor->debug_menu ()->addAction (_debug_continue); + _file_editor->toolbar ()->addAction (_debug_continue); _debug_continue->setShortcut (Qt::Key_F5); _debug_menu->addSeparator (); _file_editor->debug_menu ()->addSeparator (); - _debug_quit = _debug_menu->addAction (tr ("Exit Debug Mode")); + _debug_quit = _debug_menu->addAction (QIcon (":/actions/icons/db_stop.png"), tr ("Exit Debug Mode")); _debug_quit->setEnabled (false); _file_editor->debug_menu ()->addAction (_debug_quit); + _file_editor->toolbar ()->addAction (_debug_quit); _debug_quit->setShortcut (Qt::ShiftModifier + Qt::Key_F5); //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
--- a/gui/src/resource.qrc Sat Aug 04 11:18:20 2012 +0200 +++ b/gui/src/resource.qrc Sat Aug 04 20:22:26 2012 +0200 @@ -27,5 +27,14 @@ <file>icons/jabber_protocol.png</file> <file>icons/logo.png</file> <file>icons/terminal.png</file> + <file>icons/bp_toggle.png</file> + <file>icons/bp_rm_all.png</file> + <file>icons/bp_prev.png</file> + <file>icons/bp_next.png</file> + <file>icons/db_cont.png</file> + <file>icons/db_step.png</file> + <file>icons/db_step_in.png</file> + <file>icons/db_step_out.png</file> + <file>icons/db_stop.png</file> </qresource> </RCC>