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