partly working configuration
still writes in the wrong config file
This commit is contained in:
parent
9ab4acd23a
commit
aa1940b246
@ -25,6 +25,8 @@ Item {
|
|||||||
id: iconsPage
|
id: iconsPage
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
|
property alias cfg_Test: testConfigField.text
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 4
|
spacing: 4
|
||||||
|
@ -64,12 +64,12 @@ Rectangle {
|
|||||||
plasmoid.busy = !plasmoid.busy
|
plasmoid.busy = !plasmoid.busy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextInput {
|
/*TextInput {
|
||||||
width: 100
|
width: 100
|
||||||
height: 22
|
height: 22
|
||||||
text: plasmoid.configuration.Test
|
text: plasmoid.configuration.Test
|
||||||
onTextChanged: plasmoid.configuration.Test = text
|
onTextChanged: plasmoid.configuration.Test = text
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
print("Test Applet loaded")
|
print("Test Applet loaded")
|
||||||
|
@ -28,11 +28,21 @@ Rectangle {
|
|||||||
width: 640
|
width: 640
|
||||||
height: 480
|
height: 480
|
||||||
|
|
||||||
function addConfigPage(url) {
|
function saveConfig() {
|
||||||
print("Loading config page: " + url)
|
for (var key in plasmoid.configuration) {
|
||||||
main.source = url
|
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 {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -87,6 +97,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
main.sourceComponent = configDialog.configPages[modelData].component
|
main.sourceComponent = configDialog.configPages[modelData].component
|
||||||
|
root.restoreConfig()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,10 +131,16 @@ Rectangle {
|
|||||||
PlasmaComponents.Button {
|
PlasmaComponents.Button {
|
||||||
iconSource: "dialog-ok"
|
iconSource: "dialog-ok"
|
||||||
text: "Ok"
|
text: "Ok"
|
||||||
|
onClicked: {
|
||||||
|
root.saveConfig()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents.Button {
|
PlasmaComponents.Button {
|
||||||
iconSource: "dialog-ok-apply"
|
iconSource: "dialog-ok-apply"
|
||||||
text: "Apply"
|
text: "Apply"
|
||||||
|
onClicked: {
|
||||||
|
root.saveConfig()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents.Button {
|
PlasmaComponents.Button {
|
||||||
iconSource: "dialog-cancel"
|
iconSource: "dialog-cancel"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user