summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-06-30 12:30:28 (GMT)
committerSwift Review <review@swift.im>2014-07-09 13:04:52 (GMT)
commit16b1f85c1a7a0310b0a722c853e5fc8dd799570b (patch)
treea52e93753da58e6b9f3c039c6ae4b886ee30f83e /Swift/QtUI/UserSearch/QtSuggestingJIDInput.h
parent1edfc36235cc67d303ceb2bcf0630affc509f2f7 (diff)
downloadswift-contrib-16b1f85c1a7a0310b0a722c853e5fc8dd799570b.zip
swift-contrib-16b1f85c1a7a0310b0a722c853e5fc8dd799570b.tar.bz2
Reset QtSuggestingJIDInput when a contact has been selected.
Test-Information: Verified that the selected contact is added to the contact list when selecting from the drop-down list or by pressing the 'Add' button and that the JID field is reset after this happens. Change-Id: I7ef047ec9dbacf1af8635849320371f082bb3d0d
Diffstat (limited to 'Swift/QtUI/UserSearch/QtSuggestingJIDInput.h')
-rw-r--r--Swift/QtUI/UserSearch/QtSuggestingJIDInput.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.h b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.h
index 25e7d42..71cd87d 100644
--- a/Swift/QtUI/UserSearch/QtSuggestingJIDInput.h
+++ b/Swift/QtUI/UserSearch/QtSuggestingJIDInput.h
@@ -1,64 +1,66 @@
/*
* Copyright (c) 2013 Tobias Markmann
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
* Copyright (c) 2014 Kevin Smith and Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <QLineEdit>
#include <QTreeView>
#include <Swiften/Base/boost_bsignals.h>
#include <Swift/Controllers/Contact.h>
namespace Swift {
class ContactListDelegate;
class SettingsProvider;
class ContactListModel;
class QtSuggestingJIDInput : public QLineEdit {
Q_OBJECT
public:
QtSuggestingJIDInput(QWidget* parent, SettingsProvider* settings);
virtual ~QtSuggestingJIDInput();
Contact::ref getContact();
void setSuggestions(const std::vector<Contact::ref>& suggestions);
+ void clear();
+
boost::signal<void (const JID&)> onUserSelected;
signals:
void editingDone();
protected:
virtual void keyPressEvent(QKeyEvent* event);
private:
void handleSettingsChanged(const std::string& setting);
private slots:
void handleClicked(const QModelIndex& index);
void handleApplicationFocusChanged(QWidget* old, QWidget* now);
private:
void positionPopup();
void showPopup();
void hidePopup();
private:
SettingsProvider* settings_;
ContactListModel* contactListModel_;
QTreeView* treeViewPopup_;
ContactListDelegate* contactListDelegate_;
Contact::ref currentContact_;
};
}