comments++
This commit is contained in:
parent
528429b5ab
commit
4608fc6012
@ -24,37 +24,14 @@ import org.kde.plasma.core 0.1 as PlasmaCore
|
|||||||
//TODO: all of this will be done with desktop components
|
//TODO: all of this will be done with desktop components
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
//BEGIN properties
|
||||||
color: "lightgray"
|
color: "lightgray"
|
||||||
width: 640
|
width: 640
|
||||||
height: 480
|
height: 480
|
||||||
|
//END properties
|
||||||
|
|
||||||
function saveConfig() {
|
//BEGIN model
|
||||||
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]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (configDialog.configPages.length > 0) {
|
|
||||||
main.sourceComponent = configDialog.configPages[0].component
|
|
||||||
} else {
|
|
||||||
main.sourceComponent = globalConfigPages[0].component
|
|
||||||
}
|
|
||||||
root.restoreConfig()
|
|
||||||
root.width = mainColumn.implicitWidth
|
|
||||||
root.height = mainColumn.implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
property list<QtObject> globalConfigPages: [
|
property list<QtObject> globalConfigPages: [
|
||||||
QtObject {
|
QtObject {
|
||||||
property string name: "Keyboard shortcuts"
|
property string name: "Keyboard shortcuts"
|
||||||
@ -73,7 +50,41 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
//END model
|
||||||
|
|
||||||
|
//BEGIN functions
|
||||||
|
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]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//END functions
|
||||||
|
|
||||||
|
|
||||||
|
//BEGIN connections
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (configDialog.configPages.length > 0) {
|
||||||
|
main.sourceComponent = configDialog.configPages[0].component
|
||||||
|
} else {
|
||||||
|
main.sourceComponent = globalConfigPages[0].component
|
||||||
|
}
|
||||||
|
root.restoreConfig()
|
||||||
|
root.width = mainColumn.implicitWidth
|
||||||
|
root.height = mainColumn.implicitHeight
|
||||||
|
}
|
||||||
|
//END connections
|
||||||
|
|
||||||
|
//BEGIN UI components
|
||||||
Column {
|
Column {
|
||||||
id: mainColumn
|
id: mainColumn
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -163,4 +174,5 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//END UI components
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user