mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 12:40:33 +00:00
- Forgot to enable the GeoId code.
- Fixed another hardcoded Unicode string. - More indentation fixes. - No code changes. svn path=/trunk/; revision=28877
This commit is contained in:
parent
63d106c29f
commit
0addcc009e
1 changed files with 103 additions and 102 deletions
|
@ -41,7 +41,7 @@
|
||||||
HWND hList;
|
HWND hList;
|
||||||
HWND hLocaleList, hGeoList;
|
HWND hLocaleList, hGeoList;
|
||||||
|
|
||||||
BOOL CALLBACK
|
static BOOL CALLBACK
|
||||||
LocalesEnumProc(LPTSTR lpLocale)
|
LocalesEnumProc(LPTSTR lpLocale)
|
||||||
{
|
{
|
||||||
LCID lcid;
|
LCID lcid;
|
||||||
|
@ -54,14 +54,14 @@ LocalesEnumProc(LPTSTR lpLocale)
|
||||||
GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang));
|
GetLocaleInfo(lcid, LOCALE_SLANGUAGE, lang, sizeof(lang));
|
||||||
|
|
||||||
index = SendMessage(hList,
|
index = SendMessage(hList,
|
||||||
CB_ADDSTRING,
|
CB_ADDSTRING,
|
||||||
0,
|
0,
|
||||||
(LPARAM)lang);
|
(LPARAM)lang);
|
||||||
|
|
||||||
SendMessage(hList,
|
SendMessage(hList,
|
||||||
CB_SETITEMDATA,
|
CB_SETITEMDATA,
|
||||||
index,
|
index,
|
||||||
(LPARAM)lcid);
|
(LPARAM)lcid);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -112,16 +112,17 @@ CreateLanguagesList(HWND hwnd)
|
||||||
hList = hwnd;
|
hList = hwnd;
|
||||||
EnumSystemLocales(LocalesEnumProc, LCID_SUPPORTED);
|
EnumSystemLocales(LocalesEnumProc, LCID_SUPPORTED);
|
||||||
|
|
||||||
// Select current locale
|
/* Select current locale */
|
||||||
GetLocaleInfo(GetUserDefaultLCID(), LOCALE_SLANGUAGE, langSel, sizeof(langSel)); // or should it be System and not user?
|
/* or should it be System and not user? */
|
||||||
|
GetLocaleInfo(GetUserDefaultLCID(), LOCALE_SLANGUAGE, langSel, sizeof(langSel));
|
||||||
|
|
||||||
SendMessage(hList,
|
SendMessage(hList,
|
||||||
CB_SELECTSTRING,
|
CB_SELECTSTRING,
|
||||||
-1,
|
-1,
|
||||||
(LPARAM)langSel);
|
(LPARAM)langSel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets new locale
|
/* Sets new locale */
|
||||||
VOID
|
VOID
|
||||||
SetNewLocale(LCID lcid)
|
SetNewLocale(LCID lcid)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +177,7 @@ SetNewLocale(LCID lcid)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wsprintf(value, L"%04X", (DWORD)lcid);
|
wsprintf(value, _T("%04X"), (DWORD)lcid);
|
||||||
valuesize = (_tcslen(value) + 1) * sizeof(TCHAR);
|
valuesize = (_tcslen(value) + 1) * sizeof(TCHAR);
|
||||||
|
|
||||||
RegSetValueEx(localeKey, _T("Locale"), 0, REG_SZ, (BYTE *)value, valuesize);
|
RegSetValueEx(localeKey, _T("Locale"), 0, REG_SZ, (BYTE *)value, valuesize);
|
||||||
|
@ -213,7 +214,6 @@ SetNewLocale(LCID lcid)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Location enumerate procedure */
|
/* Location enumerate procedure */
|
||||||
#if 0
|
|
||||||
BOOL
|
BOOL
|
||||||
CALLBACK
|
CALLBACK
|
||||||
LocationsEnumProc(GEOID gId)
|
LocationsEnumProc(GEOID gId)
|
||||||
|
@ -234,14 +234,12 @@ LocationsEnumProc(GEOID gId)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enumerate all system locations identifiers */
|
/* Enumerate all system locations identifiers */
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
CreateLocationsList(HWND hWnd)
|
CreateLocationsList(HWND hWnd)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
GEOID userGeoID;
|
GEOID userGeoID;
|
||||||
TCHAR loc[MAX_STR_SIZE];
|
TCHAR loc[MAX_STR_SIZE];
|
||||||
|
|
||||||
|
@ -258,10 +256,9 @@ CreateLocationsList(HWND hWnd)
|
||||||
LANG_SYSTEM_DEFAULT);
|
LANG_SYSTEM_DEFAULT);
|
||||||
|
|
||||||
SendMessage(hGeoList,
|
SendMessage(hGeoList,
|
||||||
CB_SELECTSTRING,
|
CB_SELECTSTRING,
|
||||||
(WPARAM) -1,
|
(WPARAM) -1,
|
||||||
(LPARAM)loc);
|
(LPARAM)loc);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
|
@ -269,101 +266,105 @@ VerifyUnattendLCID(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
LRESULT lCount, lIndex, lResult;
|
LRESULT lCount, lIndex, lResult;
|
||||||
|
|
||||||
lCount = SendMessage(hList, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
|
lCount = SendMessage(hList, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
|
||||||
if (lCount == CB_ERR)
|
if (lCount == CB_ERR)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (lIndex = 0; lIndex < lCount; lIndex++)
|
for (lIndex = 0; lIndex < lCount; lIndex++)
|
||||||
{
|
{
|
||||||
lResult = SendMessage(hList, CB_GETITEMDATA, (WPARAM)lIndex, (LPARAM)0);
|
lResult = SendMessage(hList, CB_GETITEMDATA, (WPARAM)lIndex, (LPARAM)0);
|
||||||
if (lResult == CB_ERR)
|
if (lResult == CB_ERR)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lResult == (LCID)UnattendLCID)
|
if (lResult == (LCID)UnattendLCID)
|
||||||
{
|
{
|
||||||
SendMessage(hList, CB_SETCURSEL, (WPARAM)lIndex, (LPARAM)0);
|
SendMessage(hList, CB_SETCURSEL, (WPARAM)lIndex, (LPARAM)0);
|
||||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Property page dialog callback */
|
/* Property page dialog callback */
|
||||||
INT_PTR CALLBACK
|
INT_PTR CALLBACK
|
||||||
GeneralPageProc(HWND hwndDlg,
|
GeneralPageProc(HWND hwndDlg,
|
||||||
UINT uMsg,
|
UINT uMsg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
CreateLanguagesList(GetDlgItem(hwndDlg, IDC_LANGUAGELIST));
|
CreateLanguagesList(GetDlgItem(hwndDlg, IDC_LANGUAGELIST));
|
||||||
UpdateLocaleSample(hwndDlg, LOCALE_USER_DEFAULT);
|
UpdateLocaleSample(hwndDlg, LOCALE_USER_DEFAULT);
|
||||||
CreateLocationsList(GetDlgItem(hwndDlg, IDC_LOCATION_COMBO));
|
CreateLocationsList(GetDlgItem(hwndDlg, IDC_LOCATION_COMBO));
|
||||||
if (IsUnattendedSetupEnabled)
|
if (IsUnattendedSetupEnabled)
|
||||||
{
|
{
|
||||||
if (VerifyUnattendLCID(hwndDlg))
|
if (VerifyUnattendLCID(hwndDlg))
|
||||||
{
|
{
|
||||||
SetNewLocale(UnattendLCID);
|
SetNewLocale(UnattendLCID);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
|
||||||
switch (LOWORD(wParam))
|
|
||||||
{
|
|
||||||
case IDC_LANGUAGELIST:
|
|
||||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
|
||||||
{
|
|
||||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case IDC_SETUP_BUTTON:
|
|
||||||
SetupApplet(hwndDlg, uMsg, wParam, lParam);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_COMMAND:
|
||||||
{
|
switch (LOWORD(wParam))
|
||||||
LPNMHDR lpnm = (LPNMHDR)lParam;
|
{
|
||||||
if (lpnm->code == (UINT)PSN_APPLY)
|
case IDC_LANGUAGELIST:
|
||||||
{
|
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||||
// Apply changes
|
{
|
||||||
LCID NewLcid;
|
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||||
int iCurSel;
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// Acquire new value
|
case IDC_SETUP_BUTTON:
|
||||||
iCurSel = SendMessage(hList,
|
SetupApplet(hwndDlg, uMsg, wParam, lParam);
|
||||||
CB_GETCURSEL,
|
break;
|
||||||
0,
|
}
|
||||||
0);
|
break;
|
||||||
if (iCurSel == CB_ERR)
|
|
||||||
break;
|
|
||||||
|
|
||||||
NewLcid = SendMessage(hList,
|
case WM_NOTIFY:
|
||||||
CB_GETITEMDATA,
|
{
|
||||||
iCurSel,
|
LPNMHDR lpnm = (LPNMHDR)lParam;
|
||||||
0);
|
|
||||||
|
|
||||||
if (NewLcid == (LCID)CB_ERR)
|
if (lpnm->code == (UINT)PSN_APPLY)
|
||||||
break;
|
{
|
||||||
|
/* Apply changes */
|
||||||
|
LCID NewLcid;
|
||||||
|
INT iCurSel;
|
||||||
|
|
||||||
// Actually set new locale
|
/* Acquire new value */
|
||||||
SetNewLocale(NewLcid);
|
iCurSel = SendMessage(hList,
|
||||||
}
|
CB_GETCURSEL,
|
||||||
}
|
0,
|
||||||
break;
|
0);
|
||||||
}
|
if (iCurSel == CB_ERR)
|
||||||
return FALSE;
|
break;
|
||||||
|
|
||||||
|
NewLcid = SendMessage(hList,
|
||||||
|
CB_GETITEMDATA,
|
||||||
|
iCurSel,
|
||||||
|
0);
|
||||||
|
if (NewLcid == (LCID)CB_ERR)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Set new locale */
|
||||||
|
SetNewLocale(NewLcid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue