From 9ec2ba379f413bc3817a49f374c5faa1ee23c01a Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 22 May 2012 06:36:30 +0000 Subject: Svc_dbepp: +ability to open options from menu *fixed translating menus with per-plugin langpacks git-svn-id: http://svn.miranda-ng.org/main/trunk@125 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Svc_dbepp/main_window.cpp | 16 ++++++++++++---- plugins/Svc_dbepp/moduletree.cpp | 4 ++-- plugins/Svc_dbepp/resource.h | 5 +++-- plugins/Svc_dbepp/resource.rc | 1 + plugins/Svc_dbepp/settinglist.cpp | 4 ++-- plugins/Svc_dbepp/watchedvars.cpp | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/plugins/Svc_dbepp/main_window.cpp b/plugins/Svc_dbepp/main_window.cpp index da58799e1c..01916108ac 100644 --- a/plugins/Svc_dbepp/main_window.cpp +++ b/plugins/Svc_dbepp/main_window.cpp @@ -127,10 +127,10 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM } else if ((mtis->type == CONTACT) && hContact) { - char msg[1024]; - mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete contact \"%s\"?"), module); if (DBGetContactSettingByte(NULL,"CList", "ConfirmDelete",1)) { + char msg[1024]; + mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete contact \"%s\"?"), module); if (MessageBox(0,msg, Translate("Confirm Contact Delete"), MB_YESNO|MB_ICONEXCLAMATION) == IDNO) break; } @@ -228,11 +228,11 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SettingListSubClass=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwnd,IDC_SETTINGS),GWLP_WNDPROC,(LONG)SettingListSubclassProc); // traslation stuff TranslateDialogDefault(hwnd); - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)hMenu,0); + TranslateMenu(hMenu); for (i=0;i<6;i++) { - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)GetSubMenu(hMenu,i),0); + TranslateMenu(GetSubMenu(hMenu,i)); } // move the dialog to the users position @@ -620,6 +620,14 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) CheckMenuItem(GetSubMenu(GetMenu(hwnd),5),MENU_SORT_ORDER,MF_BYCOMMAND|(Order?MF_CHECKED:MF_UNCHECKED)); refreshTree(1); break; + case MENU_OPEN_OPTIONS: + OPENOPTIONSDIALOG odp = {0}; + odp.cbSize = sizeof(odp); + odp.pszGroup = "Services"; + odp.pszPage = modFullname; + odp.pszTab = 0; + CallService(MS_OPT_OPENOPTIONS,0,(LPARAM)&odp); + break; } return TRUE; // case WM_COMMAND case WM_NOTIFY: diff --git a/plugins/Svc_dbepp/moduletree.cpp b/plugins/Svc_dbepp/moduletree.cpp index a3828b843e..231275c5c0 100644 --- a/plugins/Svc_dbepp/moduletree.cpp +++ b/plugins/Svc_dbepp/moduletree.cpp @@ -953,7 +953,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i HANDLE hContact = mtis->hContact; GetCursorPos(&(hti.pt)); hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU)); - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)hMenu,0); + TranslateMenu(hMenu); if (mtis->type == CONTACT && hContact) menuNumber = 2; else if ((mtis->type == MODULE || mtis->type == UNKNOWN_MODULE) && !hContact) menuNumber = 1; else if (mtis->type == CONTACT && !hContact) menuNumber = 3; @@ -962,7 +962,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i else return; hSubMenu = GetSubMenu(hMenu, menuNumber); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); switch (menuNumber) { case 1: // null module diff --git a/plugins/Svc_dbepp/resource.h b/plugins/Svc_dbepp/resource.h index 9e40bcf899..c32d146126 100644 --- a/plugins/Svc_dbepp/resource.h +++ b/plugins/Svc_dbepp/resource.h @@ -143,13 +143,14 @@ #define MENU_FILTER_LOADED 40061 #define MENU_FILTER_UNLOADED 40062 #define MENU_BYTE_HEX 40063 +#define MENU_OPEN_OPTIONS 40064 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 40064 +#define _APS_NEXT_COMMAND_VALUE 40065 #define _APS_NEXT_CONTROL_VALUE 1059 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/plugins/Svc_dbepp/resource.rc b/plugins/Svc_dbepp/resource.rc index 12e527dad0..26ac45f0eb 100644 --- a/plugins/Svc_dbepp/resource.rc +++ b/plugins/Svc_dbepp/resource.rc @@ -380,6 +380,7 @@ BEGIN MENUITEM "Edit &Dwords in Hex", MENU_DWORD_HEX MENUITEM SEPARATOR MENUITEM "&Restore position", MENU_SAVE_POSITION + MENUITEM "&Open Options", MENU_OPEN_OPTIONS END END diff --git a/plugins/Svc_dbepp/settinglist.cpp b/plugins/Svc_dbepp/settinglist.cpp index 9225fe04a8..ab2f5652e0 100644 --- a/plugins/Svc_dbepp/settinglist.cpp +++ b/plugins/Svc_dbepp/settinglist.cpp @@ -858,7 +858,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here GetCursorPos(&pt); hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU)); hSubMenu = GetSubMenu(hMenu, 6); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); if (!UDB) RemoveMenu(hSubMenu, MENU_ADD_UNICODE, MF_BYCOMMAND); @@ -953,7 +953,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here GetCursorPos(&pt); hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU)); hSubMenu = GetSubMenu(hMenu, 0); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hSubMenu, 0); + TranslateMenu(hSubMenu); lvi.mask = LVIF_IMAGE|LVIF_TEXT; lvi.iItem = hti.iItem; diff --git a/plugins/Svc_dbepp/watchedvars.cpp b/plugins/Svc_dbepp/watchedvars.cpp index 08813de6ba..083a23b4b2 100644 --- a/plugins/Svc_dbepp/watchedvars.cpp +++ b/plugins/Svc_dbepp/watchedvars.cpp @@ -212,8 +212,8 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) mmi.fState = MFS_CHECKED; SetMenuItemInfo(GetMenu(hwnd), MENU_LOADAUTOMATCIALLY, FALSE, &mmi); } -*/ CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)GetMenu(hwnd),0); - CallService(MS_LANGPACK_TRANSLATEMENU,(WPARAM)GetSubMenu(GetMenu(hwnd),0),0); +*/ TranslateMenu(GetMenu(hwnd)); + TranslateMenu(GetSubMenu(GetMenu(hwnd),0)); TranslateDialogDefault(hwnd); // do the icon SendMessage(hwnd,WM_SETICON,ICON_BIG,(LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(ICO_REGEDIT))); -- cgit v1.2.3