summaryrefslogtreecommitdiff
path: root/client/widgets/lineedit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/lineedit.cc')
-rw-r--r--client/widgets/lineedit.cc35
1 files changed, 34 insertions, 1 deletions
diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc
index 29ea06c..b699553 100644
--- a/client/widgets/lineedit.cc
+++ b/client/widgets/lineedit.cc
@@ -47,6 +47,7 @@ LineEdit::LineEdit(QDomNode &node, MacroWindow *macrowindow)
}
connect(this, SIGNAL(textChanged(QString)), this, SLOT(changed()));
+ connect(this, SIGNAL(textEdited(QString)), this, SLOT(user_changed()));
}
void LineEdit::changed()
@@ -69,15 +70,24 @@ void LineEdit::changed()
setPalette(palette);
}
+void LineEdit::user_changed()
+{
+ emit wasChanged();
+}
+
QString LineEdit::getValue()
{
return text();
}
-void LineEdit::setValue(QString value)
+void LineEdit::setValue(QString value, QString source)
{
+ if(isUserSource(source)) emit wasChanged();
+
if(text() == value) setText(value + " "); // Hack to make sure the textChanged signal is emitted.
setText(value);
+
+ setInitialValue(value);
}
void LineEdit::enable()
@@ -89,3 +99,26 @@ void LineEdit::disable()
{
setEnabled(false);
}
+
+void LineEdit::connectFrom(const char *signal,
+ const QObject *receiver, const char *method)
+{
+ connect(this, signal, receiver, method);
+}
+
+void LineEdit::connectTo(const QObject *sender, const char *signal,
+ const char *method)
+{
+ connect(sender, signal, this, method);
+}
+
+bool LineEdit::setKeyboardFocus()
+{
+ setFocus();
+ return true;
+}
+
+void LineEdit::setVisibility(bool visible)
+{
+ setVisible(visible);
+}