fixed hardcode string in syssetup by Pierre Schweitzer (email : heis_spiter at hotmail dot com)

See issue #2247 for more details.

svn path=/trunk/; revision=26954
This commit is contained in:
Magnus Olsen 2007-05-31 20:52:44 +00:00
parent 977e1bb11b
commit 4fc04f9002
16 changed files with 266 additions and 32 deletions

View file

@ -210,4 +210,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -235,4 +235,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -236,4 +236,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -216,4 +216,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -236,4 +236,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "L'installation ne peut pas continuer tant que vous n'avez pas entré votre nom."
IDS_WZD_SETCOMPUTERNAME "L'installation a échoué lors de la définition du nom de votre ordinateur."
IDS_WZD_COMPUTERNAME "L'installation ne peut continuer tant que vous n'avez pas entré le nom de votre ordinateur."
IDS_WZD_PASSWORDEMPTY "Vous devez entrer un mot de passe !"
IDS_WZD_PASSWORDMATCH "Les mots de passe entrés ne correspondent pas. Veuillez saisir une nouvelle fois le mot de passe désiré."
IDS_WZD_PASSWORDCHAR "Le mot de passe entré contient des caractères invalides. Veuillez saisir un mot de passe correct."
IDS_WZD_LOCALTIME "L'installation n'a pas réussi à définir l'heure locale."
END
/* EOF */

View file

@ -243,4 +243,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -234,4 +234,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -227,4 +227,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -214,4 +214,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -238,4 +238,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -214,4 +214,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -239,4 +239,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "RosPasjans.lnk"
IDS_SHORT_WINEMINE "ROSaper.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -224,4 +224,15 @@ BEGIN
IDS_SHORT_SOLITAIRE "Solitaire.lnk"
IDS_SHORT_WINEMINE "WineMine.lnk"
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -199,4 +199,14 @@ BEGIN
IDS_REASON_UNKNOWN ""
END
STRINGTABLE
BEGIN
IDS_WZD_NAME "Setup cannot continue until you enter your name."
IDS_WZD_SETCOMPUTERNAME "Setup failed to set the computer name."
IDS_WZD_COMPUTERNAME "Setup cannot continue until you enter the name of your computer."
IDS_WZD_PASSWORDEMPTY "You must enter a password !"
IDS_WZD_PASSWORDMATCH "The passwords you entered do not match. Please enter the desired password again."
IDS_WZD_PASSWORDCHAR "The password you entered contains invalid characters. Please enter a cleaned password."
IDS_WZD_LOCALTIME "Setup was unable to set the local time."
END
/* EOF */

View file

@ -127,6 +127,14 @@
#define IDS_SHORT_SOLITAIRE 3411
#define IDS_SHORT_WINEMINE 3412
#define IDS_WZD_NAME 3450
#define IDS_WZD_SETCOMPUTERNAME 3451
#define IDS_WZD_COMPUTERNAME 3452
#define IDS_WZD_PASSWORDEMPTY 3453
#define IDS_WZD_PASSWORDMATCH 3454
#define IDS_WZD_PASSWORDCHAR 3455
#define IDS_WZD_LOCALTIME 3456
#define IDR_GPL 4000
#endif /* RESOURCE_H */

View file

@ -1,7 +1,10 @@
/*
* PROJECT: System setup
* LICENSE: GPL - See COPYING in the top level directory
* PROGRAMMER: Eric Kohl
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: System setup
* FILE: dll/win32/syssetup/wizard.c
* PURPOSE: GUI controls
* PROGRAMMERS: Eric Kohl
* Pierre Schweitzer <heis_spiter@hotmail.com>
*/
/* INCLUDES *****************************************************************/
@ -446,6 +449,8 @@ OwnerPageDlgProc(HWND hwndDlg,
{
TCHAR OwnerName[51];
TCHAR OwnerOrganization[51];
WCHAR Title[64];
WCHAR ErrorName[256];
LPNMHDR lpnm;
switch (uMsg)
@ -486,10 +491,15 @@ OwnerPageDlgProc(HWND hwndDlg,
OwnerName[0] = 0;
if (GetDlgItemText(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
{
MessageBox(hwndDlg,
_T("Setup cannot continue until you enter your name."),
_T("ReactOS Setup"),
MB_ICONERROR | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0])))
{
wcscpy(Title, L"ReactOS Setup");
}
if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, sizeof(ErrorName) / sizeof(ErrorName[0])))
{
wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
}
MessageBox(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
@ -527,12 +537,20 @@ static
BOOL
WriteComputerSettings(TCHAR * ComputerName, HWND hwndDlg)
{
WCHAR Title[64];
WCHAR ErrorComputerName[256];
if (!SetComputerName(ComputerName))
{
MessageBox(hwndDlg,
_T("Setup failed to set the computer name."),
_T("ReactOS Setup"),
MB_ICONERROR | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0])))
{
wcscpy(Title, L"ReactOS Setup");
}
if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName,
sizeof(ErrorComputerName) / sizeof(ErrorComputerName[0])))
{
wcscpy(ErrorComputerName, L"Setup failed to set the computer name.");
}
MessageBox(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
return FALSE;
}
@ -552,9 +570,17 @@ ComputerPageDlgProc(HWND hwndDlg,
TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
TCHAR Password1[15];
TCHAR Password2[15];
PWCHAR Password;
WCHAR Title[64];
WCHAR EmptyComputerName[256], EmptyPassword[256], NotMatchPassword[256], WrongPassword[256];
DWORD Length;
LPNMHDR lpnm;
if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0])))
{
wcscpy(Title, L"ReactOS Setup");
}
switch (uMsg)
{
case WM_INITDIALOG:
@ -603,10 +629,12 @@ ComputerPageDlgProc(HWND hwndDlg,
case PSN_WIZNEXT:
if (GetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName, 64) == 0)
{
MessageBox(hwndDlg,
_T("Setup cannot continue until you enter the name of your computer."),
_T("ReactOS Setup"),
MB_ICONERROR | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
sizeof(EmptyComputerName) / sizeof(EmptyComputerName[0])))
{
wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
}
MessageBox(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME));
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
return TRUE;
@ -622,21 +650,50 @@ ComputerPageDlgProc(HWND hwndDlg,
return TRUE;
}
/* Check admin passwords */
GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15);
GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15);
/* Check if admin passwords have been entered */
if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15) == 0) ||
(GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15) == 0))
{
if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
sizeof(EmptyPassword) / sizeof(EmptyPassword[0])))
{
wcscpy(EmptyPassword, L"You must enter a password !");
}
MessageBox(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
return TRUE;
}
/* Check if passwords match */
if (_tcscmp(Password1, Password2))
{
MessageBox(hwndDlg,
_T("The passwords you entered do not match. Please enter "\
"the desired password again."),
_T("ReactOS Setup"),
MB_ICONERROR | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
sizeof(NotMatchPassword) / sizeof(NotMatchPassword[0])))
{
wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
}
MessageBox(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
return TRUE;
}
/* FIXME: check password for invalid characters */
/* Check password for invalid characters */
Password = (PWCHAR)Password1;
while (*Password)
{
if (!isprint(*Password))
{
if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
sizeof(WrongPassword) / sizeof(WrongPassword[0])))
{
wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
}
MessageBox(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
return TRUE;
break;
}
Password++;
}
/* FIXME: Set admin password */
break;
@ -1329,6 +1386,8 @@ SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
static BOOL
WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
{
WCHAR Title[64];
WCHAR ErrorLocalTime[256];
GetLocalSystemTime(hwndDlg, SetupData);
SetLocalTimeZone(GetDlgItem(hwndDlg, IDC_TIMEZONELIST),
SetupData);
@ -1336,10 +1395,16 @@ WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
SetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT));
if(!SetSystemLocalTime(hwndDlg, SetupData))
{
MessageBox(hwndDlg,
_T("Setup was unable to set the local time."),
_T("ReactOS Setup"),
MB_ICONWARNING | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0])))
{
wcscpy(Title, L"ReactOS Setup");
}
if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
sizeof(ErrorLocalTime) / sizeof(ErrorLocalTime[0])))
{
wcscpy(ErrorLocalTime, L"Setup failed to set the computer name.");
}
MessageBox(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
return FALSE;
}
@ -1353,6 +1418,8 @@ DateTimePageDlgProc(HWND hwndDlg,
LPARAM lParam)
{
PSETUPDATA SetupData;
WCHAR Title[64];
WCHAR ErrorLocalTime[256];
/* Retrieve pointer to the global setup data */
SetupData = (PSETUPDATA)GetWindowLongPtr (hwndDlg, GWL_USERDATA);
@ -1413,10 +1480,16 @@ DateTimePageDlgProc(HWND hwndDlg,
SetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT));
if(!SetSystemLocalTime(hwndDlg, SetupData))
{
MessageBox(hwndDlg,
_T("Setup was unable to set the local time."),
_T("ReactOS Setup"),
MB_ICONWARNING | MB_OK);
if (0 == LoadStringW(hDllInstance, IDS_REACTOS_SETUP, Title, sizeof(Title) / sizeof(Title[0])))
{
wcscpy(Title, L"ReactOS Setup");
}
if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
sizeof(ErrorLocalTime) / sizeof(ErrorLocalTime[0])))
{
wcscpy(ErrorLocalTime, L"Setup failed to set the computer name.");
}
MessageBox(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
}
}
break;