diff options
Diffstat (limited to 'client/widgets/radiobuttons.cc')
-rw-r--r-- | client/widgets/radiobuttons.cc | 22 |
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(); } |