本文整理汇总了C++中prepend_title函数的典型用法代码示例。如果您正苦于以下问题:C++ prepend_title函数的具体用法?C++ prepend_title怎么用?C++ prepend_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prepend_title函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "确认是否清除所有数据?",
"这一步操作不可挽回.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " 取消",
" 确认 -- 删除所有用户数据", // [1]
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 1) {
return;
}
}
ui_print("\n-- 格式化 Data...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("格式化 Data 完成.\n");
}
开发者ID:EYEALAN,项目名称:CWM_recovery_6.0.3.5_CN_EYE,代码行数:34,代码来源:recovery.c
示例2: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "确认清空所有数据?",
"",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " 是的 - 清空所有数据", //[1]
" 取消 - 返回", // [0]
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 0) {
return;
}
}
ui_print("\n-- 清空 data...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("所有数据清空完毕.\n");
}
开发者ID:xiangxin19960319,项目名称:android_bootable_recovery_cn_ics,代码行数:34,代码来源:recovery.c
示例3: prompt_and_wait
static void
prompt_and_wait() {
char** headers = prepend_title((const char**)MENU_HEADERS);
int select = 0;
for (;;) {
ui_reset_progress();
int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, select);
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);
switch (chosen_item) {
case ITEM_BOOT:
if (show_menu_boot()) return; else break;
case ITEM_SYSTEM:
if (show_menu_system()) return; else break;
case ITEM_RECOVERY:
if (show_menu_recovery()) return; else break;
case ITEM_TOOLS:
if (show_menu_tools()) return; else break;
case ITEM_REBOOT:
ui_print("Reboot now....\n");
sync();
reboot(RB_AUTOBOOT);
return;
}
select = chosen_item;
}
}
开发者ID:timoti111,项目名称:Android-Bootmenu-ZTE-Skate,代码行数:31,代码来源:bootmenu.c
示例4: prompt_and_wait
static void
prompt_and_wait() {
char** headers = prepend_title((const char**)MENU_HEADERS);
for (;;) {
finish_recovery(NULL);
ui_reset_progress();
allow_display_toggle = 1;
int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0);
allow_display_toggle = 0;
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);
int status;
switch (chosen_item) {
case ITEM_REBOOT:
poweroff=0;
return;
case ITEM_WIPE_DATA:
wipe_data(ui_text_visible());
if (!ui_text_visible()) return;
break;
case ITEM_WIPE_CACHE:
if (confirm_selection("Confirm wipe?", "Yes - Wipe Cache"))
{
ui_print("\n-- Wiping cache...\n");
erase_volume("/cache");
ui_print("Cache wipe complete.\n");
if (!ui_text_visible()) return;
}
break;
case ITEM_APPLY_SDCARD:
show_install_update_menu();
break;
case ITEM_NANDROID:
show_nandroid_menu();
break;
case ITEM_PARTITION:
show_partition_menu();
break;
case ITEM_ADVANCED:
show_advanced_menu();
break;
case ITEM_POWEROFF:
poweroff = 1;
return;
}
}
}
开发者ID:Racing1,项目名称:android_bootable_touch_recovery,代码行数:60,代码来源:recovery.c
示例5: root_menu
void root_menu(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "ROOT installed ROM?",
" ",
"Rooting without the superuser app installed",
"does nothing. Please install the superuser app",
"from the market! (by ChainsDD)",
" ",
NULL };
title_headers = prepend_title(headers);
}
char* items[] = { " No",
" OK, give me root!",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 1) {
return;
}
}
char* argv[] = { "/sbin/actroot",
NULL };
char* envp[] = { NULL };
ensure_root_path_mounted("SYSTEM:");
remove("/system/recovery-from-boot.p");
int status = runve("/sbin/actroot",argv,envp,1);
ensure_root_path_unmounted("SYSTEM:");
return;
}
开发者ID:Jewremy,项目名称:RZrecovery,代码行数:35,代码来源:options_menu.c
示例6: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "Confirm wipe of all user data?",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " No",
" Yes -- delete all user data", // [1]
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 1) {
return;
}
}
ui_print("\n-- Wiping data...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sdcard/.android_secure");
ui_print("Data wipe complete.\n");
}
开发者ID:manveru0,项目名称:FeaMod-Recovery-for-S3,代码行数:33,代码来源:recovery.c
示例7: headless_wait
static void headless_wait() {
ui_show_text(0);
char** headers = prepend_title((const char**)MENU_HEADERS);
for (;;) {
finish_recovery(NULL);
get_menu_selection(headers, MENU_ITEMS, 0, 0);
}
}
开发者ID:EYEALAN,项目名称:CWM_recovery_6.0.3.5_CN_EYE,代码行数:8,代码来源:recovery.c
示例8: prompt_and_wait
static void
prompt_and_wait() {
char** headers = prepend_title(MENU_HEADERS);
for (;;) {
finish_recovery(NULL);
ui_reset_progress();
ui_set_background(BACKGROUND_ICON_ERROR);
int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0);
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);
switch (chosen_item) {
case ITEM_REBOOT:
return;
case ITEM_APPLY_SDCARD:
show_install_update_menu();
/*
ui_print("\n-- Install from sdcard...\n");
set_sdcard_update_bootloader_message();
int status = install_package(SDCARD_PACKAGE_FILE);
if (status != INSTALL_SUCCESS) {
ui_set_background(BACKGROUND_ICON_ERROR);
ui_print("Installation aborted.\n");
} else if (!ui_text_visible()) {
return; // reboot if logs aren't visible
} else {
ui_print("\nInstall from sdcard complete.\n");
}
*/
break;
case ITEM_WIPE_DATA:
wipe_data(ui_text_visible());
if (!ui_text_visible()) return;
break;
case ITEM_WIPE_CACHE:
ui_print("\n-- Wiping cache...\n");
erase_root("CACHE:");
ui_print("Cache wipe complete.\n");
if (!ui_text_visible()) return;
break;
case ITEM_ADVANCED:
show_advanced_menu();
break;
}
}
}
开发者ID:35mmslr,项目名称:Dell-Streak-Recovery,代码行数:56,代码来源:recovery.c
示例9: nandroid_menu
void
nandroid_menu()
{
// define constants for menu selection
#define ITEM_BACKUP_MENU 0
#define ITEM_RESTORE_MENU 1
#define ITEM_MENU_RBOOT 2
#define ITEM_MENU_BACK 3
// build headers and items in menu
char* nan_headers[] = { "Nandroid Menu",
"Choose Backup or Restore:",
NULL };
char* nan_items[] = { "Backup Partitions",
"Restore Partitions",
"--> Reboot System",
"<-- Back To Main Menu",
NULL };
char** headers = prepend_title(nan_headers);
int chosen_item;
inc_menu_loc(ITEM_MENU_BACK); // record back selection into array
for (;;)
{
ui_set_background(BACKGROUND_ICON_NANDROID);
chosen_item = get_menu_selection(headers, nan_items, 0, 0);
switch (chosen_item)
{
case ITEM_BACKUP_MENU:
nan_backup_menu(0);
break;
case ITEM_RESTORE_MENU:
choose_backup_folder();
break;
case ITEM_MENU_RBOOT:
tw_reboot();
break;
case ITEM_MENU_BACK:
dec_menu_loc();
ui_set_background(BACKGROUND_ICON_MAIN);
return;
}
if (go_home) { // if home was called
dec_menu_loc();
ui_set_background(BACKGROUND_ICON_MAIN);
return;
}
}
}
开发者ID:kbzona,项目名称:TWRP-LG-P500-Port,代码行数:51,代码来源:backstore.c
示例10: prompt_and_wait
static void
prompt_and_wait() {
char** headers = prepend_title((const char**)MENU_HEADERS);
for (;;) {
finish_recovery(NULL);
ui_reset_progress();
ui_menu_level = -1;
allow_display_toggle = 1;
int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0);
allow_display_toggle = 0;
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);
int status;
switch (chosen_item) {
case ITEM_REBOOT:
show_reboot_menu();
break;
case ITEM_WIPE_MENU:
show_wipe_menu();
break;
case ITEM_INSTALL_ZIP:
show_install_update_menu();
break;
case ITEM_NANDROID:
show_nandroid_menu();
break;
case ITEM_PARTITION:
show_partition_menu();
break;
case ITEM_ADVANCED:
show_advanced_menu();
break;
case ITEM_POWEROFF:
poweroff=1;
return;
}
}
}
开发者ID:spanner3003,项目名称:android_bootable_recovery,代码行数:50,代码来源:recovery.c
示例11: prompt_and_wait
void
prompt_and_wait() {
char** headers = prepend_title((const char**)MENU_HEADERS);
for (;;) {
finish_recovery(NULL);
ui_reset_progress();
int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0, 0);
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);
switch (chosen_item) {
case ITEM_REBOOT:
return;
case ITEM_WIPE_DATA:
wipe_data(ui_text_visible());
if (!ui_text_visible()) return;
break;
case ITEM_WIPE_CACHE:
printf("\n-- Wiping cache...\n");
erase_volume("/cache");
printf("Cache wipe complete.\n");
if (!ui_text_visible()) return;
break;
case ITEM_APPLY_SDCARD:
;
int status = sdcard_directory(SDCARD_ROOT);
if (status >= 0) {
if (status != INSTALL_SUCCESS) {
ui_set_background(BACKGROUND_ICON_ERROR);
printf("Installation aborted.\n");
} else if (!ui_text_visible()) {
return; // reboot if logs aren't visible
} else {
printf("\nInstall from sdcard complete.\n");
}
}
break;
}
}
}
开发者ID:xwliu,项目名称:open-ivi.MX53,代码行数:48,代码来源:recovery.c
示例12: wipe_data
void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
ui_set_background(BACKGROUND_ICON_WIPE_CHOOSE);
if (title_headers == NULL) {
char* headers[] = { "Confirm wipe of all user data?",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " No",
" Yes -- delete all user data", // [1]
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 1) {
return;
}
}
ui_set_background(BACKGROUND_ICON_WIPE);
ui_print("\n-- Wiping data...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
struct stat st;
if (stat("/sd-ext",&st) == 0)
{
ui_print("Formatting /sd-ext...\n");
__system("rm -rf /sd-ext/* && rm -rf /sd-ext/.*");
} else {
ui_print("/sd-ext not found, skipping...\n");
}
if (0 == stat("/sdcard/.android_secure", &st))
{
__system("rm -rf /sdcard/.android_secure/* && rm -rf /sdcard/.android_secure/.*");
ui_print("Formatting /sdcard/.android_secure...\n");
} else {
ui_print("/sdcard/.android_secure not found, skipping...\n");
}
ui_reset_progress();
ui_print("-- Data wipe complete.\n");
}
开发者ID:kbzona,项目名称:TWRP-LG-P500-Port,代码行数:46,代码来源:recovery.c
示例13: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "确认清空DATA分区?",
"该操作将会删除您设备内的个人数据",
"注意!该操作无法撤销.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " 否",
" 否",
" 否",
" 否",
" 否",
" 否",
" 否",
" 是 -- 清空所有个人数据", // [7]
" 否",
" 否",
" 否",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 7) {
return;
}
}
ui_print("\n-- 正在清空DATA分区...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("DATA分区已清空.\n");
}
开发者ID:84506232,项目名称:android_bootable_recovery_cn,代码行数:44,代码来源:recovery.c
示例14: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "Confirm wipe of all user data?",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title(headers);
}
char* items[] = { " No",
" No",
" No",
" No",
" No",
" No",
" No",
" Yes -- delete all user data", // [7]
" No",
" No",
" No",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1);
if (chosen_item != 7) {
return;
}
}
ui_print("\n-- Wiping data...\n");
device_wipe_data();
erase_root("DATA:");
#ifdef BOARD_HAS_DATADATA
erase_root("DATADATA:");
#endif
erase_root("CACHE:");
erase_root("SDEXT:");
erase_root("SDCARD:/.android_secure");
ui_print("Data wipe complete.\n");
}
开发者ID:bandroidx,项目名称:bravo_recovery,代码行数:43,代码来源:recovery.c
示例15: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "你真的要清除数据?",
" 这个操作可是不允许撤销的啊 ",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " 呀买碟",
" 呀买碟",
" 呀买碟",
" 呀买碟",
" 呀买碟",
" 呀买碟",
" 呀买碟",
" 我一定要删除所有用户数据", // [7]
" 呀买碟",
" 呀买碟",
" 呀买碟",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 7) {
return;
}
}
ui_print("\n-- 清除数据中 \n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("已经抹掉数据\n");
}
开发者ID:HyperToxic,项目名称:CWM_REC_6.0.3.2_CHN,代码行数:43,代码来源:recovery.c
示例16: wipe_data
static void
wipe_data(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "Confirm wipe of ALL user data?",
"following partitions will be WIPED:",
" /data",
" /cache",
" /sd-ext",
" /sdcard/.android_secure",
"",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " No",
" Yes -- delete ALL user data", // [1]
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 1) {
return;
}
}
ui_print("\n-- 正在清空用户数据...\n");
device_wipe_data();
erase_volume("/data");
erase_volume("/cache");
if (has_datadata()) {
erase_volume("/datadata");
}
erase_volume("/sd-ext");
erase_volume("/sdcard/.android_secure");
ui_print("清空完毕\n");
}
开发者ID:eamars,项目名称:CHS-RECOVERY-XGT,代码行数:40,代码来源:recovery.c
示例17: show_interactive_menu
int show_interactive_menu(char** headers, char** items)
{
int title_length;
int item_length;
char** title, **p;
unsigned char* selectability;
title = prepend_title(headers, &title_length);
item_length = 0;
for (p = items; *p; ++p, ++item_length);
selectability = malloc(item_length);
memset(selectability, 1, item_length);
int chosen_item = get_menu_selection(title, items, selectability, title_length, 0, 1);
hide_menu_selection();
free(selectability);
free(title);
return chosen_item + 1;
}
开发者ID:Mioze7Ae,项目名称:openrecovery,代码行数:22,代码来源:recovery.c
示例18: wipe_data
static void
wipe_data(int confirm, Device* device) {
if (confirm) {
static const char** title_headers = NULL;
if (title_headers == NULL) {
const char* headers[] = { "Confirm wipe of all user data?",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
const char* items[] = { " No",
" No",
" No",
" No",
" No",
" No",
" No",
" Yes -- delete all user data", // [7]
" No",
" No",
" No",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0, device);
if (chosen_item != 7) {
return;
}
}
ui->Print("\n-- Wiping data...\n");
device->WipeData();
erase_volume("/data");
erase_volume("/cache");
erase_persistent_partition();
ui->Print("Data wipe complete.\n");
}
开发者ID:TheTypoMaster,项目名称:x86-android-5.0,代码行数:39,代码来源:recovery.cpp
示例19: choose_recovery_file
static void choose_recovery_file(Device* device) {
int i;
static const char** title_headers = NULL;
char *filename;
const char* headers[] = { "Select file to view",
"",
NULL };
char* entries[KEEP_LOG_COUNT + 2];
memset(entries, 0, sizeof(entries));
for (i = 0; i < KEEP_LOG_COUNT; i++) {
char *filename;
if (asprintf(&filename, (i==0) ? LAST_LOG_FILE : (LAST_LOG_FILE ".%d"), i) == -1) {
// memory allocation failure - return early. Should never happen.
return;
}
if ((ensure_path_mounted(filename) != 0) || (access(filename, R_OK) == -1)) {
free(filename);
entries[i+1] = NULL;
break;
}
entries[i+1] = filename;
}
entries[0] = strdup("Go back");
title_headers = prepend_title((const char**)headers);
while(1) {
int chosen_item = get_menu_selection(title_headers, entries, 1, 0, device);
if (chosen_item == 0) break;
file_to_ui(entries[chosen_item]);
}
for (i = 0; i < KEEP_LOG_COUNT + 1; i++) {
free(entries[i]);
}
}
开发者ID:TheTypoMaster,项目名称:x86-android-5.0,代码行数:37,代码来源:recovery.cpp
示例20: wipe_media
static void
wipe_media(int confirm) {
if (confirm) {
static char** title_headers = NULL;
if (title_headers == NULL) {
char* headers[] = { "Confirm wipe of all media data?",
" THIS CAN NOT BE UNDONE.",
"",
NULL };
title_headers = prepend_title((const char**)headers);
}
char* items[] = { " No",
" No",
" No",
" No",
" No",
" No",
" No",
" Yes -- delete all media data", // [7]
" No",
" No",
" No",
NULL };
int chosen_item = get_menu_selection(title_headers, items, 1, 0);
if (chosen_item != 7) {
return;
}
}
ui_print("\n-- Wiping media...\n");
erase_volume(MEDIA_ROOT);
ui_print("Media wipe complete.\n");
}
开发者ID:fards,项目名称:ainol_elfii_bootable,代码行数:36,代码来源:recovery.c
注:本文中的prepend_title函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论