diff options
Diffstat (limited to 'client/widgets/dbwidget.cc')
-rw-r--r-- | client/widgets/dbwidget.cc | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/client/widgets/dbwidget.cc b/client/widgets/dbwidget.cc index 1a68d2a..00b3886 100644 --- a/client/widgets/dbwidget.cc +++ b/client/widgets/dbwidget.cc @@ -40,6 +40,8 @@ DBWidget::DBWidget(QDomNode &node, MacroWindow *macrowindow) : QComboBox(), Widget(node, macrowindow) { + changedByUser = true; + QDomElement elem = node.toElement(); if(!elem.hasAttribute("driver") || @@ -108,9 +110,15 @@ QString DBWidget::getValue() return value; } -void DBWidget::setValue(QString value) +void DBWidget::setValue(QString value, QString source) { + changedByUser = false; + if(isUserSource(source)) emit wasChanged(); + setEditText(value); + + setInitialValue(value); + changedByUser = true; } bool DBWidget::isValid() @@ -133,6 +141,8 @@ void DBWidget::changed() } lineEdit()->setPalette(palette); + + if(changedByUser) emit wasChanged(); } void DBWidget::update_list(QString prefix) @@ -175,6 +185,29 @@ void DBWidget::disable() { setEnabled(false); } + +void DBWidget::connectFrom(const char *signal, + const QObject *receiver, const char *method) +{ + connect(this, signal, receiver, method); +} + +void DBWidget::connectTo(const QObject *sender, const char *signal, + const char *method) +{ + connect(sender, signal, this, method); +} + +bool DBWidget::setKeyboardFocus() +{ + setFocus(); + return true; +} + +void DBWidget::setVisibility(bool visible) +{ + setVisible(visible); +} /* $ psql -h sensei -d lms -U postgres =================================================================== |