Mercurial > octave
annotate libgui/src/documentation-dock-widget.cc @ 24011:9107bae20480
style fixes for some GUI source files
* color-picker.cc, color-picker.h, documentation-dock-widget.cc,
documentation-dock-widget.h, external-editor-interface.cc,
external-editor-interface.h, find-files-dialog.cc,
find-files-dialog.h, find-files-model.cc, find-files-model.h,
history-dock-widget.cc, history-dock-widget.h, settings-dialog.cc,
settings-dialog.h, terminal-dock-widget.cc, thread-manager.cc,
thread-manager.h: Use m_ prefix for member variables, order
functions consistently in header and source files, and follow more
Octave coding conventions.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 06 Sep 2017 09:25:46 -0400 |
parents | b2d55b52ee51 |
children | 194eb4bd202b |
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 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
23 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
24 # include "config.h" |
15286
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15204
diff
changeset
|
25 #endif |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15204
diff
changeset
|
26 |
16460
4d4e7c6f839d
use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents:
16453
diff
changeset
|
27 #include "documentation-dock-widget.h" |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
28 |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
29 #include "help.h" |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
30 #include "interpreter-private.h" |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
31 |
15368
36ececf69385
avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents:
15286
diff
changeset
|
32 documentation_dock_widget::documentation_dock_widget (QWidget *p) |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
33 : octave_dock_widget (p) |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
34 { |
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
35 setObjectName ("DocumentationDockWidget"); |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
36 setWindowIcon (QIcon (":/actions/icons/logo.png")); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16461
diff
changeset
|
37 set_title (tr ("Documentation")); |
16453
2e3c652c89d1
improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents:
15552
diff
changeset
|
38 setStatusTip (tr ("See the documentation for help.")); |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
39 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
40 m_webinfo = new webinfo (this); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
41 setWidget (m_webinfo); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
42 setFocusProxy (m_webinfo); |
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
|
43 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
44 connect (p, SIGNAL (show_doc_signal (const QString&)), |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
45 this, SLOT (showDoc (const QString&))); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
46 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
47 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
48 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
49 documentation_dock_widget::notice_settings (const QSettings *settings) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
50 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
51 m_webinfo->notice_settings (settings); |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
52 } |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
53 |
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
54 void |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
55 documentation_dock_widget::load_info_file (void) |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
56 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
57 octave::help_system& help_sys |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
58 = octave::__get_help_system__ ("doc widget: load_info_file"); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
59 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
60 QString info_file = QString::fromStdString (help_sys.info_file ()); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
61 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
62 m_webinfo->load_info_file (info_file); |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
63 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
64 |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
65 void |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
66 documentation_dock_widget::copyClipboard (void) |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
67 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
68 m_webinfo->copyClipboard (); |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16798
diff
changeset
|
69 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
70 |
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
|
71 void |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
72 documentation_dock_widget::pasteClipboard (void) |
18555
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17790
diff
changeset
|
73 { |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
74 m_webinfo->pasteClipboard (); |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
75 } |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
76 |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
77 void |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
78 documentation_dock_widget::selectAll (void) |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
79 { |
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
80 m_webinfo->selectAll (); |
18555
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17790
diff
changeset
|
81 } |
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17790
diff
changeset
|
82 |
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17790
diff
changeset
|
83 void |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23322
diff
changeset
|
84 documentation_dock_widget::showDoc (const QString& name) |
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
|
85 { |
19445
8c47eb286151
open doc browser for keywords correctly (bug #41110)
Torsten <ttl@justmail.de>
parents:
18555
diff
changeset
|
86 // show the doc pane without focus for carrying on typing in the console |
20955
77f5591878bf
maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
87 if (! isVisible ()) |
17030
05b8ad3b7d12
Display/focus documentation browser when running command doc 'xxxxx'
John Donoghue <john.donoghue@ieee.org>
parents:
17029
diff
changeset
|
88 setVisible (true); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
89 |
17030
05b8ad3b7d12
Display/focus documentation browser when running command doc 'xxxxx'
John Donoghue <john.donoghue@ieee.org>
parents:
17029
diff
changeset
|
90 raise (); |
05b8ad3b7d12
Display/focus documentation browser when running command doc 'xxxxx'
John Donoghue <john.donoghue@ieee.org>
parents:
17029
diff
changeset
|
91 |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
92 m_webinfo->load_ref (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
|
93 } |