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 (keyseqconfig*, 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) {} |
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 ConfigDialog (ForgeWindow* parent); |
44 enum Tab { |
|
45 InterfaceTab, |
|
46 ProfileTab, |
|
47 ShortcutsTab, |
|
48 QuickColorsTab, |
|
49 GridsTab, |
|
50 ExtProgsTab, |
|
51 DownloadTab |
|
52 }; |
|
53 |
|
54 explicit ConfigDialog (Tab deftab = InterfaceTab, QWidget* parent = null, Qt::WindowFlags f = 0); |
45 virtual ~ConfigDialog(); |
55 virtual ~ConfigDialog(); |
46 static void staticDialog(); |
|
47 const Ui_ConfigUI* getUI() const; |
|
48 float getGridValue (int i, int j) const; |
56 float getGridValue (int i, int j) const; |
49 |
57 |
50 List<LDQuickColor> quickColors; |
58 List<LDQuickColor> quickColors; |
51 QDoubleSpinBox* dsb_gridData[3][4]; |
59 QDoubleSpinBox* dsb_gridData[3][4]; |
52 |
60 |
54 Ui_ConfigUI* ui; |
62 Ui_ConfigUI* ui; |
55 QLabel* lb_gridLabels[3]; |
63 QLabel* lb_gridLabels[3]; |
56 QLabel* lb_gridIcons[3]; |
64 QLabel* lb_gridIcons[3]; |
57 List<QListWidgetItem*> quickColorItems; |
65 List<QListWidgetItem*> quickColorItems; |
58 |
66 |
59 void initMainTab(); |
67 void applySettings(); |
60 void initShortcutsTab(); |
68 void addShortcut (KeySequenceConfig& cfg, QAction* act, ulong& i); |
61 void initQuickColorTab(); |
|
62 void initGridTab(); |
|
63 void initExtProgTab(); |
|
64 void addShortcut (keyseqconfig& cfg, QAction* act, ulong& i); |
|
65 void setButtonBackground (QPushButton* button, str value); |
69 void setButtonBackground (QPushButton* button, str value); |
66 void pickColor (strconfig& cfg, QPushButton* button); |
70 void pickColor (StringConfig& cfg, QPushButton* button); |
67 void updateQuickColorList (LDQuickColor* sel = null); |
71 void updateQuickColorList (LDQuickColor* sel = null); |
68 void setShortcutText (ShortcutListItem* item); |
72 void setShortcutText (ShortcutListItem* item); |
69 int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); |
73 int getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack); |
70 str quickColorString(); |
74 str quickColorString(); |
71 QListWidgetItem* getSelectedQuickColor(); |
75 QListWidgetItem* getSelectedQuickColor(); |
72 QList<ShortcutListItem*> getShortcutSelection(); |
76 QList<ShortcutListItem*> getShortcutSelection(); |
|
77 void initGrids(); |
|
78 void initExtProgs(); |
73 |
79 |
74 private slots: |
80 private slots: |
75 void slot_setGLBackground(); |
81 void slot_setGLBackground(); |
76 void slot_setGLForeground(); |
82 void slot_setGLForeground(); |
77 void slot_setShortcut(); |
83 void slot_setShortcut(); |
82 void slot_addColorSeparator(); |
88 void slot_addColorSeparator(); |
83 void slot_moveColor(); |
89 void slot_moveColor(); |
84 void slot_clearColors(); |
90 void slot_clearColors(); |
85 void slot_setExtProgPath(); |
91 void slot_setExtProgPath(); |
86 void slot_findDownloadFolder(); |
92 void slot_findDownloadFolder(); |
|
93 void buttonClicked (QAbstractButton* button); |
87 }; |
94 }; |
88 |
95 |
89 // ============================================================================= |
96 // ============================================================================= |
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
91 // ============================================================================= |
98 // ============================================================================= |
92 class KeySequenceDialog : public QDialog { |
99 class KeySequenceDialog : public QDialog { |
93 Q_OBJECT |
100 Q_OBJECT |
94 |
101 |
95 public: |
102 public: |
96 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); |
103 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); |
97 static bool staticDialog (keyseqconfig* cfg, QWidget* parent = null); |
104 static bool staticDialog (KeySequenceConfig* cfg, QWidget* parent = null); |
98 |
105 |
99 QLabel* lb_output; |
106 QLabel* lb_output; |
100 QDialogButtonBox* bbx_buttons; |
107 QDialogButtonBox* bbx_buttons; |
101 QKeySequence seq; |
108 QKeySequence seq; |
102 |
109 |