src/main.cpp

changeset 330
edb6c09cdd3c
parent 329
6d75fa09cc0c
child 331
638a7458ef5e
equal deleted inserted replaced
329:6d75fa09cc0c 330:edb6c09cdd3c
16 #include "src/ldrawalgorithm.h" 16 #include "src/ldrawalgorithm.h"
17 #include "src/messagelog.h" 17 #include "src/messagelog.h"
18 #include "src/settings.h" 18 #include "src/settings.h"
19 #include "src/settingseditor/settingseditor.h" 19 #include "src/settingseditor/settingseditor.h"
20 #include "src/ui/circletooloptionswidget.h" 20 #include "src/ui/circletooloptionswidget.h"
21 #include "src/ui/objecteditor.h"
22 #include "src/version.h" 21 #include "src/version.h"
23 #include "src/widgets/colorselectdialog.h" 22 #include "src/widgets/colorselectdialog.h"
24 #include "src/parser.h" 23 #include "src/parser.h"
25 #include <GL/glew.h> 24 #include <GL/glew.h>
26 25
281 } 280 }
282 281
283 struct ToolWidgets 282 struct ToolWidgets
284 { 283 {
285 CircleToolOptionsWidget* circleToolOptions; 284 CircleToolOptionsWidget* circleToolOptions;
286 ObjectEditor* objectEditor;
287 }; 285 };
288 286
289 void initializeTools(Ui_MainWindow* ui, ToolWidgets* toolWidgets, QWidget* parent) 287 void initializeTools(Ui_MainWindow* ui, ToolWidgets* toolWidgets, QWidget* parent)
290 { 288 {
291 const struct 289 const struct
296 } editingModesInfo[] = { 294 } editingModesInfo[] = {
297 { 295 {
298 .name = QObject::tr("Select"), 296 .name = QObject::tr("Select"),
299 .tooltip = QObject::tr("Select elements from the model."), 297 .tooltip = QObject::tr("Select elements from the model."),
300 .icon = {":/icons/navigate-outline.png"}, 298 .icon = {":/icons/navigate-outline.png"},
301 .widget = toolWidgets->objectEditor, 299 .widget = nullptr,
302 }, 300 },
303 { 301 {
304 .name = QObject::tr("Draw"), 302 .name = QObject::tr("Draw"),
305 .tooltip = QObject::tr("Draw new elements into the model."), 303 .tooltip = QObject::tr("Draw new elements into the model."),
306 .icon = {":/icons/pencil-outline.png"}, 304 .icon = {":/icons/pencil-outline.png"},
438 MessageLog messageLog; 436 MessageLog messageLog;
439 Signal settingsChanged; 437 Signal settingsChanged;
440 ui.setupUi(&mainWindow); 438 ui.setupUi(&mainWindow);
441 ToolWidgets toolWidgets{ 439 ToolWidgets toolWidgets{
442 .circleToolOptions = new CircleToolOptionsWidget{&mainWindow}, 440 .circleToolOptions = new CircleToolOptionsWidget{&mainWindow},
443 .objectEditor = new ObjectEditor{&mainWindow},
444 }; 441 };
445 const auto updateTitle = [&ui, &mainWindow]{ 442 const auto updateTitle = [&ui, &mainWindow]{
446 mainWindow.setWindowTitle(title(&ui)); 443 mainWindow.setWindowTitle(title(&ui));
447 }; 444 };
448 const uiutilities::KeySequenceMap defaultKeyboardShortcuts = 445 const uiutilities::KeySequenceMap defaultKeyboardShortcuts =

mercurial