984f066070
Now the StatusView (bottom-left corner, right below the room list) can be used to set the nickname and status not only for all accounts at once, but for managing the status/nick of individual accounts. AccountManager now can set details of a single account, too. MainWindow is no longer an Observer (as it just passed the information along to StatusView― now StatusView manages that itself). NicknameTextControl was removed, not being in use.
38 lines
862 B
C++
38 lines
862 B
C++
/*
|
|
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _ACCOUNT_MANAGER_H
|
|
#define _ACCOUNT_MANAGER_H
|
|
|
|
#include <Messenger.h>
|
|
|
|
#include "AppConstants.h"
|
|
#include "Notifier.h"
|
|
|
|
|
|
class AccountManager : public Notifier {
|
|
public:
|
|
static AccountManager* Get();
|
|
|
|
void SetNickname(BString nick, int64 instance = -1);
|
|
|
|
UserStatus Status() const;
|
|
void SetStatus(UserStatus status, int64 instance = -1);
|
|
void SetStatus(UserStatus status, const char* str,
|
|
int64 instance = -1);
|
|
|
|
void SetReplicantMessenger(BMessenger* messenger);
|
|
void ReplicantStatusNotify(UserStatus status,
|
|
bool wait = false);
|
|
private:
|
|
AccountManager();
|
|
~AccountManager();
|
|
|
|
UserStatus fStatus;
|
|
BMessenger* fReplicantMessenger;
|
|
|
|
};
|
|
|
|
#endif // _ACCOUNT_MANAGER_H
|