Skip to content

Commit

Permalink
added confirm on selecting backup; added reboot options
Browse files Browse the repository at this point in the history
  • Loading branch information
DooMLoRD committed Nov 10, 2011
1 parent 1ffc6e7 commit 509671a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
5 changes: 4 additions & 1 deletion bootable/recovery/extendedcommands.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -861,7 +861,9 @@ void show_nandroid_menu()
{ {
case 0: case 0:
{ {
char backup_path[PATH_MAX]; if (confirm_selection("Confirm BACKUP?", "Yes - Start Backup NOW!"))
{
char backup_path[PATH_MAX];
time_t t = time(NULL); time_t t = time(NULL);
struct tm *tmp = localtime(&t); struct tm *tmp = localtime(&t);
if (tmp == NULL) if (tmp == NULL)
Expand All @@ -875,6 +877,7 @@ void show_nandroid_menu()
strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp); strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp);
} }
nandroid_backup(backup_path); nandroid_backup(backup_path);
}
} }
break; break;
case 1: case 1:
Expand Down
37 changes: 34 additions & 3 deletions bootable/recovery/recovery.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -705,9 +705,40 @@ prompt_and_wait() {


switch (chosen_item) { switch (chosen_item) {
case ITEM_REBOOT: case ITEM_REBOOT:
poweroff=0; {
return;

static char* headers[] = { "Reboot Options",
"",
NULL
};

static char* list[] = { "reboot system now",
"reboot recovery",
"reboot into fastboot mode",
NULL
};

int chosen_item = get_menu_selection(headers, list, 0, 0);
switch (chosen_item)
{
case 0:
{
poweroff=0;
return;
}
case 1:
{
__system("reboot recovery");
break;
}
case 2:
{
__system("reboot bootloader");
break;
}
}
break;
}
case ITEM_WIPE_DATA: case ITEM_WIPE_DATA:
wipe_data(ui_text_visible()); wipe_data(ui_text_visible());
if (!ui_text_visible()) return; if (!ui_text_visible()) return;
Expand Down
4 changes: 2 additions & 2 deletions device/semc/msm7x30-common/recovery-anzu/recovery_ui.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "extendedcommands.h" #include "extendedcommands.h"


//char* MENU_HEADERS[] = { NULL }; //char* MENU_HEADERS[] = { NULL };
char* MENU_HEADERS[] = { "Xperia Arc [v02]", char* MENU_HEADERS[] = { "Xperia Arc [v03]",
"", "",
NULL }; NULL };


char* MENU_ITEMS[] = { "reboot system now", char* MENU_ITEMS[] = { "reboot options",
"install zip from sdcard", "install zip from sdcard",
"apply /sdcard/update.zip", "apply /sdcard/update.zip",
"factory reset", "factory reset",
Expand Down
4 changes: 2 additions & 2 deletions device/semc/msm7x30-common/recovery-zeus/recovery_ui.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "extendedcommands.h" #include "extendedcommands.h"


//char* MENU_HEADERS[] = { NULL }; //char* MENU_HEADERS[] = { NULL };
char* MENU_HEADERS[] = { "Xperia Play [v02]", char* MENU_HEADERS[] = { "Xperia Play [v03]",
"", "",
NULL }; NULL };


char* MENU_ITEMS[] = { "reboot system now", char* MENU_ITEMS[] = { "reboot options",
"install zip from sdcard", "install zip from sdcard",
"apply /sdcard/update.zip", "apply /sdcard/update.zip",
"factory reset", "factory reset",
Expand Down

0 comments on commit 509671a

Please sign in to comment.