Mercurial > octave
annotate libgui/src/documentation-dock-widget.cc @ 30564:796f54d4ddbf stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
In all .txi and .texi files except gpl.txi and gpl.texi in the
doc/liboctave and doc/interpreter directories, change the copyright
to "Octave Project Developers", the same as used for other source
files. Update copyright notices for 2022 (not done since 2019). For
gpl.txi and gpl.texi, change the copyright notice to be "Free Software
Foundation, Inc." and leave the date at 2007 only because this file
only contains the text of the GPL, not anything created by the Octave
Project Developers.
Add Paul Thomas to contributors.in.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 28 Dec 2021 18:22:40 -0500 |
parents | 7a0be7c8b7ca |
children | 04601f6c47f4 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29711
diff
changeset
|
3 // Copyright (C) 2011-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
27 # include "config.h" |
15286
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15204
diff
changeset
|
28 #endif |
ae9079bbc627
Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents:
15204
diff
changeset
|
29 |
16460
4d4e7c6f839d
use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents:
16453
diff
changeset
|
30 #include "documentation-dock-widget.h" |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
31 |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
32 #include "help.h" |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
33 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
34 namespace octave |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
35 { |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
36 documentation_dock_widget::documentation_dock_widget (QWidget *p, |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
37 base_qobject& oct_qobj) |
29550
8dd0fca2a3d9
where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
38 : octave_dock_widget ("DocumentationDockWidget", p, oct_qobj), |
8dd0fca2a3d9
where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
39 m_docs (new documentation (this, oct_qobj)) |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
40 { |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
41 setWindowIcon (QIcon (":/actions/icons/logo.png")); |
25508
3edae6ba1fcd
use a custom title bar widget for the main dock widgets
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
42 set_title (tr ("Documentation")); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
43 setStatusTip (tr ("See the documentation for help.")); |
15055
48ae6a7c69c1
Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff
changeset
|
44 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
45 setWidget (m_docs); |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29594
diff
changeset
|
46 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29594
diff
changeset
|
47 if (! p) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29594
diff
changeset
|
48 make_window (); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
49 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
50 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
51 void documentation_dock_widget::notice_settings (const gui_settings *settings) |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
52 { |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
53 m_docs->notice_settings (settings); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
54 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
55 |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
56 void documentation_dock_widget::save_settings (void) |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
57 { |
29711
7a0be7c8b7ca
restore zoom level in documentation browser at start up
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
58 m_docs->save_settings (); |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
59 octave_dock_widget::save_settings (); |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
60 } |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
61 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
62 void documentation_dock_widget::copyClipboard (void) |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
63 { |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
64 m_docs->copyClipboard (); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
65 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
66 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
67 void documentation_dock_widget::pasteClipboard (void) |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
68 { |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
69 m_docs->pasteClipboard (); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
70 } |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
71 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
72 void documentation_dock_widget::selectAll (void) |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
73 { |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
74 m_docs->selectAll (); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
75 } |
18555
2d5d0d86432e
gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents:
17790
diff
changeset
|
76 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
77 void documentation_dock_widget::showDoc (const QString& name) |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
78 { |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
79 // show the doc pane without focus for carrying on typing in the console |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
80 if (! isVisible ()) |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
81 setVisible (true); |
24011
9107bae20480
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
82 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
83 raise (); |
17030
05b8ad3b7d12
Display/focus documentation browser when running command doc 'xxxxx'
John Donoghue <john.donoghue@ieee.org>
parents:
17029
diff
changeset
|
84 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
24733
diff
changeset
|
85 m_docs->load_ref (name); |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24718
diff
changeset
|
86 } |
25060
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
87 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
88 void documentation_dock_widget::registerDoc (const QString& name) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
89 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
90 m_docs->registerDoc (name); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
91 } |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
92 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
93 void documentation_dock_widget::unregisterDoc (const QString& name) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
94 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
95 m_docs->unregisterDoc (name); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
96 } |
23322
c4aebfe51a17
provide a context menu and shortcuts for the doc browser tab bar (bug #44605)
Torsten <mttl@mailbox.org>
parents:
23220
diff
changeset
|
97 } |