diff options
| author | deva <deva> | 2009-01-13 09:59:22 +0000 | 
|---|---|---|
| committer | deva <deva> | 2009-01-13 09:59:22 +0000 | 
| commit | 9fcf15a06b9ec422dbad53508e8ce71d2d4145c3 (patch) | |
| tree | d54147e52b1939ba9ebaf356e7047dfebea02887 /client/widgets/checkbox.cc | |
| parent | 9d982a5b4fc9c7efaa56c8f7a4130361f26b0302 (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/checkbox.cc')
| -rw-r--r-- | client/widgets/checkbox.cc | 42 | 
1 files changed, 38 insertions, 4 deletions
| diff --git a/client/widgets/checkbox.cc b/client/widgets/checkbox.cc index 1b8d64b..4fbdad1 100644 --- a/client/widgets/checkbox.cc +++ b/client/widgets/checkbox.cc @@ -31,6 +31,8 @@  CheckBox::CheckBox(QDomNode &node, MacroWindow *macrowindow)    : QCheckBox(), Widget(node, macrowindow)  { +  changedByUser = true; +      setCommonAttributes(this, node);    QDomElement elem = node.toElement(); @@ -51,7 +53,7 @@ CheckBox::CheckBox(QDomNode &node, MacroWindow *macrowindow)      falsevalue = "false";    } -  connect(this, SIGNAL(stateChanged(int)), this, SLOT(state_change())); +  connect(this, SIGNAL(stateChanged(int)), this, SLOT(state_change(int)));  }  QString CheckBox::getValue() @@ -60,8 +62,12 @@ QString CheckBox::getValue()    return falsevalue;  } -void CheckBox::setValue(QString value) +void CheckBox::setValue(QString value, QString source)  { +  if(isUserSource(source)) emit wasChanged(); + +  changedByUser = false; +    bool old = isChecked();    if(value == truevalue) { @@ -73,7 +79,11 @@ void CheckBox::setValue(QString value)    }    // If set operation did not change the value we must invocate the code manually. -  if(old == isChecked()) state_change(); +  if(old == isChecked()) state_change(0); + +  setInitialValue(value); + +  changedByUser = true;  }  /*  bool CheckBox::isValid() @@ -81,7 +91,31 @@ bool CheckBox::isValid()    return luaValidator();  }  */ -void CheckBox::state_change() +void CheckBox::state_change(int)  { +  if(changedByUser) emit wasChanged();    luaValidator();  } + +void CheckBox::connectFrom(const char *signal, +                           const QObject *receiver, const char *method) +{ +  connect(this, signal, receiver, method); +} + +void CheckBox::connectTo(const QObject *sender, const char *signal, +                         const char *method) +{ +  connect(sender, signal, this, method); +} + +void CheckBox::setVisibility(bool visible) +{ +  setVisible(visible); +} + +bool CheckBox::setKeyboardFocus() +{ +  setFocus(); +  return true; +} | 
