diff options
author | Tobias Markmann <tm@ayena.de> | 2016-10-21 12:46:37 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-10-21 12:46:37 (GMT) |
commit | e7ea063f2d5e448d10111d14539c7b19b34243a6 (patch) | |
tree | c8b1c05c04bd35bded7b05a94ac36723a88b0d57 /Swift/QtUI/QtWebKitChatView.cpp | |
parent | 37c12b839fa3dc7ebe77b7b337e92440e8135058 (diff) | |
download | swift-e7ea063f2d5e448d10111d14539c7b19b34243a6.zip swift-e7ea063f2d5e448d10111d14539c7b19b34243a6.tar.bz2 |
Add delivery-warning SVG icon with a matching style
The delviery-warning.svg matches the style of
delivery-failure.svg and delivery-success.svg. It is a
yellowish circle with a white border and a white exclamation
mark in it.
Test-Information:
Build and checked the new icon is shown when a message
receipt is requested but no receipt is received.
Tested on macOS 10.12 with Qt 5.7.0 and QtWebKit TP4.
Change-Id: Ie715993eabd8f853ea0a6983645d7d89259f61a7
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.cpp')
-rw-r--r-- | Swift/QtUI/QtWebKitChatView.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index 414f098..c0ce3dc 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -935,57 +935,57 @@ void QtWebKitChatView::addMUCInvitation(const std::string& senderName, const JID addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, appendToPrevious, theme_, id, ChatSnippet::getDirection(message))); previousMessageWasSelf_ = false; previousSenderName_ = P2QSTRING(senderName); previousMessageKind_ = PreviousMessageWasMUCInvite; } void QtWebKitChatView::setAckState(std::string const& id, ChatWindow::AckState state) { QString xml; switch (state) { case ChatWindow::Pending: xml = "<img src='qrc:/icons/throbber.gif' title='" + tr("This message has not been received by your server yet.") + "'/>"; displayReceiptInfo(P2QSTRING(id), false); break; case ChatWindow::Received: xml = ""; displayReceiptInfo(P2QSTRING(id), true); break; case ChatWindow::Failed: xml = "<img src='qrc:/icons/error.png' title='" + tr("This message may not have been transmitted.") + "'/>"; break; } setAckXML(P2QSTRING(id), xml); } void QtWebKitChatView::setMessageReceiptState(const std::string& id, ChatWindow::ReceiptState state) { QString xml; switch (state) { case ChatWindow::ReceiptReceived: xml = "<img src='qrc:/icons/delivery-success.svg' title='" + tr("The receipt for this message has been received.") + "'/>"; break; case ChatWindow::ReceiptRequested: - xml = "<img src='qrc:/icons/warn.png' title='" + tr("The receipt for this message has not yet been received. The recipient(s) might not have received this message.") + "'/>"; + xml = "<img src='qrc:/icons/delivery-warning.svg' title='" + tr("The receipt for this message has not yet been received. The recipient(s) might not have received this message.") + "'/>"; break; case ChatWindow::ReceiptFailed: xml = "<img src='qrc:/icons/delivery-failure.svg' title='" + tr("Failed to transmit message to the receipient(s).") + "'/>"; } setReceiptXML(P2QSTRING(id), xml); } bool QtWebKitChatView::appendToPreviousCheck(PreviousMessageKind messageKind, const std::string& senderName, bool senderIsSelf) { bool result = previousMessageKind_ == messageKind && ((senderIsSelf && previousMessageWasSelf_) || (!senderIsSelf && !previousMessageWasSelf_&& previousSenderName_ == P2QSTRING(senderName))); if (insertingLastLine_) { insertingLastLine_ = false; return false; } return result; } ChatSnippet::Direction QtWebKitChatView::getActualDirection(const ChatWindow::ChatMessage& message, ChatWindow::Direction direction) { if (direction == ChatWindow::DefaultDirection) { return QCoreApplication::translate("QApplication", "QT_LAYOUT_DIRECTION") == "RTL" ? ChatSnippet::RTL : ChatSnippet::LTR; } else { return ChatSnippet::getDirection(message); } } } |