diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-06-20 22:08:20 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-06-20 22:08:20 (GMT) |
commit | 9695b3f8343a04e71fea697fc8c280cdafe85465 (patch) | |
tree | ac76b5de06621c8733e629cd6874eac376fd81ce /Swift/QtUI/QtChatWindow.cpp | |
parent | dfea757fd085ca9386b96db58c5d2bcd6173a917 (diff) | |
download | swift-contrib-swift-1.0beta4.zip swift-contrib-swift-1.0beta4.tar.bz2 |
Show total unread count in tab title.swift-1.0beta4
Resolves: #448
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 0c297b2..fcc1308 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -198,6 +198,7 @@ void QtChatWindow::showEvent(QShowEvent* event) { void QtChatWindow::setUnreadMessageCount(int count) { unreadCount_ = count; updateTitleWithUnreadCount(); + emit countUpdated(); } void QtChatWindow::setContactChatState(ChatState::ChatStateType state) { @@ -221,7 +222,7 @@ void QtChatWindow::setName(const String& name) { } void QtChatWindow::updateTitleWithUnreadCount() { - setWindowTitle(unreadCount_ > 0 ? QString("(%1) %2").arg(unreadCount_).arg(contact_) : contact_); + setWindowTitle(contact_); emit titleUpdated(); } @@ -255,6 +256,10 @@ void QtChatWindow::addMessage(const String &message, const String &senderName, b previousMessageWasSystem_ = false; } +int QtChatWindow::getCount() { + return unreadCount_; +} + void QtChatWindow::addAction(const String &message, const String &senderName, bool senderIsSelf, const boost::optional<SecurityLabel>& label, const String& avatarPath, const boost::posix_time::ptime& time) { addMessage(" *" + message + "*", senderName, senderIsSelf, label, avatarPath, "font-style:italic ", time); } |