- const KUrl url = activeViewContainer()->url();
- m_settingsDialog = new DolphinSettingsDialog(url, this);
- m_settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
- m_settingsDialog->show();
- } else {
- m_settingsDialog->raise();
- }
-}
-
-void DolphinMainWindow::setActiveTab(int index)
-{
- Q_ASSERT(index >= 0);
- Q_ASSERT(index < m_viewTab.count());
- if (index == m_tabIndex) {
- return;
- }
-
- // hide current tab content
- ViewTab& hiddenTab = m_viewTab[m_tabIndex];
- hiddenTab.isPrimaryViewActive = hiddenTab.primaryView->isActive();
- hiddenTab.primaryView->setActive(false);
- if (hiddenTab.secondaryView) {
- hiddenTab.secondaryView->setActive(false);
- }
- QSplitter* splitter = m_viewTab[m_tabIndex].splitter;
- splitter->hide();
- m_centralWidgetLayout->removeWidget(splitter);
-
- // show active tab content
- m_tabIndex = index;
-
- ViewTab& viewTab = m_viewTab[index];
- m_centralWidgetLayout->addWidget(viewTab.splitter, 1);
- viewTab.primaryView->show();
- if (viewTab.secondaryView) {
- viewTab.secondaryView->show();
- }
- viewTab.splitter->show();
-
- setActiveViewContainer(viewTab.isPrimaryViewActive ? viewTab.primaryView :
- viewTab.secondaryView);
-}
-
-void DolphinMainWindow::closeTab()
-{
- closeTab(m_tabBar->currentIndex());
-}
-
-void DolphinMainWindow::closeTab(int index)
-{
- Q_ASSERT(index >= 0);
- Q_ASSERT(index < m_viewTab.count());
- if (m_viewTab.count() == 1) {
- // the last tab may never get closed
- return;
- }
-
- if (index == m_tabIndex) {
- // The tab that should be closed is the active tab. Activate the
- // previous tab before closing the tab.
- m_tabBar->setCurrentIndex((index > 0) ? index - 1 : 1);
- }
- rememberClosedTab(index);
-
- // delete tab
- m_viewTab[index].primaryView->deleteLater();
- if (m_viewTab[index].secondaryView) {
- m_viewTab[index].secondaryView->deleteLater();
- }
- m_viewTab[index].splitter->deleteLater();
- m_viewTab.erase(m_viewTab.begin() + index);
-
- m_tabBar->blockSignals(true);
- m_tabBar->removeTab(index);
-
- if (m_tabIndex > index) {
- m_tabIndex--;
- Q_ASSERT(m_tabIndex >= 0);
- }
-
- // if only one tab is left, also remove the tab entry so that
- // closing the last tab is not possible
- if (m_viewTab.count() == 1) {
- m_tabBar->removeTab(0);
- actionCollection()->action("close_tab")->setEnabled(false);
+ DolphinViewContainer* container = activeViewContainer();
+ container->view()->writeSettings();
+
+ const QUrl url = container->url();
+ DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
+ connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews);
+ settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
+ settingsDialog->show();
+ m_settingsDialog = settingsDialog;