From 12ba89fb1b6c6094c7646431a98dceeb382a38c8 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 27 Feb 2009 10:45:35 +0000 Subject: Fixed missing script on radiobuttons --- client/widgets/radiobuttons.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'client') 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(); } -- cgit v1.2.3