summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
commitd9fddc0cfa9066eb1b5ad3f4807b37426ae6ca88 (patch)
treef09baaf9b91477d009cedc5bd77449b0fa3e3af7 /plugins/ChangeKeyboardLayout
parent8a1ff32e54b39ceef22df61bda17bbfda94918fc (diff)
Popup:
- wiping out checks for service presence; - code cleaning
Diffstat (limited to 'plugins/ChangeKeyboardLayout')
-rw-r--r--plugins/ChangeKeyboardLayout/src/hook_events.cpp26
-rw-r--r--plugins/ChangeKeyboardLayout/src/options.cpp2
-rw-r--r--plugins/ChangeKeyboardLayout/src/text_operations.cpp2
3 files changed, 13 insertions, 17 deletions
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
index 7f8ef8a952..9cdf91d010 100644
--- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp
+++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp
@@ -74,15 +74,13 @@ void WritePopupOptions()
void RegPopupActions()
{
- if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
- poOptions.paActions[0].cbSize = sizeof(POPUPACTION);
- strncpy_s(poOptions.paActions[0].lpzTitle, MODULENAME, _TRUNCATE);
- strncat_s(poOptions.paActions[0].lpzTitle, _countof(poOptions.paActions[0].lpzTitle), "/Copy to clipboard", _TRUNCATE);
- poOptions.paActions[0].flags = PAF_ENABLED;
- poOptions.paActions[0].wParam = poOptions.paActions[0].lParam = 0;
- poOptions.paActions[0].lchIcon = hCopyIcon;
- CallService(MS_POPUP_REGISTERACTIONS, (WPARAM)&poOptions.paActions, 1);
- }
+ poOptions.paActions[0].cbSize = sizeof(POPUPACTION);
+ strncpy_s(poOptions.paActions[0].lpzTitle, MODULENAME, _TRUNCATE);
+ strncat_s(poOptions.paActions[0].lpzTitle, _countof(poOptions.paActions[0].lpzTitle), "/Copy to clipboard", _TRUNCATE);
+ poOptions.paActions[0].flags = PAF_ENABLED;
+ poOptions.paActions[0].wParam = poOptions.paActions[0].lParam = 0;
+ poOptions.paActions[0].lchIcon = hCopyIcon;
+ CallService(MS_POPUP_REGISTERACTIONS, (WPARAM)&poOptions.paActions, 1);
}
int OnIconsChanged(WPARAM, LPARAM)
@@ -148,12 +146,10 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM)
odp.pfnDlgProc = DlgMainProcOptions;
g_plugin.addOptions(wParam, &odp);
- if (ServiceExists(MS_POPUP_ADDPOPUPW)) {
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP_OPTION_FORM);
- odp.szGroup.a = LPGEN("Popups");
- odp.pfnDlgProc = DlgPopupsProcOptions;
- g_plugin.addOptions(wParam, &odp);
- }
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP_OPTION_FORM);
+ odp.szGroup.a = LPGEN("Popups");
+ odp.pfnDlgProc = DlgPopupsProcOptions;
+ g_plugin.addOptions(wParam, &odp);
return 0;
}
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp
index 32261377bd..a8a4e11be5 100644
--- a/plugins/ChangeKeyboardLayout/src/options.cpp
+++ b/plugins/ChangeKeyboardLayout/src/options.cpp
@@ -390,7 +390,7 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam,
pdtData.actionCount = 1;
pdtData.PluginWindowProc = (WNDPROC)CKLPopupDlgProc;
- if ( CallService(MS_POPUP_ADDPOPUPW, (WPARAM) &pdtData, APF_NEWDATA) < 0)
+ if (PUAddPopupW( &pdtData, APF_NEWDATA) < 0)
mir_free(ptszPopupPreviewText);
}
break;
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
index ae0f47645f..d1d2d05a65 100644
--- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp
+++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
@@ -486,7 +486,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
pdtData.lpActions = poOptions.paActions;
pdtData.actionCount = 1;
- if (CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pdtData, APF_NEWDATA) < 0) {
+ if (PUAddPopupW(&pdtData, APF_NEWDATA) < 0) {
mir_free(ptszPopupText);
MessageBox(nullptr, ptszMBox, TranslateT(MODULENAME), MB_ICONINFORMATION);
}