Mercurial > octave
annotate libgui/src/documentation-dock-widget.h @ 23322:c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
* documentation-dock-widget.cc (constructor): set focus proxy to _webinfo;
(notice_settings): new slot, just calling the settings method in _webinfo;
* documentation-dock-widget.h: new slot notice_settings
* webinfo.cc (webinfo::webinfo): add close actions to the tab bar;
(webinfo::add_action): new helper function for adding actions to a menu;
(webinfo::request_close_tab): new slot for tab closing action;
(webinfo::request_close_other_tabs): new slot for closing all other tabs;
(webinfo::tab_state_changed): function called when a new tab gets focus
for dis-/enabling actions and setting the focus to the new tab;
(webinfo::current_tab_changed, webinfo::addNewTab, webinfo::close_tab):
use new function tab_state_changed;
(webinfo::notice_settings): new function called from dock widget when
settings have changed, sets the close shortcuts (same as in editor);
(webinfo_tab_bar::webinfo_tab_bar): initialize the new context menu;
(webinfo_tab_bar::~webinfo_tab_bar): delete the context menu;
(webinfo_tab_bar::mousePressEvent): extend event handler by the right
click for showing the context menu
* webinfo.h (webinfo_tab_bar): class variable _context_menu and public
method returning this menu, constructor and destructor in webinfo.cc
(webinfo): new methods add_action and notice_settings, new slots
request_close_tab and request_close_other_tabs, new actions for tab closing
author | Torsten <mttl@mailbox.org> |
---|---|
date | Tue, 21 Mar 2017 20:25:27 +0100 |
parents | 092078913d54 |
children | 21baad6b35c4 |
rev | line source |
---|---|
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
1 /* |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
2 |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 2011-2017 Jacob Dawid |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
6 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
9 the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
10 (at your option) any later version. |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
15 GNU General Public License for more details. |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
16 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
20 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
21 */ |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
22 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
23 #if ! defined (octave_documentation_dock_widget_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
24 #define octave_documentation_dock_widget_h 1 |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
25 |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
26 #include "octave-dock-widget.h" |
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
27 |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
28 #include "webinfo.h" |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
29 |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
30 class documentation_dock_widget : public octave_dock_widget |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
31 { |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
32 Q_OBJECT |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
33 |
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
34 public: |
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
35 |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
36 documentation_dock_widget (QWidget *parent = 0); |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
37 |
23322
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
38 public slots: |
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
39 |
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
40 void notice_settings (const QSettings *settings); |
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
41 |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16461
diff
changeset
|
42 protected slots: |
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16461
diff
changeset
|
43 void copyClipboard (); |
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16461
diff
changeset
|
44 void pasteClipboard (); |
18555
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17744
diff
changeset
|
45 void selectAll (); |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16461
diff
changeset
|
46 |
17029
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
16881
diff
changeset
|
47 void showDoc (const QString & name); |
23322
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
48 |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
49 private: |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
50 |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
51 webinfo *_webinfo; |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
52 }; |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
53 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
54 #endif |