diff options
| -rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 7 | ||||
| -rw-r--r-- | Swift/QtUI/QtChatWindow.h | 1 | 
2 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index d1b3194..e5c48f2 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -28,6 +28,7 @@  namespace Swift {  QtChatWindow::QtChatWindow(const QString &contact, UIEventStream* eventStream) : QtTabbable(), contact_(contact), previousMessageWasSelf_(false), previousMessageWasSystem_(false), eventStream_(eventStream) {  	unreadCount_ = 0; +	inputEnabled_ = true;  	updateTitleWithUnreadCount();  	QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); @@ -133,7 +134,8 @@ void QtChatWindow::qAppFocusChanged(QWidget *old, QWidget *now) {  }  void QtChatWindow::setInputEnabled(bool enabled) { -	input_->setEnabled(enabled); +	inputEnabled_ = enabled; +//	input_->setEnabled(enabled);  }  void QtChatWindow::showEvent(QShowEvent* event) { @@ -232,6 +234,9 @@ void QtChatWindow::addSystemMessage(const String& message) {  }  void QtChatWindow::returnPressed() { +	if (!inputEnabled_) { +		return; +	}  	onSendMessageRequest(Q2PSTRING(input_->toPlainText()));  	messageLog_->scrollToBottom();  	inputClearing_ = true; diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h index 0b22ea1..4581a67 100644 --- a/Swift/QtUI/QtChatWindow.h +++ b/Swift/QtUI/QtChatWindow.h @@ -73,6 +73,7 @@ namespace Swift {  			QString previousSenderName_;  			bool inputClearing_;  			UIEventStream* eventStream_; +			bool inputEnabled_;  	};  }  | 
 Swift