summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/SystemTrayController.cpp')
-rw-r--r--Swift/Controllers/SystemTrayController.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Swift/Controllers/SystemTrayController.cpp b/Swift/Controllers/SystemTrayController.cpp
new file mode 100644
index 0000000..8caf79a
--- /dev/null
+++ b/Swift/Controllers/SystemTrayController.cpp
@@ -0,0 +1,21 @@
+#include "Swift/Controllers/SystemTrayController.h"
+
+#include <boost/bind.hpp>
+
+#include "Swift/Controllers/EventController.h"
+#include "Swift/Controllers/SystemTray.h"
+
+namespace Swift {
+
+SystemTrayController::SystemTrayController(EventController* eventController, SystemTray* systemTray) {
+ eventController_ = eventController;
+ systemTray_ = systemTray;
+ eventController_->onEventQueueLengthChange.connect(boost::bind(&SystemTrayController::handleEventQueueLengthChange, this, _1));
+}
+
+void SystemTrayController::handleEventQueueLengthChange(int length) {
+ systemTray_->setUnreadMessages(length > 0 ? true : false);
+}
+
+
+}