src/configDialog.h

changeset 382
c1642530ea35
parent 367
3745caa5d87d
child 395
5210bcb1d7e0
equal deleted inserted replaced
381:241f65769a57 382:c1642530ea35
27 class QDoubleSpinBox; 27 class QDoubleSpinBox;
28 28
29 // ============================================================================= 29 // =============================================================================
30 class ShortcutListItem : public QListWidgetItem 30 class ShortcutListItem : public QListWidgetItem
31 { 31 {
32 PROPERTY (keyseqconfig*, keyConfig, setKeyConfig)
33 PROPERTY (QAction*, action, setAction)
34
32 public: 35 public:
33 explicit ShortcutListItem( QListWidget* view = null, int type = Type ) : 36 explicit ShortcutListItem( QListWidget* view = null, int type = Type ) :
34 QListWidgetItem( view, type ) {} 37 QListWidgetItem( view, type ) {}
35
36 actionmeta* getActionInfo() const
37 {
38 return m_info;
39 }
40
41 void setActionInfo( actionmeta* info )
42 {
43 m_info = info;
44 }
45
46 private:
47 actionmeta* m_info;
48 }; 38 };
49 39
50 // ============================================================================= 40 // =============================================================================
51 class ConfigDialog : public QDialog 41 class ConfigDialog : public QDialog
52 { 42 {
53 Q_OBJECT 43 Q_OBJECT
54 44
55 public: 45 public:
56 ConfigDialog( ForgeWindow* parent ); 46 ConfigDialog (ForgeWindow* parent);
57 virtual ~ConfigDialog(); 47 virtual ~ConfigDialog();
58 static void staticDialog(); 48 static void staticDialog();
59 const Ui_ConfigUI* getUI() const; 49 const Ui_ConfigUI* getUI() const;
60 float getGridValue( int i, int j ) const; 50 float getGridValue (int i, int j) const;
61 51
62 vector<quickColor> quickColorMeta; 52 vector<quickColor> quickColorMeta;
63 QDoubleSpinBox* dsb_gridData[3][4]; 53 QDoubleSpinBox* dsb_gridData[3][4];
64 54
65 private: 55 private:
71 void initMainTab(); 61 void initMainTab();
72 void initShortcutsTab(); 62 void initShortcutsTab();
73 void initQuickColorTab(); 63 void initQuickColorTab();
74 void initGridTab(); 64 void initGridTab();
75 void initExtProgTab(); 65 void initExtProgTab();
66 void addShortcut (keyseqconfig& cfg, QAction* act, ulong& i);
76 void setButtonBackground( QPushButton* button, str value ); 67 void setButtonBackground( QPushButton* button, str value );
77 void pickColor( strconfig& cfg, QPushButton* button ); 68 void pickColor( strconfig& cfg, QPushButton* button );
78 void updateQuickColorList( quickColor* sel = null ); 69 void updateQuickColorList( quickColor* sel = null );
79 void setShortcutText( QListWidgetItem* qItem, actionmeta meta ); 70 void setShortcutText (ShortcutListItem* item);
80 int getItemRow( QListWidgetItem* item, vector<QListWidgetItem*>& haystack ); 71 int getItemRow( QListWidgetItem* item, vector<QListWidgetItem*>& haystack );
81 str makeColorToolBarString(); 72 str makeColorToolBarString();
82 QListWidgetItem* getSelectedQuickColor(); 73 QListWidgetItem* getSelectedQuickColor();
83 QList<ShortcutListItem*> getShortcutSelection(); 74 QList<ShortcutListItem*> getShortcutSelection();
84 75
103 { 94 {
104 Q_OBJECT 95 Q_OBJECT
105 96
106 public: 97 public:
107 explicit KeySequenceDialog( QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0 ); 98 explicit KeySequenceDialog( QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0 );
108 static bool staticDialog( actionmeta& meta, QWidget* parent = null ); 99 static bool staticDialog( keyseqconfig* cfg, QWidget* parent = null );
109 100
110 QLabel* lb_output; 101 QLabel* lb_output;
111 QDialogButtonBox* bbx_buttons; 102 QDialogButtonBox* bbx_buttons;
112 QKeySequence seq; 103 QKeySequence seq;
113 104

mercurial