Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/behaviorsettingspage.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 93 | #endif | |||
---|---|---|---|---|---|
95 | // 'Inline renaming of items' | 95 | // 'Inline renaming of items' | ||
96 | m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline")); | 96 | m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline")); | ||
97 | topLayout->addRow(QString(), m_renameInline); | 97 | topLayout->addRow(QString(), m_renameInline); | ||
98 | 98 | | |||
99 | // 'Switch between split views with tab key' | 99 | // 'Switch between split views with tab key' | ||
100 | m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check", "Switch between split views with tab key")); | 100 | m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check", "Switch between split views with tab key")); | ||
101 | topLayout->addRow(QString(), m_useTabForSplitViewSwitch); | 101 | topLayout->addRow(QString(), m_useTabForSplitViewSwitch); | ||
102 | 102 | | |||
103 | // 'Close active view when turning off split view' | ||||
104 | m_closeActiveSplitView = new QCheckBox(i18nc("option:check", "Turning off split view closes active pane")); | ||||
cfeck: I guess we need to come up with a better description, "when toggling off" sounds confusing. Or… | |||||
105 | topLayout->addRow(QString(), m_closeActiveSplitView); | ||||
106 | m_closeActiveSplitView->setToolTip(i18n("When deactivated, turning off split view will close the inactive pane")); | ||||
107 | | ||||
103 | loadSettings(); | 108 | loadSettings(); | ||
104 | 109 | | |||
105 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 110 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
106 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 111 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
107 | #ifdef HAVE_BALOO | 112 | #ifdef HAVE_BALOO | ||
108 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 113 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
109 | #endif | 114 | #endif | ||
110 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 115 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
111 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 116 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
112 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 117 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
113 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 118 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
114 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 119 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
115 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 120 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
121 | connect(m_closeActiveSplitView, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||||
116 | } | 122 | } | ||
117 | 123 | | |||
118 | BehaviorSettingsPage::~BehaviorSettingsPage() | 124 | BehaviorSettingsPage::~BehaviorSettingsPage() | ||
119 | { | 125 | { | ||
120 | } | 126 | } | ||
121 | 127 | | |||
122 | void BehaviorSettingsPage::applySettings() | 128 | void BehaviorSettingsPage::applySettings() | ||
123 | { | 129 | { | ||
124 | GeneralSettings* settings = GeneralSettings::self(); | 130 | GeneralSettings* settings = GeneralSettings::self(); | ||
125 | ViewProperties props(m_url); // read current view properties | 131 | ViewProperties props(m_url); // read current view properties | ||
126 | 132 | | |||
127 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | 133 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | ||
128 | settings->setGlobalViewProps(useGlobalViewProps); | 134 | settings->setGlobalViewProps(useGlobalViewProps); | ||
129 | #ifdef HAVE_BALOO | 135 | #ifdef HAVE_BALOO | ||
130 | settings->setShowToolTips(m_showToolTips->isChecked()); | 136 | settings->setShowToolTips(m_showToolTips->isChecked()); | ||
131 | #endif | 137 | #endif | ||
132 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | 138 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | ||
133 | setSortingChoiceValue(settings); | 139 | setSortingChoiceValue(settings); | ||
134 | settings->setRenameInline(m_renameInline->isChecked()); | 140 | settings->setRenameInline(m_renameInline->isChecked()); | ||
135 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | 141 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | ||
142 | settings->setCloseActiveSplitView(m_closeActiveSplitView->isChecked()); | ||||
136 | settings->save(); | 143 | settings->save(); | ||
137 | 144 | | |||
138 | if (useGlobalViewProps) { | 145 | if (useGlobalViewProps) { | ||
139 | // Remember the global view properties by applying the current view properties. | 146 | // Remember the global view properties by applying the current view properties. | ||
140 | // It is important that GeneralSettings::globalViewProps() is set before | 147 | // It is important that GeneralSettings::globalViewProps() is set before | ||
141 | // the class ViewProperties is used, as ViewProperties uses this setting | 148 | // the class ViewProperties is used, as ViewProperties uses this setting | ||
142 | // to find the destination folder for storing the view properties. | 149 | // to find the destination folder for storing the view properties. | ||
143 | ViewProperties globalProps(m_url); | 150 | ViewProperties globalProps(m_url); | ||
Show All 16 Lines | 164 | { | |||
160 | m_globalViewProps->setChecked(useGlobalViewProps); | 167 | m_globalViewProps->setChecked(useGlobalViewProps); | ||
161 | 168 | | |||
162 | #ifdef HAVE_BALOO | 169 | #ifdef HAVE_BALOO | ||
163 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | 170 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | ||
164 | #endif | 171 | #endif | ||
165 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | 172 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | ||
166 | m_renameInline->setChecked(GeneralSettings::renameInline()); | 173 | m_renameInline->setChecked(GeneralSettings::renameInline()); | ||
167 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | 174 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | ||
175 | m_closeActiveSplitView->setChecked(GeneralSettings::closeActiveSplitView()); | ||||
168 | 176 | | |||
169 | loadSortingChoiceSettings(); | 177 | loadSortingChoiceSettings(); | ||
170 | } | 178 | } | ||
171 | 179 | | |||
172 | void BehaviorSettingsPage::setSortingChoiceValue(GeneralSettings *settings) | 180 | void BehaviorSettingsPage::setSortingChoiceValue(GeneralSettings *settings) | ||
173 | { | 181 | { | ||
174 | using Choice = GeneralSettings::EnumSortingChoice; | 182 | using Choice = GeneralSettings::EnumSortingChoice; | ||
175 | if (m_naturalSorting->isChecked()) { | 183 | if (m_naturalSorting->isChecked()) { | ||
Show All 25 Lines |
I guess we need to come up with a better description, "when toggling off" sounds confusing. Or could that just be removed, and a more verbose explanation added to a tooltip? Those are also accessible via Qt Accessibility.