mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
Confirmations setting: Add checkbox for ConfirmOpenManyFolders and ConfirmOpenManyTerminals
We have to special handle the values saved as it is interpreted by KMessageBox
This commit is contained in:
parent
1318f16fd7
commit
b45c57332f
|
@ -142,4 +142,14 @@
|
||||||
<emit signal="sortingChoiceChanged" />
|
<emit signal="sortingChoiceChanged" />
|
||||||
</entry>
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
|
<group name="Notification Messages">
|
||||||
|
<entry name="ConfirmOpenManyFolders" type="Bool">
|
||||||
|
<label>Ask for confirmation when opening many folders at once.</label>
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
|
<entry name="ConfirmOpenManyTerminals" type="Bool">
|
||||||
|
<label>Ask for confirmation when opening many terminals at once.</label>
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
|
</group>
|
||||||
</kcfg>
|
</kcfg>
|
||||||
|
|
|
@ -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);
|
new QCheckBox(i18nc("@option:check Ask for confirmation when", "Closing windows with a program running in the Terminal panel"), this);
|
||||||
#endif
|
#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();
|
QHBoxLayout *executableScriptLayout = new QHBoxLayout();
|
||||||
QLabel *executableScriptLabel = new QLabel(i18nc("@title:group", "When opening an executable file:"), this);
|
QLabel *executableScriptLabel = new QLabel(i18nc("@title:group", "When opening an executable file:"), this);
|
||||||
confirmLabelKde->setWordWrap(true);
|
executableScriptLabel->setWordWrap(true);
|
||||||
executableScriptLayout->addWidget(executableScriptLabel);
|
executableScriptLayout->addWidget(executableScriptLabel);
|
||||||
|
|
||||||
m_confirmScriptExecution = new QComboBox(this);
|
m_confirmScriptExecution = new QComboBox(this);
|
||||||
|
@ -81,6 +84,9 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget *parent)
|
||||||
topLayout->addWidget(m_confirmClosingTerminalRunningProgram);
|
topLayout->addWidget(m_confirmClosingTerminalRunningProgram);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
topLayout->addWidget(m_confirmOpenManyFolders);
|
||||||
|
topLayout->addWidget(m_confirmOpenManyTerminals);
|
||||||
|
|
||||||
topLayout->addSpacing(Dolphin::VERTICAL_SPACER_HEIGHT);
|
topLayout->addSpacing(Dolphin::VERTICAL_SPACER_HEIGHT);
|
||||||
topLayout->addLayout(executableScriptLayout);
|
topLayout->addLayout(executableScriptLayout);
|
||||||
|
|
||||||
|
@ -93,6 +99,8 @@ ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget *parent)
|
||||||
connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
|
connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
|
||||||
connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfirmationsSettingsPage::changed);
|
connect(m_confirmScriptExecution, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConfirmationsSettingsPage::changed);
|
||||||
connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, 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
|
#if HAVE_TERMINAL
|
||||||
connect(m_confirmClosingTerminalRunningProgram, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
|
connect(m_confirmClosingTerminalRunningProgram, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
|
||||||
|
@ -128,6 +136,8 @@ void ConfirmationsSettingsPage::applySettings()
|
||||||
|
|
||||||
GeneralSettings *settings = GeneralSettings::self();
|
GeneralSettings *settings = GeneralSettings::self();
|
||||||
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
|
settings->setConfirmClosingMultipleTabs(m_confirmClosingMultipleTabs->isChecked());
|
||||||
|
settings->setConfirmOpenManyFolders(!m_confirmOpenManyFolders->isChecked());
|
||||||
|
settings->setConfirmOpenManyTerminals(!m_confirmOpenManyTerminals->isChecked());
|
||||||
|
|
||||||
#if HAVE_TERMINAL
|
#if HAVE_TERMINAL
|
||||||
settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked());
|
settings->setConfirmClosingTerminalRunningProgram(m_confirmClosingTerminalRunningProgram->isChecked());
|
||||||
|
@ -169,6 +179,12 @@ void ConfirmationsSettingsPage::loadSettings()
|
||||||
|
|
||||||
m_confirmClosingMultipleTabs->setChecked(GeneralSettings::confirmClosingMultipleTabs());
|
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
|
#if HAVE_TERMINAL
|
||||||
m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram());
|
m_confirmClosingTerminalRunningProgram->setChecked(GeneralSettings::confirmClosingTerminalRunningProgram());
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,6 +43,8 @@ private:
|
||||||
|
|
||||||
QCheckBox *m_confirmClosingMultipleTabs;
|
QCheckBox *m_confirmClosingMultipleTabs;
|
||||||
QComboBox *m_confirmScriptExecution;
|
QComboBox *m_confirmScriptExecution;
|
||||||
|
QCheckBox *m_confirmOpenManyFolders;
|
||||||
|
QCheckBox *m_confirmOpenManyTerminals;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue