summaryrefslogtreecommitdiff
path: root/attic/muse2-oom/muse2/muse/widgets/shortcutconfig.h
blob: 0cc11dd78a44436f78588a05228444a7cb741f0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// C++ Interface: shortcutconfig
//
// Description:
// Dialog for configuring keyboard shortcuts
//
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
#ifndef __SHORTCUTCONFIG_H
#define __SHORTCUTCONFIG_H

class QCloseEvent;

#include "ui_shortcutconfigbase.h"

#define SHRT_CATEGORY_COL 0
enum
      {
      SHRT_DESCR_COL = 0,
      SHRT_SHRTCUT_COL
      };

class SCListViewItem : public QTreeWidgetItem {
      private:
      int index;

      public:
      SCListViewItem(QTreeWidget* parent, int i)
            : QTreeWidgetItem(parent), index(i) { }
      int getIndex() { return index; }

};


class ShortcutConfig : public QDialog, public Ui::ShortcutConfigBase {
      Q_OBJECT
      private:
      int current_category;
      void updateSCListView(int category);
      void updateSCListView() { updateSCListView(current_category); }
      void closeEvent(QCloseEvent *e);

      private slots:
      void categorySelChanged(QTreeWidgetItem*, int);
      void shortcutSelChanged(QTreeWidgetItem*, int);
      void assignShortcut();
      void clearShortcut();
      void assignAll();


      public:
      ShortcutConfig(QWidget* parent);
      bool _config_changed;

};

#endif