From 2458812a42e91dbcc531401926290ecb19984bac Mon Sep 17 00:00:00 2001 From: Krzysztof Szewczyk Date: Sun, 10 Nov 2019 12:09:37 +0100 Subject: [PATCH] Add a submenu item in Languages menu to open UDL folder Fix #5404, close #7540 --- PowerEditor/src/Notepad_plus.rc | 2 ++ PowerEditor/src/NppCommands.cpp | 7 +++++++ PowerEditor/src/Parameters.cpp | 1 + PowerEditor/src/menuCmdID.h | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index ddb9ccb1..82f55afd 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -775,6 +775,7 @@ BEGIN MENUITEM "YAML", IDM_LANG_YAML MENUITEM SEPARATOR MENUITEM "Define your language...", IDM_LANG_USER_DLG + MENUITEM "Open UDL folder...", IDM_LANG_OPENUDLDIR MENUITEM "User-Defined", IDM_LANG_USER END @@ -918,6 +919,7 @@ BEGIN MENUITEM "YAML", IDM_LANG_YAML MENUITEM SEPARATOR MENUITEM "Define your language...", IDM_LANG_USER_DLG + MENUITEM "Open UDL folder...", IDM_LANG_OPENUDLDIR MENUITEM "User-Defined", IDM_LANG_USER END diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 0eb5e7f5..fe9b29b3 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -3048,6 +3048,13 @@ void Notepad_plus::command(int id) } } break; + + case IDM_LANG_OPENUDLDIR: { + generic_string _userPath = NppParameters::getInstance().getUserPath(); + PathAppend(_userPath, TEXT("userDefineLangs")); + ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), _userPath.c_str(), NULL, NULL, SW_SHOW); + break; + } case IDC_PREV_DOC : case IDC_NEXT_DOC : diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index b6171fe9..f17d865d 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -369,6 +369,7 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_LANG_USER_DLG, false, false, false, nullptr }, { VK_NULL, IDM_LANG_USER, false, false, false, nullptr }, + { VK_NULL, IDM_LANG_OPENUDLDIR, false, false, false, nullptr }, { VK_NULL, IDM_SETTING_PREFERENCE, false, false, false, nullptr }, { VK_NULL, IDM_LANGSTYLE_CONFIG_DLG, false, false, false, nullptr }, diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index e488f130..b03c264e 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -521,7 +521,8 @@ #define IDM_LANG_USER (IDM_LANG + 180) //46180: Used for translation #define IDM_LANG_USER_LIMIT (IDM_LANG + 210) //46210: Ajust with IDM_LANG_USER - #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_OPENUDLDIR (IDM_LANG + 300)