summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtHighlightEditor.cpp')
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp
index c7ccf60..f014ce6 100644
--- a/Swift/QtUI/QtHighlightEditor.cpp
+++ b/Swift/QtUI/QtHighlightEditor.cpp
@@ -51,6 +51,9 @@ QtHighlightEditor::QtHighlightEditor(QtSettingsProvider* settings, QWidget* pare
jid_ = new QtSuggestingJIDInput(this, settings);
ui_.senderName->addWidget(jid_);
+ /* handle autocomplete */
+ connect(jid_, SIGNAL(textEdited(QString)), SLOT(handleContactSuggestionRequested(QString)));
+
/* we need to be notified if any of the state changes so that we can update our textual rule description */
connect(ui_.chatCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
connect(ui_.roomCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
@@ -166,6 +169,12 @@ void QtHighlightEditor::setHighlightManager(HighlightManager* highlightManager)
//ui_.moveDownButton->setEnabled(false);
}
+void QtHighlightEditor::setContactSuggestions(const std::vector<Contact>& suggestions)
+{
+ std::cout << "SETTINGS SUGGESTIONS!" << std::endl;
+ jid_->setSuggestions(suggestions);
+}
+
void QtHighlightEditor::colorOtherSelect()
{
ui_.foregroundColor->setEnabled(false);
@@ -302,6 +311,13 @@ void QtHighlightEditor::enableDialog(bool state)
ui_.customSoundRadio->setEnabled(state);
}
+void QtHighlightEditor::handleContactSuggestionRequested(const QString& text)
+{
+ std::cout << "GOT TEXT INPUT EVENT" << std::endl;
+ std::string stdText = Q2PSTRING(text);
+ onContactSuggestionsRequested(stdText);
+}
+
void QtHighlightEditor::selectRow(int row)
{
for (int i = 0; i < ui_.listWidget->count(); ++i) {