From 13d6f8703bacfb8543c9d22c01db60e083650cad Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Sun, 13 May 2012 14:09:21 +0200 Subject: Factorize boolean user prompting. Introduce a new `status_ask_bool()` function, and use it where applicable. This greatly reduces code duplication, and will allow handling special events (resize, user escape) much more uniformely. Signed-off-by: Baptiste Jonglez Signed-off-by: Lukas Fleischer --- src/calcurse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/calcurse.c') diff --git a/src/calcurse.c b/src/calcurse.c index 6c473c3..ee85ea7 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -546,10 +546,8 @@ main (int argc, char **argv) if (conf.confirm_quit) { - status_mesg_yesno (_("Do you really want to quit ?")); - key = wgetch (win[STA].p); - if (key == 'y') - exit_calcurse (EXIT_SUCCESS); + if (status_ask_bool (_("Do you really want to quit ?")) == 1) + exit_calcurse (EXIT_SUCCESS); else { wins_erase_status_bar (); -- cgit v1.2.3-54-g00ecf