25 class Ui_ConfigUI; |
25 class Ui_ConfigUI; |
26 class QLabel; |
26 class QLabel; |
27 class QDoubleSpinBox; |
27 class QDoubleSpinBox; |
28 |
28 |
29 // ============================================================================= |
29 // ============================================================================= |
30 class ShortcutListItem : public QListWidgetItem |
30 class ShortcutListItem : public QListWidgetItem { |
31 { |
|
32 PROPERTY (keyseqconfig*, keyConfig, setKeyConfig) |
31 PROPERTY (keyseqconfig*, keyConfig, setKeyConfig) |
33 PROPERTY (QAction*, action, setAction) |
32 PROPERTY (QAction*, action, setAction) |
34 |
33 |
35 public: |
34 public: |
36 explicit ShortcutListItem( QListWidget* view = null, int type = Type ) : |
35 explicit ShortcutListItem (QListWidget* view = null, int type = Type) : |
37 QListWidgetItem( view, type ) {} |
36 QListWidgetItem (view, type) {} |
38 }; |
37 }; |
39 |
38 |
40 // ============================================================================= |
39 // ============================================================================= |
41 class ConfigDialog : public QDialog |
40 class ConfigDialog : public QDialog { |
42 { |
|
43 Q_OBJECT |
41 Q_OBJECT |
44 |
42 |
45 public: |
43 public: |
46 ConfigDialog (ForgeWindow* parent); |
44 ConfigDialog (ForgeWindow* parent); |
47 virtual ~ConfigDialog(); |
45 virtual ~ConfigDialog(); |
49 const Ui_ConfigUI* getUI() const; |
47 const Ui_ConfigUI* getUI() const; |
50 float getGridValue (int i, int j) const; |
48 float getGridValue (int i, int j) const; |
51 |
49 |
52 List<LDQuickColor> quickColors; |
50 List<LDQuickColor> quickColors; |
53 QDoubleSpinBox* dsb_gridData[3][4]; |
51 QDoubleSpinBox* dsb_gridData[3][4]; |
54 |
52 |
55 private: |
53 private: |
56 Ui_ConfigUI* ui; |
54 Ui_ConfigUI* ui; |
57 QLabel* lb_gridLabels[3]; |
55 QLabel* lb_gridLabels[3]; |
58 QLabel* lb_gridIcons[3]; |
56 QLabel* lb_gridIcons[3]; |
59 List<QListWidgetItem*> quickColorItems; |
57 List<QListWidgetItem*> quickColorItems; |
62 void initShortcutsTab(); |
60 void initShortcutsTab(); |
63 void initQuickColorTab(); |
61 void initQuickColorTab(); |
64 void initGridTab(); |
62 void initGridTab(); |
65 void initExtProgTab(); |
63 void initExtProgTab(); |
66 void addShortcut (keyseqconfig& cfg, QAction* act, ulong& i); |
64 void addShortcut (keyseqconfig& cfg, QAction* act, ulong& i); |
67 void setButtonBackground( QPushButton* button, str value ); |
65 void setButtonBackground (QPushButton* button, str value); |
68 void pickColor( strconfig& cfg, QPushButton* button ); |
66 void pickColor (strconfig& cfg, QPushButton* button); |
69 void updateQuickColorList( LDQuickColor* sel = null ); |
67 void updateQuickColorList (LDQuickColor* sel = null); |
70 void setShortcutText (ShortcutListItem* item); |
68 void setShortcutText (ShortcutListItem* item); |
71 int getItemRow( QListWidgetItem* item, List<QListWidgetItem*>& haystack ); |
69 int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); |
72 str quickColorString(); |
70 str quickColorString(); |
73 QListWidgetItem* getSelectedQuickColor(); |
71 QListWidgetItem* getSelectedQuickColor(); |
74 QList<ShortcutListItem*> getShortcutSelection(); |
72 QList<ShortcutListItem*> getShortcutSelection(); |
75 |
73 |
76 private slots: |
74 private slots: |
77 void slot_setGLBackground(); |
75 void slot_setGLBackground(); |
78 void slot_setGLForeground(); |
76 void slot_setGLForeground(); |
79 void slot_setShortcut(); |
77 void slot_setShortcut(); |
80 void slot_resetShortcut(); |
78 void slot_resetShortcut(); |
88 }; |
86 }; |
89 |
87 |
90 // ============================================================================= |
88 // ============================================================================= |
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
92 // ============================================================================= |
90 // ============================================================================= |
93 class KeySequenceDialog : public QDialog |
91 class KeySequenceDialog : public QDialog { |
94 { |
|
95 Q_OBJECT |
92 Q_OBJECT |
96 |
93 |
97 public: |
94 public: |
98 explicit KeySequenceDialog( QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0 ); |
95 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); |
99 static bool staticDialog( keyseqconfig* cfg, QWidget* parent = null ); |
96 static bool staticDialog (keyseqconfig* cfg, QWidget* parent = null); |
100 |
97 |
101 QLabel* lb_output; |
98 QLabel* lb_output; |
102 QDialogButtonBox* bbx_buttons; |
99 QDialogButtonBox* bbx_buttons; |
103 QKeySequence seq; |
100 QKeySequence seq; |
104 |
101 |
105 private: |
102 private: |
106 void updateOutput(); |
103 void updateOutput(); |
107 |
104 |
108 private slots: |
105 private slots: |
109 virtual void keyPressEvent( QKeyEvent* ev ) override; |
106 virtual void keyPressEvent (QKeyEvent* ev) override; |
110 }; |
107 }; |
111 |
108 |
112 #endif // CONFIGDIALOG_H |
109 #endif // CONFIGDIALOG_H |