Add online status indicator.

Attempt to resync as soon as system goes online. #145
This commit is contained in:
Black Hat
2019-07-06 10:24:47 +08:00
parent 3501f964b5
commit 81fe2919ed
5 changed files with 52 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ class MsgCountComposedIcon : public QIconEngine {
QIcon::State state);
int msgCount = 0;
bool isOnline = true; // Default to false?
private:
const int BubbleDiameter = 14;
@@ -39,6 +40,7 @@ class TrayIcon : public QSystemTrayIcon {
iconSourceChanged)
Q_PROPERTY(int notificationCount READ notificationCount WRITE
setNotificationCount NOTIFY notificationCountChanged)
Q_PROPERTY(bool isOnline READ isOnline WRITE setIsOnline NOTIFY isOnlineChanged)
public:
TrayIcon(QObject* parent = nullptr);
@@ -48,15 +50,20 @@ class TrayIcon : public QSystemTrayIcon {
int notificationCount() { return m_notificationCount; }
void setNotificationCount(int count);
bool isOnline() { return m_isOnline; }
void setIsOnline(bool online);
signals:
void notificationCountChanged();
void iconSourceChanged();
void isOnlineChanged();
void showWindow();
private:
QString m_iconSource;
int m_notificationCount = 0;
bool m_isOnline = true;
QAction* viewAction_;
QAction* quitAction_;