diff options
| author | Alexander Saoutkin <[email protected]> | 2019-06-23 13:22:41 +0200 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2019-06-23 13:27:25 +0200 |
| commit | 2647dc47d4ba636e4d1dc350bc48c7983ba0fc93 (patch) | |
| tree | cf747956bd023d64b8f657b21023381e28dc65e0 /src | |
| parent | 0a06b1764cd309e4ec5805eb78ac77a9ca0de4fd (diff) | |
Adding option to open externally called folder in a new tab
Summary:
Adds an option to open externally called folder in a new tab.
By default this option is enabled
Test Plan:
If option selected:
1. All valid arguments passed to Dolphin should be opened in tabs of an instance(s) (if it exists). Duplicate tabs just change activation to current tab.
If option not selected:
1. All calls to Dolphin result in a new instance being opened
This option does not require Dolphin to be restarted to take effect.
Reviewers: #dolphin, elvisangelaccio, ngraham
Reviewed By: #dolphin, ngraham
Subscribers: broulik, ngraham, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D21736
Diffstat (limited to 'src')
| -rw-r--r-- | src/dbusinterface.cpp | 2 | ||||
| -rw-r--r-- | src/global.cpp | 2 | ||||
| -rw-r--r-- | src/settings/dolphin_generalsettings.kcfg | 4 | ||||
| -rw-r--r-- | src/settings/startup/startupsettingspage.cpp | 9 | ||||
| -rw-r--r-- | src/settings/startup/startupsettingspage.h | 1 |
5 files changed, 14 insertions, 4 deletions
diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index 4e24354ab..15016d2e0 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -59,7 +59,7 @@ void DBusInterface::ShowItems(const QStringList& uriList, const QString& startUp } const auto serviceName = QStringLiteral("org.kde.dolphin-%1").arg(QCoreApplication::applicationPid()); if(!Dolphin::attachToExistingInstance(urls, true, GeneralSettings::splitView(), serviceName)) { - Dolphin::openNewWindow(urls); + Dolphin::openNewWindow(urls, nullptr, Dolphin::OpenNewWindowFlag::Select); }; } diff --git a/src/global.cpp b/src/global.cpp index 42044c97d..4547faced 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -73,7 +73,7 @@ void Dolphin::openNewWindow(const QList<QUrl> &urls, QWidget *window, const Open bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFiles, bool splitView, const QString& preferredService) { // TODO: once Wayland clients can raise or activate themselves remove check from conditional - if (KWindowSystem::isPlatformWayland() || inputUrls.isEmpty()) { + if (KWindowSystem::isPlatformWayland() || inputUrls.isEmpty() || !GeneralSettings::openExternallyCalledFolderInNewTab()) { return false; } diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index 5a6bba06b..5a7bb1a01 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -26,6 +26,10 @@ <label>Should the full path be shown in the title bar</label> <default>false</default> </entry> + <entry name="OpenExternallyCalledFolderInNewTab" type="Bool"> + <label>Should an externally called folder open in a new tab in an existing Dolphin instance</label> + <default>true</default> + </entry> <entry name="Version" type="Int"> <label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label> <default>0</default> diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 23d8731d4..d7d5fba4c 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -43,7 +43,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : m_editableUrl(nullptr), m_showFullPath(nullptr), m_filterBar(nullptr), - m_showFullPathInTitlebar(nullptr) + m_showFullPathInTitlebar(nullptr), + m_openExternallyCalledFolderInNewTab(nullptr) { QFormLayout* topLayout = new QFormLayout(this); @@ -100,6 +101,8 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : topLayout->addRow(QString(), m_filterBar); m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar")); topLayout->addRow(QString(), m_showFullPathInTitlebar); + m_openExternallyCalledFolderInNewTab = new QCheckBox(i18nc("@option:check Startup Settings", "Open new folders in tabs")); + topLayout->addRow(QString(), m_openExternallyCalledFolderInNewTab); loadSettings(); @@ -110,6 +113,7 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : connect(m_showFullPath, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); connect(m_filterBar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); + connect(m_openExternallyCalledFolderInNewTab, &QCheckBox::toggled, this, &StartupSettingsPage::slotSettingsChanged); } StartupSettingsPage::~StartupSettingsPage() @@ -133,7 +137,7 @@ void StartupSettingsPage::applySettings() settings->setShowFullPath(m_showFullPath->isChecked()); settings->setFilterBar(m_filterBar->isChecked()); settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked()); - + settings->setOpenExternallyCalledFolderInNewTab(m_openExternallyCalledFolderInNewTab->isChecked()); settings->save(); } @@ -183,4 +187,5 @@ void StartupSettingsPage::loadSettings() m_showFullPath->setChecked(GeneralSettings::showFullPath()); m_filterBar->setChecked(GeneralSettings::filterBar()); m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); + m_openExternallyCalledFolderInNewTab->setChecked(GeneralSettings::openExternallyCalledFolderInNewTab()); } diff --git a/src/settings/startup/startupsettingspage.h b/src/settings/startup/startupsettingspage.h index e06b65697..a5e0b236f 100644 --- a/src/settings/startup/startupsettingspage.h +++ b/src/settings/startup/startupsettingspage.h @@ -64,6 +64,7 @@ private: QCheckBox* m_showFullPath; QCheckBox* m_filterBar; QCheckBox* m_showFullPathInTitlebar; + QCheckBox* m_openExternallyCalledFolderInNewTab; }; #endif |
