17 */ |
17 */ |
18 |
18 |
19 #include <QComboBox> |
19 #include <QComboBox> |
20 #include <QPainter> |
20 #include <QPainter> |
21 #include <QPushButton> |
21 #include <QPushButton> |
|
22 #include <QInputDialog> |
22 #include "colors.h" |
23 #include "colors.h" |
23 #include "guiutilities.h" |
24 #include "guiutilities.h" |
24 #include "lddocument.h" |
25 #include "lddocument.h" |
25 #include "dialogs/colorselector.h" |
26 #include "dialogs/colorselector.h" |
26 #include "mainwindow.h" |
27 #include "mainwindow.h" |
27 #include "linetypes/modelobject.h" |
28 #include "linetypes/modelobject.h" |
|
29 #include "linetypes/comment.h" |
28 #include "dialogs/subfilereferenceeditor.h" |
30 #include "dialogs/subfilereferenceeditor.h" |
29 #include "widgets/vertexobjecteditor.h" |
31 #include "widgets/vertexobjecteditor.h" |
30 |
32 |
31 GuiUtilities::GuiUtilities (QObject* parent) : |
33 GuiUtilities::GuiUtilities (QObject* parent) : |
32 QObject (parent), |
34 QObject (parent), |
177 LDSubfileReference* reference = static_cast<LDSubfileReference*>(object); |
179 LDSubfileReference* reference = static_cast<LDSubfileReference*>(object); |
178 SubfileReferenceEditor editor {reference, parent}; |
180 SubfileReferenceEditor editor {reference, parent}; |
179 editor.setPrimitivesTree(parent->primitives()); |
181 editor.setPrimitivesTree(parent->primitives()); |
180 editor.exec(); |
182 editor.exec(); |
181 } |
183 } |
|
184 else if (object->type() == LDObjectType::Comment) |
|
185 { |
|
186 LDComment* comment = static_cast<LDComment*>(object); |
|
187 comment->setText(QInputDialog::getText( |
|
188 parent, |
|
189 QObject::tr("Edit comment"), |
|
190 QObject::tr("Comment text:"), |
|
191 QLineEdit::Normal, |
|
192 comment->text() |
|
193 )); |
|
194 } |
182 else |
195 else |
183 { |
196 { |
184 VertexObjectEditor editor {object, parent}; |
197 VertexObjectEditor editor {object, parent}; |
185 editor.exec(); |
198 editor.exec(); |
186 } |
199 } |