From 80c01b9bfed353182e4177f6f1854177181d2b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laci=20b=C3=A1?= Date: Fri, 12 Nov 2021 22:43:18 +0100 Subject: [PATCH] Settings dialog cleanup --- src/win/languages/en-US.rc | 3 --- src/win/languages/hu-HU.rc | 3 --- src/win/win_settings.c | 55 -------------------------------------- 3 files changed, 61 deletions(-) diff --git a/src/win/languages/en-US.rc b/src/win/languages/en-US.rc index 4c7460213..cf5956691 100644 --- a/src/win/languages/en-US.rc +++ b/src/win/languages/en-US.rc @@ -338,9 +338,6 @@ BEGIN CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,100,212 CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,226,373,1 - LTEXT "Language:",IDT_1700,7,237,41,10 - COMBOBOX IDC_COMBO_LANG,48,236,108,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP END DLG_SPECIFY_DIM DIALOG DISCARDABLE 0, 0, 175, 66 diff --git a/src/win/languages/hu-HU.rc b/src/win/languages/hu-HU.rc index 4604fcb91..84f4b4ecf 100644 --- a/src/win/languages/hu-HU.rc +++ b/src/win/languages/hu-HU.rc @@ -340,9 +340,6 @@ BEGIN CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,100,212 CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,226,373,1 - LTEXT "Nyelv:",IDT_1700,7,237,41,10 - COMBOBOX IDC_COMBO_LANG,48,236,108,120,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP END DLG_SPECIFY_DIM DIALOG DISCARDABLE 0, 0, 203, 66 diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 1a1aa12a1..3f3b4511d 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -78,9 +78,6 @@ static int first_cat = 0; static int dpi = 96; -/* Language */ -static LCID temp_language; - /* Machine category */ static int temp_machine_type, temp_machine, temp_cpu, temp_wait_states, temp_fpu, temp_sync; static cpu_family_t *temp_cpu_f; @@ -319,40 +316,6 @@ settings_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn return(i); } -int enum_helper, c; - -BOOL CALLBACK -EnumResLangProc(HMODULE hModule, LPCTSTR lpszType, LPCTSTR lpszName, WORD wIDLanguage, LONG_PTR lParam) -{ - wchar_t temp[LOCALE_NAME_MAX_LENGTH + 1]; - LCIDToLocaleName(wIDLanguage, temp, LOCALE_NAME_MAX_LENGTH, 0); - SendMessage((HWND)lParam, CB_ADDSTRING, 0, (LPARAM)temp); - SendMessage((HWND)lParam, CB_SETITEMDATA, c, (LPARAM)wIDLanguage); - - pclog("widl: %u, langid: %u, c: %u\n", wIDLanguage, lang_id, c); - if (wIDLanguage == lang_id) - enum_helper = c; - c++; - - return 1; -} - -/* Load available languages */ -static void -win_fill_languages(HWND hdlg) -{ - temp_language = GetThreadUILanguage(); - HWND lang_combo = GetDlgItem(hdlg, IDC_COMBO_LANG); - - SendMessage(lang_combo, CB_RESETCONTENT, 0, 0); - - enum_helper = -1; c = 0; - EnumResourceLanguages(hinstance, RT_MENU, L"MainMenu", &EnumResLangProc, (LPARAM)lang_combo); - pclog("enum_helper is %d\n", enum_helper); - - SendMessage(lang_combo, CB_SETCURSEL, enum_helper, 0); - pclog("win_fill_languages\n"); -} /* This does the initial read of global variables into the temporary ones. */ static void @@ -360,11 +323,6 @@ win_settings_init(void) { int i = 0; - /* Language */ - temp_language = lang_id; - pclog("temp_language is %u\n", lang_id); - win_fill_languages(hwndParentDialog); - /* Machine category */ temp_machine_type = machines[machine].type; temp_machine = machine; @@ -490,9 +448,6 @@ win_settings_changed(void) { int i = 0, j = 0; - /* Language */ - i = i || has_language_changed(temp_language); - /* Machine category */ i = i || (machine != temp_machine); i = i || (cpu_f != temp_cpu_f); @@ -583,9 +538,6 @@ win_settings_save(void) pc_reset_hard_close(); - /* Language */ - set_language(temp_language); - /* Machine category */ machine = temp_machine; cpu_f = temp_cpu_f; @@ -5238,13 +5190,6 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) EndDialog(hdlg, 0); win_notify_dlg_closed(); return TRUE; - case IDC_COMBO_LANG: - if (HIWORD(wParam) == CBN_SELCHANGE) { - HWND combo = GetDlgItem(hwndParentDialog, IDC_COMBO_LANG); - int index = SendMessage(combo, CB_GETCURSEL, 0, 0); - temp_language = SendMessage(combo, CB_GETITEMDATA, index, 0); - pclog("combobox changed -> temp_language = %u", temp_language); - } } break;