Chat-O-Matic/application/views/AccountsMenu.h
Jaidyn Ann 0ffe3e5ce8 Replace CreateAccountMenu() with dedicated class
CreateAccountMenu() is used to populate a BMenu with items corresponding
to the map of accounts provided to it― but when an account is disabled
or enabled, it can't update automatically.

A dedicated class, fAccountsMenu, now replaces it― it'll automatically
repopulate the list whenever the active accounts update.
2021-07-21 12:14:25 -05:00

28 lines
553 B
C++

/*
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef _ACCOUNTS_MENU_H
#define _ACCOUNTS_MENU_H
#include <Menu.h>
#include "Observer.h"
class AccountsMenu : public BMenu, public Observer {
public:
AccountsMenu(const char* name, BMessage msg, BMessage* allMsg = NULL);
~AccountsMenu();
virtual void ObserveInteger(int32 what, int32 value);
private:
void _PopulateMenu();
BMessage fAccountMessage;
BMessage* fAllMessage;
};
#endif // _ACCOUNTS_MENU_H