diff options
Diffstat (limited to 'src/settings')
5 files changed, 35 insertions, 16 deletions
diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index 48fecb2d0..b29526d64 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -115,10 +115,6 @@ <label>Show a bar for easy pasting after a cut or copy was done using the selection mode bottom bar.</label> <default>true</default> </entry> - <entry name="UseTabForSwitchingSplitView" type="Bool"> - <label>Use tab for switching between right and left view</label> - <default>false</default> - </entry> <entry name="CloseSplitViewChoice" type="Enum"> <choices> <choice name="ActiveView" /> diff --git a/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.py b/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.py new file mode 100644 index 000000000..4a18ad094 --- /dev/null +++ b/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.py @@ -0,0 +1,27 @@ +#SPDX-FileCopyrightText: 2026 Felix Ernst <[email protected]> +#SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +import os +import sys +from pathlib import Path +import xml.etree.ElementTree as ET + +use_tab_setting_detected = False + +XDG_CONFIG_HOME = Path(os.getenv("XDG_CONFIG_HOME") or (Path.home() / ".config")) +custom_settings_file = XDG_CONFIG_HOME / "dolphinrc" +print(custom_settings_file) +if custom_settings_file.exists(): + with open(custom_settings_file, "r+") as f: + lines = [line for line in f if line.find("UseTabForSwitchingSplitView=true") >= 0] + if len(lines) > 0: + use_tab_setting_detected = True + +XDG_DATA_HOME = Path(os.getenv("XDG_DATA_HOME") or (Path.home() / ".local/share")) +custom_ui_file = XDG_DATA_HOME / "kxmlgui5/dolphin/dolphinui.rc" +if use_tab_setting_detected and custom_ui_file.exists(): + tree = ET.parse(custom_ui_file) + root = tree.getroot() + for actionProperties in root.iter("ActionProperties"): + ET.SubElement(actionProperties, "Action", {"name":"focus_inactive_split_view", "shortcut":"Ctrl+F3; Tab"}) + tree.write(custom_ui_file, encoding="utf-8") diff --git a/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.upd b/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.upd new file mode 100644 index 000000000..579eb233a --- /dev/null +++ b/src/settings/dolphin_tab_key_shortcut_for_focus_other_view.upd @@ -0,0 +1,8 @@ +#SPDX-FileCopyrightText: 2026 Felix Ernst <[email protected]> +#SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL + +#Configuration update for Dolphin +Version=6 + +Id=tab_key_shortcut_for_focus_other_view +Script=dolphin_tab_key_shortcut_for_focus_other_view.py,python3 diff --git a/src/settings/interface/folderstabssettingspage.cpp b/src/settings/interface/folderstabssettingspage.cpp index 10303258c..fa1b1b80f 100644 --- a/src/settings/interface/folderstabssettingspage.cpp +++ b/src/settings/interface/folderstabssettingspage.cpp @@ -44,7 +44,6 @@ FoldersTabsSettingsPage::FoldersTabsSettingsPage(QWidget *parent) , m_filterBar(nullptr) , m_showFullPathInTitlebar(nullptr) , m_openExternallyCalledFolderInNewTab(nullptr) - , m_useTabForSplitViewSwitch(nullptr) , m_closeSplitComboBox(nullptr) { QFormLayout *topLayout = new QFormLayout(this); @@ -160,10 +159,6 @@ FoldersTabsSettingsPage::FoldersTabsSettingsPage(QWidget *parent) closeSplitViewHLayout->addWidget(m_closeSplitComboBox); topLayout->addRow(i18nc("@title:group", "Split view: "), closeSplitViewWidget); - // 'Switch between panes of split views with tab key' - m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check split view panes", "Switch between views with Tab key")); - topLayout->addRow(QString(), m_useTabForSplitViewSwitch); - // 'Begin in split view mode' m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Open new windows in split view mode")); topLayout->addRow(QString(), m_splitView); @@ -182,8 +177,6 @@ FoldersTabsSettingsPage::FoldersTabsSettingsPage(QWidget *parent) connect(m_openExternallyCalledFolderInNewTab, &QCheckBox::toggled, this, &FoldersTabsSettingsPage::slotSettingsChanged); connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &FoldersTabsSettingsPage::slotSettingsChanged); - connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &FoldersTabsSettingsPage::changed); - connect(m_closeSplitComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &FoldersTabsSettingsPage::changed); connect(m_alwaysShowTabBar, &QCheckBox::toggled, this, &FoldersTabsSettingsPage::changed); @@ -203,8 +196,6 @@ void FoldersTabsSettingsPage::applySettings() { GeneralSettings *settings = GeneralSettings::self(); - settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); - settings->setCloseSplitViewChoice(m_closeSplitComboBox->currentIndex()); const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile)); @@ -322,8 +313,6 @@ void FoldersTabsSettingsPage::loadSettings() m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); m_openExternallyCalledFolderInNewTab->setChecked(GeneralSettings::openExternallyCalledFolderInNewTab()); - m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); - m_closeSplitComboBox->setCurrentIndex(GeneralSettings::closeSplitViewChoice()); m_alwaysShowTabBar->setChecked(GeneralSettings::alwaysShowTabBar()); diff --git a/src/settings/interface/folderstabssettingspage.h b/src/settings/interface/folderstabssettingspage.h index 690407b39..cf926e557 100644 --- a/src/settings/interface/folderstabssettingspage.h +++ b/src/settings/interface/folderstabssettingspage.h @@ -70,7 +70,6 @@ private: QCheckBox *m_filterBar; QCheckBox *m_showFullPathInTitlebar; QCheckBox *m_openExternallyCalledFolderInNewTab; - QCheckBox *m_useTabForSplitViewSwitch; QComboBox *m_closeSplitComboBox; }; |
