summaryrefslogtreecommitdiff
path: root/client/widgets/radiobuttons.cc
diff options
context:
space:
mode:
authordeva <deva>2009-02-27 10:45:35 +0000
committerdeva <deva>2009-02-27 10:45:35 +0000
commit12ba89fb1b6c6094c7646431a98dceeb382a38c8 (patch)
tree1a5ff3f835cca7b535e4b6c5ffda56d6be5703af /client/widgets/radiobuttons.cc
parentee5b3e99fcff0573ea39a2ed52027ef6a60f6b01 (diff)
Fixed missing script on radiobuttons
Diffstat (limited to 'client/widgets/radiobuttons.cc')
-rw-r--r--client/widgets/radiobuttons.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/client/widgets/radiobuttons.cc b/client/widgets/radiobuttons.cc
index 5846ff7..2385428 100644
--- a/client/widgets/radiobuttons.cc
+++ b/client/widgets/radiobuttons.cc
@@ -58,6 +58,10 @@ RadioButtons::RadioButtons(QDomNode &node, MacroWindow *macrowindow)
bool RadioButtons::isValid()
{
+ if(!regexpValidator()) return false;
+ if(!luaValidator()) return false;
+
+
QVector< RadioButton* >::iterator i;
for (i = radiobutton_list.begin(); i != radiobutton_list.end(); ++i) {
RadioButton *widget = *i;
@@ -65,6 +69,7 @@ bool RadioButtons::isValid()
return true;
}
}
+
return false;
}
@@ -138,6 +143,23 @@ void RadioButtons::setVisibility(bool visible)
void RadioButtons::childChanged()
{
+ QPalette palette;
+
+ if(regexpValidator()) {
+ if(luaValidator()) {
+ // valid string
+ palette.setBrush(QPalette::Base, QBrush(QColor(255, 255, 255)));
+ } else {
+ // invalid string
+ palette.setBrush(QPalette::Base, QBrush(QColor(200, 230, 200)));
+ }
+ } else {
+ // invalid string
+ palette.setBrush(QPalette::Base, QBrush(QColor(230, 200, 200)));
+ }
+
+ setPalette(palette);
+
emit wasChanged();
}