src/dialogs/configdialog.h

changeset 1217
314e12e23c3a
parent 1010
969b48eddd6b
child 1222
34def2630300
equal deleted inserted replaced
1216:12f9ea615cbc 1217:314e12e23c3a
26 26
27 // ============================================================================= 27 // =============================================================================
28 class ShortcutListItem : public QListWidgetItem 28 class ShortcutListItem : public QListWidgetItem
29 { 29 {
30 public: 30 public:
31 explicit ShortcutListItem (QListWidget* view = nullptr, int type = Type); 31 explicit ShortcutListItem(QListWidget* view = nullptr, int type = Type);
32 32
33 QAction* action() const; 33 QAction* action() const;
34 QKeySequence sequence() const; 34 QKeySequence sequence() const;
35 void setAction (QAction* action); 35 void setAction(QAction* action);
36 void setSequence (const QKeySequence& sequence); 36 void setSequence(const QKeySequence& sequence);
37 37
38 private: 38 private:
39 QAction* m_action; 39 QAction* m_action;
40 QKeySequence m_sequence; 40 QKeySequence m_sequence;
41 }; 41 };
63 GridsTab, 63 GridsTab,
64 ExtProgsTab, 64 ExtProgsTab,
65 DownloadTab 65 DownloadTab
66 }; 66 };
67 67
68 explicit ConfigDialog (QWidget* parent = nullptr, Tab defaulttab = (Tab) 0, Qt::WindowFlags f = 0); 68 explicit ConfigDialog(QWidget* parent = nullptr, Tab defaulttab = (Tab) 0, Qt::WindowFlags f = 0);
69 virtual ~ConfigDialog(); 69 virtual ~ConfigDialog();
70 70
71 QList<ColorToolbarItem> quickColors; 71 QList<ColorToolbarItem> quickColors;
72 72
73 private: 73 private:
76 QMap<QPushButton*, QColor> m_buttonColors; 76 QMap<QPushButton*, QColor> m_buttonColors;
77 ExternalProgramWidgets m_externalProgramWidgets[NumExternalPrograms]; 77 ExternalProgramWidgets m_externalProgramWidgets[NumExternalPrograms];
78 class QSettings* m_settings; 78 class QSettings* m_settings;
79 79
80 void applySettings(); 80 void applySettings();
81 void addShortcut (QAction* act); 81 void addShortcut(QAction* act);
82 void setButtonBackground (QPushButton* button, QString value); 82 void setButtonBackground(QPushButton* button, QString value);
83 void updateQuickColorList (ColorToolbarItem* sel = nullptr); 83 void updateQuickColorList(ColorToolbarItem* sel = nullptr);
84 void setShortcutText (ShortcutListItem* item); 84 void setShortcutText(ShortcutListItem* item);
85 int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack); 85 int getItemRow(QListWidgetItem* item, QList<QListWidgetItem*>& haystack);
86 QString quickColorString(); 86 QString quickColorString();
87 QListWidgetItem* getSelectedQuickColor(); 87 QListWidgetItem* getSelectedQuickColor();
88 QList<ShortcutListItem*> getShortcutSelection(); 88 QList<ShortcutListItem*> getShortcutSelection();
89 void initExtProgs(); 89 void initExtProgs();
90 void applyToWidgetOptions (std::function<void (QWidget*, QString)> func); 90 void applyToWidgetOptions(std::function<void(QWidget*, QString)> func);
91 91
92 private slots: 92 private slots:
93 void setButtonColor(); 93 void setButtonColor();
94 void slot_setShortcut(); 94 void slot_setShortcut();
95 void slot_resetShortcut(); 95 void slot_resetShortcut();
99 void slot_addColorSeparator(); 99 void slot_addColorSeparator();
100 void slot_moveColor(); 100 void slot_moveColor();
101 void slot_clearColors(); 101 void slot_clearColors();
102 void slot_setExtProgPath(); 102 void slot_setExtProgPath();
103 void slot_findDownloadFolder(); 103 void slot_findDownloadFolder();
104 void buttonClicked (QAbstractButton* button); 104 void buttonClicked(QAbstractButton* button);
105 void selectPage (int row); 105 void selectPage(int row);
106 }; 106 };
107 107
108 // ============================================================================= 108 // =============================================================================
109 // 109 //
110 class KeySequenceDialog : public QDialog 110 class KeySequenceDialog : public QDialog
111 { 111 {
112 Q_OBJECT 112 Q_OBJECT
113 113
114 public: 114 public:
115 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = nullptr, Qt::WindowFlags f = 0); 115 explicit KeySequenceDialog(QKeySequence seq, QWidget* parent = nullptr, Qt::WindowFlags f = 0);
116 static bool staticDialog (ShortcutListItem* item, QWidget* parent = nullptr); 116 static bool staticDialog(ShortcutListItem* item, QWidget* parent = nullptr);
117 117
118 QLabel* lb_output; 118 QLabel* lb_output;
119 QDialogButtonBox* bbx_buttons; 119 QDialogButtonBox* bbx_buttons;
120 QKeySequence seq; 120 QKeySequence seq;
121 121
122 private: 122 private:
123 void updateOutput(); 123 void updateOutput();
124 124
125 private slots: 125 private slots:
126 virtual void keyPressEvent (QKeyEvent* ev) override; 126 virtual void keyPressEvent(QKeyEvent* ev) override;
127 }; 127 };

mercurial