aboutsummaryrefslogtreecommitdiffstats
path: root/src/io.c
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-13 14:09:21 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-14 19:31:13 +0200
commit13d6f8703bacfb8543c9d22c01db60e083650cad (patch)
treec7c9449a0627df8b17be995cfa02fa8ccca07711 /src/io.c
parent7d4ef08345d51e59b045c3d8415a4f15bd758d3c (diff)
downloadcalcurse-13d6f8703bacfb8543c9d22c01db60e083650cad.tar.gz
calcurse-13d6f8703bacfb8543c9d22c01db60e083650cad.zip
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>
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/io.c b/src/io.c
index 737a198..b382e07 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1253,16 +1253,8 @@ io_log_display (struct io_file *log, const char *msg, const char *pager)
}
else
{
- status_mesg_yesno (msg);
- do
- {
- ans = wgetch (win[STA].p);
- if (ans == 'y')
- {
- wins_launch_external (log->name, pager);
- }
- }
- while (ans != 'y' && ans != 'n');
+ if (status_ask_bool (msg) == 1)
+ wins_launch_external (log->name, pager);
wins_erase_status_bar ();
}
}