From e1d48367f8ccb83fc1fcdaee899e5bf4f8ac2669 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 15 Apr 2017 19:04:02 +0300 Subject: Show the unread message count on the window title --- include/ChatPage.h | 2 ++ include/RoomInfoListItem.h | 6 ++++++ include/RoomList.h | 3 +++ 3 files changed, 11 insertions(+) (limited to 'include') diff --git a/include/ChatPage.h b/include/ChatPage.h index fd0b63dc..182dca3a 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -48,8 +48,10 @@ public: signals: void close(); + void changeWindowTitle(const QString &msg); private slots: + void showUnreadMessageNotification(int count); void updateTopBarAvatar(const QString &roomid, const QPixmap &img); void updateOwnProfileInfo(const QUrl &avatar_url, const QString &display_name); void setOwnAvatar(const QPixmap &img); diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 24e84bd3..5c403dc3 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -42,6 +42,7 @@ public: inline bool isPressed(); inline RoomInfo info(); inline void setAvatar(const QImage &avatar_image); + inline int unreadMessageCount(); signals: void clicked(const RoomInfo &info_); @@ -82,6 +83,11 @@ private: int unread_msg_count_; }; +inline int RoomInfoListItem::unreadMessageCount() +{ + return unread_msg_count_; +} + inline bool RoomInfoListItem::isPressed() { return is_pressed_; diff --git a/include/RoomList.h b/include/RoomList.h index d6066166..e22f0954 100644 --- a/include/RoomList.h +++ b/include/RoomList.h @@ -48,6 +48,7 @@ public: signals: void roomChanged(const RoomInfo &info); + void totalUnreadMessageCountUpdated(int count); public slots: void updateRoomAvatar(const QString &roomid, const QPixmap &img); @@ -55,6 +56,8 @@ public slots: void updateUnreadMessageCount(const QString &roomid, int count); private: + void calculateUnreadMessageCount(); + Ui::RoomList *ui; QMap rooms_; -- cgit 1.5.1