mirror of
https://github.com/reactos/reactos.git
synced 2025-06-09 20:11:14 +00:00
[REGEDIT] Improve message box for importing registry files (#3006)
- Change the messagebox's icon type from warning icon to question icon, because this is done in Windows Regedit too. - Use two buttons (Yes and No) or three buttons (Yes, No, and Cancel) depending on the file count. CORE-15494 Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
parent
85fdcdf2cc
commit
25f78cda99
1 changed files with 18 additions and 3 deletions
|
@ -140,16 +140,31 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
|
||||||
{
|
{
|
||||||
WCHAR szText[512];
|
WCHAR szText[512];
|
||||||
WCHAR filename[MAX_PATH];
|
WCHAR filename[MAX_PATH];
|
||||||
|
LPWSTR command_line = s;
|
||||||
|
UINT count = 0, mbType = MB_YESNO;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
get_file_name(&s, filename);
|
get_file_name(&command_line, filename);
|
||||||
if (!filename[0])
|
while (filename[0])
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
get_file_name(&command_line, filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
{
|
{
|
||||||
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
|
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified.");
|
||||||
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
|
InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage);
|
||||||
exit(4);
|
exit(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count > 1)
|
||||||
|
{
|
||||||
|
/* Enable three buttons if we have more than one file */
|
||||||
|
mbType = MB_YESNOCANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_file_name(&s, filename);
|
||||||
while (filename[0])
|
while (filename[0])
|
||||||
{
|
{
|
||||||
/* Request import confirmation */
|
/* Request import confirmation */
|
||||||
|
@ -159,7 +174,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
|
||||||
|
|
||||||
LoadStringW(hInst, IDS_IMPORT_PROMPT, szText, COUNT_OF(szText));
|
LoadStringW(hInst, IDS_IMPORT_PROMPT, szText, COUNT_OF(szText));
|
||||||
|
|
||||||
choice = InfoMessageBox(NULL, MB_YESNOCANCEL | MB_ICONWARNING, szTitle, szText, filename);
|
choice = InfoMessageBox(NULL, mbType | MB_ICONQUESTION, szTitle, szText, filename);
|
||||||
|
|
||||||
switch (choice)
|
switch (choice)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue