95 class QSettings* getSettings() { return m_settings; } |
95 class QSettings* getSettings() { return m_settings; } |
96 LDColor getUniformSelectedColor(); |
96 LDColor getUniformSelectedColor(); |
97 class GuiUtilities* guiUtilities(); |
97 class GuiUtilities* guiUtilities(); |
98 void loadShortcuts(); |
98 void loadShortcuts(); |
99 LDDocument* newDocument (bool cache = false); |
99 LDDocument* newDocument (bool cache = false); |
|
100 PrimitiveManager* primitives(); |
100 GLRenderer* renderer(); |
101 GLRenderer* renderer(); |
101 void refresh(); |
102 void refresh(); |
102 void refreshObjectList(); |
103 void refreshObjectList(); |
103 bool ringToolHiRes() const; |
104 bool ringToolHiRes() const; |
104 int ringToolSegments() const; |
105 int ringToolSegments() const; |
136 struct ToolInfo { QMetaMethod method; Toolset* object; }; |
137 struct ToolInfo { QMetaMethod method; Toolset* object; }; |
137 |
138 |
138 Configuration& m_config; |
139 Configuration& m_config; |
139 class GuiUtilities* m_guiUtilities; |
140 class GuiUtilities* m_guiUtilities; |
140 GLRenderer* m_renderer; |
141 GLRenderer* m_renderer; |
|
142 PrimitiveManager* m_primitives; |
141 LDObjectList m_sel; |
143 LDObjectList m_sel; |
142 QList<ColorToolbarItem> m_quickColors; |
144 QList<ColorToolbarItem> m_quickColors; |
143 QList<QToolButton*> m_colorButtons; |
145 QList<QToolButton*> m_colorButtons; |
144 QList<QAction*> m_recentFiles; |
146 QList<QAction*> m_recentFiles; |
145 class Ui_MainWindow& ui; |
147 class Ui_MainWindow& ui; |
154 DoubleMap<LDObject*, QListWidgetItem*> m_objectsInList; |
156 DoubleMap<LDObject*, QListWidgetItem*> m_objectsInList; |
155 bool m_isSelectionLocked; |
157 bool m_isSelectionLocked; |
156 QMap<QAction*, QKeySequence> m_defaultShortcuts; |
158 QMap<QAction*, QKeySequence> m_defaultShortcuts; |
157 |
159 |
158 private slots: |
160 private slots: |
|
161 void finishInitialization(); |
159 void selectionChanged(); |
162 void selectionChanged(); |
160 void recentFileClicked(); |
163 void recentFileClicked(); |
161 void quickColorClicked(); |
164 void quickColorClicked(); |
162 void doLastSecondCleanup(); |
165 void doLastSecondCleanup(); |
163 void objectListDoubleClicked (QListWidgetItem* listitem); |
166 void objectListDoubleClicked (QListWidgetItem* listitem); |
178 // Returns true if the user answered yes, false if no. |
181 // Returns true if the user answered yes, false if no. |
179 bool Confirm (const QString& message); |
182 bool Confirm (const QString& message); |
180 |
183 |
181 // Displays an error prompt with the given message |
184 // Displays an error prompt with the given message |
182 void Critical (const QString& message); |
185 void Critical (const QString& message); |
|
186 void errorPrompt (QWidget *parent, const QString& message); |
183 |
187 |
184 // Takes in pairs of radio buttons and respective values and finds the first selected one. |
188 // Takes in pairs of radio buttons and respective values and finds the first selected one. |
185 // Returns returns the value of the first found radio button that was checked by the user. |
189 // Returns returns the value of the first found radio button that was checked by the user. |
186 template<class T> |
190 template<class T> |
187 T RadioSwitch (const T& defval, QList<Pair<QRadioButton*, T>> haystack) |
191 T RadioSwitch (const T& defval, QList<Pair<QRadioButton*, T>> haystack) |
208 return; |
212 return; |
209 } |
213 } |
210 } |
214 } |
211 } |
215 } |
212 |
216 |
213 class PrimitiveTreeItem : public QTreeWidgetItem |
|
214 { |
|
215 public: |
|
216 PrimitiveTreeItem (QTreeWidgetItem* parent, Primitive* info); |
|
217 PrimitiveTreeItem (QTreeWidget* parent, Primitive* info); |
|
218 Primitive* primitive() const; |
|
219 |
|
220 private: |
|
221 Primitive* m_primitive; |
|
222 }; |
|
223 |
|
224 void populatePrimitivesTree (QTreeWidget* tw, const QString& selectByDefault = QString()); |
|
225 QSettings* makeSettings (QObject* parent = nullptr); |
217 QSettings* makeSettings (QObject* parent = nullptr); |