Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / editors / sc-ide / widgets / settings / shortcuts_page.hpp
blobb84d65241f7f170ae5a085ed23414b9c9df64a9b
1 /*
2 SuperCollider Qt IDE
3 Copyright (c) 2012 Jakob Leben & Tim Blechmann
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef SCIDE_WIDGETS_SETTINGS_SHORTCUTS_PAGE_HPP_INCLUDED
22 #define SCIDE_WIDGETS_SETTINGS_SHORTCUTS_PAGE_HPP_INCLUDED
24 #include <QWidget>
25 #include <QStandardItemModel>
26 #include <QSortFilterProxyModel>
28 class QTreeWidgetItem;
30 namespace Ui {
31 class ShortcutConfigPage;
34 namespace ScIDE { namespace Settings {
36 class Manager;
38 class ShortcutsPage : public QWidget
40 Q_OBJECT
42 public:
43 ShortcutsPage(QWidget *parent = 0);
44 ~ShortcutsPage();
46 public Q_SLOTS:
47 void load( Manager * );
48 void store( Manager * );
49 void filterBy( const QString & );
51 private Q_SLOTS:
52 void showItem( QTreeWidgetItem *, QTreeWidgetItem * );
53 void apply();
55 private:
56 enum ItemDataRole
58 ActionRole = Qt::UserRole,
59 SettingsKeyRole,
60 DefaultSequenceRole,
61 CustomSequenceRole,
62 EditedRole
65 void addAction( QAction *, Manager * );
66 void applyTo( QTreeWidgetItem * );
67 void updateItem( QTreeWidgetItem * );
69 Ui::ShortcutConfigPage *ui;
70 QStandardItemModel *mActionModel;
71 QSortFilterProxyModel *mFilter;
74 }} // namespace ScIDE::Settings
76 #endif // SCIDE_WIDGETS_SETTINGS_SHORTCUTS_PAGE_HPP_INCLUDED