summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-26 19:56:55 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-26 19:56:55 (GMT)
commit533111880ed9346dc8844f148a5dcfecb5095047 (patch)
treeda9c0f8a84335d68580a6a3b93313dc6aa1a8db5 /Swift/Controllers
parentde7ee8e38a2dfaab9fde40a7916c8212f5859d68 (diff)
downloadswift-contrib-533111880ed9346dc8844f148a5dcfecb5095047.zip
swift-contrib-533111880ed9346dc8844f148a5dcfecb5095047.tar.bz2
Show status in system tray.
Resolves: #304
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp2
-rw-r--r--Swift/Controllers/SystemTray.h3
-rw-r--r--Swift/Controllers/SystemTrayController.cpp3
-rw-r--r--Swift/Controllers/SystemTrayController.h5
4 files changed, 12 insertions, 1 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 9e4eb00..a2fb3a4 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -277,6 +277,7 @@ void MainController::handleChangeStatusRequest(StatusShow::Type show, const Stri
void MainController::sendPresence(boost::shared_ptr<Presence> presence) {
rosterController_->getWindow()->setMyStatusType(presence->getShow());
rosterController_->getWindow()->setMyStatusText(presence->getStatus());
+ systemTrayController_->setMyStatusType(presence->getShow());
// Add information and send
if (!vCardPhotoHash_.isEmpty()) {
@@ -408,6 +409,7 @@ void MainController::signOut() {
}
void MainController::logout() {
+ systemTrayController_->setMyStatusType(StatusShow::None);
resetPendingReconnects();
if (client_ /*&& client_->isAvailable()*/) {
client_->disconnect();
diff --git a/Swift/Controllers/SystemTray.h b/Swift/Controllers/SystemTray.h
index cd007e7..2821785 100644
--- a/Swift/Controllers/SystemTray.h
+++ b/Swift/Controllers/SystemTray.h
@@ -6,10 +6,13 @@
#pragma once
+#include "Swiften/Elements/StatusShow.h"
+
namespace Swift {
class SystemTray {
public:
virtual ~SystemTray(){};
virtual void setUnreadMessages(bool some) = 0;
+ virtual void setStatusType(StatusShow::Type type) = 0;
};
}
diff --git a/Swift/Controllers/SystemTrayController.cpp b/Swift/Controllers/SystemTrayController.cpp
index 00c0f31..758bdd8 100644
--- a/Swift/Controllers/SystemTrayController.cpp
+++ b/Swift/Controllers/SystemTrayController.cpp
@@ -23,5 +23,8 @@ void SystemTrayController::handleEventQueueLengthChange(int length) {
systemTray_->setUnreadMessages(length > 0);
}
+void SystemTrayController::setMyStatusType(StatusShow::Type type) {
+ systemTray_->setStatusType(type);
+}
}
diff --git a/Swift/Controllers/SystemTrayController.h b/Swift/Controllers/SystemTrayController.h
index 3c5d29e..8fd514f 100644
--- a/Swift/Controllers/SystemTrayController.h
+++ b/Swift/Controllers/SystemTrayController.h
@@ -6,13 +6,16 @@
#pragma once
+#include "Swiften/Elements/StatusShow.h"
+
namespace Swift {
class EventController;
class SystemTray;
class SystemTrayController {
public:
- SystemTrayController(EventController* eventController, SystemTray* systemTray);
+ SystemTrayController(EventController* eventController, SystemTray* systemTray);
+ void setMyStatusType(StatusShow::Type type);
private:
void handleEventQueueLengthChange(int length);