Menu reloading fixes for Multilanguage UI
This commit is contained in:
@@ -714,11 +714,6 @@ usage:
|
|||||||
if (lang_init)
|
if (lang_init)
|
||||||
lang_id = lang_init;
|
lang_id = lang_init;
|
||||||
|
|
||||||
lang_init = lang_id;
|
|
||||||
lang_id = 0;
|
|
||||||
if (lang_init)
|
|
||||||
set_language(lang_init);
|
|
||||||
|
|
||||||
/* All good! */
|
/* All good! */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
@@ -239,6 +239,9 @@ extern void media_menu_update_cdrom(int id);
|
|||||||
extern void media_menu_update_zip(int id);
|
extern void media_menu_update_zip(int id);
|
||||||
extern void media_menu_update_mo(int id);
|
extern void media_menu_update_mo(int id);
|
||||||
|
|
||||||
|
/* Functions in win_ui.c */
|
||||||
|
extern HMENU menuMain;
|
||||||
|
extern void ResetAllMenus();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@@ -269,9 +269,11 @@ set_language(uint32_t id)
|
|||||||
LoadCommonStrings();
|
LoadCommonStrings();
|
||||||
|
|
||||||
/* Reload main menu */
|
/* Reload main menu */
|
||||||
SetMenu(hwndMain, LoadMenu(hinstance, L"MainMenu"));
|
menuMain = LoadMenu(hinstance, L"MainMenu");
|
||||||
|
SetMenu(hwndMain, menuMain);
|
||||||
|
|
||||||
/* Re-init media menu */
|
/* Re-init all the menus */
|
||||||
|
ResetAllMenus();
|
||||||
media_menu_init();
|
media_menu_init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -203,13 +203,13 @@ delete_submenu(HMENU parent, HMENU target)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int menu_vidapi = -1;
|
||||||
|
static HMENU cur_menu = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_render_options_menu()
|
show_render_options_menu()
|
||||||
{
|
{
|
||||||
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
static int menu_vidapi = -1;
|
|
||||||
static HMENU cur_menu = NULL;
|
|
||||||
|
|
||||||
if (vid_api == menu_vidapi)
|
if (vid_api == menu_vidapi)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ video_set_filter_menu(HMENU menu)
|
|||||||
EnableMenuItem(menu, IDM_VID_FILTER_LINEAR, vid_api == 0 ? MF_GRAYED : MF_ENABLED);
|
EnableMenuItem(menu, IDM_VID_FILTER_LINEAR, vid_api == 0 ? MF_GRAYED : MF_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
ResetAllMenus(void)
|
ResetAllMenus(void)
|
||||||
{
|
{
|
||||||
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, MF_UNCHECKED);
|
||||||
@@ -294,6 +294,9 @@ ResetAllMenus(void)
|
|||||||
CheckMenuItem(menuMain, IDM_VID_SDL_OPENGL, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_SDL_OPENGL, MF_UNCHECKED);
|
||||||
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
||||||
CheckMenuItem(menuMain, IDM_VID_OPENGL_CORE, MF_UNCHECKED);
|
CheckMenuItem(menuMain, IDM_VID_OPENGL_CORE, MF_UNCHECKED);
|
||||||
|
|
||||||
|
menu_vidapi = -1;
|
||||||
|
cur_menu = NULL;
|
||||||
show_render_options_menu();
|
show_render_options_menu();
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_VNC
|
#ifdef USE_VNC
|
||||||
@@ -1401,9 +1404,10 @@ ui_init(int nCmdShow)
|
|||||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset all menus to their defaults. */
|
/* Load the desired language, and reset all menus to their defaults */
|
||||||
ResetAllMenus();
|
uint32_t helper_lang = lang_id;
|
||||||
media_menu_init();
|
lang_id = 0;
|
||||||
|
set_language(helper_lang);
|
||||||
|
|
||||||
/* Make the window visible on the screen. */
|
/* Make the window visible on the screen. */
|
||||||
ShowWindow(hwnd, nCmdShow);
|
ShowWindow(hwnd, nCmdShow);
|
||||||
|
Reference in New Issue
Block a user