diff options
-rw-r--r-- | client/macrowindow.cc | 42 | ||||
-rw-r--r-- | client/widgets/altcombobox.cc | 2 | ||||
-rw-r--r-- | client/widgets/checkbox.cc | 2 | ||||
-rw-r--r-- | client/widgets/combobox.cc | 2 | ||||
-rw-r--r-- | client/widgets/datetime.cc | 2 | ||||
-rw-r--r-- | client/widgets/dbwidget.cc | 2 | ||||
-rw-r--r-- | client/widgets/lineedit.cc | 2 | ||||
-rw-r--r-- | client/widgets/listbox.cc | 2 | ||||
-rw-r--r-- | client/widgets/metawidget.cc | 4 | ||||
-rw-r--r-- | client/widgets/metawidget.h | 2 | ||||
-rw-r--r-- | client/widgets/multilist.cc | 5 | ||||
-rw-r--r-- | client/widgets/radiobuttons.cc | 2 | ||||
-rw-r--r-- | client/widgets/textedit.cc | 2 | ||||
-rw-r--r-- | client/widgets/widget.cc | 28 | ||||
-rw-r--r-- | client/widgets/widget.h | 6 |
15 files changed, 47 insertions, 58 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc index f8c9af6..6588416 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -87,41 +87,41 @@ void MacroWindow::update(QDomNode &node) void MacroWindow::initMacro(QDomNode &node) { - QDomElement xml_elem = node.toElement(); + QDomElement elem = node.toElement(); - if(xml_elem.tagName() == "macro") { + if(elem.tagName() == "macro") { // Assign the macro name and version to QStrings for use when comitting - macro = xml_elem.attribute("name", ""); - version = xml_elem.attribute("version", ""); + macro = elem.attribute("name", ""); + version = elem.attribute("version", ""); - } else if(xml_elem.tagName() == "scripts") { + } else if(elem.tagName() == "scripts") { // Nothing to do here - } else if(xml_elem.tagName() == "resume") { - QString resume = xml_elem.text(); + } else if(elem.tagName() == "resume") { + QString resume = elem.text(); ResumeWidget::state_t state = ResumeWidget::OLD; - if(xml_elem.hasAttribute("state")) { - if(xml_elem.attribute("state") == "old") state = ResumeWidget::OLD; - if(xml_elem.attribute("state") == "new") state = ResumeWidget::NEW; - if(xml_elem.attribute("state") == "dirty") state = ResumeWidget::DIRTY; + if(elem.hasAttribute("state")) { + if(elem.attribute("state") == "old") state = ResumeWidget::OLD; + if(elem.attribute("state") == "new") state = ResumeWidget::NEW; + if(elem.attribute("state") == "dirty") state = ResumeWidget::DIRTY; } ((ResumeWidget*)collapsedWidget())->setText(resume, state); - } else if(xml_elem.tagName() == "script") { + } else if(elem.tagName() == "script") { - if(xml_elem.attribute("language", "lua") == "lua") { - lua->runScript(xml_elem.text(), NULL, "preload"); + if(elem.attribute("language", "lua") == "lua") { + lua->runScript(elem.text(), NULL, "preload"); } - } else if(xml_elem.tagName() == "widgets") { + } else if(elem.tagName() == "widgets") { if(mainwidget) { DEBUG("ERROR!!!!!!\n\tmainwidget already exists!\n"); } - Window *window = new Window(xml_elem, this); + Window *window = new Window(elem, this); connect(window, SIGNAL(wasChanged()), this, SLOT(macroChanged())); - macrotitle = xml_elem.attribute("caption"); + macrotitle = elem.attribute("caption"); clear(); mainwidget = window; @@ -204,14 +204,14 @@ void MacroWindow::expandWrapper() if(true || macronode.childNodes().count()) { // macrowindows.push_back( new MacroWindow( netcom, macronode ) ); - QDomElement xml_elem = macronode.toElement(); + QDomElement elem = macronode.toElement(); - if(xml_elem.tagName() == "macro") { + if(elem.tagName() == "macro") { // Assign the macro name and version to QStrings for use when comitting QString macroname; - if(xml_elem.hasAttribute("name")) { - if(xml_elem.attribute("name") == macro) { + if(elem.hasAttribute("name")) { + if(elem.attribute("name") == macro) { // update me! initMacro(macronode); } diff --git a/client/widgets/altcombobox.cc b/client/widgets/altcombobox.cc index 88ce376..e18fb59 100644 --- a/client/widgets/altcombobox.cc +++ b/client/widgets/altcombobox.cc @@ -171,7 +171,7 @@ void AltComboBox::setValue(QString value, QString source) } } - setInitialValue(value); + // setInitialValue(value); } void AltComboBox::onValueChange(int index) diff --git a/client/widgets/checkbox.cc b/client/widgets/checkbox.cc index af7d68f..6448298 100644 --- a/client/widgets/checkbox.cc +++ b/client/widgets/checkbox.cc @@ -91,7 +91,7 @@ void CheckBox::setValue(QString value, QString source) // If set operation did not change the value we must invocate the code manually. if(old == checkbox->isChecked()) state_change(0); - setInitialValue(value); + // setInitialValue(value); changedByUser = true; } diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc index a167e29..c426e41 100644 --- a/client/widgets/combobox.cc +++ b/client/widgets/combobox.cc @@ -177,7 +177,7 @@ void ComboBox::setValue(QString value, QString source) combobox->setCurrentIndex(idx); ischangingbyuser = true; - setInitialValue(value); + // setInitialValue(value); } diff --git a/client/widgets/datetime.cc b/client/widgets/datetime.cc index b97178f..43977e3 100644 --- a/client/widgets/datetime.cc +++ b/client/widgets/datetime.cc @@ -118,7 +118,7 @@ void DateTime::setValue(QString value, QString source) datetimeedit->setDateTime(QDateTime::fromTime_t(value.toUInt())); - setInitialValue(value); + // setInitialValue(value); changedByUser = true; } diff --git a/client/widgets/dbwidget.cc b/client/widgets/dbwidget.cc index 3852b21..4d6240c 100644 --- a/client/widgets/dbwidget.cc +++ b/client/widgets/dbwidget.cc @@ -126,7 +126,7 @@ void DBWidget::setValue(QString value, QString source) combobox->setEditText(value); - setInitialValue(value); + // setInitialValue(value); changedByUser = true; } diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc index cddd59e..dbd0ca6 100644 --- a/client/widgets/lineedit.cc +++ b/client/widgets/lineedit.cc @@ -93,7 +93,7 @@ void LineEdit::setValue(QString value, QString source) lineedit->setText(value); - setInitialValue(value); + // setInitialValue(value); } bool LineEdit::eventFilter(QObject *, QEvent *event) diff --git a/client/widgets/listbox.cc b/client/widgets/listbox.cc index da234ab..b691650 100644 --- a/client/widgets/listbox.cc +++ b/client/widgets/listbox.cc @@ -123,7 +123,7 @@ void ListBox::setValue(QString value, QString source) listwidget->setCurrentRow(sel); - setInitialValue(value); + // setInitialValue(value); valueIsChangingByComputer = false; } diff --git a/client/widgets/metawidget.cc b/client/widgets/metawidget.cc index 55a8bd4..a179138 100644 --- a/client/widgets/metawidget.cc +++ b/client/widgets/metawidget.cc @@ -140,7 +140,7 @@ bool MetaWidget::setKeyboardFocus() } return false; } - +/* void MetaWidget::reset() { // If children are stored they will be reset individually. @@ -153,7 +153,7 @@ void MetaWidget::reset() } } } - +*/ void MetaWidget::setWdgValid(bool valid) { QPalette palette; diff --git a/client/widgets/metawidget.h b/client/widgets/metawidget.h index dd32adf..f44fd79 100644 --- a/client/widgets/metawidget.h +++ b/client/widgets/metawidget.h @@ -50,7 +50,7 @@ public: bool setKeyboardFocus(); - void reset(); + // void reset(); public slots: void changed(); diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc index 0160440..8544e06 100644 --- a/client/widgets/multilist.cc +++ b/client/widgets/multilist.cc @@ -183,7 +183,7 @@ void MultiList::setValue(QString values, QString source) idx++; } while(value != ""); - setInitialValue(values); + // setInitialValue(values); eventOnChange(); } @@ -205,7 +205,8 @@ void MultiList::add() list->addItem(innerwidget->value()); emit wasChanged(); - innerwidget->reset(); + // innerwidget->reset(); + innerwidget->setValues(); innerwidget_has_changes = false; eventOnChange(); diff --git a/client/widgets/radiobuttons.cc b/client/widgets/radiobuttons.cc index 7f1bda7..5d9abb4 100644 --- a/client/widgets/radiobuttons.cc +++ b/client/widgets/radiobuttons.cc @@ -127,7 +127,7 @@ void RadioButtons::setValue(QString value, QString source) } } - setInitialValue(value); + // setInitialValue(value); } bool RadioButtons::setKeyboardFocus() diff --git a/client/widgets/textedit.cc b/client/widgets/textedit.cc index 0b7ddde..b5d62e5 100644 --- a/client/widgets/textedit.cc +++ b/client/widgets/textedit.cc @@ -78,7 +78,7 @@ void TextEdit::setValue(QString value, QString source) { if(isUserSource(source)) emit wasChanged(); textedit->setText(value); - setInitialValue(value); + // setInitialValue(value); } bool TextEdit::eventFilter(QObject *, QEvent *event) diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc index cd29d0a..e5ec498 100644 --- a/client/widgets/widget.cc +++ b/client/widgets/widget.cc @@ -55,14 +55,14 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow) widget_local = elem.hasAttribute("local") && elem.attribute("local") == "true"; - + /* if(elem.hasAttribute("prefilled")) { prefilled = elem.attribute("prefilled"); } - - has_initial_value = elem.hasAttribute("name") && elem.hasAttribute("value"); + */ + has_lazy = elem.hasAttribute("name") && elem.hasAttribute("value"); lazy_value = elem.attribute("value", ""); - lazy_source = elem.attribute("prefilled", ""); + lazy_source = elem.attribute("prefilled", "pracro"); if((hasOnChangeEvent = elem.hasAttribute("onChange"))) { onChangeEventScript = elem.attribute("onChange"); @@ -116,6 +116,8 @@ bool Widget::valid() if(preValid() == false) return false; if(is_valid == false) return false; + if(hideChildren) return true; + QVector< Widget* >::iterator i = children.begin(); while(i != children.end()) { if(*i && (*i)->valid() == false) return false; @@ -131,24 +133,6 @@ void Widget::setValid(bool valid) setWdgValid(valid); } -void Widget::setInitialValue(QString value) -{ - if(!has_initial_value) { - initial_value = value; - has_initial_value = true; - } -} - -bool Widget::hasInitialValue() -{ - return has_initial_value; -} - -void Widget::reset() -{ - setValue(initial_value, ""); -} - void Widget::eventOnChange() { if(enabled() && hasOnChangeEvent) diff --git a/client/widgets/widget.h b/client/widgets/widget.h index 2a95294..ef22c18 100644 --- a/client/widgets/widget.h +++ b/client/widgets/widget.h @@ -69,9 +69,11 @@ public: virtual bool setKeyboardFocus(); + /* void setInitialValue(QString value); bool hasInitialValue(); virtual void reset(); + */ QWidget *qwidget() { return widget; } @@ -119,11 +121,13 @@ private: bool hasOnChangeEvent; QString onChangeEventScript; + /* QString initial_value; QString initial_source; bool has_initial_value; - QString prefilled; + */ + }; #endif/*__PRACRO_WIDGET_H__*/ |