void DolphinMainWindow::openNewActivatedTab()
{
+ // keep browsers compatibility, new tab is always after last one
+ auto openNewTabAfterLastTabConfigured = GeneralSettings::openNewTabAfterLastTab();
+ GeneralSettings::setOpenNewTabAfterLastTab(true);
m_tabWidget->openNewActivatedTab();
+ GeneralSettings::setOpenNewTabAfterLastTab(openNewTabAfterLastTabConfigured);
}
void DolphinMainWindow::addToPlaces()
}
}
-void DolphinMainWindow::openNewTab(const QUrl& url, DolphinTabWidget::TabPlacement tabPlacement)
+void DolphinMainWindow::openNewTab(const QUrl& url)
{
- m_tabWidget->openNewTab(url, QUrl(), tabPlacement);
-}
-
-void DolphinMainWindow::openNewTabAfterCurrentTab(const QUrl& url)
-{
- m_tabWidget->openNewTab(url, QUrl(), DolphinTabWidget::AfterCurrentTab);
-}
-
-void DolphinMainWindow::openNewTabAfterLastTab(const QUrl& url)
-{
- m_tabWidget->openNewTab(url, QUrl(), DolphinTabWidget::AfterLastTab);
+ m_tabWidget->openNewTab(url, QUrl());
}
void DolphinMainWindow::openInNewTab()
for (const KFileItem& item : list) {
const QUrl& url = DolphinView::openItemAsFolderUrl(item);
if (!url.isEmpty()) {
- openNewTabAfterCurrentTab(url);
+ openNewTab(url);
tabCreated = true;
}
}
// if no new tab has been created from the selection
// open the current directory in a new tab
if (!tabCreated) {
- openNewTabAfterCurrentTab(m_activeViewContainer->url());
+ openNewTab(m_activeViewContainer->url());
}
}
{
if (action) {
const KUrlNavigator *urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
- openNewTabAfterCurrentTab(urlNavigator->locationUrl(action->data().value<int>()));
+ openNewTab(urlNavigator->locationUrl(action->data().value<int>()));
}
}
void DolphinMainWindow::toggleSplitView()
{
DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
- tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled());
+ tabPage->setSplitViewEnabled(!tabPage->splitViewEnabled(), WithAnimation);
updateViewActions();
}
void DolphinMainWindow::toggleSplitStash()
{
DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
- tabPage->setSplitViewEnabled(false);
- tabPage->setSplitViewEnabled(true, QUrl("stash:/"));
+ tabPage->setSplitViewEnabled(false, WithAnimation);
+ tabPage->setSplitViewEnabled(true, WithAnimation, QUrl("stash:/"));
}
void DolphinMainWindow::reloadView()
{
const KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
const int index = urlNavigator->historyIndex() + 1;
- openNewTabAfterCurrentTab(urlNavigator->locationUrl(index));
+ openNewTab(urlNavigator->locationUrl(index));
}
void DolphinMainWindow::goForwardInNewTab()
{
const KUrlNavigator* urlNavigator = activeViewContainer()->urlNavigatorInternalWithHistory();
const int index = urlNavigator->historyIndex() - 1;
- openNewTabAfterCurrentTab(urlNavigator->locationUrl(index));
+ openNewTab(urlNavigator->locationUrl(index));
}
void DolphinMainWindow::goUpInNewTab()
{
const QUrl currentUrl = activeViewContainer()->urlNavigator()->locationUrl();
- openNewTabAfterCurrentTab(KIO::upUrl(currentUrl));
+ openNewTab(KIO::upUrl(currentUrl));
}
void DolphinMainWindow::goHomeInNewTab()
{
- openNewTabAfterCurrentTab(Dolphin::homeUrl());
+ openNewTab(Dolphin::homeUrl());
}
void DolphinMainWindow::compareFiles()
break;
case DolphinContextMenu::OpenParentFolderInNewTab:
- openNewTabAfterLastTab(KIO::upUrl(item.url()));
+ openNewTab(KIO::upUrl(item.url()));
break;
case DolphinContextMenu::None:
connect(foldersPanel, &FoldersPanel::folderActivated,
this, &DolphinMainWindow::changeUrl);
connect(foldersPanel, &FoldersPanel::folderMiddleClicked,
- this, &DolphinMainWindow::openNewTabAfterCurrentTab);
+ this, &DolphinMainWindow::openNewTab);
connect(foldersPanel, &FoldersPanel::errorMessage,
this, &DolphinMainWindow::showErrorMessage);
placesDock->setWidget(m_placesPanel);
QAction *placesAction = placesDock->toggleViewAction();
- createPanelAction(QIcon::fromTheme(QStringLiteral("bookmarks")), Qt::Key_F9, placesAction, QStringLiteral("show_places_panel"));
+ createPanelAction(QIcon::fromTheme(QStringLiteral("compass")), Qt::Key_F9, placesAction, QStringLiteral("show_places_panel"));
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
connect(m_placesPanel, &PlacesPanel::placeActivated,
this, &DolphinMainWindow::slotPlaceActivated);
connect(m_placesPanel, &PlacesPanel::placeMiddleClicked,
- this, &DolphinMainWindow::openNewTabAfterCurrentTab);
+ this, &DolphinMainWindow::openNewTab);
connect(m_placesPanel, &PlacesPanel::errorMessage,
this, &DolphinMainWindow::showErrorMessage);
connect(this, &DolphinMainWindow::urlChanged,
// The startup settings have been changed by the user (see bug #254947).
// Synchronize the split-view setting with the active view:
const bool splitView = GeneralSettings::splitView();
- m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView);
+ m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView, WithAnimation);
updateSplitAction();
updateWindowTitle();
}
connect(navigator, &KUrlNavigator::editableStateChanged,
this, &DolphinMainWindow::slotEditableStateChanged);
connect(navigator, &KUrlNavigator::tabRequested,
- this, &DolphinMainWindow::openNewTabAfterLastTab);
+ this, &DolphinMainWindow::openNewTab);
disconnect(m_updateHistoryConnection);
m_updateHistoryConnection = connect(