mirror of
https://gitlab.com/comunic/comunicterm
synced 2024-12-26 13:38:55 +00:00
Improve main menu
This commit is contained in:
parent
d7c8ee85d8
commit
72e37b6242
20
mainmenu.cpp
20
mainmenu.cpp
@ -18,13 +18,17 @@ using namespace std;
|
|||||||
#define CTRLD 4
|
#define CTRLD 4
|
||||||
|
|
||||||
static char *choices[] = {
|
static char *choices[] = {
|
||||||
|
"Conversations",
|
||||||
"Logout",
|
"Logout",
|
||||||
"Quit"
|
"Quit",
|
||||||
|
nullptr
|
||||||
};
|
};
|
||||||
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
|
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
|
||||||
|
|
||||||
void showMainMenu()
|
void showMainMenu()
|
||||||
{ ITEM **my_items;
|
{
|
||||||
|
while(true) {
|
||||||
|
ITEM **my_items;
|
||||||
int c;
|
int c;
|
||||||
MENU *my_menu;
|
MENU *my_menu;
|
||||||
WINDOW *my_menu_win;
|
WINDOW *my_menu_win;
|
||||||
@ -114,10 +118,16 @@ void showMainMenu()
|
|||||||
/* Process requested action */
|
/* Process requested action */
|
||||||
int o = 0;
|
int o = 0;
|
||||||
|
|
||||||
// Logout
|
// Open user conversations
|
||||||
if(o++ == action) {
|
if(o++ == action) {
|
||||||
|
cerr << "TODO : implement conversations" << endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Logout
|
||||||
|
else if(o++ == action) {
|
||||||
AccountHelper::SignOut();
|
AccountHelper::SignOut();
|
||||||
LoginScreen().exec(true);
|
LoginScreen().exec(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quit application
|
// Quit application
|
||||||
@ -125,6 +135,8 @@ void showMainMenu()
|
|||||||
cout << "Good bye !" << endl;
|
cout << "Good bye !" << endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color)
|
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color)
|
||||||
|
Loading…
Reference in New Issue
Block a user