option to work online/offline to menu
parent
a0fcbb577b
commit
316758e94e
|
@ -47,15 +47,20 @@ void MenuHandler::panelHandlerStatic()
|
||||||
SetHardTimer("PANELUPDATE", panelHandlerStatic, 110000);
|
SetHardTimer("PANELUPDATE", panelHandlerStatic, 110000);
|
||||||
}
|
}
|
||||||
|
|
||||||
int MenuHandler::createMenu(bool loggedIn, iv_menuhandler handler)
|
int MenuHandler::createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler)
|
||||||
{
|
{
|
||||||
|
char *text = "Work offline";
|
||||||
|
if(workOffline)
|
||||||
|
text = "Work online";
|
||||||
|
|
||||||
imenu mainMenu[] =
|
imenu mainMenu[] =
|
||||||
{
|
{
|
||||||
{ITEM_HEADER, 0, "Menu", NULL},
|
{ITEM_HEADER, 0, "Menu", NULL},
|
||||||
//show logged in
|
//show logged in
|
||||||
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 101, "Logout", NULL},
|
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 101, text , NULL},
|
||||||
|
{loggedIn ? ITEM_ACTIVE : ITEM_HIDDEN, 102, "Logout", NULL},
|
||||||
//show always
|
//show always
|
||||||
{ITEM_ACTIVE, 102, "Exit"},
|
{ITEM_ACTIVE, 103, "Exit"},
|
||||||
{0, 0, NULL, NULL}};
|
{0, 0, NULL, NULL}};
|
||||||
|
|
||||||
if (loggedIn)
|
if (loggedIn)
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
* @param handler handles the clicks on the menu
|
* @param handler handles the clicks on the menu
|
||||||
* @return int returns if the event was handled
|
* @return int returns if the event was handled
|
||||||
*/
|
*/
|
||||||
int createMenu(bool loggedIn, iv_menuhandler handler);
|
int createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ifont *_menuFont;
|
ifont *_menuFont;
|
||||||
|
|
Loading…
Reference in New Issue