From 1c1e79e557263e306da9c6afc8698af1f0cd9bd7 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 20 Jun 2015 12:59:55 +0000 Subject: [PATCH] [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 --- reactos/dll/win32/browseui/shellbrowser.cpp | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/reactos/dll/win32/browseui/shellbrowser.cpp b/reactos/dll/win32/browseui/shellbrowser.cpp index ef41f836a72..21f7187b3bc 100644 --- a/reactos/dll/win32/browseui/shellbrowser.cpp +++ b/reactos/dll/win32/browseui/shellbrowser.cpp @@ -1520,6 +1520,7 @@ HRESULT CShellBrowser::UpdateUpState() void CShellBrowser::UpdateGotoMenu(HMENU theMenu) { CComPtr travelLog; + CComPtr 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(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(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(this), theMenu, position, IDM_GOTO_TRAVEL_FIRSTTARGET, IDM_GOTO_TRAVEL_LASTTARGET, TLMENUF_BACKANDFORTH | TLMENUF_CHECKCURRENT); if (SUCCEEDED(hResult))