From 21fa0801787172aa6a772e0f71a4f323d4410594 Mon Sep 17 00:00:00 2001 From: Gabriel Ilardi Date: Sat, 7 May 2011 14:53:32 +0000 Subject: [PATCH] [regedit] - 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 --- reactos/base/applications/regedit/framewnd.c | 6 +++++- .../base/applications/regedit/lang/bg-BG.rc | 6 ++++++ .../base/applications/regedit/lang/cs-CZ.rc | 6 ++++++ .../base/applications/regedit/lang/de-DE.rc | 6 ++++++ .../base/applications/regedit/lang/el-GR.rc | 6 ++++++ .../base/applications/regedit/lang/en-US.rc | 6 ++++++ .../base/applications/regedit/lang/es-ES.rc | 6 ++++++ .../base/applications/regedit/lang/fr-FR.rc | 6 ++++++ .../base/applications/regedit/lang/hu-HU.rc | 6 ++++++ .../base/applications/regedit/lang/id-ID.rc | 6 ++++++ .../base/applications/regedit/lang/it-IT.rc | 6 ++++++ .../base/applications/regedit/lang/ja-JP.rc | 6 ++++++ .../base/applications/regedit/lang/ko-KR.rc | 6 ++++++ .../base/applications/regedit/lang/nl-NL.rc | 6 ++++++ .../base/applications/regedit/lang/no-NO.rc | 6 ++++++ .../base/applications/regedit/lang/pl-PL.rc | 6 ++++++ .../base/applications/regedit/lang/pt-BR.rc | 6 ++++++ .../base/applications/regedit/lang/pt-PT.rc | 6 ++++++ .../base/applications/regedit/lang/ru-RU.rc | 6 ++++++ .../base/applications/regedit/lang/sk-SK.rc | 6 ++++++ .../base/applications/regedit/lang/sl-SI.rc | 6 ++++++ .../base/applications/regedit/lang/sv-SE.rc | 6 ++++++ .../base/applications/regedit/lang/th-TH.rc | 6 ++++++ .../base/applications/regedit/lang/uk-UA.rc | 6 ++++++ .../base/applications/regedit/lang/zh-CN.rc | 6 ++++++ reactos/base/applications/regedit/regedit.c | 20 ++++++++++++++++--- reactos/base/applications/regedit/resource.h | 2 ++ 27 files changed, 168 insertions(+), 4 deletions(-) diff --git a/reactos/base/applications/regedit/framewnd.c b/reactos/base/applications/regedit/framewnd.c index e37adbef08b..79cc3b36b7f 100644 --- a/reactos/base/applications/regedit/framewnd.c +++ b/reactos/base/applications/regedit/framewnd.c @@ -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 diff --git a/reactos/base/applications/regedit/lang/bg-BG.rc b/reactos/base/applications/regedit/lang/bg-BG.rc index 8603663ce1e..854d276977f 100644 --- a/reactos/base/applications/regedit/lang/bg-BG.rc +++ b/reactos/base/applications/regedit/lang/bg-BG.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/cs-CZ.rc b/reactos/base/applications/regedit/lang/cs-CZ.rc index 9226c8eb36a..be14bc5002c 100644 --- a/reactos/base/applications/regedit/lang/cs-CZ.rc +++ b/reactos/base/applications/regedit/lang/cs-CZ.rc @@ -391,6 +391,12 @@ BEGIN IDS_FINISHEDFIND "Prohledvn registru bylo dokoneno." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/de-DE.rc b/reactos/base/applications/regedit/lang/de-DE.rc index 8d6f251f962..e48dc17a4c5 100644 --- a/reactos/base/applications/regedit/lang/de-DE.rc +++ b/reactos/base/applications/regedit/lang/de-DE.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/el-GR.rc b/reactos/base/applications/regedit/lang/el-GR.rc index 44ca2d9f33c..c7228641bb8 100644 --- a/reactos/base/applications/regedit/lang/el-GR.rc +++ b/reactos/base/applications/regedit/lang/el-GR.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/en-US.rc b/reactos/base/applications/regedit/lang/en-US.rc index fb81f164e87..679f264d0e6 100644 --- a/reactos/base/applications/regedit/lang/en-US.rc +++ b/reactos/base/applications/regedit/lang/en-US.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/es-ES.rc b/reactos/base/applications/regedit/lang/es-ES.rc index 0e1dc4c5d86..c4c4b1f0545 100644 --- a/reactos/base/applications/regedit/lang/es-ES.rc +++ b/reactos/base/applications/regedit/lang/es-ES.rc @@ -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 informacin ha sido agregada al registro" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/fr-FR.rc b/reactos/base/applications/regedit/lang/fr-FR.rc index 56e31bcd755..7f01199c3e2 100644 --- a/reactos/base/applications/regedit/lang/fr-FR.rc +++ b/reactos/base/applications/regedit/lang/fr-FR.rc @@ -396,6 +396,12 @@ BEGIN IDS_FINISHEDFIND "Recherche dans le registre termine." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/hu-HU.rc b/reactos/base/applications/regedit/lang/hu-HU.rc index 7efa45d5221..ba56f983dbe 100644 --- a/reactos/base/applications/regedit/lang/hu-HU.rc +++ b/reactos/base/applications/regedit/lang/hu-HU.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/id-ID.rc b/reactos/base/applications/regedit/lang/id-ID.rc index 4d8571470fe..4195cd20756 100644 --- a/reactos/base/applications/regedit/lang/id-ID.rc +++ b/reactos/base/applications/regedit/lang/id-ID.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/it-IT.rc b/reactos/base/applications/regedit/lang/it-IT.rc index 8f81f05ea36..370a6d5e562 100644 --- a/reactos/base/applications/regedit/lang/it-IT.rc +++ b/reactos/base/applications/regedit/lang/it-IT.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/ja-JP.rc b/reactos/base/applications/regedit/lang/ja-JP.rc index 66a0967fb17..62eb80fb2b4 100644 --- a/reactos/base/applications/regedit/lang/ja-JP.rc +++ b/reactos/base/applications/regedit/lang/ja-JP.rc @@ -391,6 +391,12 @@ BEGIN IDS_FINISHEDFIND "WXgׂČ܂B" END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/ko-KR.rc b/reactos/base/applications/regedit/lang/ko-KR.rc index b2057978fca..783b12bef14 100644 --- a/reactos/base/applications/regedit/lang/ko-KR.rc +++ b/reactos/base/applications/regedit/lang/ko-KR.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/nl-NL.rc b/reactos/base/applications/regedit/lang/nl-NL.rc index 2bc09796371..24e77cf8708 100644 --- a/reactos/base/applications/regedit/lang/nl-NL.rc +++ b/reactos/base/applications/regedit/lang/nl-NL.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/no-NO.rc b/reactos/base/applications/regedit/lang/no-NO.rc index 60d0d1af091..166dea05c25 100644 --- a/reactos/base/applications/regedit/lang/no-NO.rc +++ b/reactos/base/applications/regedit/lang/no-NO.rc @@ -393,6 +393,12 @@ BEGIN IDS_FINISHEDFIND "Sket i registret er fullfrt." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/pl-PL.rc b/reactos/base/applications/regedit/lang/pl-PL.rc index 50087cfe068..f908a26c0a3 100644 --- a/reactos/base/applications/regedit/lang/pl-PL.rc +++ b/reactos/base/applications/regedit/lang/pl-PL.rc @@ -400,6 +400,12 @@ BEGIN IDS_FINISHEDFIND "Przeszukiwanie rejestru zakoczone." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/pt-BR.rc b/reactos/base/applications/regedit/lang/pt-BR.rc index 7abc3c211ba..a7b6acbf75d 100644 --- a/reactos/base/applications/regedit/lang/pt-BR.rc +++ b/reactos/base/applications/regedit/lang/pt-BR.rc @@ -394,6 +394,12 @@ BEGIN IDS_FINISHEDFIND "Pesquisa do Registro concluda." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/pt-PT.rc b/reactos/base/applications/regedit/lang/pt-PT.rc index 52b15fd526c..ed973c09c0c 100644 --- a/reactos/base/applications/regedit/lang/pt-PT.rc +++ b/reactos/base/applications/regedit/lang/pt-PT.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/ru-RU.rc b/reactos/base/applications/regedit/lang/ru-RU.rc index f8e74660ab9..538644acb70 100644 --- a/reactos/base/applications/regedit/lang/ru-RU.rc +++ b/reactos/base/applications/regedit/lang/ru-RU.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/sk-SK.rc b/reactos/base/applications/regedit/lang/sk-SK.rc index b6cb4754993..ea0c0bdb9ed 100644 --- a/reactos/base/applications/regedit/lang/sk-SK.rc +++ b/reactos/base/applications/regedit/lang/sk-SK.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/sl-SI.rc b/reactos/base/applications/regedit/lang/sl-SI.rc index 0be7a429a8a..b3c40553c23 100644 --- a/reactos/base/applications/regedit/lang/sl-SI.rc +++ b/reactos/base/applications/regedit/lang/sl-SI.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/sv-SE.rc b/reactos/base/applications/regedit/lang/sv-SE.rc index 8a890d7a48d..9931b9af3c1 100644 --- a/reactos/base/applications/regedit/lang/sv-SE.rc +++ b/reactos/base/applications/regedit/lang/sv-SE.rc @@ -391,6 +391,12 @@ BEGIN IDS_FINISHEDFIND "Slutfrt skningen av registret." END +STRINGTABLE DISCARDABLE +BEGIN + IDS_IMPORT_PROMPT "Add the data to the registry?" + IDS_IMPORTED_OK "Information added to the registry" +END + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/th-TH.rc b/reactos/base/applications/regedit/lang/th-TH.rc index 51aa5da0a8f..9bfd14c493d 100644 --- a/reactos/base/applications/regedit/lang/th-TH.rc +++ b/reactos/base/applications/regedit/lang/th-TH.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/uk-UA.rc b/reactos/base/applications/regedit/lang/uk-UA.rc index 6f98e38c0eb..4bde2043e90 100644 --- a/reactos/base/applications/regedit/lang/uk-UA.rc +++ b/reactos/base/applications/regedit/lang/uk-UA.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/lang/zh-CN.rc b/reactos/base/applications/regedit/lang/zh-CN.rc index 8e098469ad3..21acd7999ef 100644 --- a/reactos/base/applications/regedit/lang/zh-CN.rc +++ b/reactos/base/applications/regedit/lang/zh-CN.rc @@ -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 + /*****************************************************************/ diff --git a/reactos/base/applications/regedit/regedit.c b/reactos/base/applications/regedit/regedit.c index 1a91ffa0397..e49f0e0b11b 100644 --- a/reactos/base/applications/regedit/regedit.c +++ b/reactos/base/applications/regedit/regedit.c @@ -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); diff --git a/reactos/base/applications/regedit/resource.h b/reactos/base/applications/regedit/resource.h index 19432c8cdc1..8ee02c6d811 100644 --- a/reactos/base/applications/regedit/resource.h +++ b/reactos/base/applications/regedit/resource.h @@ -185,6 +185,8 @@ #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