remove work offline mode

pull/23/head
JuanJakobo 2022-07-20 14:58:27 +02:00
parent 8531df2c0a
commit f0fe9004d1
2 changed files with 7 additions and 13 deletions

View File

@ -38,7 +38,7 @@ MainMenu::MainMenu(const string &name)
MainMenu::~MainMenu()
{
CloseFont(_menuFont);
free(_text);
free(_syncFolder);
free(_menu);
free(_makeStartfolder);
free(_logout);
@ -52,19 +52,13 @@ void MainMenu::panelHandlerStatic()
SetHardTimer("PANELUPDATE", panelHandlerStatic, 110000);
}
int MainMenu::createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler)
int MainMenu::createMenu(bool loggedIn, iv_menuhandler handler)
{
string text = "Work offline";
if (workOffline)
text = "Work online";
_text = strdup(text.c_str());
imenu mainMenu[] =
{
{ITEM_HEADER, 0, _menu, NULL},
//show logged in
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 101, _text, NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 101, _syncFolder, NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 102, _makeStartfolder, NULL},
{loggedIn ? (short)ITEM_ACTIVE : (short)ITEM_HIDDEN, 103, _logout, NULL},
//show always

View File

@ -25,8 +25,8 @@ public:
~MainMenu();
irect *getContentRect() { return &_contentRect; };
irect *getMenuButtonRect() { return &_menuButtonRect; };
irect &getContentRect() { return _contentRect; };
irect &getMenuButtonRect() { return _menuButtonRect; };
/**
* Shows the menu on the screen, lets the user choose menu options and then redirects the handler to the caller
@ -35,7 +35,7 @@ public:
* @param handler handles the clicks on the menu
* @return int returns if the event was handled
*/
int createMenu(bool loggedIn, bool workOffline, iv_menuhandler handler);
int createMenu(bool loggedIn, iv_menuhandler handler);
private:
ifont *_menuFont;
@ -49,8 +49,8 @@ private:
imenu _mainMenu;
irect _contentRect;
char *_text;
char *_menu = strdup("Menu");
char *_syncFolder = strdup("Sync folder");
char *_makeStartfolder = strdup("Make startfolder");
char *_logout = strdup("Logout");
char *_info = strdup("Info");