OSDN Git Service

Confirm copy all in file merge (#1827)
authorwilfzim <48259856+wilfz@users.noreply.github.com>
Mon, 1 May 2023 13:14:43 +0000 (15:14 +0200)
committerGitHub <noreply@github.com>
Mon, 1 May 2023 13:14:43 +0000 (22:14 +0900)
* warning message before copying all differences to other file

* make translation work

Src/HexMergeDoc.cpp
Src/ImgMergeFrm.cpp
Src/Merge.rc
Src/MergeEditView.cpp
Src/PropMessageBoxes.cpp
Src/resource.h
Translations/WinMerge/English.pot
Translations/WinMerge/German.po
Translations/WinMerge/Spanish.po

index 717fbb5..327bba5 100644 (file)
@@ -872,6 +872,13 @@ void CHexMergeDoc::OnUpdateCopyFromRight(CCmdUI* pCmdUI)
  */
 void CHexMergeDoc::OnAllRight()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_RIGHT, GetActiveMergeView()->m_nThisPane, m_nBuffers);
        CHexMergeView::CopyAll(m_pView[srcPane], m_pView[dstPane]);
 }
@@ -892,6 +899,14 @@ void CHexMergeDoc::OnUpdateAllRight(CCmdUI* pCmdUI)
  */
 void CHexMergeDoc::OnAllLeft()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
+
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_LEFT, GetActiveMergeView()->m_nThisPane, m_nBuffers);
        CHexMergeView::CopyAll(m_pView[srcPane], m_pView[dstPane]);
 }
index aa0acf9..ce4ac82 100644 (file)
@@ -1924,6 +1924,13 @@ void CImgMergeFrame::OnUpdateCopyFromRight(CCmdUI* pCmdUI)
  */
 void CImgMergeFrame::OnAllLeft()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_LEFT, m_pImgMergeWindow->GetActivePane(), m_pImgMergeWindow->GetPaneCount());
 
        CWaitCursor waitstatus;
@@ -1949,6 +1956,13 @@ void CImgMergeFrame::OnUpdateAllLeft(CCmdUI* pCmdUI)
  */
 void CImgMergeFrame::OnAllRight()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_RIGHT, m_pImgMergeWindow->GetActivePane(), m_pImgMergeWindow->GetPaneCount());
 
        CWaitCursor waitstatus;
index 89f7f4e..0840920 100644 (file)
@@ -3726,11 +3726,12 @@ BEGIN
     IDS_INVALID_DIRECTORY   "The selected folder is invalid."\r
     IDS_CANNOT_OPEN_BINARYFILE "Cannot open a binary file to editor."\r
     IDS_CREATE_PAIR_FOLDER  "The folder exists only in other side and cannot be opened.\n\nDo you want to create a matching folder:\n%1\nto the other side and open these folders?"\r
-    IDS_MOVE_TO_NEXTFILE    "Do you want to move to the next file?"\r
+    IDS_CONFIRM_COPY_ALL_DIFFS "Are you sure you want top copy ALL diffs to other file?"\r
 END\r
 \r
 STRINGTABLE\r
 BEGIN\r
+    IDS_MOVE_TO_NEXTFILE    "Do you want to move to the next file?"\r
     IDS_MOVE_TO_PREVFILE    "Do you want to move to the previous file?"\r
     IDS_MOVE_TO_NEXTPAGE    "Do you want to move to the next page?"\r
     IDS_MOVE_TO_PREVPAGE    "Do you want to move to the previous page?"\r
index c5d084c..2c01435 100644 (file)
@@ -2170,6 +2170,13 @@ void CMergeEditView::OnUpdateCopyLinesFromRight(CCmdUI* pCmdUI)
  */
 void CMergeEditView::OnAllLeft()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
        // Check that left side is not readonly
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_LEFT, m_nThisPane, GetDocument()->m_nBuffers);
        if (IsReadOnly(dstPane))
@@ -2199,6 +2206,13 @@ void CMergeEditView::OnUpdateAllLeft(CCmdUI* pCmdUI)
  */
 void CMergeEditView::OnAllRight()
 {
+       UINT userChoice = 0;
+       String msg = _("Are you sure you want top copy ALL diffs to other file?");
+       userChoice = AfxMessageBox(msg.c_str(), MB_YESNO |
+               MB_ICONWARNING | MB_DEFBUTTON2 | MB_DONT_ASK_AGAIN, IDS_CONFIRM_COPY_ALL_DIFFS);
+       if (userChoice == IDNO)
+               return;
+
        // Check that right side is not readonly
        auto [srcPane, dstPane] = CMergeFrameCommon::MenuIDtoXY(ID_ALL_RIGHT, m_nThisPane, GetDocument()->m_nBuffers);
        if (IsReadOnly(dstPane))
index d8a63fc..1f8320a 100644 (file)
@@ -35,6 +35,7 @@ static struct MessageBox
        { IDS_FILECHANGED_RESCAN, IDS_FILECHANGED_RESCAN, nullptr, MB_YESNO | MB_ICONWARNING },
        { IDS_BACKUP_FAILED_PROMPT, IDS_BACKUP_FAILED_PROMPT,  nullptr, MB_YESNO | MB_ICONWARNING | MB_DONT_ASK_AGAIN },
        { IDS_SUGGEST_IGNOREEOL, IDS_SUGGEST_IGNOREEOL, nullptr, MB_YESNO | MB_ICONWARNING | MB_DONT_ASK_AGAIN },
+       { IDS_CONFIRM_COPY_ALL_DIFFS, IDS_CONFIRM_COPY_ALL_DIFFS, nullptr, MB_YESNO | MB_ICONWARNING | MB_DONT_ASK_AGAIN },
        { IDS_MOVE_TO_NEXTFILE, IDS_MOVE_TO_NEXTFILE, nullptr, MB_YESNO | MB_DONT_ASK_AGAIN },
        { IDS_MOVE_TO_PREVFILE, IDS_MOVE_TO_PREVFILE, nullptr, MB_YESNO | MB_DONT_ASK_AGAIN },
        { IDS_MOVE_TO_FIRSTFILE, IDS_MOVE_TO_FIRSTFILE, nullptr, MB_YESNO | MB_DONT_ASK_AGAIN },
index a9b40f8..2f426b2 100644 (file)
 #define IDS_CLIPBOARDHISTORY_NOT_SUPPORTED1 44512\r
 #define IDS_CLIPBOARDHISTORY_NOT_SUPPORTED2 44513\r
 #define IDS_WEBVIEW2_RUNTIME_NOT_INSTALLED 44514\r
-#define IDS_PROJECT_ITEM_HIDDEN_ITEMS  44515\r
+#define IDS_PROJECT_ITEM_HIDDEN_ITEMS   44515\r
+#define IDS_CONFIRM_COPY_ALL_DIFFS      44516\r
+\r
 // Next default values for new objects\r
 // \r
 #ifdef APSTUDIO_INVOKED\r
index fc0d614..7eba578 100644 (file)
@@ -5,7 +5,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WinMerge\n"
 "Report-Msgid-Bugs-To: https://bugs.winmerge.org/\n"
-"POT-Creation-Date: 2023-04-15 08:40+0000\n"
+"POT-Creation-Date: 2023-05-01 00:11+0000\n"
 "PO-Revision-Date: \n"
 "Last-Translator: \n"
 "Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"
@@ -3075,6 +3075,9 @@ msgstr ""
 msgid "The folder exists only in other side and cannot be opened.\n\nDo you want to create a matching folder:\n%1\nto the other side and open these folders?"
 msgstr ""
 
+msgid "Are you sure you want top copy ALL diffs to other file?"
+msgstr ""
+
 msgid "Do you want to move to the next file?"
 msgstr ""
 
index a25318a..cd47d73 100644 (file)
@@ -3739,6 +3739,9 @@ msgstr "Kann keine Binärdatei im Editor öffnen."
 msgid "The folder exists only in other side and cannot be opened.\n\nDo you want to create a matching folder:\n%1\nto the other side and open these folders?"
 msgstr "Der Ordner existiert nur auf der anderen Seite und kann nicht geöffnet werden. \n\nMöchten Sie einen passenden Ordner: \n%1 \nauf der anderen Seite erzeugen und die Ordner öffnen?"
 
+msgid "Are you sure you want top copy ALL diffs to other file?"
+msgstr "Wollen Sie wirklich ALLE Unterschiede herüberkopieren?"
+
 #, c-format
 msgid "Do you want to move to the next file?"
 msgstr "Möchten Sie zur nächsten Datei wechseln?"
index cb69dc5..d26ab3b 100644 (file)
@@ -3344,6 +3344,9 @@ msgstr ""
 "%1\n"
 "al otro lado y abrir éstas carpetas?"
 
+msgid "Are you sure you want top copy ALL diffs to other file?"
+msgstr "¿Está seguro que quiere copiar todas las differencias al otro archivo?"
+
 msgid "Do you want to move to the next file?"
 msgstr "¿Quieres pasar al siguiente archivo?"