enum and int tests

This commit is contained in:
Marco Martin 2013-09-11 18:00:44 +02:00
parent 879b6adff3
commit 65037c2873
3 changed files with 26 additions and 5 deletions

View File

@ -10,9 +10,14 @@
<label>This is a test</label> <label>This is a test</label>
<default>test</default> <default>test</default>
</entry> </entry>
<entry name="TestBool" type="Bool"> <entry name="BoolTest" type="Bool">
<default>true</default> <default>true</default>
</entry> </entry>
<entry name="IntTest" type="Int">
<default>1</default>
<min>-1</min>
<max>100</max>
</entry>
</group> </group>
<group name="Group2"> <group name="Group2">

View File

@ -31,7 +31,7 @@ Item {
implicitHeight: pageColumn.implicitHeight implicitHeight: pageColumn.implicitHeight
property alias cfg_Test: testConfigField.text property alias cfg_Test: testConfigField.text
property alias cfg_TestBool: testBoolConfigField.checked property alias cfg_BoolTest: testBoolConfigField.checked
Column { Column {
id: pageColumn id: pageColumn

View File

@ -35,7 +35,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
PlasmaComponents.Label { PlasmaComponents.Label {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: i18n("I'm an applet") text: i18n("String test")
} }
PlasmaComponents.TextField { PlasmaComponents.TextField {
text: plasmoid.configuration.Test text: plasmoid.configuration.Test
@ -43,18 +43,34 @@ Item {
} }
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
enabled: true enabled: true
checked: plasmoid.configuration.TestBool checked: plasmoid.configuration.BoolTest
text: i18n("Bool from config") text: i18n("Bool from config")
onCheckedChanged: plasmoid.configuration.TestBool = checked onCheckedChanged: plasmoid.configuration.BoolTest = checked
}
PlasmaComponents.Label {
anchors.horizontalCenter: parent.horizontalCenter
text: i18n("String from another group")
} }
PlasmaComponents.TextField { PlasmaComponents.TextField {
text: plasmoid.configuration.OtherTest text: plasmoid.configuration.OtherTest
onTextChanged: plasmoid.configuration.OtherTest = text onTextChanged: plasmoid.configuration.OtherTest = text
} }
PlasmaComponents.Label {
anchors.horizontalCenter: parent.horizontalCenter
text: i18n("Enum: displayed as int,\n written as string")
}
PlasmaComponents.TextField { PlasmaComponents.TextField {
text: plasmoid.configuration.EnumTest text: plasmoid.configuration.EnumTest
onTextChanged: plasmoid.configuration.EnumTest = text onTextChanged: plasmoid.configuration.EnumTest = text
} }
PlasmaComponents.Label {
anchors.horizontalCenter: parent.horizontalCenter
text: i18n("Integer: minimum -1,\n maximum 100")
}
PlasmaComponents.TextField {
text: plasmoid.configuration.IntTest
onTextChanged: plasmoid.configuration.IntTest = text
}
} }
} }