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 <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
committed by
Lukas Fleischer
parent
7d4ef08345
commit
13d6f8703b
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user