67 void addMessage (QString msg); |
66 void addMessage (QString msg); |
68 void applyToActions (std::function<void(QAction*)> function); |
67 void applyToActions (std::function<void(QAction*)> function); |
69 void changeDocument (LDDocument* f); |
68 void changeDocument (LDDocument* f); |
70 void clearSelection(); |
69 void clearSelection(); |
71 void closeInitialDocument(); |
70 void closeInitialDocument(); |
72 Configuration* config(); |
|
73 void createBlankDocument(); |
71 void createBlankDocument(); |
74 LDDocument* currentDocument(); |
72 LDDocument* currentDocument(); |
75 void currentDocumentClosed(); |
73 void currentDocumentClosed(); |
76 QItemSelectionModel* currentSelectionModel(); |
74 QItemSelectionModel* currentSelectionModel(); |
77 QKeySequence defaultShortcut (QAction* act); |
75 QKeySequence defaultShortcut (QAction* act); |
79 int deleteSelection(); |
77 int deleteSelection(); |
80 DocumentManager* documents() { return m_documents; } |
78 DocumentManager* documents() { return m_documents; } |
81 void doFullRefresh(); |
79 void doFullRefresh(); |
82 void endAction(); |
80 void endAction(); |
83 class ExtProgramToolset* externalPrograms(); |
81 class ExtProgramToolset* externalPrograms(); |
84 QVariant getConfigValue (QString name); |
|
85 class QSettings* getSettings() { return m_settings; } |
|
86 LDColor getUniformSelectedColor(); |
82 LDColor getUniformSelectedColor(); |
87 Canvas* getRendererForDocument(LDDocument* document); |
83 Canvas* getRendererForDocument(LDDocument* document); |
88 Grid* grid(); |
84 Grid* grid(); |
89 class GuiUtilities* guiUtilities(); |
85 class GuiUtilities* guiUtilities(); |
90 void loadShortcuts(); |
86 void loadShortcuts(); |
104 QModelIndexList selectedIndexes() const; |
100 QModelIndexList selectedIndexes() const; |
105 QSet<LDObject*> selectedObjects() const; |
101 QSet<LDObject*> selectedObjects() const; |
106 void setQuickColors (const QVector<ColorToolbarItem> &colors); |
102 void setQuickColors (const QVector<ColorToolbarItem> &colors); |
107 void spawnContextMenu (const QPoint& position); |
103 void spawnContextMenu (const QPoint& position); |
108 int suggestInsertPoint(); |
104 int suggestInsertPoint(); |
109 void syncSettings(); |
|
110 Q_SLOT void updateActions(); |
105 Q_SLOT void updateActions(); |
111 void updateColorToolbar(); |
106 void updateColorToolbar(); |
112 void updateDocumentList(); |
107 void updateDocumentList(); |
113 void updateDocumentListItem (LDDocument* doc); |
108 void updateDocumentListItem (LDDocument* doc); |
114 void updateEditModeActions(); |
109 void updateEditModeActions(); |
115 void updateGridToolBar(); |
110 void updateGridToolBar(); |
116 void updateRecentFilesMenu(); |
111 void updateRecentFilesMenu(); |
117 |
112 |
118 static QPixmap getIcon(QString iconName); |
113 static QPixmap getIcon(QString iconName); |
119 static class QSettings* makeSettings(QObject* parent = nullptr); |
|
120 |
114 |
121 template<typename... Args> |
115 template<typename... Args> |
122 void print(QString formatString, Args... args) |
116 void print(QString formatString, Args... args) |
123 { |
117 { |
124 formatHelper(formatString, args...); |
118 formatHelper(formatString, args...); |
142 void closeEvent (QCloseEvent* ev); |
136 void closeEvent (QCloseEvent* ev); |
143 |
137 |
144 private: |
138 private: |
145 struct ToolInfo; |
139 struct ToolInfo; |
146 |
140 |
147 Configuration& m_config; |
|
148 class GuiUtilities* m_guiUtilities; |
141 class GuiUtilities* m_guiUtilities; |
149 MessageManager* m_messageLog = nullptr; |
142 MessageManager* m_messageLog = nullptr; |
150 QMap<LDDocument*, Canvas*> m_renderers; |
143 QMap<LDDocument*, Canvas*> m_renderers; |
151 QMap<LDDocument*, QItemSelectionModel*> m_selections; |
144 QMap<LDDocument*, QItemSelectionModel*> m_selections; |
152 PrimitiveManager* m_primitives; |
145 PrimitiveManager* m_primitives; |
159 QTabBar* m_tabs; |
152 QTabBar* m_tabs; |
160 bool m_updatingTabs; |
153 bool m_updatingTabs; |
161 QVector<Toolset*> m_toolsets; |
154 QVector<Toolset*> m_toolsets; |
162 QMap<QAction*, ToolInfo> m_toolmap; |
155 QMap<QAction*, ToolInfo> m_toolmap; |
163 class ExtProgramToolset* m_externalPrograms; |
156 class ExtProgramToolset* m_externalPrograms; |
164 class QSettings* m_settings; |
|
165 DocumentManager* m_documents; |
157 DocumentManager* m_documents; |
166 LDDocument* m_currentDocument; |
158 LDDocument* m_currentDocument; |
167 QMap<QAction*, QKeySequence> m_defaultShortcuts; |
159 QMap<QAction*, QKeySequence> m_defaultShortcuts; |
168 |
160 |
169 private slots: |
161 private slots: |