Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/confirmationssettingspage.cpp
Show All 19 Lines | |||||
20 | #include "confirmationssettingspage.h" | 20 | #include "confirmationssettingspage.h" | ||
21 | 21 | | |||
22 | #include "dolphin_generalsettings.h" | 22 | #include "dolphin_generalsettings.h" | ||
23 | 23 | | |||
24 | #include <KLocalizedString> | 24 | #include <KLocalizedString> | ||
25 | 25 | | |||
26 | #include <QCheckBox> | 26 | #include <QCheckBox> | ||
27 | #include <QLabel> | 27 | #include <QLabel> | ||
28 | #include <QVBoxLayout> | 28 | #include <QFormLayout> | ||
29 | 29 | | |||
30 | namespace { | 30 | namespace { | ||
31 | const bool ConfirmEmptyTrash = true; | 31 | const bool ConfirmEmptyTrash = true; | ||
32 | const bool ConfirmTrash = false; | 32 | const bool ConfirmTrash = false; | ||
33 | const bool ConfirmDelete = true; | 33 | const bool ConfirmDelete = true; | ||
34 | const bool ConfirmScriptExecution = true; | 34 | const bool ConfirmScriptExecution = true; | ||
35 | } | 35 | } | ||
36 | 36 | | |||
37 | ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) : | 37 | ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) : | ||
38 | SettingsPageBase(parent), | 38 | SettingsPageBase(parent), | ||
39 | m_confirmMoveToTrash(nullptr), | 39 | m_confirmMoveToTrash(nullptr), | ||
40 | m_confirmEmptyTrash(nullptr), | 40 | m_confirmEmptyTrash(nullptr), | ||
41 | m_confirmDelete(nullptr), | 41 | m_confirmDelete(nullptr), | ||
42 | m_confirmClosingMultipleTabs(nullptr) | 42 | m_confirmClosingMultipleTabs(nullptr) | ||
43 | { | 43 | { | ||
44 | QVBoxLayout* topLayout = new QVBoxLayout(this); | 44 | QFormLayout* topLayout = new QFormLayout(this); | ||
45 | 45 | | |||
46 | QLabel* confirmLabelKde = new QLabel(i18nc("@title:group", "Ask for confirmation in all KDE applications when:"), this); | | |||
47 | confirmLabelKde->setWordWrap(true); | | |||
48 | 46 | | |||
49 | m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 47 | // Note: these apply to all KDE Apps | ||
50 | "Moving files or folders to trash"), this); | 48 | m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check confirm", | ||
51 | m_confirmEmptyTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 49 | "Moving files or folders to trash")); | ||
52 | "Emptying trash"), this); | 50 | topLayout->addRow(i18n("Confirm:"), m_confirmMoveToTrash); | ||
53 | m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 51 | | ||
54 | "Deleting files or folders"), this); | 52 | m_confirmEmptyTrash = new QCheckBox(i18nc("@option:check confirm", | ||
55 | m_confirmScriptExecution = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 53 | "Emptying trash")); | ||
56 | "Executing scripts or desktop files"), this); | 54 | topLayout->addRow(QString(), m_confirmEmptyTrash); | ||
57 | 55 | | |||
58 | QLabel* confirmLabelDolphin = new QLabel(i18nc("@title:group", "Ask for confirmation when:"), this); | 56 | m_confirmDelete = new QCheckBox(i18nc("@option:check confirm", | ||
59 | confirmLabelDolphin->setWordWrap(true); | 57 | "Deleting files or folders")); | ||
60 | 58 | topLayout->addRow(QString(), m_confirmDelete); | |||
61 | m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 59 | | ||
62 | "Closing Dolphin windows with multiple tabs"), this); | 60 | m_confirmScriptExecution = new QCheckBox(i18nc("@option:check confirm", | ||
63 | 61 | "Executing scripts or desktop files")); | |||
64 | topLayout->addWidget(confirmLabelKde); | 62 | topLayout->addRow(QString(), m_confirmScriptExecution); | ||
65 | topLayout->addWidget(m_confirmMoveToTrash); | 63 | | ||
66 | topLayout->addWidget(m_confirmEmptyTrash); | 64 | // Note: this only applies to Dolphin | ||
67 | topLayout->addWidget(m_confirmDelete); | 65 | m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Confirm", | ||
68 | topLayout->addWidget(m_confirmScriptExecution); | 66 | "Closing Dolphin when multiple tabs are open")); | ||
69 | topLayout->addWidget(confirmLabelDolphin); | 67 | topLayout->addRow(QString(), m_confirmClosingMultipleTabs); | ||
70 | topLayout->addWidget(m_confirmClosingMultipleTabs); | | |||
71 | topLayout->addStretch(); | | |||
72 | 68 | | |||
73 | loadSettings(); | 69 | loadSettings(); | ||
74 | 70 | | |||
75 | connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 71 | connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
76 | connect(m_confirmEmptyTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 72 | connect(m_confirmEmptyTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
77 | connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 73 | connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
78 | connect(m_confirmScriptExecution, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 74 | connect(m_confirmScriptExecution, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
79 | connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 75 | connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |