+
+#ifdef HAVE_KDE
+ _nickToolBar = new KToolBar("NickToolBar", this, Qt::TopToolBarArea, false, true, true);
+#else
+ _nickToolBar = new QToolBar(this);
+ _nickToolBar->setObjectName("NickToolBar");
+#endif
+ _nickToolBar->setWindowTitle(tr("Nick Toolbar"));
+ _nickToolBar->setVisible(false); //default: not visible
+ addToolBar(_nickToolBar);
+
+ QtUi::toolBarActionProvider()->addActions(_nickToolBar, ToolBarActionProvider::NickToolBar);
+ _toolbarMenu->addAction(_nickToolBar->toggleViewAction());
+
+#ifdef Q_OS_MAC
+ QtUiSettings uiSettings;
+
+ bool visible = uiSettings.value("ShowMainToolBar", QVariant(true)).toBool();
+ _mainToolBar->setVisible(visible);
+ connect(_mainToolBar, SIGNAL(visibilityChanged(bool)), this, SLOT(saveMainToolBarStatus(bool)));
+#endif
+}
+
+void MainWin::saveMainToolBarStatus(bool enabled)
+{
+#ifdef Q_OS_MAC
+ QtUiSettings uiSettings;
+ uiSettings.setValue("ShowMainToolBar", enabled);
+#else
+ Q_UNUSED(enabled);
+#endif