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 PROPERTY (KeySequenceConfig*, keyConfig, setKeyConfig) |
31 { PROPERTY (KeySequenceConfig*, keyConfig, setKeyConfig) |
32 PROPERTY (QAction*, action, setAction) |
32 PROPERTY (QAction*, action, setAction) |
33 |
33 |
34 public: |
34 public: |
35 explicit ShortcutListItem (QListWidget* view = null, int type = Type) : |
35 explicit ShortcutListItem (QListWidget* view = null, int type = Type) : |
36 QListWidgetItem (view, type) {} |
36 QListWidgetItem (view, type) {} |
37 }; |
37 }; |
38 |
38 |
39 // ============================================================================= |
39 // ============================================================================= |
40 class ConfigDialog : public QDialog { |
40 class ConfigDialog : public QDialog |
41 Q_OBJECT |
41 { Q_OBJECT |
42 |
42 |
43 public: |
43 public: |
44 enum Tab { |
44 enum Tab |
45 InterfaceTab, |
45 { InterfaceTab, |
46 ProfileTab, |
46 ProfileTab, |
47 ShortcutsTab, |
47 ShortcutsTab, |
48 QuickColorsTab, |
48 QuickColorsTab, |
49 GridsTab, |
49 GridsTab, |
50 ExtProgsTab, |
50 ExtProgsTab, |
51 DownloadTab |
51 DownloadTab |
52 }; |
52 }; |
53 |
53 |
54 explicit ConfigDialog (Tab deftab = InterfaceTab, QWidget* parent = null, Qt::WindowFlags f = 0); |
54 explicit ConfigDialog (Tab deftab = InterfaceTab, QWidget* parent = null, Qt::WindowFlags f = 0); |
55 virtual ~ConfigDialog(); |
55 virtual ~ConfigDialog(); |
56 float getGridValue (int i, int j) const; |
56 float getGridValue (int i, int j) const; |
57 |
57 |
58 List<LDQuickColor> quickColors; |
58 List<LDQuickColor> quickColors; |
59 QDoubleSpinBox* dsb_gridData[3][4]; |
59 QDoubleSpinBox* dsb_gridData[3][4]; |
60 |
60 |
61 private: |
61 private: |
62 Ui_ConfigUI* ui; |
62 Ui_ConfigUI* ui; |
63 QLabel* lb_gridLabels[3]; |
63 QLabel* lb_gridLabels[3]; |
64 QLabel* lb_gridIcons[3]; |
64 QLabel* lb_gridIcons[3]; |
65 List<QListWidgetItem*> quickColorItems; |
65 List<QListWidgetItem*> quickColorItems; |
66 |
66 |
67 void applySettings(); |
67 void applySettings(); |
68 void addShortcut (KeySequenceConfig& cfg, QAction* act, ulong& i); |
68 void addShortcut (KeySequenceConfig& cfg, QAction* act, ulong& i); |
69 void setButtonBackground (QPushButton* button, str value); |
69 void setButtonBackground (QPushButton* button, str value); |
70 void pickColor (StringConfig& cfg, QPushButton* button); |
70 void pickColor (StringConfig& cfg, QPushButton* button); |
71 void updateQuickColorList (LDQuickColor* sel = null); |
71 void updateQuickColorList (LDQuickColor* sel = null); |
72 void setShortcutText (ShortcutListItem* item); |
72 void setShortcutText (ShortcutListItem* item); |
73 int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); |
73 int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); |
74 str quickColorString(); |
74 str quickColorString(); |
75 QListWidgetItem* getSelectedQuickColor(); |
75 QListWidgetItem* getSelectedQuickColor(); |
76 QList<ShortcutListItem*> getShortcutSelection(); |
76 QList<ShortcutListItem*> getShortcutSelection(); |
77 void initGrids(); |
77 void initGrids(); |
78 void initExtProgs(); |
78 void initExtProgs(); |
79 |
79 |
80 private slots: |
80 private slots: |
81 void slot_setGLBackground(); |
81 void slot_setGLBackground(); |
82 void slot_setGLForeground(); |
82 void slot_setGLForeground(); |
83 void slot_setShortcut(); |
83 void slot_setShortcut(); |
84 void slot_resetShortcut(); |
84 void slot_resetShortcut(); |
85 void slot_clearShortcut(); |
85 void slot_clearShortcut(); |
86 void slot_setColor(); |
86 void slot_setColor(); |
87 void slot_delColor(); |
87 void slot_delColor(); |
88 void slot_addColorSeparator(); |
88 void slot_addColorSeparator(); |
89 void slot_moveColor(); |
89 void slot_moveColor(); |
90 void slot_clearColors(); |
90 void slot_clearColors(); |
91 void slot_setExtProgPath(); |
91 void slot_setExtProgPath(); |
92 void slot_findDownloadFolder(); |
92 void slot_findDownloadFolder(); |
93 void buttonClicked (QAbstractButton* button); |
93 void buttonClicked (QAbstractButton* button); |
94 }; |
94 }; |
95 |
95 |
96 // ============================================================================= |
96 // ============================================================================= |
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
98 // ============================================================================= |
98 // ============================================================================= |
99 class KeySequenceDialog : public QDialog { |
99 class KeySequenceDialog : public QDialog |
100 Q_OBJECT |
100 { Q_OBJECT |
101 |
101 |
102 public: |
102 public: |
103 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); |
103 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); |
104 static bool staticDialog (KeySequenceConfig* cfg, QWidget* parent = null); |
104 static bool staticDialog (KeySequenceConfig* cfg, QWidget* parent = null); |
105 |
105 |
106 QLabel* lb_output; |
106 QLabel* lb_output; |
107 QDialogButtonBox* bbx_buttons; |
107 QDialogButtonBox* bbx_buttons; |
108 QKeySequence seq; |
108 QKeySequence seq; |
109 |
109 |
110 private: |
110 private: |
111 void updateOutput(); |
111 void updateOutput(); |
112 |
112 |
113 private slots: |
113 private slots: |
114 virtual void keyPressEvent (QKeyEvent* ev) override; |
114 virtual void keyPressEvent (QKeyEvent* ev) override; |
115 }; |
115 }; |
116 |
116 |
117 #endif // CONFIGDIALOG_H |
117 #endif // CONFIGDIALOG_H |