src/configDialog.h

changeset 667
31540c1f22ea
parent 606
3dd6f343ec06
equal deleted inserted replaced
666:c595cfb4791c 667:31540c1f22ea
1 /* 1 /*
2 * LDForge: LDraw parts authoring CAD 2 * LDForge: LDraw parts authoring CAD
3 * Copyright (C) 2013 Santeri Piippo 3 * Copyright (C) 2013, 2014 Santeri Piippo
4 * 4 *
5 * This program is free software: you can redistribute it and/or modify 5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or 7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
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 {
32 PROPERTY (QAction*, action, setAction) 32 PROPERTY (public, KeySequenceConfig*, KeyConfig, NO_OPS, STOCK_WRITE)
33 PROPERTY (public, QAction*, Action, NO_OPS, STOCK_WRITE)
33 34
34 public: 35 public:
35 explicit ShortcutListItem (QListWidget* view = null, int type = Type) : 36 explicit ShortcutListItem (QListWidget* view = null, int type = Type) :
36 QListWidgetItem (view, type) {} 37 QListWidgetItem (view, type) {}
37 }; 38 };
38 39
39 // ============================================================================= 40 // =============================================================================
40 class ConfigDialog : public QDialog 41 class ConfigDialog : public QDialog
41 { Q_OBJECT 42 {
43 Q_OBJECT
42 44
43 public: 45 public:
44 enum Tab 46 enum Tab
45 { InterfaceTab, 47 {
48 InterfaceTab,
46 ProfileTab, 49 ProfileTab,
47 ShortcutsTab, 50 ShortcutsTab,
48 QuickColorsTab, 51 QuickColorsTab,
49 GridsTab, 52 GridsTab,
50 ExtProgsTab, 53 ExtProgsTab,
64 QLabel* lb_gridIcons[3]; 67 QLabel* lb_gridIcons[3];
65 QList<QListWidgetItem*> quickColorItems; 68 QList<QListWidgetItem*> quickColorItems;
66 69
67 void applySettings(); 70 void applySettings();
68 void addShortcut (KeySequenceConfig& cfg, QAction* act, int& i); 71 void addShortcut (KeySequenceConfig& cfg, QAction* act, int& i);
69 void setButtonBackground (QPushButton* button, str value); 72 void setButtonBackground (QPushButton* button, QString value);
70 void pickColor (StringConfig& cfg, QPushButton* button); 73 void pickColor (QString& conf, QPushButton* button);
71 void updateQuickColorList (LDQuickColor* sel = null); 74 void updateQuickColorList (LDQuickColor* sel = null);
72 void setShortcutText (ShortcutListItem* item); 75 void setShortcutText (ShortcutListItem* item);
73 int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack); 76 int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack);
74 str quickColorString(); 77 QString quickColorString();
75 QListWidgetItem* getSelectedQuickColor(); 78 QListWidgetItem* getSelectedQuickColor();
76 QList<ShortcutListItem*> getShortcutSelection(); 79 QList<ShortcutListItem*> getShortcutSelection();
77 void initGrids(); 80 void initGrids();
78 void initExtProgs(); 81 void initExtProgs();
79 82
80 private slots: 83 private slots:
81 void slot_setGLBackground(); 84 void slot_setGLBackground();
82 void slot_setGLForeground(); 85 void slot_setGLForeground();
86 void slot_setGLSelectColor();
83 void slot_setShortcut(); 87 void slot_setShortcut();
84 void slot_resetShortcut(); 88 void slot_resetShortcut();
85 void slot_clearShortcut(); 89 void slot_clearShortcut();
86 void slot_setColor(); 90 void slot_setColor();
87 void slot_delColor(); 91 void slot_delColor();
96 100
97 // ============================================================================= 101 // =============================================================================
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
99 // ============================================================================= 103 // =============================================================================
100 class KeySequenceDialog : public QDialog 104 class KeySequenceDialog : public QDialog
101 { Q_OBJECT 105 {
106 Q_OBJECT
102 107
103 public: 108 public:
104 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0); 109 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0);
105 static bool staticDialog (KeySequenceConfig* cfg, QWidget* parent = null); 110 static bool staticDialog (KeySequenceConfig* cfg, QWidget* parent = null);
106 111

mercurial