Mercurial > octave
annotate libgui/src/shortcut-manager.h @ 20685:be130eb147f8
provide only one set of gui shortcuts at a time
* settings-dialog.cc (settings_dialog): remove initializations of all items
related to the second shortcut set;
(write_changed_settings): remove storing the values of the second set;
(import_shortcut_set, export_shortcut_set): renamed slots for import/export;
(import_shortcut_set2, export_shortcut_set2): removed slots of second set
* settings-dialog.h: renamed and remoced slots for import/export of shortcuts
* settings-dialog.ui: removed all items related to the second shortcut set
* shortcut-manager.cc (do_init_data): shortcut structure and the used hash
only stores on shortcut now;
(do_fill_treewidget): adapt filling the table in the settings dialog;
(do_write_shortcuts): Only write the one shortcut set into the settings file;
(do_set_shortcut): Do not check for active shortcut set;
(handle_double_clicked): slot for changing a shortcut adapted to the new
table in the settings dialog;
(shortcut_dialog, shortcut_dialog_finish): only considering one shortcut set;
(import_shortcuts, do_import_export): do not consider a second set to import
or export
* shortcut-manager.h (write_shortcuts, do_write_shortcuts, import_export,
do_import_export, import_shortcuts): remove function parameter for shortcut
set;
(shortcut_t): no more arrays of QKeySequence in the structure for storing
the shortcuts;
removed class variable _selected_set
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 08 Nov 2015 11:59:50 +0100 |
parents | aa36fb998a4d |
children | b6b16d8c8b57 |
rev | line source |
---|---|
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
1 /* |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
2 |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19664
diff
changeset
|
3 Copyright (C) 2014-2015 Torsten <ttl@justmail.de> |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
4 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
5 This file is part of Octave. |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
6 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
10 option) any later version. |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
11 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
15 for more details. |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
16 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
20 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
21 */ |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
22 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
23 #ifndef SHORTCUT_MANAGER_H |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
24 #define SHORTCUT_MANAGER_H |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
25 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
26 #include <QWidget> |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
27 #include <QTreeWidget> |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
28 #include <QLineEdit> |
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> |
18656
1b289f45187f
add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents:
18611
diff
changeset
|
31 #include <QSettings> |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
32 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
33 class enter_shortcut : public QLineEdit |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
34 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
35 Q_OBJECT |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
36 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
37 public: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
38 enter_shortcut (QWidget *p = 0); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
39 ~enter_shortcut (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
40 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
41 virtual void keyPressEvent (QKeyEvent *e); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
42 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
43 public slots: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
44 void handle_direct_shortcut (int); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
45 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
46 private: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
47 bool _direct_shortcut; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
48 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
49 }; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
50 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
51 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
52 class shortcut_manager : public QWidget |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
53 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
54 Q_OBJECT |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
55 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
56 public: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
57 shortcut_manager (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
58 ~shortcut_manager (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
59 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
60 static void init_data () |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
61 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
62 if (instance_ok ()) |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
63 instance->do_init_data (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
64 } |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
65 |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
66 static void write_shortcuts (QSettings *settings, bool closing) |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
67 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
68 if (instance_ok ()) |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
69 instance->do_write_shortcuts (settings, closing); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
70 } |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
71 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
72 static void set_shortcut (QAction *action, const QString& key) |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
73 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
74 if (instance_ok ()) |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
75 instance->do_set_shortcut (action, key); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
76 } |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
77 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
78 static void fill_treewidget (QTreeWidget *tree_view) |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
79 { |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
80 if (instance_ok ()) |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
81 instance->do_fill_treewidget (tree_view); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
82 } |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
83 |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
84 static void import_export (bool import) |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18728
diff
changeset
|
85 { |
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18728
diff
changeset
|
86 if (instance_ok ()) |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
87 instance->do_import_export (import); |
18822
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18728
diff
changeset
|
88 } |
3f6280d0a36b
allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents:
18728
diff
changeset
|
89 |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
90 public slots: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
91 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
92 signals: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
93 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
94 protected: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
95 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
96 protected slots: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
97 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
98 void handle_double_clicked (QTreeWidgetItem*, int); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
99 void shortcut_dialog_finished (int); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
100 void shortcut_dialog_set_default (); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
101 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
102 private: |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
103 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
104 static shortcut_manager *instance; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
105 static void cleanup_instance (void) { delete instance; instance = 0; } |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
106 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
107 // No copying! |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
108 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
109 shortcut_manager (const shortcut_manager&); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
110 shortcut_manager& operator = (const shortcut_manager&); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
111 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
112 static bool instance_ok (void); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
113 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
114 void init (QString, QString, QKeySequence); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
115 void do_init_data (); |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
116 void do_write_shortcuts (QSettings *settings, bool closing); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
117 void do_set_shortcut (QAction *action, const QString& key); |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
118 void do_fill_treewidget (QTreeWidget *tree_view); |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
119 void do_import_export (bool import); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
120 void shortcut_dialog (int); |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
121 void import_shortcuts (QSettings *settings); |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
122 |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
123 class shortcut_t |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
124 { |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
125 public: |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
126 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
127 shortcut_t (void) |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
128 : tree_item (0), description (), settings_key (), |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
129 actual_sc (QKeySequence ()), default_sc (QKeySequence ()) |
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
130 { } |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
131 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
132 shortcut_t (const shortcut_t& x) |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
133 : tree_item (x.tree_item), description (x.description), |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
134 settings_key (x.settings_key) |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
135 { |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
136 actual_sc = x.actual_sc; |
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
137 default_sc = x.default_sc; |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
138 } |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
139 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
140 shortcut_t& operator = (const shortcut_t& x) |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
141 { |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
142 if (&x != this) |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
143 { |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
144 tree_item = x.tree_item; |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
145 description = x.description; |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
146 settings_key = x.settings_key; |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
147 |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
148 actual_sc = QKeySequence (); |
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
149 default_sc = QKeySequence (); |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
150 |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
151 actual_sc = x.actual_sc; |
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
152 default_sc = x.default_sc; |
19783
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
153 } |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
154 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
155 return *this; |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
156 } |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
157 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
158 ~shortcut_t (void) |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
159 { |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
160 } |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
161 |
2dd6d5bdf11d
avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
162 QTreeWidgetItem *tree_item; |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
163 QString description; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
164 QString settings_key; |
20685
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
165 QKeySequence actual_sc; |
be130eb147f8
provide only one set of gui shortcuts at a time
Torsten <ttl@justmail.de>
parents:
20181
diff
changeset
|
166 QKeySequence default_sc; |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
167 }; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
168 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
169 QList<shortcut_t> _sc; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
170 QHash<QString, int> _shortcut_hash; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
171 QHash<QString, int> _action_hash; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
172 QHash <QString, QTreeWidgetItem*> _level_hash; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
173 QHash<int, QTreeWidgetItem*> _index_item_hash; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
174 QHash<QTreeWidgetItem*, int> _item_index_hash; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
175 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
176 QDialog *_dialog; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
177 enter_shortcut *_edit_actual; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
178 QLabel *_label_default; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
179 int _handled_index; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
180 |
18656
1b289f45187f
add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents:
18611
diff
changeset
|
181 QSettings *_settings; |
1b289f45187f
add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents:
18611
diff
changeset
|
182 |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
183 }; |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
184 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
185 |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
186 #endif // SHORTCUT_MANAGER_H |