From e12763d5bc45a0a0fcf20c2898c1850e83516f85 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Sat, 11 Nov 2017 18:16:22 +0300 Subject: [PATCH] [BROWSEUI] CISFBand: Add "Open Folder" feature CORE-13996 #resolve --- dll/win32/browseui/lang/bg-BG.rc | 1 + dll/win32/browseui/lang/de-DE.rc | 1 + dll/win32/browseui/lang/en-US.rc | 1 + dll/win32/browseui/lang/es-ES.rc | 1 + dll/win32/browseui/lang/fr-FR.rc | 1 + dll/win32/browseui/lang/he-IL.rc | 1 + dll/win32/browseui/lang/it-IT.rc | 1 + dll/win32/browseui/lang/ja-JP.rc | 1 + dll/win32/browseui/lang/pl-PL.rc | 1 + dll/win32/browseui/lang/pt-BR.rc | 1 + dll/win32/browseui/lang/ro-RO.rc | 1 + dll/win32/browseui/lang/ru-RU.rc | 1 + dll/win32/browseui/lang/sq-AL.rc | 1 + dll/win32/browseui/lang/tr-TR.rc | 1 + dll/win32/browseui/lang/uk-UA.rc | 1 + dll/win32/browseui/lang/zh-CN.rc | 1 + dll/win32/browseui/lang/zh-TW.rc | 1 + dll/win32/browseui/resource.h | 1 + dll/win32/browseui/shellbars/CISFBand.cpp | 20 ++++++++++++++++++++ 19 files changed, 38 insertions(+) diff --git a/dll/win32/browseui/lang/bg-BG.rc b/dll/win32/browseui/lang/bg-BG.rc index 3c926e1d707..8a269d8d6d5 100644 --- a/dll/win32/browseui/lang/bg-BG.rc +++ b/dll/win32/browseui/lang/bg-BG.rc @@ -102,6 +102,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/de-DE.rc b/dll/win32/browseui/lang/de-DE.rc index ae7f85d5184..eeb812102a9 100644 --- a/dll/win32/browseui/lang/de-DE.rc +++ b/dll/win32/browseui/lang/de-DE.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/en-US.rc b/dll/win32/browseui/lang/en-US.rc index be6f51ae8c4..29aabb6f564 100644 --- a/dll/win32/browseui/lang/en-US.rc +++ b/dll/win32/browseui/lang/en-US.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/es-ES.rc b/dll/win32/browseui/lang/es-ES.rc index 7003b588e6a..420f350f3e6 100644 --- a/dll/win32/browseui/lang/es-ES.rc +++ b/dll/win32/browseui/lang/es-ES.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/fr-FR.rc b/dll/win32/browseui/lang/fr-FR.rc index da07016e3fb..90c89bab9ce 100644 --- a/dll/win32/browseui/lang/fr-FR.rc +++ b/dll/win32/browseui/lang/fr-FR.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/he-IL.rc b/dll/win32/browseui/lang/he-IL.rc index dfb3dd71001..28a1d629f28 100644 --- a/dll/win32/browseui/lang/he-IL.rc +++ b/dll/win32/browseui/lang/he-IL.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/it-IT.rc b/dll/win32/browseui/lang/it-IT.rc index 7fa4e6f7a0d..b8beedf2ca1 100644 --- a/dll/win32/browseui/lang/it-IT.rc +++ b/dll/win32/browseui/lang/it-IT.rc @@ -102,6 +102,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ja-JP.rc b/dll/win32/browseui/lang/ja-JP.rc index def88114c60..2d73353080c 100644 --- a/dll/win32/browseui/lang/ja-JP.rc +++ b/dll/win32/browseui/lang/ja-JP.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/pl-PL.rc b/dll/win32/browseui/lang/pl-PL.rc index 8d5f6a6f5d1..f1799d0d338 100644 --- a/dll/win32/browseui/lang/pl-PL.rc +++ b/dll/win32/browseui/lang/pl-PL.rc @@ -110,6 +110,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/pt-BR.rc b/dll/win32/browseui/lang/pt-BR.rc index 2915c1e8cff..a1147b38a63 100644 --- a/dll/win32/browseui/lang/pt-BR.rc +++ b/dll/win32/browseui/lang/pt-BR.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ro-RO.rc b/dll/win32/browseui/lang/ro-RO.rc index bbe6b769434..f026a960948 100644 --- a/dll/win32/browseui/lang/ro-RO.rc +++ b/dll/win32/browseui/lang/ro-RO.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ru-RU.rc b/dll/win32/browseui/lang/ru-RU.rc index 593d685b830..2fa74fc9223 100644 --- a/dll/win32/browseui/lang/ru-RU.rc +++ b/dll/win32/browseui/lang/ru-RU.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/sq-AL.rc b/dll/win32/browseui/lang/sq-AL.rc index 31d615019a4..0decaa6937a 100644 --- a/dll/win32/browseui/lang/sq-AL.rc +++ b/dll/win32/browseui/lang/sq-AL.rc @@ -121,6 +121,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/tr-TR.rc b/dll/win32/browseui/lang/tr-TR.rc index 86e6ed6d6a7..1fe3b6fee6c 100644 --- a/dll/win32/browseui/lang/tr-TR.rc +++ b/dll/win32/browseui/lang/tr-TR.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/uk-UA.rc b/dll/win32/browseui/lang/uk-UA.rc index 0cebd383762..ff49e59e97f 100644 --- a/dll/win32/browseui/lang/uk-UA.rc +++ b/dll/win32/browseui/lang/uk-UA.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/zh-CN.rc b/dll/win32/browseui/lang/zh-CN.rc index ca887e9670a..7ab4cf42ff4 100644 --- a/dll/win32/browseui/lang/zh-CN.rc +++ b/dll/win32/browseui/lang/zh-CN.rc @@ -122,6 +122,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/zh-TW.rc b/dll/win32/browseui/lang/zh-TW.rc index 3889152c0c5..cd9b4ef5fd5 100644 --- a/dll/win32/browseui/lang/zh-TW.rc +++ b/dll/win32/browseui/lang/zh-TW.rc @@ -122,6 +122,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index fbad0083f7a..24303de2290 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -69,6 +69,7 @@ #define IDM_SMALL_ICONS 2003 #define IDM_SHOW_TEXT 2004 #define IDM_VIEW_MENU 2005 +#define IDM_OPEN_FOLDER 2006 /* Random id for band close button, feel free to change it */ #define IDM_BASEBAR_CLOSE 0xA200 diff --git a/dll/win32/browseui/shellbars/CISFBand.cpp b/dll/win32/browseui/shellbars/CISFBand.cpp index 2ea32eb63a1..042a10640e9 100644 --- a/dll/win32/browseui/shellbars/CISFBand.cpp +++ b/dll/win32/browseui/shellbars/CISFBand.cpp @@ -600,6 +600,23 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent) if (FAILED_UNEXPECTEDLY(hr)) return hr; break; } + case IDM_OPEN_FOLDER: + { + SHELLEXECUTEINFO shexinfo; + + memset(&shexinfo, 0x0, sizeof(shexinfo)); + + shexinfo.cbSize = sizeof(shexinfo); + shexinfo.fMask = SEE_MASK_IDLIST; + shexinfo.lpVerb = _T("open"); + shexinfo.lpIDList = m_pidl; + shexinfo.nShow = SW_SHOW; + + if (!ShellExecuteEx(&shexinfo)) + return E_FAIL; + + break; + } case IDM_SHOW_TEXT: { if (m_textFlag) @@ -646,6 +663,9 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent) CheckMenuItem(qMenu, IDM_SMALL_ICONS, MF_UNCHECKED); } + if (_ILIsDesktop(m_pidl)) + DeleteMenu(qMenu, IDM_OPEN_FOLDER, MF_BYCOMMAND); + UINT idMax = Shell_MergeMenus(hmenu, GetSubMenu(qMenu, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); DestroyMenu(qMenu); return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1));