diff options
| author | Méven Car <[email protected]> | 2023-09-10 15:24:39 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-09-10 15:24:39 +0200 |
| commit | 4cbeb81b2b8e2d37c93cda4d88787e08e0658291 (patch) | |
| tree | 013a28405e8011fd5a5a5c514aaf3daa395a42b1 /src/settings | |
| parent | 0ed26df6a9074b71ae247017e1080b2285b73438 (diff) | |
| parent | 5c33e0211ff09f37adb5b48c59cf15b67c0059dc (diff) | |
Merge remote-tracking branch 'origin/master' into kf6
Diffstat (limited to 'src/settings')
| -rw-r--r-- | src/settings/contextmenu/contextmenusettingspage.cpp | 14 | ||||
| -rw-r--r-- | src/settings/dolphin_contextmenusettings.kcfg | 4 | ||||
| -rw-r--r-- | src/settings/dolphin_generalsettings.kcfg | 10 | ||||
| -rw-r--r-- | src/settings/dolphinsettingsdialog.cpp | 13 | ||||
| -rw-r--r-- | src/settings/interface/confirmationssettingspage.cpp | 18 | ||||
| -rw-r--r-- | src/settings/interface/confirmationssettingspage.h | 2 | ||||
| -rw-r--r-- | src/settings/viewmodes/viewsettingstab.h | 3 | ||||
| -rw-r--r-- | src/settings/viewpropertiesdialog.cpp | 8 |
8 files changed, 38 insertions, 34 deletions
diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp index 5e755d249..1c83e477e 100644 --- a/src/settings/contextmenu/contextmenusettingspage.cpp +++ b/src/settings/contextmenu/contextmenusettingspage.cpp @@ -7,7 +7,6 @@ #include "contextmenusettingspage.h" #include "dolphin_contextmenusettings.h" -#include "dolphin_generalsettings.h" #include "dolphin_versioncontrolsettings.h" #include "global.h" #include "settings/servicemodel.h" @@ -118,6 +117,8 @@ bool ContextMenuSettingsPage::entryVisible(const QString &id) return ContextMenuSettings::showOpenInNewTab(); } else if (id == "open_in_new_window") { return ContextMenuSettings::showOpenInNewWindow(); + } else if (id == "open_in_split_view") { + return ContextMenuSettings::showOpenInSplitView(); } else if (id == "copy_location") { return ContextMenuSettings::showCopyLocation(); } else if (id == "duplicate") { @@ -144,6 +145,8 @@ void ContextMenuSettingsPage::setEntryVisible(const QString &id, bool visible) ContextMenuSettings::setShowOpenInNewTab(visible); } else if (id == "open_in_new_window") { ContextMenuSettings::setShowOpenInNewWindow(visible); + } else if (id == "open_in_split_view") { + return ContextMenuSettings::setShowOpenInSplitView(visible); } else if (id == "copy_location") { ContextMenuSettings::setShowCopyLocation(visible); } else if (id == "duplicate") { @@ -201,24 +204,15 @@ void ContextMenuSettingsPage::applySettings() VersionControlSettings::self()->save(); if (!laterSelected) { -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) KMessageBox::ButtonCode promptRestart = KMessageBox::questionTwoActions(window(), -#else - KMessageBox::ButtonCode promptRestart = - KMessageBox::questionYesNo(window(), -#endif i18nc("@info", "Dolphin must be restarted to apply the " "updated version control system settings."), i18nc("@info", "Restart now?"), KGuiItem(QApplication::translate("KStandardGuiItem", "&Restart"), QStringLiteral("dialog-restart")), KGuiItem(QApplication::translate("KStandardGuiItem", "&Later"), QStringLiteral("dialog-later"))); -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) if (promptRestart == KMessageBox::ButtonCode::PrimaryAction) { -#else - if (promptRestart == KMessageBox::ButtonCode::Yes) { -#endif Dolphin::openNewWindow(); qApp->quit(); } else { diff --git a/src/settings/dolphin_contextmenusettings.kcfg b/src/settings/dolphin_contextmenusettings.kcfg index 63ca079af..6e45d9bcd 100644 --- a/src/settings/dolphin_contextmenusettings.kcfg +++ b/src/settings/dolphin_contextmenusettings.kcfg @@ -30,6 +30,10 @@ <label>Show 'Open in New Window' in context menu.</label> <default>true</default> </entry> + <entry name="ShowOpenInSplitView" type="Bool"> + <label>Show 'Open In Split View' in context menu.</label> + <default>true</default> + </entry> <entry name="ShowCopyLocation" type="Bool"> <label>Show 'Copy Location' in context menu.</label> <default>true</default> diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index aedc24ea4..2abd7da49 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -142,4 +142,14 @@ <emit signal="sortingChoiceChanged" /> </entry> </group> + <group name="Notification Messages"> + <entry name="ConfirmOpenManyFolders" type="Bool"> + <label>Ask for confirmation when opening many folders at once.</label> + <default>true</default> + </entry> + <entry name="ConfirmOpenManyTerminals" type="Bool"> + <label>Ask for confirmation when opening many terminals at once.</label> + <default>true</default> + </entry> + </group> </kcfg> diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp index 0d2c76e3c..8c41794e9 100644 --- a/src/settings/dolphinsettingsdialog.cpp +++ b/src/settings/dolphinsettingsdialog.cpp @@ -68,6 +68,7 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K QStringLiteral("view_mode"), QStringLiteral("open_in_new_tab"), QStringLiteral("open_in_new_window"), + QStringLiteral("open_in_split_view"), QStringLiteral("copy_location"), QStringLiteral("duplicate"), QStringLiteral("open_terminal_here"), @@ -160,29 +161,17 @@ void DolphinSettingsDialog::closeEvent(QCloseEvent *event) return; } -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) const auto response = KMessageBox::warningTwoActionsCancel(this, -#else - const auto response = KMessageBox::warningYesNoCancel(this, -#endif i18n("You have unsaved changes. Do you want to apply the changes or discard them?"), i18n("Warning"), KStandardGuiItem::save(), KStandardGuiItem::discard(), KStandardGuiItem::cancel()); switch (response) { -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) case KMessageBox::PrimaryAction: -#else - case KMessageBox::Yes: -#endif applySettings(); Q_FALLTHROUGH(); -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) case KMessageBox::SecondaryAction: -#else - case KMessageBox::No: -#endif event->accept(); break; case KMessageBox::Cancel: diff --git a/src/settings/interface/confirmationssettingspage.cpp b/src/settings/interface/confirmationssettingspage.cpp index 61c3a14b6..5f1abb4cd 100644 --- a/src/settings/interface/confirmationssettingspage.cpp +++ b/src/settings/interface/confirmationssettingspage.cpp @@ -60,9 +60,12 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget *parent) new QCheckBox(i18nc("@option:check Ask for confirmation when", "Closing windows with a program running in the Terminal panel"), this); #endif + m_confirmOpenManyFolders = new QCheckBox(i18nc("@option:check Ask for confirmation in Dolphin when", "Opening many folders at once"), this); + m_confirmOpenManyTerminals = new QCheckBox(i18nc("@option:check Ask for confirmation in Dolphin when", "Opening many terminals at once"), this); + QHBoxLayout *executableScriptLayout = new QHBoxLayout(); QLabel *executableScriptLabel = new QLabel(i18nc("@title:group", "When opening an executable file:"), this); - confirmLabelKde->setWordWrap(true); + executableScriptLabel->setWordWrap(true); executableScriptLayout->addWidget(executableScriptLabel); m_confirmScriptExecution = new QComboBox(this); @@ -81,6 +84,9 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget *parent) topLayout->addWidget(m_confirmClosingTerminalRunningProgram); #endif + topLayout->addWidget(m_confirmOpenManyFolders); + topLayout->addWidget(m_confirmOpenManyTerminals); + topLayout->addSpacing(Dolphin::VERTICAL_SPACER_HEIGHT); topLayout->addLayout(executableScriptLayout); @@ -93,6 +99,8 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget *parent) connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfirmationsSettingsPage::changed); connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); + connect(m_confirmOpenManyFolders, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); + connect(m_confirmOpenManyTerminals, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); #if HAVE_TERMINAL connect(m_confirmClosingTerminalRunningProgram, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); @@ -128,6 +136,8 @@ void ConfirmationsSettingsPage::applySettings() GeneralSettings *settings = GeneralSettings::self(); settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked()); + settings->setConfirmOpenManyFolders(m_confirmOpenManyFolders->isChecked()); + settings->setConfirmOpenManyTerminals(m_confirmOpenManyTerminals->isChecked()); #if HAVE_TERMINAL settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked()); @@ -169,6 +179,12 @@ void ConfirmationsSettingsPage::loadSettings() m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs()); + // KMessageBox for its dontshowAgain settings are true => Yes, false => No, No value => ask + // we use default = false to not write false into the rc file, but have no value + // the UI has inversed meaning compared to the interpretation + m_confirmOpenManyFolders->setChecked(GeneralSettings::confirmOpenManyFolders()); + m_confirmOpenManyTerminals->setChecked(GeneralSettings::confirmOpenManyTerminals()); + #if HAVE_TERMINAL m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram()); #endif diff --git a/src/settings/interface/confirmationssettingspage.h b/src/settings/interface/confirmationssettingspage.h index 56dd1a78c..d9413d754 100644 --- a/src/settings/interface/confirmationssettingspage.h +++ b/src/settings/interface/confirmationssettingspage.h @@ -43,6 +43,8 @@ private: QCheckBox *m_confirmClosingMultipleTabs; QComboBox *m_confirmScriptExecution; + QCheckBox *m_confirmOpenManyFolders; + QCheckBox *m_confirmOpenManyTerminals; }; #endif diff --git a/src/settings/viewmodes/viewsettingstab.h b/src/settings/viewmodes/viewsettingstab.h index fd4cc85a7..5181e8018 100644 --- a/src/settings/viewmodes/viewsettingstab.h +++ b/src/settings/viewmodes/viewsettingstab.h @@ -32,9 +32,6 @@ public: void applySettings() override; void restoreDefaults() override; -Q_SIGNALS: - void changed(); - private Q_SLOTS: void slotDefaultSliderMoved(int value); diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index f7bd754b1..c630f8113 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -333,11 +333,7 @@ void ViewPropertiesDialog::applyViewProperties() const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked(); if (applyToSubFolders) { const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?")); -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) if (KMessageBox::questionTwoActions(this, text, {}, KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) { -#else - if (KMessageBox::questionYesNo(this, text, {}, KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::No) { -#endif return; } @@ -367,11 +363,7 @@ void ViewPropertiesDialog::applyViewProperties() if (applyToAllFolders) { const QString text(i18nc("@info", "The view properties of all folders will be changed. Do you want to continue?")); -#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0) if (KMessageBox::questionTwoActions(this, text, {}, KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::SecondaryAction) { -#else - if (KMessageBox::questionYesNo(this, text, {}, KStandardGuiItem::cont(), KStandardGuiItem::cancel()) == KMessageBox::No) { -#endif return; } |
