Add mechanism so that task_database informs the menu driver that
we need to refresh the horizontal list. Kivutar; make the icons work again after we do a horizontal list refresh
This commit is contained in:
parent
f2a608b131
commit
039ba91c48
|
@ -773,8 +773,7 @@ static void glui_context_reset(void)
|
||||||
settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true);
|
settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int glui_environ(void *data, void *data2,
|
static int glui_environ(menu_environ_cb_t type, void *data)
|
||||||
menu_environ_cb_t type)
|
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -736,7 +736,7 @@ static void rgui_populate_entries(const char *path,
|
||||||
rgui_navigation_set(true);
|
rgui_navigation_set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rgui_environ(void *data, void *data2, menu_environ_cb_t type)
|
static int rgui_environ(menu_environ_cb_t type, void *data)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -312,7 +312,7 @@ static void rmenu_free(void *data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rmenu_environ(void *data, void *data2, menu_environ_cb_t type)
|
static int rmenu_environ(menu_environ_cb_t type, void *data)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -676,7 +676,7 @@ static void rmenu_xui_list_set_selection(file_list_t *list)
|
||||||
XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list));
|
XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rmenu_xui_environ(void *data, void *data2, menu_environ_cb_t type)
|
static int rmenu_xui_environ(menu_environ_cb_t type, void *data)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1041,37 +1041,37 @@ static void xmb_list_open_horizontal_list(xmb_handle_t *xmb, menu_handle_t *menu
|
||||||
static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
|
static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
|
||||||
menu_handle_t *menu)
|
menu_handle_t *menu)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
char mediapath[PATH_MAX_LENGTH] = {0};
|
char mediapath[PATH_MAX_LENGTH] = {0};
|
||||||
char themepath[PATH_MAX_LENGTH] = {0};
|
char themepath[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
fill_pathname_join(mediapath, settings->assets_directory, "xmb", sizeof(mediapath));
|
fill_pathname_join(mediapath, settings->assets_directory, "xmb", sizeof(mediapath));
|
||||||
fill_pathname_join(themepath, mediapath, XMB_THEME, sizeof(themepath));
|
fill_pathname_join(themepath, mediapath, XMB_THEME, sizeof(themepath));
|
||||||
|
|
||||||
|
xmb_context_destroy_horizontal_list(xmb, menu);
|
||||||
if (xmb->horizontal_list)
|
if (xmb->horizontal_list)
|
||||||
free(xmb->horizontal_list);
|
free(xmb->horizontal_list);
|
||||||
xmb->horizontal_list = NULL;
|
xmb->horizontal_list = NULL;
|
||||||
xmb_context_destroy_horizontal_list(xmb, menu);
|
|
||||||
xmb_init_horizontal_list(menu, xmb);
|
xmb_init_horizontal_list(menu, xmb);
|
||||||
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xmb_environ(void *data, void *data2, menu_environ_cb_t type)
|
static int xmb_environ(menu_environ_cb_t type, void *data)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case MENU_ENVIRON_RESET_HORIZONTAL_LIST:
|
case MENU_ENVIRON_RESET_HORIZONTAL_LIST:
|
||||||
{
|
{
|
||||||
char mediapath[PATH_MAX_LENGTH] = {0};
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
char themepath[PATH_MAX_LENGTH] = {0};
|
xmb_handle_t *xmb = menu ?
|
||||||
|
(xmb_handle_t*)menu->userdata : NULL;
|
||||||
|
|
||||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
if (!xmb || !menu)
|
||||||
menu_handle_t *menu = (menu_handle_t*)data2;
|
return -1;
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
fill_pathname_join(mediapath, settings->assets_directory, "xmb", sizeof(mediapath));
|
xmb_refresh_horizontal_list(xmb, menu);
|
||||||
fill_pathname_join(themepath, mediapath, XMB_THEME, sizeof(themepath));
|
|
||||||
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1099,12 +1099,6 @@ static void xmb_list_open(xmb_handle_t *xmb)
|
||||||
else if (xmb->depth < xmb->old_depth)
|
else if (xmb->depth < xmb->old_depth)
|
||||||
dir = -1;
|
dir = -1;
|
||||||
|
|
||||||
/* TODO, call xmb_refresh_horizontal_list when a new scanning process is
|
|
||||||
started instead of using this condition. It causes a small lag when comming
|
|
||||||
back to the main menu from a submenu. */
|
|
||||||
if (dir == -1 && xmb->depth == 1 && xmb->categories.selection_ptr == 0)
|
|
||||||
xmb_refresh_horizontal_list(xmb, menu);
|
|
||||||
|
|
||||||
xmb_list_open_horizontal_list(xmb, menu);
|
xmb_list_open_horizontal_list(xmb, menu);
|
||||||
|
|
||||||
xmb_list_open_old(xmb, xmb->selection_buf_old,
|
xmb_list_open_old(xmb, xmb->selection_buf_old,
|
||||||
|
|
|
@ -467,3 +467,17 @@ void menu_driver_unset_alive(void)
|
||||||
{
|
{
|
||||||
menu_alive = false;
|
menu_alive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menu_environment_cb(menu_environ_cb_t type, void *data)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->environ_cb)
|
||||||
|
{
|
||||||
|
int ret = driver->environ_cb(type, data);
|
||||||
|
if (ret == 0)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -114,8 +114,7 @@ typedef struct menu_ctx_driver
|
||||||
uint32_t label_hash, uint32_t menu_label_hash);
|
uint32_t label_hash, uint32_t menu_label_hash);
|
||||||
bool (*load_image)(void *data, menu_image_type_t type);
|
bool (*load_image)(void *data, menu_image_type_t type);
|
||||||
const char *ident;
|
const char *ident;
|
||||||
int (*environ_cb)(void *data, void *data2,
|
int (*environ_cb)(menu_environ_cb_t type, void *data);
|
||||||
menu_environ_cb_t type);
|
|
||||||
bool (*perform_action)(void* data, unsigned action);
|
bool (*perform_action)(void* data, unsigned action);
|
||||||
} menu_ctx_driver_t;
|
} menu_ctx_driver_t;
|
||||||
|
|
||||||
|
@ -221,6 +220,8 @@ void menu_driver_unset_alive(void);
|
||||||
|
|
||||||
size_t menu_driver_list_get_selection(void);
|
size_t menu_driver_list_get_selection(void);
|
||||||
|
|
||||||
|
bool menu_environment_cb(menu_environ_cb_t type, void *data);
|
||||||
|
|
||||||
int menu_driver_bind_init(menu_file_list_cbs_t *cbs,
|
int menu_driver_bind_init(menu_file_list_cbs_t *cbs,
|
||||||
const char *path, const char *label, unsigned type, size_t idx,
|
const char *path, const char *label, unsigned type, size_t idx,
|
||||||
const char *elem0, const char *elem1,
|
const char *elem0, const char *elem1,
|
||||||
|
|
|
@ -72,6 +72,7 @@ static int database_info_iterate_start
|
||||||
RARCH_LOG("msg: %s\n", msg);
|
RARCH_LOG("msg: %s\n", msg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
db->status = DATABASE_STATUS_ITERATE;
|
db->status = DATABASE_STATUS_ITERATE;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -410,6 +411,9 @@ void rarch_main_data_db_iterate(bool is_thread, void *data)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rarch_main_msg_queue_push_new(MSG_SCANNING_OF_DIRECTORY_FINISHED, 0, 180, true);
|
rarch_main_msg_queue_push_new(MSG_SCANNING_OF_DIRECTORY_FINISHED, 0, 180, true);
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_environment_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST, NULL);
|
||||||
|
#endif
|
||||||
db->status = DATABASE_STATUS_FREE;
|
db->status = DATABASE_STATUS_FREE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue