IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Portuguese (Brazil) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Bulgarian resources
IDS_COMPARE_TO "Compara amb"
IDS_HELP_SAVETHIS "Selecciona aquest camí. Tria un altre camí per a comparar-lo amb aquest camí."
IDS_HELP_COMPARESAVED "Compara amb el camí anteriorment seleccionat (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Catalan resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Chinese (Traditional) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Chinese (Traditional) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Czech resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Danish resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Dutch (Netherlands) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // French (France) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // German (Germany) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // English (U.S.) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Italian (Italy) resources
IDS_COMPARE_TO "\94ä\8ar\91Î\8fÛ\82Æ\82µ\82Ä\91I\91ð"
IDS_HELP_SAVETHIS "\82±\82Ì\83p\83X\82ð\95Û\91¶\82µ\82Ü\82·\81B \82±\82Ì\83p\83X\82Æ\94ä\8ar\82·\82é\82½\82ß\82É\95Ê\82Ì\83p\83X\82ð\91I\91ð\82µ\82Ä\82\82¾\82³\82¢\81B"
IDS_HELP_COMPARESAVED "\95Û\91¶\82³\82ê\82½\83p\83X(%1)\82Æ\94ä\8ar\82µ\82Ü\82·\81B"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // \93ú\96{\8cê resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Korean resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Norwegian (Bokmal) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Polish resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Russian resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Slovak resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Spanish (Modern) resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Swedish resources
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // Turkish resources
#define IDS_HELP_SAVETHIS 107
#define IDS_HELP_COMPARESTORED 108
#define IDS_HELP_COMPARESAVED 109
+#define IDS_RESELECT_FIRST 110
#define IDB_WINMERGE 202
// Next default values for new objects
#define _APS_NEXT_RESOURCE_VALUE 203
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
-#define _APS_NEXT_SYMED_VALUE 103
+#define _APS_NEXT_SYMED_VALUE 111
#endif
#endif
IDS_COMPARE_TO "Compare To"
IDS_HELP_SAVETHIS "Save this path. Select another path to compare with this path."
IDS_HELP_COMPARESAVED "Compare to saved path (%1)"
+ IDS_RESELECT_FIRST "Re-select First"
END
#endif // English (U.S.) resources
HRESULT CWinMergeShell::InvokeCommand(LPCMINVOKECOMMANDINFO pCmdInfo)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
+ CRegKeyEx reg;
CString strWinMergePath;
BOOL bCompare = FALSE;
USES_WINMERGELOCALE;
if (LOWORD(pCmdInfo->lpVerb) == 0)
{
- CRegKeyEx reg;
switch (m_dwMenuState)
{
case MENU_SIMPLE:
}
else if (LOWORD(pCmdInfo->lpVerb) == 1)
{
- // "Compare..." - user wants to compare this single item and open WinMerge
- m_strPaths[1].Empty();
- bCompare = TRUE;
+ switch (m_dwMenuState)
+ {
+ case MENU_ONESEL_PREV:
+ m_strPreviousPath = m_strPaths[0];
+ if (reg.Open(HKEY_CURRENT_USER, f_RegDir) == ERROR_SUCCESS)
+ reg.WriteString(f_FirstSelection, m_strPreviousPath);
+ bCompare = FALSE;
+ break;
+ default:
+ // "Compare..." - user wants to compare this single item and open WinMerge
+ m_strPaths[1].Empty();
+ bCompare = TRUE;
+ break;
+ }
}
else
return E_INVALIDARG;
if (bCompare == FALSE)
return S_FALSE;
- // Format command line
- CString strCommandLine = strWinMergePath + _T(" \"") +
- m_strPaths[0] + _T("\"");
-
- if (!m_strPaths[1].IsEmpty())
- strCommandLine += _T(" \"") + m_strPaths[1] + _T("\"");
+ CString strCommandLine = FormatCmdLine(strWinMergePath, m_strPaths[0],
+ m_strPaths[1]);
// Finally start a new WinMerge process
BOOL retVal = FALSE;
CString strCompare;
CString strCompareEllipsis;
CString strCompareTo;
+ CString strReselect;
int nItemsAdded = 0;
VERIFY(strCompare.LoadString(IDS_COMPARE));
VERIFY(strCompareEllipsis.LoadString(IDS_COMPARE_ELLIPSIS));
VERIFY(strCompareTo.LoadString(IDS_COMPARE_TO));
+ VERIFY(strReselect.LoadString(IDS_RESELECT_FIRST));
switch (m_dwMenuState)
{
+ // No items selected earlier
+ // Select item as first item to compare
case MENU_ONESEL_NOPREV:
InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strCompareTo);
uMenuIndex++;
nItemsAdded = 2;
break;
+ // One item selected earlier:
+ // Allow re-selecting first item or selecting second item
case MENU_ONESEL_PREV:
InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strCompare);
uMenuIndex++;
uidFirstCmd++;
- InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strCompareEllipsis);
+ InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strReselect);
nItemsAdded = 2;
break;
+ // Two items selected
+ // Select both items for compare
case MENU_TWOSEL:
InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strCompare);
nItemsAdded = 1;
}
else if (idCmd == 1)
{
- VERIFY(strHelp.LoadString(IDS_CONTEXT_HELP));
+ switch (m_dwMenuState)
+ {
+ case MENU_ONESEL_PREV:
+ VERIFY(strHelp.LoadString(IDS_HELP_SAVETHIS));
+ break;
+ default:
+ VERIFY(strHelp.LoadString(IDS_CONTEXT_HELP));
+ break;
+ }
}
return strHelp;
}
+
+/// Format commandline used to start WinMerge
+CString CWinMergeShell::FormatCmdLine(const CString &winmergePath,
+ const CString &path1, const CString &path2)
+{
+ CString strCommandline = winmergePath;
+ BOOL bOnlyFiles = FALSE;
+
+ if (!path1.IsEmpty() && !path2.IsEmpty())
+ {
+ CFileStatus status;
+ CFileStatus status2;
+ if (CFile::GetStatus(path1, status) &&
+ CFile::GetStatus(path2, status2))
+ {
+ // Check if both paths are files
+ if ((status.m_attribute & CFile::Attribute::directory) == 0 &&
+ (status2.m_attribute & CFile::Attribute::directory) == 0)
+ {
+ bOnlyFiles = TRUE;
+ }
+ }
+ }
+
+ strCommandline += _T(" \"") +
+ path1 + _T("\"");
+
+ if (!m_strPaths[1].IsEmpty())
+ strCommandline += _T(" \"") + path2 + _T("\"");
+
+ return strCommandline;
+}
int DrawSimpleMenu(HMENU hmenu, UINT uMenuIndex, UINT uidFirstCmd);
int DrawAdvancedMenu(HMENU hmenu, UINT uMenuIndex, UINT uidFirstCmd);
CString GetHelpText(int idCmd);
+ CString FormatCmdLine(const CString &winmergePath,
+ const CString &path1, const CString &path2);
public:
// IShellExtInit
+2005-08-16 Kimmo
+ PATCH: [ 1258270 ] ShellExtension: allow re-selecting first item
+ ShellExtension: Resource.h ShellExtension.rc WinMergeShell.cpp WinMergeShell.h
+ ShellExtension/Languages: *.rc
+
2005-08-14 Kimmo
PATCH: [ 1255864 ] Different icons for Folder and File Comparison
Icon submitted by Tim