test config ui handling

svn path=/trunk/KDE/kdebase/runtime/; revision=973262
This commit is contained in:
Aaron J. Seigo 2009-05-26 18:02:32 +00:00
parent 5856954871
commit 2617a0b82d
3 changed files with 65 additions and 2 deletions

View File

@ -1,7 +1,13 @@
plasmoid.configChanged = function()
{
plasmoid.activeConfig = "main";
print("Configuration changed: " + plasmoid.readConfig("Test"));
}
print(plasmoid.readConfig("Test"));
plasmoid.activeConfig = "secondary";
print(plasmoid.activeConfig);
print(plasmoid.readConfig("Test"));
plasmoid.writeConfig("Test", "You should see this!");
plasmoid.writeConfig("Test", "A different text!");
print(plasmoid.readConfig("Test"));

View File

@ -5,7 +5,7 @@
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name=""/>
<group name="General">
<group name="Secondary">
<entry name="Test" type="String">
<label>A test label</label>
<default>This is in the secondary config XML</default>

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>38</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Text:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_Test</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KLineEdit" name="kcfg_Test"/>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>3</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>