mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 12:52:58 +00:00
[REGEDIT] Add back import prompt message lost during Wine sync. CORE-18770
This commit is contained in:
parent
8b75dce45a
commit
910822b8f5
1 changed files with 50 additions and 0 deletions
|
@ -123,7 +123,11 @@ typedef enum {
|
||||||
ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
|
ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
|
||||||
} REGEDIT_ACTION;
|
} REGEDIT_ACTION;
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i, BOOL silent)
|
||||||
|
#else
|
||||||
static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
|
static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_ADD: {
|
case ACTION_ADD: {
|
||||||
|
@ -131,6 +135,41 @@ static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
|
||||||
WCHAR *realname = NULL;
|
WCHAR *realname = NULL;
|
||||||
FILE *reg_file;
|
FILE *reg_file;
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
/* Request import confirmation */
|
||||||
|
if (!silent)
|
||||||
|
{
|
||||||
|
WCHAR szText[512];
|
||||||
|
int choice;
|
||||||
|
UINT mbType = MB_YESNO;
|
||||||
|
|
||||||
|
LoadStringW(hInst, IDS_IMPORT_PROMPT, szText, ARRAY_SIZE(szText));
|
||||||
|
|
||||||
|
if (argv[*i + 1] != NULL)
|
||||||
|
{
|
||||||
|
/* Enable three buttons if there's another file coming */
|
||||||
|
mbType = MB_YESNOCANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
choice = InfoMessageBox(NULL, mbType | MB_ICONQUESTION, szTitle, szText, filename);
|
||||||
|
switch (choice)
|
||||||
|
{
|
||||||
|
case IDNO:
|
||||||
|
return;
|
||||||
|
case IDCANCEL:
|
||||||
|
/* The cancel case is useful if the user is importing more than one registry file
|
||||||
|
* at a time, and wants to back out anytime during the import process. This way, the
|
||||||
|
* user doesn't have to resort to ending the regedit process abruptly just to cancel
|
||||||
|
* the operation.
|
||||||
|
* To achieve this, we skip all further command line arguments.
|
||||||
|
*/
|
||||||
|
*i = INT_MAX - 1;
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!lstrcmpW(filename, L"-"))
|
if (!lstrcmpW(filename, L"-"))
|
||||||
reg_file = stdin;
|
reg_file = stdin;
|
||||||
else
|
else
|
||||||
|
@ -190,6 +229,9 @@ BOOL ProcessCmdLine(WCHAR *cmdline)
|
||||||
WCHAR **argv;
|
WCHAR **argv;
|
||||||
int argc, i;
|
int argc, i;
|
||||||
REGEDIT_ACTION action = ACTION_ADD;
|
REGEDIT_ACTION action = ACTION_ADD;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
BOOL silent = FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
argv = CommandLineToArgvW(cmdline, &argc);
|
argv = CommandLineToArgvW(cmdline, &argc);
|
||||||
|
|
||||||
|
@ -231,6 +273,10 @@ BOOL ProcessCmdLine(WCHAR *cmdline)
|
||||||
/* unhandled */;
|
/* unhandled */;
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
silent = TRUE;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 'V':
|
case 'V':
|
||||||
/* ignored */;
|
/* ignored */;
|
||||||
break;
|
break;
|
||||||
|
@ -256,7 +302,11 @@ BOOL ProcessCmdLine(WCHAR *cmdline)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < argc; i++)
|
for (; i < argc; i++)
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
PerformRegAction(action, argv, &i, silent);
|
||||||
|
#else
|
||||||
PerformRegAction(action, argv, &i);
|
PerformRegAction(action, argv, &i);
|
||||||
|
#endif
|
||||||
|
|
||||||
LocalFree(argv);
|
LocalFree(argv);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue