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); | 46 | // Confirmations for all KDE applications | ||
47 | confirmLabelKde->setWordWrap(true); | 47 | QLabel *KDEConfirmations = new QLabel(xi18nc("@info", "<emphasis strong='true'>All KDE Applications</emphasis>")); | ||
48 | topLayout->addRow(KDEConfirmations); | ||||
49 | m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check In all KDE applications, confirm", | ||||
50 | "Moving files or folders to trash")); | ||||
51 | topLayout->addRow(i18n("Confirm:"), m_confirmMoveToTrash); | ||||
48 | 52 | | |||
49 | m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 53 | m_confirmEmptyTrash = new QCheckBox(i18nc("@option:check In all KDE applications, confirm", | ||
50 | "Moving files or folders to trash"), this); | 54 | "Emptying trash")); | ||
51 | m_confirmEmptyTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 55 | topLayout->addRow(QString(), m_confirmEmptyTrash); | ||
52 | "Emptying trash"), this); | 56 | | ||
53 | m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 57 | m_confirmDelete = new QCheckBox(i18nc("@option:check In all KDE applications, confirm", | ||
54 | "Deleting files or folders"), this); | 58 | "Deleting files or folders")); | ||
55 | m_confirmScriptExecution = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 59 | topLayout->addRow(QString(), m_confirmDelete); | ||
56 | "Executing scripts or desktop files"), this); | 60 | | ||
57 | 61 | | |||
58 | QLabel* confirmLabelDolphin = new QLabel(i18nc("@title:group", "Ask for confirmation when:"), this); | 62 | m_confirmScriptExecution = new QCheckBox(i18nc("@option:check In all KDE applications, confirm", | ||
59 | confirmLabelDolphin->setWordWrap(true); | 63 | "Executing scripts or desktop files")); | ||
60 | 64 | topLayout->addRow(QString(), m_confirmScriptExecution); | |||
61 | m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for confirmation when", | 65 | | ||
62 | "Closing Dolphin windows with multiple tabs"), this); | 66 | | ||
63 | 67 | topLayout->addItem(new QSpacerItem(0,12, QSizePolicy::Fixed, QSizePolicy::Fixed)); | |||
64 | topLayout->addWidget(confirmLabelKde); | 68 | | ||
65 | topLayout->addWidget(m_confirmMoveToTrash); | 69 | | ||
66 | topLayout->addWidget(m_confirmEmptyTrash); | 70 | // Confirmations only applying to Dolphin | ||
67 | topLayout->addWidget(m_confirmDelete); | 71 | QLabel *dolphinConfirmations = new QLabel(xi18nc("@info", "<emphasis strong='true'>Dolphin</emphasis>")); | ||
68 | topLayout->addWidget(m_confirmScriptExecution); | 72 | topLayout->addRow(dolphinConfirmations); | ||
69 | topLayout->addWidget(confirmLabelDolphin); | 73 | m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Confirm", | ||
70 | topLayout->addWidget(m_confirmClosingMultipleTabs); | 74 | "Closing windows with multiple tabs")); | ||
71 | topLayout->addStretch(); | 75 | topLayout->addRow(i18n("Confirm:"), m_confirmClosingMultipleTabs); | ||
72 | 76 | | |||
73 | loadSettings(); | 77 | loadSettings(); | ||
74 | 78 | | |||
75 | connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 79 | connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
76 | connect(m_confirmEmptyTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 80 | connect(m_confirmEmptyTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
77 | connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 81 | connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
78 | connect(m_confirmScriptExecution, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 82 | connect(m_confirmScriptExecution, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
79 | connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | 83 | connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed); | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |