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
}
const auto serviceName = QStringLiteral("org.kde.dolphin-%1").arg(QCoreApplication::applicationPid());
if(!Dolphin::attachToExistingInstance(urls, true, GeneralSettings::splitView(), serviceName)) {
}
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);
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
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()) {
<label>Should the full path be shown in the title bar</label>
<default>false</default>
</entry>
<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>
<entry name="Version" type="Int">
<label>Internal version of Dolphin, containing 3 digits for major, minor, bugfix</label>
<default>0</default>
m_editableUrl(nullptr),
m_showFullPath(nullptr),
m_filterBar(nullptr),
m_editableUrl(nullptr),
m_showFullPath(nullptr),
m_filterBar(nullptr),
- m_showFullPathInTitlebar(nullptr)
+ m_showFullPathInTitlebar(nullptr),
+ m_openExternallyCalledFolderInNewTab(nullptr)
{
QFormLayout* topLayout = new QFormLayout(this);
{
QFormLayout* topLayout = new QFormLayout(this);
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);
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);
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_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()
}
StartupSettingsPage::~StartupSettingsPage()
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
settings->setShowFullPath(m_showFullPath->isChecked());
settings->setFilterBar(m_filterBar->isChecked());
settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked());
+ settings->setOpenExternallyCalledFolderInNewTab(m_openExternallyCalledFolderInNewTab->isChecked());
m_showFullPath->setChecked(GeneralSettings::showFullPath());
m_filterBar->setChecked(GeneralSettings::filterBar());
m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
m_showFullPath->setChecked(GeneralSettings::showFullPath());
m_filterBar->setChecked(GeneralSettings::filterBar());
m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar());
+ m_openExternallyCalledFolderInNewTab->setChecked(GeneralSettings::openExternallyCalledFolderInNewTab());
QCheckBox* m_showFullPath;
QCheckBox* m_filterBar;
QCheckBox* m_showFullPathInTitlebar;
QCheckBox* m_showFullPath;
QCheckBox* m_filterBar;
QCheckBox* m_showFullPathInTitlebar;
+ QCheckBox* m_openExternallyCalledFolderInNewTab;