From ff9b04252cbdd3bda5f1d01e1bad4a077f99791b Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Mon, 2 Nov 2009 20:18:17 +0000
Subject: Set new status when Enter is pressed in the status change input.


diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp
index 32ad9c6..1d7ce46 100644
--- a/Swift/QtUI/QtRosterHeader.cpp
+++ b/Swift/QtUI/QtRosterHeader.cpp
@@ -37,7 +37,7 @@ QtRosterHeader::QtRosterHeader(QWidget* parent) : QWidget(parent) {
 	setAvatar(":/icons/avatar.png");
 	expandedLayout_->addWidget(avatarLabel_);
 	
-	statusEdit_ = new QTextEdit(this);
+	statusEdit_ = new QtTextEdit(this);
 	expandedLayout_->addWidget(statusEdit_);
 	statusEdit_->resize(statusEdit_->width(), 64);
 	statusEdit_->setAcceptRichText(false);
@@ -48,6 +48,7 @@ QtRosterHeader::QtRosterHeader(QWidget* parent) : QWidget(parent) {
 	expanded_ = false;
 	avatarLabel_->hide();
 	statusEdit_->hide();
+	connect(statusEdit_, SIGNAL(returnPressed()), this, SLOT(emitStatus()));
 
 	setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
 }
diff --git a/Swift/QtUI/QtRosterHeader.h b/Swift/QtUI/QtRosterHeader.h
index 0c11c02..0a8a41f 100644
--- a/Swift/QtUI/QtRosterHeader.h
+++ b/Swift/QtUI/QtRosterHeader.h
@@ -3,13 +3,14 @@
 #include <QWidget>
 #include <QLabel>
 #include <QPixmap>
-#include <QTextEdit>
 #include <QSize>
 #include <QToolBar>
 
 #include "Swiften/Base/String.h"
 #include "Swiften/Elements/StatusShow.h"
 
+#include "QtTextEdit.h"
+
 class QHBoxLayout;
 
 namespace Swift {
@@ -24,6 +25,7 @@ namespace Swift {
 		void setStatusText(const QString& statusMessage);
 		void setStatusType(StatusShow::Type type);
 		QSize sizeHint() const;
+	public slots:
 		void emitStatus();
 	signals:
 		void onChangeStatusRequest(StatusShow::Type showType, const QString &statusMessage);
@@ -38,7 +40,7 @@ namespace Swift {
 		QString name_;
 		QLabel* avatarLabel_;
 		QLabel* nameLabel_;
-		QTextEdit* statusEdit_;
+		QtTextEdit* statusEdit_;
 		QToolBar* toolBar_;
 		QtStatusWidget* statusWidget_;
 		QHBoxLayout* expandedLayout_;
-- 
cgit v0.10.2-6-g49f6