void SeahubNotificationsMonitor::setUnreadNotificationsCount(int count) { if (unread_count_ != count) { unread_count_ = count; emit notificationsChanged(); } }
SeafileTrayIcon::SeafileTrayIcon(QObject *parent) : QSystemTrayIcon(parent), nth_trayicon_(0), rotate_counter_(0) { setState(STATE_DAEMON_DOWN); rotate_timer_ = new QTimer(this); connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon())); refresh_timer_ = new QTimer(this); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon())); createActions(); createContextMenu(); connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); connect(SeahubNotificationsMonitor::instance(), SIGNAL(notificationsChanged()), this, SLOT(onSeahubNotificationsChanged())); hide(); #if defined(Q_WS_MAC) tnm = new TrayNotificationManager(this); #endif }
SeafileTrayIcon::SeafileTrayIcon(QObject *parent) : QSystemTrayIcon(parent), nth_trayicon_(0), rotate_counter_(0), state_(STATE_DAEMON_UP) { setState(STATE_DAEMON_DOWN); rotate_timer_ = new QTimer(this); connect(rotate_timer_, SIGNAL(timeout()), this, SLOT(rotateTrayIcon())); refresh_timer_ = new QTimer(this); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIcon())); connect(refresh_timer_, SIGNAL(timeout()), this, SLOT(refreshTrayIconToolTip())); createActions(); createContextMenu(); connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); connect(SeahubNotificationsMonitor::instance(), SIGNAL(notificationsChanged()), this, SLOT(onSeahubNotificationsChanged())); #if defined(Q_OS_WIN32) || (defined(Q_OS_MAC) && (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))) connect(this, SIGNAL(messageClicked()), this, SLOT(onMessageClicked())); #endif hide(); createGlobalMenuBar(); #if defined(Q_OS_MAC) tnm = new TrayNotificationManager(this); #endif }