[BROWSEUI] Make the view->go to menu items reflect the toolbar buttons status. By Barrett Karish with some slight changes by me. CORE-9800

svn path=/trunk/; revision=68204
This commit is contained in:
Amine Khaldi 2015-06-20 12:59:55 +00:00
parent cf07db224f
commit 1c1e79e557

View file

@ -1520,6 +1520,7 @@ HRESULT CShellBrowser::UpdateUpState()
void CShellBrowser::UpdateGotoMenu(HMENU theMenu)
{
CComPtr<ITravelLog> travelLog;
CComPtr<ITravelEntry> unusedEntry;
int position;
MENUITEMINFO menuItemInfo;
HRESULT hResult;
@ -1530,6 +1531,35 @@ void CShellBrowser::UpdateGotoMenu(HMENU theMenu)
hResult = GetTravelLog(&travelLog);
if (FAILED_UNEXPECTEDLY(hResult))
return;
hResult = travelLog->GetTravelEntry(static_cast<IDropTarget *>(this),
TLOG_BACK,
&unusedEntry);
if (SUCCEEDED(hResult))
{
SHEnableMenuItem(theMenu, IDM_GOTO_BACK, TRUE);
unusedEntry.Release();
}
else
SHEnableMenuItem(theMenu, IDM_GOTO_BACK, FALSE);
hResult = travelLog->GetTravelEntry(static_cast<IDropTarget *>(this),
TLOG_FORE,
&unusedEntry);
if (SUCCEEDED(hResult))
{
SHEnableMenuItem(theMenu, IDM_GOTO_FORWARD, TRUE);
unusedEntry.Release();
}
else
SHEnableMenuItem(theMenu, IDM_GOTO_FORWARD, FALSE);
SHEnableMenuItem(theMenu,
IDM_GOTO_UPONELEVEL,
!_ILIsDesktop(fCurrentDirectoryPIDL));
hResult = travelLog->InsertMenuEntries(static_cast<IDropTarget *>(this), theMenu, position,
IDM_GOTO_TRAVEL_FIRSTTARGET, IDM_GOTO_TRAVEL_LASTTARGET, TLMENUF_BACKANDFORTH | TLMENUF_CHECKCURRENT);
if (SUCCEEDED(hResult))