Wed, 10 Sep 2014 14:02:31 +0300
- now remembers what toolbars are enabled and what are disabled in config
src/mainWindow.cc | file | annotate | diff | comparison | revisions |
--- a/src/mainWindow.cc Tue Sep 09 02:42:21 2014 +0300 +++ b/src/mainWindow.cc Wed Sep 10 14:02:31 2014 +0300 @@ -58,6 +58,7 @@ CFGENTRY (Bool, ColorizeObjectsList, true) CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15") CFGENTRY (Bool, ListImplicitFiles, false) +CFGENTRY (List, HiddenToolbars, {}) EXTERN_CFGENTRY (List, RecentFiles) EXTERN_CFGENTRY (Bool, DrawAxes) EXTERN_CFGENTRY (String, MainColor) @@ -125,6 +126,14 @@ connect (ui->ringToolSegments, SIGNAL (valueChanged (int)), this, SLOT (circleToolSegmentsChanged())); circleToolSegmentsChanged(); // invoke it manually for initial label text + + for (QVariant const& toolbarname : cfg::HiddenToolbars) + { + QToolBar* toolbar = findChild<QToolBar*> (toolbarname.toString()); + + if (toolbar != null) + toolbar->hide(); + } } MainWindow::~MainWindow() @@ -632,10 +641,17 @@ return; } - // Save the configuration before leaving so that, for instance, grid choice - // is preserved across instances. + // Save the toolbar set + cfg::HiddenToolbars.clear(); + + for (QToolBar* toolbar : findChildren<QToolBar*>()) + { + if (toolbar->isHidden()) + cfg::HiddenToolbars << toolbar->objectName(); + } + + // Save the configuration before leaving. Config::Save(); - ev->accept(); }