summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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);