Added option to customize Pinned folder location

Items can be pinned to directories that require administative privileges
(such as Open-Shell's default installation directory), so long as users
take ownership of the pinned folder. Also adds a command to Open-Shell's
context menu that opens the current pinned folder.

Adds general support for directory-based settings by creating a new
setting type called TYPE_DIRECTORY which uses a new bool added to
BrowseLinkHelper, called bFoldersOnly. START_MENU_PINNED_ROOT
has been removed, and all instances of both it and BrowseLinkHelper
have been adjusted accordingly. To create your own directory-based
settings, use CSetting::TYPE_DIRECTORY. Empty directory paths are
reset to their default value as they can cause unexpected behavior.
This commit is contained in:
thisismy-github
2021-08-19 18:52:06 -04:00
committed by Ibuprophen
parent 27e5c2bc74
commit 8031739110
15 changed files with 99 additions and 29 deletions
+3 -2
View File
@@ -589,7 +589,7 @@ void CItemManager::Init( void )
m_RootGames=L"::{ED228FDF-9EA8-4870-83B1-96B02CFE0D52}\\";
wchar_t text[_MAX_PATH];
Strcpy(text,_countof(text),START_MENU_PINNED_ROOT L"\\");
Sprintf(text,_countof(text),L"%s\\",GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(text,_countof(text));
m_RootStartMenu3=text;
StringUpper(m_RootStartMenu3);
@@ -2867,7 +2867,8 @@ void CItemManager::PreloadItemsThread( void )
else if (g_CacheFolders[i].folder==FOLDERID_ClassicPinned)
{
if (GetSettingInt(L"PinnedPrograms")!=PINNED_PROGRAMS_PINNED) continue;
wchar_t path[_MAX_PATH]=START_MENU_PINNED_ROOT;
wchar_t path[_MAX_PATH];
Strcpy(path,_countof(path),GetSettingString(L"PinnedItemsPath"));
DoEnvironmentSubst(path,_countof(path));
if (FAILED(SHParseDisplayName(path,NULL,&pidl,0,NULL)) || !pidl) continue;
if (FAILED(SHCreateItemFromIDList(pidl,IID_IShellItem,(void**)&pFolder)) || !pFolder) continue;