summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-03-14 21:36:10 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-20 18:15:37 (GMT)
commit3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9 (patch)
treecae0589a1826560668683d2129fe024148d4e43d /Swift/QtUI/QtContactEditWindow.cpp
parent138223ab9ca917420d107d95a113e7628c27bac5 (diff)
downloadswift-contrib-3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9.zip
swift-contrib-3d27d98ccc232ae7bfacfd5a3f85f44b6c2e9cc9.tar.bz2
Naming suggestion for 'Add Contact'-dialog and "Edit Contact"-dialog based on vCards.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/QtContactEditWindow.cpp')
-rw-r--r--Swift/QtUI/QtContactEditWindow.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Swift/QtUI/QtContactEditWindow.cpp b/Swift/QtUI/QtContactEditWindow.cpp
index 9b24b23..6520c0a 100644
--- a/Swift/QtUI/QtContactEditWindow.cpp
+++ b/Swift/QtUI/QtContactEditWindow.cpp
@@ -2,33 +2,35 @@
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "QtContactEditWindow.h"
#include <algorithm>
+#include <boost/bind.hpp>
+
#include <QScrollArea>
#include <QBoxLayout>
#include <QLabel>
#include <QCheckBox>
#include <QLineEdit>
#include <QMessageBox>
#include <QPushButton>
#include "Swift/QtUI/QtSwiftUtil.h"
#include "QtContactEditWidget.h"
namespace Swift {
QtContactEditWindow::QtContactEditWindow() : contactEditWidget_(NULL) {
- resize(300,300);
+ resize(400,300);
setWindowTitle(tr("Edit contact"));
setContentsMargins(0,0,0,0);
QBoxLayout* layout = new QVBoxLayout(this);
jidLabel_ = new QLabel(this);
jidLabel_->setAlignment(Qt::AlignHCenter);
layout->addWidget(jidLabel_);
@@ -42,18 +44,27 @@ QtContactEditWindow::QtContactEditWindow() : contactEditWidget_(NULL) {
connect(removeButton, SIGNAL(clicked()), this, SLOT(handleRemoveContact()));
buttonLayout->addWidget(removeButton);
QPushButton* okButton = new QPushButton(tr("OK"), this);
okButton->setDefault( true );
connect(okButton, SIGNAL(clicked()), this, SLOT(handleUpdateContact()));
buttonLayout->addStretch();
buttonLayout->addWidget(okButton);
}
+QtContactEditWindow::~QtContactEditWindow() {
+}
+
+void QtContactEditWindow::setNameSuggestions(const std::vector<std::string>& nameSuggestions) {
+ if (contactEditWidget_) {
+ contactEditWidget_->setNameSuggestions(nameSuggestions);
+ }
+}
+
void QtContactEditWindow::setContact(const JID& jid, const std::string& name, const std::vector<std::string>& groups, const std::set<std::string>& allGroups) {
delete contactEditWidget_;
jid_ = jid;
jidLabel_->setText("<b>" + P2QSTRING(jid.toString()) + "</b>");
contactEditWidget_ = new QtContactEditWidget(allGroups, this);
groupsLayout_->addWidget(contactEditWidget_);
contactEditWidget_->setName(name);
contactEditWidget_->setSelectedGroups(groups);