Skip to content
Permalink
Browse files

Add 'Open Plugins Folder...' command

Closes #5224.
  • Loading branch information...
pnedev committed Jan 11, 2019
1 parent 70dee50 commit c9db8f5b65b49e1bb4beb5b6d148e8bf23475a98
@@ -470,31 +470,33 @@ void PluginsManager::addInMenuFromPMIndex(int i)

HMENU PluginsManager::setMenu(HMENU hMenu, const TCHAR *menuName, bool enablePluginAdmin)
{
if (hasPlugins() || enablePluginAdmin)
const TCHAR *nom_menu = (menuName && menuName[0])?menuName:TEXT("&Plugins");
size_t nbPlugin = _pluginInfos.size();

if (!_hPluginsMenu)
{
const TCHAR *nom_menu = (menuName && menuName[0])?menuName:TEXT("&Plugins");
size_t nbPlugin = _pluginInfos.size();
_hPluginsMenu = ::CreateMenu();
::InsertMenu(hMenu, MENUINDEX_PLUGINS, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);

if (!_hPluginsMenu)
{
_hPluginsMenu = ::CreateMenu();
::InsertMenu(hMenu, MENUINDEX_PLUGINS, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);
int i = 1;

if (enablePluginAdmin)
{
if (nbPlugin > 0)
::InsertMenu(_hPluginsMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));
::InsertMenu(_hPluginsMenu, 1, MF_BYPOSITION, IDM_SETTING_PLUGINADM, TEXT("Plugins Admin..."));
}
}
if (nbPlugin > 0)
::InsertMenu(_hPluginsMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));

for (size_t i = 0; i < nbPlugin; ++i)
if (enablePluginAdmin)
{
addInMenuFromPMIndex(static_cast<int32_t>(i));
::InsertMenu(_hPluginsMenu, i++, MF_BYPOSITION, IDM_SETTING_PLUGINADM, TEXT("Plugins Admin..."));
::InsertMenu(_hPluginsMenu, i++, MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));
}
return _hPluginsMenu;

::InsertMenu(_hPluginsMenu, i, MF_BYPOSITION, IDM_SETTING_OPENPLUGINSDIR, TEXT("Open Plugins Folder..."));
}

for (size_t i = 0; i < nbPlugin; ++i)
{
addInMenuFromPMIndex(static_cast<int32_t>(i));
}
return NULL;
return _hPluginsMenu;
}


@@ -2486,6 +2486,16 @@ void Notepad_plus::command(int id)
break;
}

case IDM_SETTING_OPENPLUGINSDIR:
{
const TCHAR* pluginHomePath = NppParameters::getInstance()->getPluginRootDir();
if (pluginHomePath && pluginHomePath[0])
{
::ShellExecute(NULL, NULL, pluginHomePath, NULL, NULL, SW_SHOWNORMAL);
}
break;
}

case IDM_SETTING_SHORTCUT_MAPPER :
case IDM_SETTING_SHORTCUT_MAPPER_MACRO :
case IDM_SETTING_SHORTCUT_MAPPER_RUN :
@@ -547,7 +547,8 @@
#define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9)
#define IDM_SETTING_REMEMBER_LAST_SESSION (IDM_SETTING + 10)
#define IDM_SETTING_PREFERECE (IDM_SETTING + 11)
#define IDM_SETTING_PLUGINADM (IDM_SETTING + 15)
#define IDM_SETTING_PLUGINADM (IDM_SETTING + 14)
#define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 15)
#define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16)
#define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17)
#define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18)

0 comments on commit c9db8f5

Please sign in to comment.
You can’t perform that action at this time.