Author: akhaldi
Date: Sat Jun 20 12:59:55 2015
New Revision: 68204
URL:
http://svn.reactos.org/svn/reactos?rev=68204&view=rev
Log:
[BROWSEUI] Make the view->go to menu items reflect the toolbar buttons status. By
Barrett Karish with some slight changes by me. CORE-9800
Modified:
trunk/reactos/dll/win32/browseui/shellbrowser.cpp
Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbr…
==============================================================================
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Sat Jun 20 12:59:55
2015
@@ -1520,6 +1520,7 @@
void CShellBrowser::UpdateGotoMenu(HMENU theMenu)
{
CComPtr<ITravelLog> travelLog;
+ CComPtr<ITravelEntry> unusedEntry;
int position;
MENUITEMINFO menuItemInfo;
HRESULT hResult;
@@ -1530,6 +1531,35 @@
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))