summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
authordeva <deva>2009-01-13 09:59:22 +0000
committerdeva <deva>2009-01-13 09:59:22 +0000
commit9fcf15a06b9ec422dbad53508e8ce71d2d4145c3 (patch)
treed54147e52b1939ba9ebaf356e7047dfebea02887 /client/widgets/widget.cc
parent9d982a5b4fc9c7efaa56c8f7a4130361f26b0302 (diff)
A huge amount of changes, based on the results of two usertest.
The changes are contained (but not limited to) in the following list: - Make disabled widgets ignored in validation test. - Do not commit values of disabled widgets to the database. - Make storechildren attribute on metawidget, that enables storing of the child widgets in the database. - Implement LUA resume generator. - Make language attribute on resume tag, and switch parser (format/LUA). - Case insensitive search in combobox. - Click on macro name or line, expands macro. - Greyed out widgets in AltComboBox should be hidden instead. - Keyboard 'delete' should delete item from multilist. - "Commit" button needs to be more visible? Icon? - Upon opening of a second macro, the first macro should indicate itself as 'not saved'. - After 'add' in multilist, the input widgets should be reset. - First widget in a macro should have keyboard focus after expansion. - "Endnu ikke udfyldt" needs to be more clear (darker). - Meta widgets must recurse the isValid() call to its children. - Greyed out widgets must be hidden. - Multilist should be read as a list prior to its input fields. - Visible field on widgets. Hides a widget without disabling it.
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r--client/widgets/widget.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index de49968..0857d67 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -35,8 +35,10 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
if(elem.hasAttribute("name")) {
widget_name = elem.attribute("name");
} else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
+ if(elem.tagName() != "frame" && elem.tagName() != "label"
+ && elem.tagName() != "button" && elem.tagName() != "window")
+ printf("XML ERROR!! Unnamed widget of type: %s\n",
+ elem.tagName().toStdString().c_str());
}
if(elem.hasAttribute("script")) {
@@ -52,6 +54,9 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
} else {
hasregexpvalidator = false;
}
+
+ has_initial_value = false;
+ initial_value = "";
}
QString Widget::getName()
@@ -59,12 +64,7 @@ QString Widget::getName()
return widget_name;
}
-QString Widget::getValue()
-{
- return "";
-}
-
-void Widget::setValue(QString)
+void Widget::setValue(QString, QString)
{
}
@@ -85,10 +85,15 @@ bool Widget::luaValidator()
return macrowindow->lua->run(luaprogram, getName(), getValue());
}
-void Widget::disable()
+void Widget::setInitialValue(QString value)
{
+ if(!has_initial_value) {
+ initial_value = value;
+ has_initial_value = true;
+ }
}
-void Widget::enable()
+void Widget::reset()
{
+ setValue(initial_value);
}