54 cfg (Bool, lv_colorize, true); |
54 cfg (Bool, lv_colorize, true); |
55 cfg (String, gui_colortoolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15"); |
55 cfg (String, gui_colortoolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15"); |
56 cfg (Bool, gui_implicitfiles, false); |
56 cfg (Bool, gui_implicitfiles, false); |
57 extern_cfg (List, io_recentfiles); |
57 extern_cfg (List, io_recentfiles); |
58 extern_cfg (Bool, gl_axes); |
58 extern_cfg (Bool, gl_axes); |
59 extern_cfg (String, gl_maincolor); |
59 extern_cfg (String, gl_maincolor); |
60 extern_cfg (Float, gl_maincolor_alpha); |
60 extern_cfg (Float, gl_maincolor_alpha); |
61 extern_cfg (Bool, gl_wireframe); |
61 extern_cfg (Bool, gl_wireframe); |
62 extern_cfg (Bool, gl_colorbfc); |
62 extern_cfg (Bool, gl_colorbfc); |
63 extern_cfg (Bool, gl_drawangles); |
63 extern_cfg (Bool, gl_drawangles); |
|
64 extern_cfg (Bool, gl_randomcolors); |
64 |
65 |
65 // ============================================================================= |
66 // ============================================================================= |
66 // |
67 // |
67 MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) : |
68 MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) : |
68 QMainWindow (parent, flags) |
69 QMainWindow (parent, flags) |
81 |
82 |
82 connect (ui->objectList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_selectionChanged())); |
83 connect (ui->objectList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_selectionChanged())); |
83 connect (ui->objectList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*))); |
84 connect (ui->objectList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*))); |
84 connect (m_tabs, SIGNAL (currentChanged(int)), this, SLOT (changeCurrentFile())); |
85 connect (m_tabs, SIGNAL (currentChanged(int)), this, SLOT (changeCurrentFile())); |
85 |
86 |
86 // Init message log manager |
|
87 m_msglog = new MessageManager; |
87 m_msglog = new MessageManager; |
88 m_msglog->setRenderer (R()); |
88 m_msglog->setRenderer (R()); |
89 m_renderer->setMessageLog (m_msglog); |
89 m_renderer->setMessageLog (m_msglog); |
90 m_quickColors = quickColorsFromConfig(); |
90 m_quickColors = quickColorsFromConfig(); |
91 slot_selectionChanged(); |
91 slot_selectionChanged(); |
92 setStatusBar (new QStatusBar); |
92 setStatusBar (new QStatusBar); |
93 |
|
94 // Make certain actions checkable |
|
95 ui->actionAxes->setChecked (gl_axes); |
93 ui->actionAxes->setChecked (gl_axes); |
96 ui->actionWireframe->setChecked (gl_wireframe); |
94 ui->actionWireframe->setChecked (gl_wireframe); |
97 ui->actionBFCView->setChecked (gl_colorbfc); |
95 ui->actionBFCView->setChecked (gl_colorbfc); |
|
96 ui->actionRandomColors->setChecked (gl_randomcolors); |
98 updateGridToolBar(); |
97 updateGridToolBar(); |
99 updateEditModeActions(); |
98 updateEditModeActions(); |
100 updateRecentFilesMenu(); |
99 updateRecentFilesMenu(); |
101 updateColorToolbar(); |
100 updateColorToolbar(); |
102 updateTitle(); |
101 updateTitle(); |
103 updateActionShortcuts(); |
102 updateActionShortcuts(); |
104 |
|
105 setMinimumSize (300, 200); |
103 setMinimumSize (300, 200); |
106 |
|
107 connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup())); |
104 connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup())); |
108 |
105 |
109 // Connect all actions |
106 // Connect all actions |
110 for (QAction* act : findChildren<QAction*>()) |
107 for (QAction* act : findChildren<QAction*>()) |
111 if (not act->objectName().isEmpty()) |
108 if (not act->objectName().isEmpty()) |