Пример #1
0
struct _menuUnit* info_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    menuUnit_set_name(p, "<~info.name>");
    menuUnit_set_title(p, "<~info.title>");
    menuUnit_set_icon(p, "@info");
    assert_if_fail(menuNode_init(p) != NULL);
    //mount
    struct _menuUnit *temp = common_ui_init();
    menuUnit_set_name(temp, "<~info.mount.name>"); 
    menuUnit_set_icon(temp, "@info.mount");
    menuUnit_set_show(temp, &info_mount_show);
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    //log
    temp = common_ui_init();
    menuUnit_set_name(temp, "<~info.log.name>"); 
    menuUnit_set_icon(temp, "@info.log");
    menuUnit_set_show(temp, &info_log_show);
    assert_if_fail(menuNode_add(p, temp) == RET_OK);

    //about
    temp = common_ui_init();
    menuUnit_set_name(temp, "<~info.about.name>"); 
    menuUnit_set_icon(temp, "@info.about");
    menuUnit_set_show(temp, &info_about_show);
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return p;
}
Пример #2
0
struct _menuUnit * sd_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    strncpy(p->name, "<~sd.name>", MENU_LEN);
    strncpy(p->title_name, "<~sd.title_name>", MENU_LEN);
    strncpy(p->icon, "@sd",  MENU_LEN);
    p->result = 0;
    return_null_if_fail(menuNode_init(p) != NULL);
    //install from sd
    struct _menuUnit  *temp = common_ui_init();
    return_null_if_fail(temp != NULL);
    menuUnit_set_icon(temp, "@sd.choose");
    strncpy(temp->name, "<~sd.install.name>", MENU_LEN);
    temp->show = &sd_menu_show;
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    //install update.bin from sd
    temp = common_ui_init();
    menuUnit_set_icon(temp, "@sd.install");
    strncpy(temp->name,"<~sd.update.name>", MENU_LEN);
    temp->show = &sd_update_show;
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    if (acfg()->sd_ext == 1)
    {
        //install from external_sd
        struct _menuUnit  *temp = common_ui_init();
        return_null_if_fail(temp != NULL);
        menuUnit_set_icon(temp, "@sd.choose");
        strncpy(temp->name, "<~sdext.install.name>", MENU_LEN);
        temp->show = &sdext_menu_show;
        assert_if_fail(menuNode_add(p, temp) == RET_OK);
    }
    return p;
}
Пример #3
0
struct _menuUnit* backup_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    menuUnit_set_name(p, "<~backup.name>");
    menuUnit_set_title(p, "<~backup.title>");
    menuUnit_set_icon(p, "@backup");
    menuUnit_set_show(p, &common_menu_show);
    return_null_if_fail(menuNode_init(p) != NULL);
    backup_menu = p;

    //set backup default format
     struct _menuUnit* temp = set_backup_fromat_init();
     assert_if_fail(menuNode_add(p, temp) == RET_OK);
    //backup
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~backup.backup.name>");
    menuUnit_set_result(temp, BACKUP_ALL);
    menuUnit_set_show(temp, &backup_child_show);
    //restore
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~backup.restore.name>");
    menuUnit_set_result(temp, RESTORE_ALL);
    menuUnit_set_show(temp, &restore_child_show);
    //advanced backup
    temp = advanced_backup_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    //advanced restore
    temp = advanced_restore_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return p;
}
Пример #4
0
struct _menuUnit* advanced_restore_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    menuUnit_set_name(p, "<~advanced_restore.name>");
    menuUnit_set_show(p, &common_menu_show);
    return_null_if_fail(menuNode_init(p) != NULL);
    //restore boot
    struct _menuUnit* temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_restore.boot.name>");
    menuUnit_set_result(temp, RESTORE_BOOT);
    menuUnit_set_show(temp, &restore_child_show);
    //restore system
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_restore.system.name>");
    menuUnit_set_result(temp, RESTORE_SYSTEM);
    menuUnit_set_show(temp, &restore_child_show);
    //restore data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_restore.data.name>");
    menuUnit_set_result(temp, RESTORE_DATA);
    menuUnit_set_show(temp, &restore_child_show);
    //restore cache
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_restore.cache.name>");
    menuUnit_set_result(temp, RESTORE_CACHE);
    menuUnit_set_show(temp, &restore_child_show);
    return p;
}
Пример #5
0
struct _menuUnit* advanced_backup_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    menuUnit_set_name(p, "<~advanced_backup.name>");
    menuUnit_set_show(p, &common_menu_show);
    return_null_if_fail(menuNode_init(p) != NULL);
    //backup boot
    struct _menuUnit* temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_backup.boot.name>");
    menuUnit_set_result(temp, BACKUP_BOOT);
    menuUnit_set_show(temp, &backup_child_show);
    //backup system
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_backup.system.name>");
    menuUnit_set_result(temp, BACKUP_SYSTEM);
    menuUnit_set_show(temp, &backup_child_show);
    //backup data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_backup.data.name>");
    menuUnit_set_result(temp, BACKUP_DATA);
    menuUnit_set_show(temp, &backup_child_show);
    //backup cache
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    menuUnit_set_name(temp, "<~advanced_backup.cache.name>");
    menuUnit_set_result(temp, BACKUP_CACHE);
    menuUnit_set_show(temp, &backup_child_show);
    return p;
}
Пример #6
0
struct _menuUnit* set_backup_fromat_init() {
	struct _menuUnit* p = common_ui_init();
	return_null_if_fail(p != NULL);
	menuUnit_set_name(p, "<~root.set.backup.format>");
	menuUnit_set_title(p, "set backup format");
	menuUnit_set_icon(p, "@root");
	assert_if_fail(menuNode_init(p) != NULL);
	//tar backup format
	struct _menuUnit* temp = common_ui_init();
	menuUnit_set_name(temp, "tar backup format(default)");
	menuUnit_set_show(temp, &set_default_backup_format);
	temp->result = TAR_FORMAT;
	assert_if_fail(menuNode_add(p, temp) == RET_OK);
	//dup backup format
	temp = common_ui_init();
	menuUnit_set_name(temp, "dup backup format");
	menuUnit_set_show(temp, &set_default_backup_format);
	temp->result = DUP_FORMAT;
	assert_if_fail(menuNode_add(p, temp) == RET_OK);
	return p;
}
Пример #7
0
struct _menuUnit * sd_ui_init()
{
    struct _menuUnit *p = common_ui_init();
    return_null_if_fail(p != NULL);
    strncpy(p->name, "<~sd.name>", MENU_LEN);
    strncpy(p->title_name, "<~sd.title_name>", MENU_LEN);
    strncpy(p->icon, "@sd",  MENU_LEN);
    p->result = 0;
    sd_menu = p;
    return_null_if_fail(menuNode_init(p) != NULL);
    struct _menuUnit  *temp = common_ui_init();
    return_null_if_fail(temp != NULL);
    menuUnit_set_icon(temp, "@sd.choose");
    strncpy(temp->name, "<~sd.install.name>", MENU_LEN);
    temp->show = &sd_menu_show;
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    temp = common_ui_init();
    menuUnit_set_icon(temp, "@sd.install");
    strncpy(temp->name,"<~sd.update.name>", MENU_LEN);
    temp->show = &sd_update_show;
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return p;
}
Пример #8
0
struct _menuUnit* wipe_ui_init()
{
    ag_canvas(&canvas_wipemenu,agw(),agh());
	
    struct _menuUnit* p = common_ui_init();
    return_null_if_fail(p != NULL);
    return_null_if_fail(menuUnit_set_name(p, "<~wipe.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_title(p, "<~wipe.title>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(p, "@wipe") == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(p, &wipe_menu_show));
    return_null_if_fail(menuNode_init(p) != NULL);
    //wipe_data/factory reset
    struct _menuUnit* temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.factory.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_FACTORY) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, "<~wipe.factory.desc>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, "@wipe.all") == RET_OK);	
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //wipe_data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.data.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_DATA) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, "<~wipe.data.desc>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, "@wipe.data") == RET_OK);		
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //wipe_cache
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.cache.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_CACHE) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, "<~wipe.cache.desc>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, "@wipe.cache") == RET_OK);		
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    return p;
}
Пример #9
0
struct _menuUnit *mount_ui_init()
{
    struct _menuUnit* p = common_ui_init();
    return_null_if_fail(p != NULL);
    strncpy(p->name, "<~mount.name>", MENU_LEN);
    menuUnit_set_title(p, "<~mount.title>");
    menuUnit_set_icon(p, "@mount");
    menuUnit_set_show(p, &mount_menu_show);
    return_null_if_fail(menuNode_init(p) != NULL);
    //mount cache?
    struct _menuUnit* temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~mount.cache.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, MOUNT_CACHE) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
    mount_cache_node = temp;
    //mount data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~mount.data.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, MOUNT_DATA) == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
    mount_data_node = temp;

    //mount system
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~mount.system.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, MOUNT_SYSTEM) == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
    mount_system_node = temp;
    //mount sdcard
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~mount.sdcard.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, MOUNT_SDCARD) == RET_OK);
    return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
    return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
    mount_sd_node = temp;

    if (acfg()->sd_ext == 1)
    {
        //mount internal_sd
        temp = common_ui_init();
        assert_if_fail(menuNode_add(p, temp) == RET_OK);
        return_null_if_fail(menuUnit_set_name(temp, "<~mount.sdext.name>") == RET_OK);
        return_null_if_fail(menuUnit_set_result(temp, MOUNT_SDEXT) == RET_OK);
        return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
        return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
        return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
        mount_sd_ext_node = temp;
    }
    //toggle usb stroage
    if (acfg()->lun_file[0] != 0)
    {
        temp = common_ui_init();
        assert_if_fail(menuNode_add(p, temp) == RET_OK);
        return_null_if_fail(menuUnit_set_name(temp, "<~mount.toggle.name>") == RET_OK);
        return_null_if_fail(menuUnit_set_result(temp, MOUNT_TOGGLE) == RET_OK);
        return_null_if_fail(menuUnit_set_icon(temp, ICON_DISABLE) == RET_OK);
        return_null_if_fail(menuUnit_set_desc(temp, MOUNT_DESC_UNMOUNT) == RET_OK);
        return_null_if_fail(RET_OK == menuUnit_set_show(temp, &mount_child_show));
    }
    mount_node = p;
    return p;

}
Пример #10
0
struct _menuUnit* wipe_ui_init()
{
    struct _menuUnit* p = common_ui_init();
    return_null_if_fail(p != NULL);
    return_null_if_fail(menuUnit_set_name(p, "<~wipe.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_title(p, "<~wipe.title>") == RET_OK);
    return_null_if_fail(menuUnit_set_icon(p, "@wipe") == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(p, &wipe_menu_show));
    return_null_if_fail(menuNode_init(p) != NULL);
    //wipe_data/factory reset
    struct _menuUnit* temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.factory.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_FACTORY) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //wipe_data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.data.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_DATA) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //wipe_cache
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~wipe.cache.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, WIPE_CACHE) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format system
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.system.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_SYSTEM) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format data
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.data.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_DATA) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format cache
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.cache.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_CACHE) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format BOOT
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.boot.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_BOOT) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format SDCARD
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.sdcard.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_SDCARD) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    //format ALL
    temp = common_ui_init();
    assert_if_fail(menuNode_add(p, temp) == RET_OK);
    return_null_if_fail(menuUnit_set_name(temp, "<~format.all.name>") == RET_OK);
    return_null_if_fail(menuUnit_set_result(temp, FORMAT_ALL) == RET_OK);
    return_null_if_fail(RET_OK == menuUnit_set_show(temp, &wipe_item_show));
    return p;
}