Commit 11005c89 authored by Kevin Ottens's avatar Kevin Ottens

Revert "Port desktoptheme, icons and workspace KCMs to SettingStateBinding"

This reverts commit dfc144bf.
parent 010c7a5e
......@@ -25,7 +25,7 @@ import QtQuick.Dialogs 1.0
import QtQuick.Controls 2.3 as QtControls
import org.kde.kirigami 2.4 as Kirigami
import org.kde.newstuff 1.62 as NewStuff
import org.kde.kcm 1.3 as KCM
import org.kde.kcm 1.1 as KCM
import org.kde.private.kcms.desktoptheme 1.0 as Private
......@@ -35,7 +35,7 @@ KCM.GridViewKCM {
view.model: kcm.filteredModel
view.currentIndex: kcm.filteredModel.selectedThemeIndex
Binding {
Binding {
target: kcm.filteredModel
property: "query"
value: searchField.text
......@@ -47,13 +47,7 @@ KCM.GridViewKCM {
value: filterCombo.model[filterCombo.currentIndex].filter
}
KCM.SettingStateBinding {
target: parent
configObject: kcm.desktopThemeSettings
itemName: "name"
extraEnabledPredicate: !kcm.downloadingFile
indicatorAsOverlay: true
}
enabled: !kcm.downloadingFile && !kcm.desktopThemeSettings.isImmutable("name")
DropArea {
anchors.fill: parent
......
......@@ -22,7 +22,6 @@ import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as QtControls
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kcm 1.3 as KCM
QtControls.Popup {
id: iconSizePopup
......@@ -111,13 +110,7 @@ QtControls.Popup {
to: sizes.length - 1
stepSize: 1.0
snapMode: QtControls.Slider.SnapAlways
KCM.SettingStateBinding {
target: parent
configObject: kcm.iconsSettings
itemName: iconTypeList.currentItem.configKey
extraEnabledPredicate: parent.sizes.length > 0
}
enabled: sizes.length > 0 && !kcm.iconsSettings.isImmutable(iconTypeList.currentItem.configKey)
onMoved: {
kcm.iconsSettings[iconTypeList.currentItem.configKey] = iconSizeSlider.sizes[iconSizeSlider.value] || 0
......
......@@ -26,27 +26,20 @@ import QtQuick.Controls 2.3 as QtControls
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kquickcontrolsaddons 2.0 as KQCAddons
import org.kde.newstuff 1.62 as NewStuff
import org.kde.kcm 1.3 as KCM
import org.kde.kcm 1.1 as KCM
import org.kde.private.kcms.icons 1.0 as Private
KCM.GridViewKCM {
id: root
KCM.ConfigModule.quickHelp: i18n("This module allows you to choose the icons for your desktop.")
view.model: kcm.iconsModel
view.currentIndex: kcm.pluginIndex(kcm.iconsSettings.theme)
enabled: !kcm.downloadingFile
KCM.SettingStateBinding {
target: view
configObject: kcm.iconsSettings
itemName: "Theme"
indicatorAsOverlay: true
}
view.enabled: !kcm.iconsSettings.isImmutable("Theme")
DropArea {
enabled: view.enabled
enabled: !kcm.iconsSettings.isImmutable("Theme")
anchors.fill: parent
onEntered: {
if (!drag.hasUrls) {
......@@ -251,8 +244,8 @@ KCM.GridViewKCM {
}
QtControls.Button {
enabled: !kcm.iconsSettings.isImmutable("Theme")
id: installFromFileButton
enabled: root.view.enabled
text: i18n("Install from File...")
icon.name: "document-import"
onClicked: fileDialogLoader.active = true
......@@ -260,7 +253,6 @@ KCM.GridViewKCM {
NewStuff.Button {
id: newStuffButton
enabled: root.view.enabled
text: i18n("Get New Icons...")
configFile: "icons.knsrc"
viewMode: NewStuff.Page.ViewMode.Preview
......
......@@ -20,7 +20,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kcm 1.3 as KCM
import org.kde.kcm 1.2 as KCM
import org.kde.plasma.core 2.0 as PlasmaCore
......@@ -37,6 +37,7 @@ KCM.SimpleKCM {
id: showToolTips
Kirigami.FormData.label: i18n("Visual behavior:")
text: i18n("Display informational tooltips on mouse hover")
enabled: !kcm.plasmaSettings.isImmutable("delay")
checked: kcm.plasmaSettings.delay > 0
onCheckedChanged: {
if (checked) {
......@@ -45,25 +46,14 @@ KCM.SimpleKCM {
kcm.plasmaSettings.delay = -1
}
}
KCM.SettingStateBinding {
target: parent
configObject: kcm.plasmaSettings
itemName: "delay"
}
}
QQC2.CheckBox {
id: showVisualFeedback
text: i18n("Display visual feedback for status changes")
enabled: !kcm.plasmaSettings.isImmutable("osdEnabled")
checked: kcm.plasmaSettings.osdEnabled
onCheckedChanged: kcm.plasmaSettings.osdEnabled = checked
KCM.SettingStateBinding {
target: parent
configObject: kcm.plasmaSettings
itemName: "osdEnabled"
}
}
Item {
......@@ -74,6 +64,7 @@ KCM.SimpleKCM {
// move from 4x, 3x, 2x, 1x, 0.5x, 0.25x, 0.125x
// 0 is a special case
ColumnLayout {
enabled: !kcm.globalsSettings.isImmutable("animationDurationFactor")
Kirigami.FormData.label: i18n("Animation speed:")
Kirigami.FormData.buddyFor: slider
......@@ -96,12 +87,6 @@ KCM.SimpleKCM {
} else {
return -(Math.log(kcm.globalsSettings.animationDurationFactor) / Math.log(2));
}
KCM.SettingStateBinding {
target: parent
configObject: kcm.globalsSettings
itemName: "animationDurationFactor"
}
}
RowLayout {
QQC2.Label {
......@@ -128,21 +113,16 @@ KCM.SimpleKCM {
id: singleClick
Kirigami.FormData.label: i18n("Click behavior:")
text: i18n("Single-click to open files and folders")
enabled: !kcm.globalsSettings.isImmutable("singleClick")
checked: kcm.globalsSettings.singleClick
onToggled: kcm.globalsSettings.singleClick = true
QQC2.ButtonGroup.group: singleClickGroup
KCM.SettingStateBinding {
target: parent
configObject: kcm.globalsSettings
itemName: "singleClick"
}
}
QQC2.RadioButton {
id: doubleClick
text: i18n("Double-click to open files and folders")
enabled: singleClick.enabled
enabled: !kcm.globalsSettings.isImmutable("singleClick")
checked: !kcm.globalsSettings.singleClick
onToggled: kcm.globalsSettings.singleClick = false
QQC2.ButtonGroup.group: singleClickGroup
......@@ -167,21 +147,16 @@ KCM.SimpleKCM {
id: scrollbarLeftClickNavigatesByPage
Kirigami.FormData.label: i18n("Clicking in scrollbar track:")
text: i18nc("@radio part of a complete sentence: 'Clicking in scrollbar track scrolls one page up or down'", "Scrolls one page up or down")
enabled: !kcm.globalsSettings.isImmutable("scrollbarLeftClickNavigatesByPage")
checked: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage
onToggled: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage = true
QQC2.ButtonGroup.group: scrollHandleBehaviorGroup
KCM.SettingStateBinding {
target: parent
configObject: kcm.globalsSettings
itemName: "scrollbarLeftClickNavigatesByPage"
}
}
QQC2.RadioButton {
id: scrollBarLeftClickWarpsScrollHandle
text: i18nc("@radio part of a complete sentence: 'Clicking in scrollbar track scrolls to the clicked location'", "Scrolls to the clicked location")
enabled: scrollbarLeftClickNavigatesByPage.enabled
enabled: !kcm.globalsSettings.isImmutable("scrollbarLeftClickNavigatesByPage")
checked: !kcm.globalsSettings.scrollbarLeftClickNavigatesByPage
onToggled: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage = false
QQC2.ButtonGroup.group: scrollHandleBehaviorGroup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment