aboutsummaryrefslogtreecommitdiffstats
path: root/ui.c
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2010-07-14 18:37:33 -0700
committerKoushik Dutta <koushd@gmail.com>2010-07-19 08:40:58 -0700
commit4ca9b4c3a07865fc1c802937853b43a395a279e7 (patch)
tree1d9a28c52a510afbe0ba447e48614a9961a01d3d /ui.c
parentefa6530dbd10d601d229a3cb135be6932db33684 (diff)
downloadbootable_recovery-4ca9b4c3a07865fc1c802937853b43a395a279e7.zip
bootable_recovery-4ca9b4c3a07865fc1c802937853b43a395a279e7.tar.gz
bootable_recovery-4ca9b4c3a07865fc1c802937853b43a395a279e7.tar.bz2
allow toggling of software back menu item. add recovery checkpoint file. mount auto now uses busybox mount.
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/ui.c b/ui.c
index 1f7b369..794ea39 100644
--- a/ui.c
+++ b/ui.c
@@ -29,6 +29,12 @@
#include "minui/minui.h"
#include "recovery_ui.h"
+#ifdef KEY_POWER_IS_SELECT_ITEM
+static int gShowBackButton = 1;
+#else
+static int gShowBackButton = 0;
+#endif
+
#define MAX_COLS 64
#define MAX_ROWS 32
@@ -500,10 +506,11 @@ int ui_start_menu(char** headers, char** items) {
strncpy(menu[i] + MENU_ITEM_HEADER_LENGTH, items[i-menu_top], text_cols-1 - MENU_ITEM_HEADER_LENGTH);
menu[i][text_cols-1] = '\0';
}
-#ifdef KEY_POWER_IS_SELECT_ITEM
- strcpy(menu[i], " - +++++Go Back+++++");
- ++i;
-#endif
+
+ if (gShowBackButton) {
+ strcpy(menu[i], " - +++++Go Back+++++");
+ ++i;
+ }
menu_items = i - menu_top;
show_menu = 1;
@@ -511,11 +518,10 @@ int ui_start_menu(char** headers, char** items) {
update_screen_locked();
}
pthread_mutex_unlock(&gUpdateMutex);
-#ifdef KEY_POWER_IS_SELECT_ITEM
- return menu_items - 1;
-#else
+ if (gShowBackButton) {
+ return menu_items - 1;
+ }
return menu_items;
-#endif
}
int ui_menu_select(int sel) {
@@ -591,3 +597,11 @@ void ui_clear_key_queue() {
void ui_set_show_text(int value) {
show_text = value;
}
+
+void ui_set_showing_back_button(int showBackButton) {
+ gShowBackButton = showBackButton;
+}
+
+int ui_get_showing_back_button() {
+ return gShowBackButton;
+}