From 72e37b6242e5604d1e9e4d5d6bb8ff2cd99111bb Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 10 Jan 2020 16:14:28 +0100 Subject: [PATCH] Improve main menu --- mainmenu.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mainmenu.cpp b/mainmenu.cpp index d5ef35d..078aab7 100644 --- a/mainmenu.cpp +++ b/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)