summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r--Swift/QtUI/QtChatWindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index 74ff109..47eeac0 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -493,70 +493,74 @@ void QtChatWindow::returnPressed() {
}
messageLog_->scrollToBottom();
lastSentMessage_ = QString(input_->toPlainText());
onSendMessageRequest(Q2PSTRING(input_->toPlainText()), isCorrection_);
inputClearing_ = true;
input_->clear();
cancelCorrection();
inputClearing_ = false;
}
void QtChatWindow::handleInputChanged() {
if (inputClearing_) {
return;
}
if (input_->toPlainText().isEmpty()) {
onUserCancelsTyping();
} else {
onUserTyping();
}
}
void QtChatWindow::handleCursorPositionChanged() {
if (tabCompletion_) {
return;
}
tabCompleteCursor_.clearSelection();
}
void QtChatWindow::show() {
if (parentWidget() == NULL) {
QWidget::show();
}
emit windowOpening();
}
+bool QtChatWindow::isVisible() const {
+ return QWidget::isVisible();
+}
+
void QtChatWindow::activate() {
if (isWindow()) {
QWidget::show();
}
emit wantsToActivate();
input_->setFocus();
}
void QtChatWindow::resizeEvent(QResizeEvent*) {
emit geometryChanged();
}
void QtChatWindow::moveEvent(QMoveEvent*) {
emit geometryChanged();
}
void QtChatWindow::dragEnterEvent(QDragEnterEvent *event) {
if (event->mimeData()->hasUrls() && event->mimeData()->urls().size() == 1) {
// TODO: check whether contact actually supports file transfer
if (!isMUC_) {
event->acceptProposedAction();
}
} else if (event->mimeData()->hasFormat("application/vnd.swift.contact-jid-list")) {
if (isMUC_ || supportsImpromptuChat_) {
event->acceptProposedAction();
}
}
}
void QtChatWindow::dropEvent(QDropEvent *event) {
if (fileTransferEnabled_ == ChatWindow::Yes && event->mimeData()->hasUrls()) {
if (event->mimeData()->urls().size() == 1) {
onSendFileRequest(Q2PSTRING(event->mimeData()->urls().at(0).toLocalFile()));
} else {
std::string messageText(Q2PSTRING(tr("Sending of multiple files at once isn't supported at this time.")));