Mercurial > octave
diff libgui/src/documentation.h @ 26128:20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
* documentation.cc (documentation): initialize new class variables;
(documentation::construct_tool_bar): add two tool buttons for popup menus
for recent backward and forward pages, connect the appropriate signal for
enabling/disabling the buttons, connect signal for changed history to the
new slot for updating the mru lists, connect the actions of the new
menus with a slot for opening the url related to the action
(documentation::update_history_menus): new slot for updating the mru
lists depending on the number of history entries which has changed;
(documentation::update_history): doing the update, get the max desired
number of entries from the test browser history and put title and url
into the related menu
(documentation::open_hist_url) new slot for opening an url from the history
* documentation.h: new slots for updating history and opening an url,
new class variables for the new menus , the entry counts and the new actions
author | Torsten <mttl@mailbox.org> |
---|---|
date | Fri, 23 Nov 2018 19:46:51 +0100 |
parents | 390d59717711 |
children | af99ea9c325f |
line wrap: on
line diff
--- a/libgui/src/documentation.h Thu Nov 22 22:17:28 2018 +0100 +++ b/libgui/src/documentation.h Fri Nov 23 19:46:51 2018 +0100 @@ -24,12 +24,14 @@ #define octave_documentation_h 1 #include <QComboBox> -#include <QWidget> +#include <QMenu> #include <QSettings> #include <QShortcut> #include <QSplitter> #include <QTextBrowser> #include <QToolBar> +#include <QToolButton> +#include <QWidget> #include <QtHelp/QHelpEngine> namespace octave @@ -119,6 +121,9 @@ void record_anchor_position (void); void handle_cursor_position_change (void); + void update_history_menus (void); + void open_hist_url (QAction *a); + signals: void show_single_result (const QUrl); @@ -129,6 +134,8 @@ QAction *add_action (const QIcon& icon, const QString& text, const char *member, QWidget *receiver = nullptr, QToolBar *tool_bar = nullptr); + void update_history (int new_count, QAction **actions); + QHelpEngine *m_help_engine; QString m_internal_search; @@ -144,6 +151,14 @@ QAction *m_action_go_home; QAction *m_action_go_prev; QAction *m_action_go_next; + QMenu *m_prev_pages_menu; + QMenu *m_next_pages_menu; + int m_prev_pages_count; + int m_next_pages_count; + + enum { max_history_entries = 10 }; + QAction *m_prev_pages_actions[max_history_entries]; + QAction *m_next_pages_actions[max_history_entries]; QAction *m_action_find; QShortcut *m_findnext_shortcut;