[regedit]
authorGabriel Ilardi <gabrielilardi@hotmail.it>
Sat, 7 May 2011 14:53:32 +0000 (14:53 +0000)
committerGabriel Ilardi <gabrielilardi@hotmail.it>
Sat, 7 May 2011 14:53:32 +0000 (14:53 +0000)
- Prompt before importing from the command line.
- Inform the user about successful import from the command line and the menu.
- Updated Spanish & Italian translations.
See issue #6230 for more details.

svn path=/trunk/; revision=51621

27 files changed:
reactos/base/applications/regedit/framewnd.c
reactos/base/applications/regedit/lang/bg-BG.rc
reactos/base/applications/regedit/lang/cs-CZ.rc
reactos/base/applications/regedit/lang/de-DE.rc
reactos/base/applications/regedit/lang/el-GR.rc
reactos/base/applications/regedit/lang/en-US.rc
reactos/base/applications/regedit/lang/es-ES.rc
reactos/base/applications/regedit/lang/fr-FR.rc
reactos/base/applications/regedit/lang/hu-HU.rc
reactos/base/applications/regedit/lang/id-ID.rc
reactos/base/applications/regedit/lang/it-IT.rc
reactos/base/applications/regedit/lang/ja-JP.rc
reactos/base/applications/regedit/lang/ko-KR.rc
reactos/base/applications/regedit/lang/nl-NL.rc
reactos/base/applications/regedit/lang/no-NO.rc
reactos/base/applications/regedit/lang/pl-PL.rc
reactos/base/applications/regedit/lang/pt-BR.rc
reactos/base/applications/regedit/lang/pt-PT.rc
reactos/base/applications/regedit/lang/ru-RU.rc
reactos/base/applications/regedit/lang/sk-SK.rc
reactos/base/applications/regedit/lang/sl-SI.rc
reactos/base/applications/regedit/lang/sv-SE.rc
reactos/base/applications/regedit/lang/th-TH.rc
reactos/base/applications/regedit/lang/uk-UA.rc
reactos/base/applications/regedit/lang/zh-CN.rc
reactos/base/applications/regedit/regedit.c
reactos/base/applications/regedit/resource.h

index e37adbe..79cc3b3 100644 (file)
@@ -393,7 +393,7 @@ static BOOL UnloadHive(HWND hWnd)
 static BOOL ImportRegistryFile(HWND hWnd)
 {
     OPENFILENAME ofn;
-    TCHAR Caption[128];
+    TCHAR Caption[128], szTitle[256], szText[256];
     LPCTSTR pszKeyPath;
     HKEY hRootKey;
 
@@ -414,6 +414,10 @@ static BOOL ImportRegistryFile(HWND hWnd)
                 fclose(fp);
             return FALSE;
         }
+        LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
+        LoadString(hInst, IDS_IMPORTED_OK, szText, sizeof(szTitle));
+        /* show successful import */
+        MessageBox(NULL, szText, szTitle, MB_OK);
         fclose(fp);
     }
     else
index 8603663..854d276 100644 (file)
@@ -394,6 +394,12 @@ BEGIN
   IDS_FINISHEDFIND               "Òúðñåíåòî â ðåãèñòúðà ïðèêëþ÷è."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 9226c8e..be14bc5 100644 (file)
@@ -391,6 +391,12 @@ BEGIN
   IDS_FINISHEDFIND               "Prohledávání registru bylo dokonèeno."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 8d6f251..e48dc17 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Durchsuchen der Registry beendet."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 44ca2d9..c722864 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "ÔÝëïò áíáæÞôçóçò óôç registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index fb81f16..679f264 100644 (file)
@@ -381,6 +381,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 0e1dc4c..c4c4b1f 100644 (file)
@@ -396,6 +396,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finalizado la busqueda del registro."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Agregar los datos al registro?"
+  IDS_IMPORTED_OK               "La información ha sido agregada al registro"
+END
+
 /*****************************************************************/
 
 
index 56e31bc..7f01199 100644 (file)
@@ -396,6 +396,12 @@ BEGIN
   IDS_FINISHEDFIND               "Recherche dans le registre terminée."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 7efa45d..ba56f98 100644 (file)
@@ -394,6 +394,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 4d85714..4195cd2 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Selesai mencari seluruh registri."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 8f81f05..370a6d5 100644 (file)
@@ -398,6 +398,12 @@ BEGIN
   IDS_FINISHEDFIND               "Fine ricerca nel registro."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Aggiungere l'informazione al registro?"
+  IDS_IMPORTED_OK               "L'informazione è stata aggiunta al registro"
+END
+
 /*****************************************************************/
 
 
index 66a0967..62eb80f 100644 (file)
@@ -391,6 +391,12 @@ BEGIN
   IDS_FINISHEDFIND               "\83\8c\83W\83X\83g\83\8a\82ð\82·\82×\82Ä\8c\9f\8dõ\82µ\82Ü\82µ\82½\81B"
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index b205797..783b12b 100644 (file)
@@ -378,6 +378,12 @@ BEGIN
   IDS_FINISHEDFIND               "·¹Áö½ºÆ®¸® °Ë»öÀ» ¿Ï·áÇß½À´Ï´Ù."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 2bc0979..24e77cf 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+       
 /*****************************************************************/
 
 
index 60d0d1a..166dea0 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Søket i registret er fullført."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 50087cf..f908a26 100644 (file)
@@ -400,6 +400,12 @@ BEGIN
   IDS_FINISHEDFIND               "Przeszukiwanie rejestru zakoñczone."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 7abc3c2..a7b6acb 100644 (file)
@@ -394,6 +394,12 @@ BEGIN
   IDS_FINISHEDFIND               "Pesquisa do Registro concluída."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 52b15fd..ed973c0 100644 (file)
@@ -384,6 +384,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index f8e7466..538644a 100644 (file)
@@ -391,6 +391,12 @@ BEGIN
   IDS_FINISHEDFIND               "Ïîèñê â ðååñòðå çàâåðøåí."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+       
 /*****************************************************************/
 
 
index b6cb475..ea0c0bd 100644 (file)
@@ -378,6 +378,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 0be7a42..b3c4055 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 8a890d7..9931b9a 100644 (file)
@@ -391,6 +391,12 @@ BEGIN
   IDS_FINISHEDFIND               "Slutfört sökningen av registret."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 51aa5da..9bfd14c 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "Finished searching through the registry."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+       
 /*****************************************************************/
 
 
index 6f98e38..4bde204 100644 (file)
@@ -394,6 +394,12 @@ BEGIN
   IDS_FINISHEDFIND               "Ïîøóê ó ðåºñòð³ çàâåðøåíèé."
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 8e09846..21acd79 100644 (file)
@@ -393,6 +393,12 @@ BEGIN
   IDS_FINISHEDFIND               "×¢²á±íËÑË÷Íê±Ï¡£"
 END
 
+STRINGTABLE DISCARDABLE
+BEGIN
+  IDS_IMPORT_PROMPT             "Add the data to the registry?"
+  IDS_IMPORTED_OK               "Information added to the registry"
+END
+
 /*****************************************************************/
 
 
index 1a91ffa..e49f0e0 100644 (file)
@@ -134,6 +134,7 @@ void get_file_name(LPWSTR *command_line, LPWSTR file_name)
 
 BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
 {
+    TCHAR szTitle[256], szText[256];
     switch (action)
     {
     case ACTION_ADD:
@@ -162,6 +163,10 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
             }
             import_registry_file(fp);
             get_file_name(&s, filename);
+            LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
+            LoadString(hInst, IDS_IMPORTED_OK, szText, sizeof(szTitle));
+            /* show successful import */
+            MessageBox(NULL, szText, szTitle, MB_OK);
         }
         break;
     }
@@ -311,9 +316,18 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
     }
 
     if (*s && action == ACTION_UNDEF)
-        action = ACTION_ADD;
-
-    if (action == ACTION_UNDEF)
+           {
+         TCHAR szTitle[256], szText[256];
+         LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
+         LoadString(hInst, IDS_IMPORT_PROMPT, szText, sizeof(szTitle));        
+         /* request import confirmation */
+            if (MessageBox(NULL, szText, szTitle, MB_YESNO) == IDYES) 
+            {
+          action = ACTION_ADD;
+         }
+                else return TRUE;
+        }
+       if (action == ACTION_UNDEF)
         return FALSE;
 
     return PerformRegAction(action, s);
index 19432c8..8ee02c6 100644 (file)
 #define IDS_NEW_VALUE                   31127
 #define IDS_GOTO_SUGGESTED_KEY          31128
 
+#define IDS_IMPORT_PROMPT               31129
+#define IDS_IMPORTED_OK                 31130
 
 #define IDD_EDIT_STRING                  2000
 #define IDC_VALUE_NAME                   2001