Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/behaviorsettingspage.cpp
Show All 30 Lines | |||||
31 | #include <QRadioButton> | 31 | #include <QRadioButton> | ||
32 | #include <QSpacerItem> | 32 | #include <QSpacerItem> | ||
33 | 33 | | |||
34 | BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) : | 34 | BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) : | ||
35 | SettingsPageBase(parent), | 35 | SettingsPageBase(parent), | ||
36 | m_url(url), | 36 | m_url(url), | ||
37 | m_localViewProps(nullptr), | 37 | m_localViewProps(nullptr), | ||
38 | m_globalViewProps(nullptr), | 38 | m_globalViewProps(nullptr), | ||
39 | m_showFullPath(nullptr), | ||||
40 | m_showFullPathInTitlebar(nullptr), | ||||
39 | m_showToolTips(nullptr), | 41 | m_showToolTips(nullptr), | ||
40 | m_showSelectionToggle(nullptr), | 42 | m_showSelectionToggle(nullptr), | ||
41 | m_naturalSorting(nullptr), | 43 | m_naturalSorting(nullptr), | ||
42 | m_caseSensitiveSorting(nullptr), | 44 | m_caseSensitiveSorting(nullptr), | ||
43 | m_caseInsensitiveSorting(nullptr), | 45 | m_caseInsensitiveSorting(nullptr), | ||
44 | m_renameInline(nullptr), | 46 | m_renameInline(nullptr), | ||
45 | m_useTabForSplitViewSwitch(nullptr) | 47 | m_useTabForSplitViewSwitch(nullptr) | ||
46 | { | 48 | { | ||
47 | QFormLayout* topLayout = new QFormLayout(this); | 49 | QFormLayout* topLayout = new QFormLayout(this); | ||
48 | 50 | | |||
49 | 51 | | |||
50 | // View properties | 52 | // View properties | ||
51 | m_globalViewProps = new QRadioButton(i18nc("@option:radio", "Use common display style for all folders")); | 53 | m_globalViewProps = new QRadioButton(i18nc("@option:radio", "Use common display style for all folders")); | ||
52 | m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember display style for each folder")); | 54 | m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember display style for each folder")); | ||
53 | m_localViewProps->setToolTip(i18nc("@info", "Dolphin will create a hidden .directory file in each folder you change view properties for.")); | 55 | m_localViewProps->setToolTip(i18nc("@info", "Dolphin will create a hidden .directory file in each folder you change view properties for.")); | ||
54 | 56 | | |||
55 | QButtonGroup* viewGroup = new QButtonGroup(this); | 57 | QButtonGroup* viewGroup = new QButtonGroup(this); | ||
56 | viewGroup->addButton(m_globalViewProps); | 58 | viewGroup->addButton(m_globalViewProps); | ||
57 | viewGroup->addButton(m_localViewProps); | 59 | viewGroup->addButton(m_localViewProps); | ||
58 | topLayout->addRow(i18nc("@title:group", "View: "), m_globalViewProps); | 60 | topLayout->addRow(i18nc("@title:group", "View: "), m_globalViewProps); | ||
59 | topLayout->addRow(QString(), m_localViewProps); | 61 | topLayout->addRow(QString(), m_localViewProps); | ||
60 | 62 | | |||
63 | topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT / 3, QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||||
ngraham: Please add a spacer between this checkbox and the radio button above it. | |||||
rjvbb: Are you sure you want a full spacer there? | |||||
64 | | ||||
65 | m_showFullPath = new QCheckBox(i18nc("@option:check", "Show full path inside location bar")); | ||||
66 | topLayout->addRow(QString(), m_showFullPath); | ||||
67 | m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check", "Show full path in title bar")); | ||||
68 | topLayout->addRow(QString(), m_showFullPathInTitlebar); | ||||
61 | 69 | | |||
62 | topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); | 70 | topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
Those translation context are pretty bad, all coming from the same copy/paste it seems. meven: Those translation context are pretty bad, all coming from the same copy/paste it seems.
How… | |||||
63 | 71 | | |||
64 | 72 | | |||
65 | // Sorting properties | 73 | // Sorting properties | ||
66 | m_naturalSorting = new QRadioButton(i18nc("option:radio", "Natural")); | 74 | m_naturalSorting = new QRadioButton(i18nc("option:radio", "Natural")); | ||
67 | m_caseInsensitiveSorting = new QRadioButton(i18nc("option:radio", "Alphabetical, case insensitive")); | 75 | m_caseInsensitiveSorting = new QRadioButton(i18nc("option:radio", "Alphabetical, case insensitive")); | ||
68 | m_caseSensitiveSorting = new QRadioButton(i18nc("option:radio", "Alphabetical, case sensitive")); | 76 | m_caseSensitiveSorting = new QRadioButton(i18nc("option:radio", "Alphabetical, case sensitive")); | ||
69 | 77 | | |||
70 | QButtonGroup* sortingModeGroup = new QButtonGroup(this); | 78 | QButtonGroup* sortingModeGroup = new QButtonGroup(this); | ||
Show All 34 Lines | 102 | #endif | |||
105 | m_closeActiveSplitView = new QCheckBox(i18nc("option:check", "Turning off split view closes active pane")); | 113 | m_closeActiveSplitView = new QCheckBox(i18nc("option:check", "Turning off split view closes active pane")); | ||
106 | topLayout->addRow(QString(), m_closeActiveSplitView); | 114 | topLayout->addRow(QString(), m_closeActiveSplitView); | ||
107 | m_closeActiveSplitView->setToolTip(i18n("When deactivated, turning off split view will close the inactive pane")); | 115 | m_closeActiveSplitView->setToolTip(i18n("When deactivated, turning off split view will close the inactive pane")); | ||
108 | 116 | | |||
109 | loadSettings(); | 117 | loadSettings(); | ||
110 | 118 | | |||
111 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 119 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
112 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 120 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
121 | connect(m_showFullPath, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||||
122 | connect(m_showFullPathInTitlebar, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||||
113 | #ifdef HAVE_BALOO | 123 | #ifdef HAVE_BALOO | ||
114 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 124 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
115 | #endif | 125 | #endif | ||
116 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 126 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
117 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 127 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
118 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 128 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
119 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 129 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
120 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 130 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
121 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 131 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
122 | connect(m_closeActiveSplitView, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 132 | connect(m_closeActiveSplitView, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
123 | } | 133 | } | ||
124 | 134 | | |||
125 | BehaviorSettingsPage::~BehaviorSettingsPage() | 135 | BehaviorSettingsPage::~BehaviorSettingsPage() | ||
126 | { | 136 | { | ||
127 | } | 137 | } | ||
128 | 138 | | |||
129 | void BehaviorSettingsPage::applySettings() | 139 | void BehaviorSettingsPage::applySettings() | ||
130 | { | 140 | { | ||
131 | GeneralSettings* settings = GeneralSettings::self(); | 141 | GeneralSettings* settings = GeneralSettings::self(); | ||
132 | ViewProperties props(m_url); // read current view properties | 142 | ViewProperties props(m_url); // read current view properties | ||
133 | 143 | | |||
134 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | 144 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | ||
135 | settings->setGlobalViewProps(useGlobalViewProps); | 145 | settings->setGlobalViewProps(useGlobalViewProps); | ||
146 | settings->setShowFullPath(m_showFullPath->isChecked()); | ||||
147 | settings->setShowFullPathInTitlebar(m_showFullPathInTitlebar->isChecked()); | ||||
136 | #ifdef HAVE_BALOO | 148 | #ifdef HAVE_BALOO | ||
137 | settings->setShowToolTips(m_showToolTips->isChecked()); | 149 | settings->setShowToolTips(m_showToolTips->isChecked()); | ||
138 | #endif | 150 | #endif | ||
139 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | 151 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | ||
140 | setSortingChoiceValue(settings); | 152 | setSortingChoiceValue(settings); | ||
141 | settings->setRenameInline(m_renameInline->isChecked()); | 153 | settings->setRenameInline(m_renameInline->isChecked()); | ||
142 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | 154 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | ||
143 | settings->setCloseActiveSplitView(m_closeActiveSplitView->isChecked()); | 155 | settings->setCloseActiveSplitView(m_closeActiveSplitView->isChecked()); | ||
Show All 18 Lines | |||||
162 | } | 174 | } | ||
163 | 175 | | |||
164 | void BehaviorSettingsPage::loadSettings() | 176 | void BehaviorSettingsPage::loadSettings() | ||
165 | { | 177 | { | ||
166 | const bool useGlobalViewProps = GeneralSettings::globalViewProps(); | 178 | const bool useGlobalViewProps = GeneralSettings::globalViewProps(); | ||
167 | m_localViewProps->setChecked(!useGlobalViewProps); | 179 | m_localViewProps->setChecked(!useGlobalViewProps); | ||
168 | m_globalViewProps->setChecked(useGlobalViewProps); | 180 | m_globalViewProps->setChecked(useGlobalViewProps); | ||
169 | 181 | | |||
182 | m_showFullPath->setChecked(GeneralSettings::showFullPath()); | ||||
183 | m_showFullPathInTitlebar->setChecked(GeneralSettings::showFullPathInTitlebar()); | ||||
170 | #ifdef HAVE_BALOO | 184 | #ifdef HAVE_BALOO | ||
171 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | 185 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | ||
172 | #endif | 186 | #endif | ||
173 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | 187 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | ||
174 | m_renameInline->setChecked(GeneralSettings::renameInline()); | 188 | m_renameInline->setChecked(GeneralSettings::renameInline()); | ||
175 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | 189 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | ||
176 | m_closeActiveSplitView->setChecked(GeneralSettings::closeActiveSplitView()); | 190 | m_closeActiveSplitView->setChecked(GeneralSettings::closeActiveSplitView()); | ||
177 | 191 | | |||
Show All 32 Lines |
Please add a spacer between this checkbox and the radio button above it.