Mercurial > octave
annotate libgui/src/shortcut-manager.h @ 29359:7854d5752dd2
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2021 10:10:40 -0500 |
parents | a0a892829b6d 0a5b15007766 |
children | d4d83344d653 |
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 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 // Copyright (C) 2014-2021 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 //////////////////////////////////////////////////////////////////////// |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
25 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
26 #if ! defined (octave_shortcut_manager_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
27 #define octave_shortcut_manager_h 1 |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
28 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
29 #include <QKeyEvent> |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
30 #include <QLabel> |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
26830
diff
changeset
|
31 #include <QLineEdit> |
25371
41bbdf17f51a
make shortcuts for searching within the documentation configurable
Torsten <mttl@mailbox.org>
parents:
25103
diff
changeset
|
32 #include <QShortcut> |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
26830
diff
changeset
|
33 #include <QTreeWidget> |
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
26830
diff
changeset
|
34 #include <QWidget> |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
35 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
36 #include "gui-settings.h" |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
37 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
38 namespace octave |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
39 { |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
40 class enter_shortcut : public QLineEdit |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
41 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
42 Q_OBJECT |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23795
diff
changeset
|
43 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
44 public: |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
45 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
46 enter_shortcut (QWidget *p = nullptr); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
47 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
48 ~enter_shortcut (void) = default; |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23795
diff
changeset
|
49 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
50 virtual void keyPressEvent (QKeyEvent *e); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
51 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
52 public slots: |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
53 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
54 void handle_direct_shortcut (int); |
26830
e255897f353d
gui: allow entering shorcuts with shift modifier and numbers (bug #50555)
Torsten <mttl@mailbox.org>
parents:
26376
diff
changeset
|
55 void handle_shift_modifier (int); |
20702
b6b16d8c8b57
possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents:
20685
diff
changeset
|
56 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
57 private: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
58 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
59 bool m_direct_shortcut; |
26830
e255897f353d
gui: allow entering shorcuts with shift modifier and numbers (bug #50555)
Torsten <mttl@mailbox.org>
parents:
26376
diff
changeset
|
60 bool m_shift_modifier; |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
61 |
20702
b6b16d8c8b57
possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents:
20685
diff
changeset
|
62 }; |
b6b16d8c8b57
possibility to set all shortcuts to default values and check overwriting
Torsten <ttl@justmail.de>
parents:
20685
diff
changeset
|
63 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
64 class base_qobject; |
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
65 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
66 class shortcut_manager : public QWidget |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
67 { |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
68 Q_OBJECT |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
69 |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
70 public: |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
71 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
72 enum |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
73 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
74 OSC_IMPORT = 0, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
75 OSC_EXPORT = 1, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
76 OSC_DEFAULT = 2 |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
77 }; |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
78 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
79 shortcut_manager (base_qobject& oct_qobj); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
80 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
81 // No copying! |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
82 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
83 shortcut_manager (const shortcut_manager&) = delete; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
84 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
85 shortcut_manager& operator = (const shortcut_manager&) = delete; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
86 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
87 ~shortcut_manager (void) = default; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
88 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
89 void init_data (void); |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
90 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
91 void write_shortcuts (gui_settings *settings, bool closing); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
92 |
29206
a0a892829b6d
fix handling global shortcuts when preventing conflicts with readline
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
93 void set_shortcut (QAction *action, const sc_pref& scpref, bool enable = true); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
94 |
27818
fa0582694fda
replace literal strings by symbolic constants for shortcut preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27630
diff
changeset
|
95 void shortcut (QShortcut *sc, const sc_pref& scpref); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
96 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
97 void fill_treewidget (QTreeWidget *tree_view); |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
98 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
99 bool import_export (int action); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
100 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
101 protected slots: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
102 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
103 void handle_double_clicked (QTreeWidgetItem*, int); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
104 void shortcut_dialog_finished (int); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
105 void shortcut_dialog_set_default (); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
106 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
107 private: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
108 |
27818
fa0582694fda
replace literal strings by symbolic constants for shortcut preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27630
diff
changeset
|
109 void init (const QString&, const sc_pref& scpref); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
110 void shortcut_dialog (int); |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
111 void import_shortcuts (gui_settings *settings); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
112 bool overwrite_all_shortcuts (void); |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
113 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
114 class shortcut_t |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
115 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
116 public: |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
117 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
118 shortcut_t (void) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
119 : m_tree_item (nullptr), m_description (), m_settings_key (), |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
120 m_actual_sc (QKeySequence ()), m_default_sc (QKeySequence ()) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
121 { } |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
122 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
123 shortcut_t (const shortcut_t& x) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
124 : m_tree_item (x.m_tree_item), m_description (x.m_description), |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
125 m_settings_key (x.m_settings_key) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
126 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
127 m_actual_sc = x.m_actual_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
128 m_default_sc = x.m_default_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
129 } |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
130 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
131 shortcut_t& operator = (const shortcut_t& x) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
132 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
133 if (&x != this) |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
134 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
135 m_tree_item = x.m_tree_item; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
136 m_description = x.m_description; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
137 m_settings_key = x.m_settings_key; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
138 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
139 m_actual_sc = QKeySequence (); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
140 m_default_sc = QKeySequence (); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
141 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
142 m_actual_sc = x.m_actual_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
143 m_default_sc = x.m_default_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
144 } |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
145 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
146 return *this; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
147 } |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
148 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
149 ~shortcut_t (void) = default; |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
150 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
151 QTreeWidgetItem *m_tree_item; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
152 QString m_description; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
153 QString m_settings_key; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
154 QKeySequence m_actual_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
155 QKeySequence m_default_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
156 }; |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
157 |
27630
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
158 base_qobject& m_octave_qobj; |
262cdd0f7619
don't use singleton pattern for shortcut manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
159 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
160 QList<shortcut_t> m_sc; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
161 QHash<QString, int> m_shortcut_hash; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
162 QHash<QString, int> m_action_hash; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
163 QHash <QString, QTreeWidgetItem*> m_level_hash; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
164 QHash<int, QTreeWidgetItem*> m_index_item_hash; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
165 QHash<QTreeWidgetItem*, int> m_item_index_hash; |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
166 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
167 QDialog *m_dialog; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
168 enter_shortcut *m_edit_actual; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
169 QLabel *m_label_default; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
170 int m_handled_index; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
171 }; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
172 } |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
173 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
20702
diff
changeset
|
174 #endif |