summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-07-21 06:40:01 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-07-21 06:40:01 +0000
commita7c37ea2d04c35628fc1ca9d353df637612303d0 (patch)
tree89df13b75ed199e4d284928cd016d0187706514e
parent2f620b8af336d65a7f48f131b1a78ecb0487de36 (diff)
downloadrockbox-a7c37ea2d04c35628fc1ca9d353df637612303d0.zip
rockbox-a7c37ea2d04c35628fc1ca9d353df637612303d0.tar.gz
rockbox-a7c37ea2d04c35628fc1ca9d353df637612303d0.tar.bz2
rockbox-a7c37ea2d04c35628fc1ca9d353df637612303d0.tar.xz
Pull yesno_pop out of the radio code as it is a nice simple resuasble yesno api worth reusing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30183 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/yesno.c14
-rw-r--r--apps/gui/yesno.h4
-rw-r--r--apps/radio/presets.c2
-rw-r--r--apps/radio/radio.c13
4 files changed, 18 insertions, 15 deletions
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index 6c87c87..5354aa5 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,
}
return(result);
}
+
+
+/* Function to manipulate all yesno dialogues.
+ This function needs the output text as an argument. */
+bool yesno_pop(const char* text)
+{
+ int i;
+ const char *lines[]={text};
+ const struct text_message message={lines, 1};
+ bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
+ FOR_NB_SCREENS(i)
+ screens[i].clear_viewport();
+ return ret;
+}
diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h
index 2c146e4..61bcf8d 100644
--- a/apps/gui/yesno.h
+++ b/apps/gui/yesno.h
@@ -21,6 +21,7 @@
#ifndef _GUI_YESNO_H_
#define _GUI_YESNO_H_
+#include <stdbool.h>
enum yesno_res
{
@@ -47,4 +48,7 @@ extern enum yesno_res gui_syncyesno_run(
const struct text_message * main_message,
const struct text_message * yes_message,
const struct text_message * no_message);
+
+bool yesno_pop(const char* text);
+
#endif /* _GUI_YESNO_H_ */
diff --git a/apps/radio/presets.c b/apps/radio/presets.c
index 77b13f2..26a607a 100644
--- a/apps/radio/presets.c
+++ b/apps/radio/presets.c
@@ -59,8 +59,6 @@ static char filepreset[MAX_PATH]; /* preset filename variable */
static int num_presets = 0; /* The number of presets in the preset list */
-bool yesno_pop(const char* text); /* radio.c */
-
int radio_current_preset(void)
{
return curr_preset;
diff --git a/apps/radio/radio.c b/apps/radio/radio.c
index e4b14c8..f88a633 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -154,19 +154,6 @@ int radio_current_frequency(void)
return curr_freq;
}
-/* Function to manipulate all yesno dialogues.
- This function needs the output text as an argument. */
-bool yesno_pop(const char* text)
-{
- int i;
- const char *lines[]={text};
- const struct text_message message={lines, 1};
- bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
- FOR_NB_SCREENS(i)
- screens[i].clear_viewport();
- return ret;
-}
-
void radio_init(void)
{
tuner_init();