Mercurial > octave-libgccjit
changeset 18711:9ef65c422f53 gui-release
use shortcut manager for the main news menu
* main_window.cc (construct_news_menu): use add_action for the actions,
(set_global_shortcuts): set/unset shortcuts
* main-window.h: actions are class variables
* shortcut-manager.cc (do_init_data): initialize the shortcuts in the news menu
author | Torsten <ttl@justmail.de> |
---|---|
date | Thu, 01 May 2014 13:24:27 +0200 |
parents | 584b20e9112c |
children | f017240310fb |
files | libgui/src/main-window.cc libgui/src/main-window.h libgui/src/shortcut-manager.cc |
diffstat | 3 files changed, 19 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc Thu May 01 12:12:08 2014 +0200 +++ b/libgui/src/main-window.cc Thu May 01 13:24:27 2014 +0200 @@ -1762,17 +1762,11 @@ { QMenu *news_menu = p->addMenu (tr ("&News")); - QAction *release_notes_action - = news_menu->addAction (tr ("Release Notes")); - - QAction *current_news_action - = news_menu->addAction (tr ("Community News")); - - connect (release_notes_action, SIGNAL (triggered ()), - this, SLOT (display_release_notes ())); - - connect (current_news_action, SIGNAL (triggered ()), - this, SLOT (load_and_display_community_news ())); + _release_notes_action = add_action (news_menu, QIcon (), + tr ("Release Notes"), SLOT (display_release_notes ())); + + _current_news_action = add_action (news_menu, QIcon (), + tr ("Community News"), SLOT (load_and_display_community_news ())); } void @@ -2273,6 +2267,9 @@ shortcut_manager::set_shortcut (_developer_action, "main_help:developer"); shortcut_manager::set_shortcut (_about_octave_action, "main_help:about"); + // news menu + shortcut_manager::set_shortcut (_release_notes_action, "main_news:release_notes"); + shortcut_manager::set_shortcut (_current_news_action, "main_news:community_news"); } else { @@ -2309,6 +2306,10 @@ _contribute_action->setShortcut (no_key); _developer_action->setShortcut (no_key); _about_octave_action->setShortcut (no_key); + + // news menu + _release_notes_action->setShortcut (no_key); + _current_news_action->setShortcut (no_key); } }
--- a/libgui/src/main-window.h Thu May 01 12:12:08 2014 +0200 +++ b/libgui/src/main-window.h Thu May 01 13:24:27 2014 +0200 @@ -355,6 +355,9 @@ QAction *_developer_action; QAction *_about_octave_action; + QAction *_release_notes_action; + QAction *_current_news_action; + // Toolbars. QComboBox *_current_directory_combo_box; static const int current_directory_width = 300;
--- a/libgui/src/shortcut-manager.cc Thu May 01 12:12:08 2014 +0200 +++ b/libgui/src/shortcut-manager.cc Thu May 01 13:24:27 2014 +0200 @@ -136,6 +136,10 @@ init (tr ("Octave Developer Resources"), "main_help:developer", QKeySequence ()); init (tr ("About Octave"), "main_help:about", QKeySequence ()); + // news + init (tr ("Release Notes"), "main_news:release_notes", QKeySequence ()); + init (tr ("Community News"), "main_news:community_news", QKeySequence ()); + // actions of the editor // file