Changeset View
Changeset View
Standalone View
Standalone View
src/settings/general/behaviorsettingspage.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 46 | { | |||
---|---|---|---|---|---|
73 | topLayout->addRow(i18nc("@title:group", "Sorting mode: "), m_naturalSorting); | 73 | topLayout->addRow(i18nc("@title:group", "Sorting mode: "), m_naturalSorting); | ||
74 | topLayout->addRow(QString(), m_caseInsensitiveSorting); | 74 | topLayout->addRow(QString(), m_caseInsensitiveSorting); | ||
75 | topLayout->addRow(QString(), m_caseSensitiveSorting); | 75 | topLayout->addRow(QString(), m_caseSensitiveSorting); | ||
76 | 76 | | |||
77 | 77 | | |||
78 | topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); | 78 | topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
79 | 79 | | |||
80 | 80 | | |||
81 | #ifdef HAVE_BALOO | ||||
81 | // 'Show tooltips' | 82 | // 'Show tooltips' | ||
82 | m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips")); | 83 | m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips")); | ||
83 | topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips); | 84 | topLayout->addRow(i18nc("@title:group", "Miscellaneous: "), m_showToolTips); | ||
85 | #endif | ||||
84 | 86 | | |||
85 | // 'Show selection marker' | 87 | // 'Show selection marker' | ||
86 | m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker")); | 88 | m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker")); | ||
87 | topLayout->addRow(QString(), m_showSelectionToggle); | 89 | topLayout->addRow(QString(), m_showSelectionToggle); | ||
88 | 90 | | |||
89 | // 'Inline renaming of items' | 91 | // 'Inline renaming of items' | ||
90 | m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline")); | 92 | m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline")); | ||
91 | topLayout->addRow(QString(), m_renameInline); | 93 | topLayout->addRow(QString(), m_renameInline); | ||
92 | 94 | | |||
93 | // 'Switch between split views with tab key' | 95 | // 'Switch between split views with tab key' | ||
94 | m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check", "Switch between split views with tab key")); | 96 | m_useTabForSplitViewSwitch = new QCheckBox(i18nc("option:check", "Switch between split views with tab key")); | ||
95 | topLayout->addRow(QString(), m_useTabForSplitViewSwitch); | 97 | topLayout->addRow(QString(), m_useTabForSplitViewSwitch); | ||
96 | 98 | | |||
97 | loadSettings(); | 99 | loadSettings(); | ||
98 | 100 | | |||
99 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 101 | connect(m_localViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
100 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 102 | connect(m_globalViewProps, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
103 | #ifdef HAVE_BALOO | ||||
101 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 104 | connect(m_showToolTips, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
105 | #endif | ||||
102 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 106 | connect(m_showSelectionToggle, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
103 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 107 | connect(m_naturalSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
104 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 108 | connect(m_caseInsensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
105 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | 109 | connect(m_caseSensitiveSorting, &QRadioButton::toggled, this, &BehaviorSettingsPage::changed); | ||
106 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 110 | connect(m_renameInline, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
107 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | 111 | connect(m_useTabForSplitViewSwitch, &QCheckBox::toggled, this, &BehaviorSettingsPage::changed); | ||
108 | } | 112 | } | ||
109 | 113 | | |||
110 | BehaviorSettingsPage::~BehaviorSettingsPage() | 114 | BehaviorSettingsPage::~BehaviorSettingsPage() | ||
111 | { | 115 | { | ||
112 | } | 116 | } | ||
113 | 117 | | |||
114 | void BehaviorSettingsPage::applySettings() | 118 | void BehaviorSettingsPage::applySettings() | ||
115 | { | 119 | { | ||
116 | GeneralSettings* settings = GeneralSettings::self(); | 120 | GeneralSettings* settings = GeneralSettings::self(); | ||
117 | ViewProperties props(m_url); // read current view properties | 121 | ViewProperties props(m_url); // read current view properties | ||
118 | 122 | | |||
119 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | 123 | const bool useGlobalViewProps = m_globalViewProps->isChecked(); | ||
120 | settings->setGlobalViewProps(useGlobalViewProps); | 124 | settings->setGlobalViewProps(useGlobalViewProps); | ||
125 | #ifdef HAVE_BALOO | ||||
121 | settings->setShowToolTips(m_showToolTips->isChecked()); | 126 | settings->setShowToolTips(m_showToolTips->isChecked()); | ||
127 | #endif | ||||
122 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | 128 | settings->setShowSelectionToggle(m_showSelectionToggle->isChecked()); | ||
123 | setSortingChoiceValue(settings); | 129 | setSortingChoiceValue(settings); | ||
124 | settings->setRenameInline(m_renameInline->isChecked()); | 130 | settings->setRenameInline(m_renameInline->isChecked()); | ||
125 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | 131 | settings->setUseTabForSwitchingSplitView(m_useTabForSplitViewSwitch->isChecked()); | ||
126 | settings->save(); | 132 | settings->save(); | ||
127 | 133 | | |||
128 | if (useGlobalViewProps) { | 134 | if (useGlobalViewProps) { | ||
129 | // Remember the global view properties by applying the current view properties. | 135 | // Remember the global view properties by applying the current view properties. | ||
Show All 14 Lines | |||||
144 | } | 150 | } | ||
145 | 151 | | |||
146 | void BehaviorSettingsPage::loadSettings() | 152 | void BehaviorSettingsPage::loadSettings() | ||
147 | { | 153 | { | ||
148 | const bool useGlobalViewProps = GeneralSettings::globalViewProps(); | 154 | const bool useGlobalViewProps = GeneralSettings::globalViewProps(); | ||
149 | m_localViewProps->setChecked(!useGlobalViewProps); | 155 | m_localViewProps->setChecked(!useGlobalViewProps); | ||
150 | m_globalViewProps->setChecked(useGlobalViewProps); | 156 | m_globalViewProps->setChecked(useGlobalViewProps); | ||
151 | 157 | | |||
158 | #ifdef HAVE_BALOO | ||||
152 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | 159 | m_showToolTips->setChecked(GeneralSettings::showToolTips()); | ||
160 | #endif | ||||
153 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | 161 | m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle()); | ||
154 | m_renameInline->setChecked(GeneralSettings::renameInline()); | 162 | m_renameInline->setChecked(GeneralSettings::renameInline()); | ||
155 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | 163 | m_useTabForSplitViewSwitch->setChecked(GeneralSettings::useTabForSwitchingSplitView()); | ||
156 | 164 | | |||
157 | loadSortingChoiceSettings(); | 165 | loadSortingChoiceSettings(); | ||
158 | } | 166 | } | ||
159 | 167 | | |||
160 | void BehaviorSettingsPage::setSortingChoiceValue(GeneralSettings *settings) | 168 | void BehaviorSettingsPage::setSortingChoiceValue(GeneralSettings *settings) | ||
Show All 28 Lines |