[PATCH 1/3] regedit: Display a dialog message after successful/unsuccessful file import

Hugh McMaster hugh.mcmaster at outlook.com
Thu Feb 9 05:08:20 CST 2017


For bug https://bugs.winehq.org/show_bug.cgi?id=19526

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/regedit/framewnd.c | 7 ++++++-
 programs/regedit/regedit.rc | 2 ++
 programs/regedit/resource.h | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c
index 0f0ce2f..fb29ffb 100644
--- a/programs/regedit/framewnd.c
+++ b/programs/regedit/framewnd.c
@@ -360,8 +360,13 @@ static BOOL ImportRegistryFile(HWND hWnd)
     LoadStringW(hInst, IDS_FILEDIALOG_IMPORT_TITLE, title, COUNT_OF(title));
     ofn.lpstrTitle = title;
     if (GetOpenFileNameW(&ofn)) {
-        if (!import_registry_filename(ofn.lpstrFile))
+        if (!import_registry_filename(ofn.lpstrFile)) {
+            messagebox(hWnd, MB_OK|MB_ICONERROR, IDS_APP_TITLE, IDS_IMPORT_FAILED, ofn.lpstrFile);
             return FALSE;
+        } else {
+            messagebox(hWnd, MB_OK|MB_ICONINFORMATION, IDS_APP_TITLE,
+                       IDS_IMPORT_SUCCESSFUL, ofn.lpstrFile);
+        }
     } else {
         CheckCommDlgError(hWnd);
     }
diff --git a/programs/regedit/regedit.rc b/programs/regedit/regedit.rc
index 649abfa..4bfd23a 100644
--- a/programs/regedit/regedit.rc
+++ b/programs/regedit/regedit.rc
@@ -216,6 +216,8 @@ BEGIN
     IDS_DELETE_KEY_FAILED    "Unable to delete the selected registry key."
     IDS_RENAME_KEY_FAILED    "Unable to rename the selected registry key."
     IDS_RENAME_VALUE_FAILED  "Unable to rename the selected registry value."
+    IDS_IMPORT_SUCCESSFUL    "The keys and values contained in %1 were successfully added to the registry."
+    IDS_IMPORT_FAILED        "Unable to import %1. The specified file is not a valid registry file."
 END
 
 /*
diff --git a/programs/regedit/resource.h b/programs/regedit/resource.h
index d8ef6f7..f09a75a 100644
--- a/programs/regedit/resource.h
+++ b/programs/regedit/resource.h
@@ -159,6 +159,8 @@
 #define IDS_DELETE_KEY_FAILED           2015
 #define IDS_RENAME_KEY_FAILED           2016
 #define IDS_RENAME_VALUE_FAILED         2017
+#define IDS_IMPORT_SUCCESSFUL           2018
+#define IDS_IMPORT_FAILED               2019
 
 #define IDC_EXPORT_BASE                 100
 #define IDC_EXPORT_ALL                  101
-- 
2.7.4




More information about the wine-patches mailing list