annotate libgui/src/shortcut-manager.h @ 20181:aa36fb998a4d stable

maint: Remove unnecessary whitespace at end of lines. * libgui/Makefile.am, libgui/graphics/Canvas.cc, libgui/graphics/EditControl.cc, libgui/graphics/Figure.cc, libgui/graphics/MouseModeActionGroup.cc, libgui/graphics/annotation-dialog.cc, libgui/graphics/annotation-dialog.h, libgui/graphics/gl-select.cc, libgui/graphics/module.mk, libgui/kb-layouts/default.keytab, libgui/kb-layouts/linux.keytab, libgui/kb-layouts/vt420pc.keytab, libgui/src/m-editor/find-dialog.cc, libgui/src/main-window.cc, libgui/src/octave-qt-link.cc, libgui/src/octave-qt-link.h, libgui/src/shortcut-manager.h, libinterp/corefcn/error.cc, libinterp/corefcn/find.cc, libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h, libinterp/corefcn/octave-link.cc, libinterp/corefcn/quadcc.cc, libinterp/corefcn/strfns.cc, libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc, libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc, libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/colamd.cc, libinterp/octave-value/ov-bool-sparse.cc, libinterp/octave-value/ov-classdef.cc, libinterp/octave-value/ov-re-sparse.cc, libinterp/octave-value/ov-struct.cc, libinterp/parse-tree/pt-arg-list.cc, scripts/audio/@audiorecorder/play.m, scripts/audio/wavwrite.m, scripts/general/cart2sph.m, scripts/geometry/inpolygon.m, scripts/gui/listdlg.m, scripts/gui/msgbox.m, scripts/gui/private/message_dialog.m, scripts/help/get_first_help_sentence.m, scripts/help/lookfor.m, scripts/image/imshow.m, scripts/io/strread.m, scripts/java/javamem.m, scripts/miscellaneous/dir.m, scripts/miscellaneous/edit.m, scripts/miscellaneous/genvarname.m, scripts/miscellaneous/gzip.m, scripts/miscellaneous/private/__w2mpth__.m, scripts/plot/appearance/annotation.m, scripts/plot/draw/colorbar.m, scripts/plot/draw/quiver3.m, scripts/plot/util/hold.m, scripts/plot/util/print.m, scripts/polynomial/mkpp.m, scripts/polynomial/polyder.m, scripts/polynomial/spline.m, scripts/polynomial/unmkpp.m, scripts/signal/arma_rnd.m, scripts/sparse/gplot.m, scripts/statistics/tests/t_test.m, scripts/statistics/tests/t_test_regression.m, scripts/strings/mat2str.m, scripts/strings/strsplit.m, scripts/strings/strtrunc.m, scripts/strings/untabify.m, scripts/testfun/assert.m: maint: Remove unnecessary whitespace at end of lines.
author Rik <rik@octave.org>
date Tue, 12 May 2015 09:22:01 -0700
parents 2dd6d5bdf11d
children be130eb147f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
19664
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
66 static void write_shortcuts (int set, 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 ())
19664
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
69 instance->do_write_shortcuts (set, 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
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
84 static void import_export (bool import, int set)
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 ())
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
87 instance->do_import_export (import, set);
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 ();
19664
ff56a9899101 fix new shortcut dialog when applying new settings (fix #44196)
Torsten <ttl@justmail.de>
parents: 18822
diff changeset
116 void do_write_shortcuts (int set, 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);
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
119 void do_import_export (bool import, int set);
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
120 void shortcut_dialog (int);
18822
3f6280d0a36b allow export and import of shortcut sets
Torsten <ttl@justmail.de>
parents: 18728
diff changeset
121 void import_shortcuts (int set, 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 (),
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
129 actual_sc (new QKeySequence[2]), default_sc (new QKeySequence[2])
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
130 {
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
131 actual_sc[0] = QKeySequence ();
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
132 actual_sc[1] = QKeySequence ();
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
133
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
134 default_sc[0] = QKeySequence ();
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
135 default_sc[1] = QKeySequence ();
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
136 }
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
137
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
138 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
139 : tree_item (x.tree_item), description (x.description),
20181
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 19783
diff changeset
140 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
141 actual_sc (new QKeySequence[2]), default_sc (new QKeySequence[2])
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
142 {
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
143 actual_sc[0] = x.actual_sc[0];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
144 actual_sc[1] = x.actual_sc[1];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
145
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
146 default_sc[0] = x.default_sc[0];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
147 default_sc[1] = x.default_sc[1];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
148 }
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
149
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
150 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
151 {
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
152 if (&x != this)
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 tree_item = x.tree_item;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
155 description = x.description;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
156 settings_key = x.settings_key;
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 actual_sc = new QKeySequence[2];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
159 default_sc = new QKeySequence[2];
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 actual_sc[0] = x.actual_sc[0];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
162 actual_sc[1] = x.actual_sc[1];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
163
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
164 default_sc[0] = x.default_sc[0];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
165 default_sc[1] = x.default_sc[1];
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
166 }
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
167
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
168 return *this;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
169 }
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
170
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
171 ~shortcut_t (void)
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
172 {
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
173 delete [] actual_sc;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
174 delete [] default_sc;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
175 }
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
176
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
177 QTreeWidgetItem *tree_item;
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
178 QString description;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
179 QString settings_key;
19783
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
180 QKeySequence *actual_sc;
2dd6d5bdf11d avoid warnings about arrays in structure from GCC
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
181 QKeySequence *default_sc;
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
182 };
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 QList<shortcut_t> _sc;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
185 QHash<QString, int> _shortcut_hash;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
186 QHash<QString, int> _action_hash;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
187 QHash <QString, QTreeWidgetItem*> _level_hash;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
188 QHash<int, QTreeWidgetItem*> _index_item_hash;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
189 QHash<QTreeWidgetItem*, int> _item_index_hash;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
190
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
191 QDialog *_dialog;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
192 enter_shortcut *_edit_actual;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
193 QLabel *_label_default;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
194 int _handled_index;
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
195
18656
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18611
diff changeset
196 QSettings *_settings;
18728
95249367d6fa provide a second set of shortcuts
Torsten <ttl@justmail.de>
parents: 18656
diff changeset
197 int _selected_set;
18656
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18611
diff changeset
198
18611
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
199 };
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
200
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
201
086093fbdc1a first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
diff changeset
202 #endif // SHORTCUT_MANAGER_H