diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/yesno.c | 14 | ||||
-rw-r--r-- | apps/gui/yesno.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index 6c87c8784c..5354aa526b 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c | |||
@@ -233,3 +233,17 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, | |||
233 | } | 233 | } |
234 | return(result); | 234 | return(result); |
235 | } | 235 | } |
236 | |||
237 | |||
238 | /* Function to manipulate all yesno dialogues. | ||
239 | This function needs the output text as an argument. */ | ||
240 | bool yesno_pop(const char* text) | ||
241 | { | ||
242 | int i; | ||
243 | const char *lines[]={text}; | ||
244 | const struct text_message message={lines, 1}; | ||
245 | bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES); | ||
246 | FOR_NB_SCREENS(i) | ||
247 | screens[i].clear_viewport(); | ||
248 | return ret; | ||
249 | } | ||
diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h index 2c146e4853..61bcf8d3c0 100644 --- a/apps/gui/yesno.h +++ b/apps/gui/yesno.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #ifndef _GUI_YESNO_H_ | 22 | #ifndef _GUI_YESNO_H_ |
23 | #define _GUI_YESNO_H_ | 23 | #define _GUI_YESNO_H_ |
24 | #include <stdbool.h> | ||
24 | 25 | ||
25 | enum yesno_res | 26 | enum yesno_res |
26 | { | 27 | { |
@@ -47,4 +48,7 @@ extern enum yesno_res gui_syncyesno_run( | |||
47 | const struct text_message * main_message, | 48 | const struct text_message * main_message, |
48 | const struct text_message * yes_message, | 49 | const struct text_message * yes_message, |
49 | const struct text_message * no_message); | 50 | const struct text_message * no_message); |
51 | |||
52 | bool yesno_pop(const char* text); | ||
53 | |||
50 | #endif /* _GUI_YESNO_H_ */ | 54 | #endif /* _GUI_YESNO_H_ */ |