Skip to content

Commit

Permalink
WInMergeContextMenu.dll: Disable advanced menu due to stability issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Sep 26, 2021
1 parent 5aa19f9 commit 76041fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 1 addition & 7 deletions ShellExtension/Common/WinMergeContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,13 @@ HRESULT WinMergeContextMenu::InvokeCommand(DWORD verb)

if (verb == CMD_COMPARE)
{
bCompare = TRUE;
switch (m_dwMenuState)
{
case MENU_SIMPLE:
bCompare = TRUE;
break;

case MENU_ONESEL_PREV:
m_strPaths.resize(2);
m_strPaths[1] = m_strPaths[0];
m_strPaths[0] = m_strPreviousPaths[0];
bCompare = TRUE;

// Forget previous selection
if (reg.Open(HKEY_CURRENT_USER, f_RegDir) == ERROR_SUCCESS)
Expand All @@ -263,7 +259,6 @@ HRESULT WinMergeContextMenu::InvokeCommand(DWORD verb)
m_strPaths[2] = m_strPaths[0];
m_strPaths[0] = m_strPreviousPaths[0];
m_strPaths[1] = m_strPreviousPaths[1];
bCompare = TRUE;

// Forget previous selection
if (reg.Open(HKEY_CURRENT_USER, f_RegDir) == ERROR_SUCCESS)
Expand All @@ -276,7 +271,6 @@ HRESULT WinMergeContextMenu::InvokeCommand(DWORD verb)
case MENU_TWOSEL:
case MENU_THREESEL:
// "Compare" - compare m_strPaths
bCompare = TRUE;
m_strPreviousPaths[0].erase();
m_strPreviousPaths[1].erase();
break;
Expand Down
6 changes: 5 additions & 1 deletion ShellExtension/WinMergeContextMenu/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class __declspec(uuid("90340779-F37E-468E-9728-A2593498ED32")) WinMergeFileDirEx
, WinMergeExplorerCommandBase(&m_contextMenu)
{
}
const wchar_t* Title() override { return L"WinMerge"; }
const wchar_t* Title() override { return L"&WinMerge"; }
const int IconId(_In_opt_ IShellItemArray* selection) override
{
auto paths = GetPaths(selection);
Expand All @@ -311,10 +311,14 @@ class __declspec(uuid("90340779-F37E-468E-9728-A2593498ED32")) WinMergeFileDirEx
const int Verb() override { return WinMergeContextMenu::CMD_COMPARE; }
const EXPCMDFLAGS Flags() override
{
// Due to stability issues, the advanced menu is currently disabled.
return ECF_DEFAULT;
/*
if ((m_contextMenu.GetContextMenuEnabled() & (WinMergeContextMenu::EXT_ENABLED | WinMergeContextMenu::EXT_ADVANCED)) == (WinMergeContextMenu::EXT_ENABLED | WinMergeContextMenu::EXT_ADVANCED))
return ECF_HASSUBCOMMANDS;
else
return ECF_DEFAULT;
*/
}
const EXPCMDSTATE State(_In_opt_ IShellItemArray* selection) override
{
Expand Down

0 comments on commit 76041fa

Please sign in to comment.