mirror of
https://gitlab.com/comunic/comunicterm
synced 2024-11-16 10:31:06 +00:00
Improve main menu
This commit is contained in:
parent
d7c8ee85d8
commit
72e37b6242
24
mainmenu.cpp
24
mainmenu.cpp
@ -18,17 +18,21 @@ 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;
|
||||
int n_choices, i;
|
||||
WINDOW *my_menu_win;
|
||||
int n_choices, i;
|
||||
|
||||
/* Initialize curses */
|
||||
initscr();
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user