1
0
mirror of https://gitlab.com/comunic/comunicterm synced 2024-12-26 05:28:54 +00:00

Improve main menu

This commit is contained in:
Pierre HUBERT 2020-01-10 16:14:28 +01:00
parent d7c8ee85d8
commit 72e37b6242

View File

@ -18,13 +18,17 @@ using namespace std;
#define CTRLD 4
static char *choices[] = {
"Conversations",
"Logout",
"Quit"
"Quit",
nullptr
};
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
void showMainMenu()
{ ITEM **my_items;
{
while(true) {
ITEM **my_items;
int c;
MENU *my_menu;
WINDOW *my_menu_win;
@ -114,10 +118,16 @@ void showMainMenu()
/* Process requested action */
int o = 0;
// Logout
// Open user conversations
if(o++ == action) {
cerr << "TODO : implement conversations" << endl;
exit(-1);
}
// Logout
else if(o++ == action) {
AccountHelper::SignOut();
LoginScreen().exec(true);
LoginScreen().exec(false);
}
// Quit application
@ -125,6 +135,8 @@ void showMainMenu()
cout << "Good bye !" << endl;
exit(0);
}
}
}
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color)