src/mainWindow.cc

changeset 896
4988666b5e3c
parent 893
ee0631d7f5d4
child 911
5209474e9f38
child 927
409b82a4765e
child 943
af81220741d9
equal deleted inserted replaced
894:120cf01d8831 896:4988666b5e3c
56 static QMap<QAction*, QKeySequence> g_defaultShortcuts; 56 static QMap<QAction*, QKeySequence> g_defaultShortcuts;
57 57
58 CFGENTRY (Bool, ColorizeObjectsList, true) 58 CFGENTRY (Bool, ColorizeObjectsList, true)
59 CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15") 59 CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15")
60 CFGENTRY (Bool, ListImplicitFiles, false) 60 CFGENTRY (Bool, ListImplicitFiles, false)
61 CFGENTRY (List, HiddenToolbars, {})
61 EXTERN_CFGENTRY (List, RecentFiles) 62 EXTERN_CFGENTRY (List, RecentFiles)
62 EXTERN_CFGENTRY (Bool, DrawAxes) 63 EXTERN_CFGENTRY (Bool, DrawAxes)
63 EXTERN_CFGENTRY (String, MainColor) 64 EXTERN_CFGENTRY (String, MainColor)
64 EXTERN_CFGENTRY (Float, MainColorAlpha) 65 EXTERN_CFGENTRY (Float, MainColorAlpha)
65 EXTERN_CFGENTRY (Bool, DrawWireframe) 66 EXTERN_CFGENTRY (Bool, DrawWireframe)
123 connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup())); 124 connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup()));
124 connect (ui->ringToolHiRes, SIGNAL (clicked (bool)), this, SLOT (ringToolHiResClicked (bool))); 125 connect (ui->ringToolHiRes, SIGNAL (clicked (bool)), this, SLOT (ringToolHiResClicked (bool)));
125 connect (ui->ringToolSegments, SIGNAL (valueChanged (int)), 126 connect (ui->ringToolSegments, SIGNAL (valueChanged (int)),
126 this, SLOT (circleToolSegmentsChanged())); 127 this, SLOT (circleToolSegmentsChanged()));
127 circleToolSegmentsChanged(); // invoke it manually for initial label text 128 circleToolSegmentsChanged(); // invoke it manually for initial label text
129
130 for (QVariant const& toolbarname : cfg::HiddenToolbars)
131 {
132 QToolBar* toolbar = findChild<QToolBar*> (toolbarname.toString());
133
134 if (toolbar != null)
135 toolbar->hide();
136 }
128 } 137 }
129 138
130 MainWindow::~MainWindow() 139 MainWindow::~MainWindow()
131 { 140 {
132 g_win = null; 141 g_win = null;
630 { 639 {
631 ev->ignore(); 640 ev->ignore();
632 return; 641 return;
633 } 642 }
634 643
635 // Save the configuration before leaving so that, for instance, grid choice 644 // Save the toolbar set
636 // is preserved across instances. 645 cfg::HiddenToolbars.clear();
646
647 for (QToolBar* toolbar : findChildren<QToolBar*>())
648 {
649 if (toolbar->isHidden())
650 cfg::HiddenToolbars << toolbar->objectName();
651 }
652
653 // Save the configuration before leaving.
637 Config::Save(); 654 Config::Save();
638
639 ev->accept(); 655 ev->accept();
640 } 656 }
641 657
642 // ============================================================================= 658 // =============================================================================
643 // 659 //

mercurial