diff options
author | Tobias Markmann <tm@ayena.de> | 2012-03-27 23:01:17 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-04-12 14:09:34 (GMT) |
commit | 2dcdee8e9f657c7f5c5d5c507373fd328beaa568 (patch) | |
tree | f6c0516afefdcf1561e32b45a415a387bc71f9d3 /Swift/QtUI/QtChatView.cpp | |
parent | 0bf6afc5c01b9eb3024a8cfd04bfd743890db4f6 (diff) | |
download | swift-contrib-2dcdee8e9f657c7f5c5d5c507373fd328beaa568.zip swift-contrib-2dcdee8e9f657c7f5c5d5c507373fd328beaa568.tar.bz2 |
Refactoring incoming MUC invites UI.
Making MUC invites non-modal by moving them into the chat view.
Adding event classes for invites so they turn up in 'Notices'-tab and generate notifications.
License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/QtChatView.cpp')
-rw-r--r-- | Swift/QtUI/QtChatView.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp index db00ba0..b0c4e09 100644 --- a/Swift/QtUI/QtChatView.cpp +++ b/Swift/QtUI/QtChatView.cpp @@ -22,6 +22,7 @@ #include "QtWebView.h" #include "QtChatTheme.h" +#include "QtChatWindow.h" #include "QtSwiftUtil.h" @@ -326,13 +327,13 @@ void QtChatView::setFileTransferStatus(QString id, const ChatWindow::FileTransfe QString newInnerHTML = ""; if (state == ChatWindow::WaitingForAccept) { - newInnerHTML = "Waiting for other side to accept the transfer.<br/>" - "<input id=\"discard\" type=\"submit\" value=\"Cancel\" onclick=\"filetransfer.cancel(\'" + id + "\');\">"; + newInnerHTML = "Waiting for other side to accept the transfer.<br/>" + + QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonFileTransferCancel, id); } if (state == ChatWindow::Negotiating) { // replace with text "Negotiaging" + Cancel button - newInnerHTML = "Negotiating...<br/>" - "<input id=\"discard\" type=\"submit\" value=\"Cancel\" onclick=\"filetransfer.cancel(\'" + id + "\');\">"; + newInnerHTML = "Negotiating...<br/>" + + QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonFileTransferCancel, id); } else if (state == ChatWindow::Transferring) { // progress bar + Cancel Button @@ -342,8 +343,8 @@ void QtChatView::setFileTransferStatus(QString id, const ChatWindow::FileTransfe "0%" "</div>" "</div>" - "</div>" - "<input id=\"discard\" type=\"submit\" value=\"Cancel\" onclick=\"filetransfer.cancel(\'" + id + "\');\">"; + "</div>" + + QtChatWindow::buildChatWindowButton(tr("Cancel"), QtChatWindow::ButtonFileTransferCancel, id); } else if (state == ChatWindow::Canceled) { newInnerHTML = "Transfer has been canceled!"; @@ -359,4 +360,12 @@ void QtChatView::setFileTransferStatus(QString id, const ChatWindow::FileTransfe ftElement.setInnerXml(newInnerHTML); } +void QtChatView::setMUCInvitationJoined(QString id) { + QWebElement divElement = findDivElementWithID(document_, id); + QWebElement buttonElement = divElement.findFirst("input#mucinvite"); + if (!buttonElement.isNull()) { + buttonElement.setAttribute("value", tr("Return to room")); + } +} + } |