diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-06-26 05:18:21 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-26 05:18:21 +0000 |
| commit | c32728c91c2579688d3e7ffc4afbea1acf2385e0 (patch) | |
| tree | ce1732eadbc0f4160fbe434563f2bf8b3e5b5d1c /utils/themeeditor/gui/devicestate.cpp | |
| parent | d93164d6c94791d7be6ab71c4a6a2a84f982ba09 (diff) | |
| download | rockbox-c32728c91c2579688d3e7ffc4afbea1acf2385e0.zip rockbox-c32728c91c2579688d3e7ffc4afbea1acf2385e0.tar.gz rockbox-c32728c91c2579688d3e7ffc4afbea1acf2385e0.tar.bz2 rockbox-c32728c91c2579688d3e7ffc4afbea1acf2385e0.tar.xz | |
Theme Editor: Began integrating device configuration panel with renderer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27135 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/devicestate.cpp')
| -rw-r--r-- | utils/themeeditor/gui/devicestate.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp index 3933926..80efd4d 100644 --- a/utils/themeeditor/gui/devicestate.cpp +++ b/utils/themeeditor/gui/devicestate.cpp @@ -234,6 +234,47 @@ QVariant DeviceState::data(QString tag) return QVariant(); } +void DeviceState::setData(QString tag, QVariant data) +{ + QPair<InputType, QWidget*> found = + inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0)); + + if(found.second == 0) + return; + + switch(found.first) + { + case Text: + dynamic_cast<QLineEdit*>(found.second)->setText(data.toString()); + break; + + case Slide: + dynamic_cast<QSlider*>(found.second)->setValue(data.toInt()); + break; + + case Spin: + dynamic_cast<QSpinBox*>(found.second)->setValue(data.toInt()); + break; + + case DSpin: + dynamic_cast<QDoubleSpinBox*>(found.second)->setValue(data.toDouble()); + break; + + case Combo: + dynamic_cast<QComboBox*> + (found.second)-> + setCurrentIndex(dynamic_cast<QComboBox*> + (found.second)->findText(data.toString())); + break; + + case Check: + dynamic_cast<QCheckBox*>(found.second)->setChecked(data.toBool()); + break; + } + + emit settingsChanged(); +} + void DeviceState::input() { emit settingsChanged(); |