diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-20 11:35:33 (GMT) |
---|---|---|
committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-20 11:35:33 (GMT) |
commit | a4c19849c82745c8bde496f2e0a928c14fcbb56d (patch) | |
tree | cd60d2b2e7a309624607219a5e3b170ae663506a /Swift/QtUI | |
parent | 3a4a3a1804a0a43dd23c97287fe8d302be323bdd (diff) | |
download | swift-a4c19849c82745c8bde496f2e0a928c14fcbb56d.zip swift-a4c19849c82745c8bde496f2e0a928c14fcbb56d.tar.bz2 |
Added SuggestingJIDInput.
Change-Id: I34690b0a019da2b882a3eba28ba77e87f61bbe7a
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.cpp | 16 | ||||
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.h | 2 |
2 files changed, 18 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) { diff --git a/Swift/QtUI/QtHighlightEditor.h b/Swift/QtUI/QtHighlightEditor.h index 2c3a819..5c0d618 100644 --- a/Swift/QtUI/QtHighlightEditor.h +++ b/Swift/QtUI/QtHighlightEditor.h @@ -30,6 +30,7 @@ namespace Swift { virtual void show(); virtual void setHighlightManager(HighlightManager* highlightManager); + virtual void setContactSuggestions(const std::vector<Contact>& suggestions); private slots: void colorOtherSelect(); @@ -44,6 +45,7 @@ namespace Swift { void onOkButtonClick(); void updateRuleDescription(); void enableDialog(bool state); + void handleContactSuggestionRequested(const QString& text); private: |