diff options
Diffstat (limited to 'Slimber/MenuletController.cpp')
m--------- | Slimber | 0 | ||||
-rw-r--r-- | Slimber/MenuletController.cpp | 51 |
2 files changed, 0 insertions, 51 deletions
diff --git a/Slimber b/Slimber new file mode 160000 +Subproject 723115ef8542c640580ea4751fca3c359a79dec diff --git a/Slimber/MenuletController.cpp b/Slimber/MenuletController.cpp deleted file mode 100644 index 1532459..0000000 --- a/Slimber/MenuletController.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "Slimber/MenuletController.h" - -#include "Swiften/Base/foreach.h" -#include "Swiften/Base/String.h" -#include "Slimber/Menulet.h" - -#include <iostream> - -using namespace Swift; - -MenuletController::MenuletController(Menulet* menulet) : - menulet(menulet), xmppStatus(Offline) { - menulet->onRestartClicked.connect(boost::ref(onRestartRequested)); - update(); -} - -MenuletController::~MenuletController() { -} - -void MenuletController::setXMPPStatus(const String& message, Status status) { - xmppStatus = status; - xmppStatusMessage = message; - update(); -} - -void MenuletController::setUserNames(const std::vector<String>& users) { - linkLocalUsers = users; - update(); -} - -void MenuletController::update() { - menulet->clear(); - if (linkLocalUsers.empty()) { - menulet->setIcon("UsersOffline"); - menulet->addItem("No online users"); - } - else { - menulet->setIcon("UsersOnline"); - menulet->addItem("Online users:"); - foreach(const String& user, linkLocalUsers) { - menulet->addItem(String(" ") + user); - } - } - menulet->addSeparator(); - menulet->addItem(xmppStatusMessage, (xmppStatus == Online ? "Online" : "Offline")); - menulet->addSeparator(); - menulet->addAboutItem(); - menulet->addSeparator(); - menulet->addRestartItem(); - menulet->addExitItem(); -} |