From 9fcf15a06b9ec422dbad53508e8ce71d2d4145c3 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 13 Jan 2009 09:59:22 +0000 Subject: 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. --- client/widgets/listbox.cc | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'client/widgets/listbox.cc') diff --git a/client/widgets/listbox.cc b/client/widgets/listbox.cc index 88a5cd2..303d288 100644 --- a/client/widgets/listbox.cc +++ b/client/widgets/listbox.cc @@ -71,6 +71,8 @@ static QListWidgetItem *createItem(QDomElement &elem) ListBox::ListBox(QDomNode &node, MacroWindow *macrowindow) : QListWidget(), Widget(node, macrowindow) { + valueIsChangingByComputer = false; + setCommonAttributes(this, node); QDomNodeList children = node.childNodes(); @@ -80,6 +82,8 @@ ListBox::ListBox(QDomNode &node, MacroWindow *macrowindow) QDomElement list_elem = child.toElement(); addItem(createItem(list_elem)); } + + connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(changed())); } bool ListBox::isValid() @@ -94,8 +98,11 @@ QString ListBox::getValue() return value; } -void ListBox::setValue(QString value) +void ListBox::setValue(QString value, QString source) { + if(isUserSource(source)) emit wasChanged(); + + valueIsChangingByComputer = true; int sel = -1; // -1 is default for none selected for(int i = 0; i < count(); i++) { @@ -104,4 +111,35 @@ void ListBox::setValue(QString value) } setCurrentRow(sel); + + setInitialValue(value); + valueIsChangingByComputer = false; +} + +void ListBox::connectFrom(const char *signal, + const QObject *receiver, const char *method) +{ + connect(this, signal, receiver, method); +} + +void ListBox::connectTo(const QObject *sender, const char *signal, + const char *method) +{ + connect(sender, signal, this, method); +} + +void ListBox::setVisibility(bool visible) +{ + setVisible(visible); +} + +void ListBox::changed() +{ + if(!valueIsChangingByComputer) emit wasChanged(); +} + +bool ListBox::setKeyboardFocus() +{ + setFocus(); + return true; } -- cgit v1.2.3