partly working configuration

still writes in the wrong config file
wilder-5.14
Marco Martin 13 years ago
parent f556ef49c9
commit fed3644592
  1. 2
      applets/testapplet/contents/ui/ConfigGeneral.qml
  2. 4
      applets/testapplet/contents/ui/main.qml
  3. 23
      qmlpackages/desktop/contents/ui/Configuration.qml

@ -25,6 +25,8 @@ Item {
id: iconsPage
height: childrenRect.height
property alias cfg_Test: testConfigField.text
Column {
anchors.fill: parent
spacing: 4

@ -64,12 +64,12 @@ Rectangle {
plasmoid.busy = !plasmoid.busy
}
}
TextInput {
/*TextInput {
width: 100
height: 22
text: plasmoid.configuration.Test
onTextChanged: plasmoid.configuration.Test = text
}
}*/
}
Component.onCompleted: {
print("Test Applet loaded")

@ -28,11 +28,21 @@ Rectangle {
width: 640
height: 480
function addConfigPage(url) {
print("Loading config page: " + url)
main.source = url
function saveConfig() {
for (var key in plasmoid.configuration) {
if (main.item["cfg_"+key] !== undefined) {
plasmoid.configuration[key] = main.item["cfg_"+key]
}
}
}
function restoreConfig() {
for (var key in plasmoid.configuration) {
if (main.item["cfg_"+key] !== undefined) {
main.item["cfg_"+key] = plasmoid.configuration[key]
}
}
}
Column {
anchors.fill: parent
@ -87,6 +97,7 @@ Rectangle {
}
onClicked: {
main.sourceComponent = configDialog.configPages[modelData].component
root.restoreConfig()
}
}
}
@ -120,10 +131,16 @@ Rectangle {
PlasmaComponents.Button {
iconSource: "dialog-ok"
text: "Ok"
onClicked: {
root.saveConfig()
}
}
PlasmaComponents.Button {
iconSource: "dialog-ok-apply"
text: "Apply"
onClicked: {
root.saveConfig()
}
}
PlasmaComponents.Button {
iconSource: "dialog-cancel"

Loading…
Cancel
Save