summaryrefslogtreecommitdiff
path: root/plugins/IEHistory/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/IEHistory/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/IEHistory/src')
-rw-r--r--plugins/IEHistory/src/IEHistory.cpp10
-rw-r--r--plugins/IEHistory/src/dlgHandlers.cpp24
-rw-r--r--plugins/IEHistory/src/services.cpp4
-rw-r--r--plugins/IEHistory/src/stdafx.h8
4 files changed, 23 insertions, 23 deletions
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp
index 4984a5984b..de3b503fd5 100644
--- a/plugins/IEHistory/src/IEHistory.cpp
+++ b/plugins/IEHistory/src/IEHistory.cpp
@@ -31,7 +31,7 @@ MWindowList hOpenWindowsList = nullptr;
HMODULE hUxTheme = nullptr;
BOOL(WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = nullptr;
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_DISPLAY_NAME,
__VERSION_DWORD,
@@ -44,9 +44,13 @@ PLUGININFOEX pluginInfo = {
{ 0x2f093b88, 0xf389, 0x44f1, { 0x9e, 0x2a, 0x37, 0xc2, 0x91, 0x94, 0x20, 0x3a } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
static const MUUID interfaces[] = { MIID_UIHISTORY, MIID_LAST };
@@ -58,7 +62,7 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(icex);
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp
index 5a2d643f3c..b4a70b1866 100644
--- a/plugins/IEHistory/src/dlgHandlers.cpp
+++ b/plugins/IEHistory/src/dlgHandlers.cpp
@@ -242,8 +242,8 @@ int LoadEvents(HWND hWnd)
{
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
int count = db_event_count(data->contact);
- int bLastFirst = db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0);
- int bRTL = db_get_b(NULL, ModuleName, "EnableRTL", 0);
+ int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
+ int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
bRTL = db_get_b(data->contact, "Tab_SRMsg", "RTL", bRTL);
data->bEnableRTL = bRTL;
data->count = count;
@@ -363,7 +363,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
TranslateDialogDefault(hWnd);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
{
- int bRTL = db_get_b(NULL, ModuleName, "EnableRTL", 0);
+ int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
if (bRTL)
SetWindowLongPtr(hWnd, GWL_EXSTYLE, WS_EX_RTLREADING);
@@ -393,7 +393,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
LoadEvents(hWnd);
{
bool bAll = (data->itemsPerPage <= 0) || (data->itemsPerPage >= data->count);
- int bLastFirst = db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0);
+ int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
if (!bLastFirst) {
EnableWindow(GetDlgItem(hWnd, IDC_PREV), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_NEXT), !bAll);
@@ -490,15 +490,15 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
{
- int count = db_get_dw(NULL, ModuleName, "EventsToLoad", 0);
+ int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0);
EnableWindow(GetDlgItem(hWnd, IDC_EVENTS_COUNT), count > 0);
EnableWindow(GetDlgItem(hWnd, IDC_SHOW_LAST_FIRST), count > 0);
CheckDlgButton(hWnd, IDC_LOAD_ALL, count <= 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_LOAD_NUMBER, count > 0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_ENABLE_RTL, db_get_b(NULL, ModuleName, "EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, ModuleName, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, ModuleName, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_ENABLE_RTL, db_get_b(NULL, MODULENAME, "EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, MODULENAME, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
wchar_t buffer[40];
_itow_s(count, buffer, 10);
@@ -543,10 +543,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
count = _wtol(buffer);
count = (count < 0) ? 0 : count;
}
- db_set_b(NULL, ModuleName, "ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
- db_set_b(NULL, ModuleName, "EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
- db_set_b(NULL, ModuleName, "UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
- db_set_dw(NULL, ModuleName, "EventsToLoad", count);
+ db_set_b(NULL, MODULENAME, "ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
+ db_set_b(NULL, MODULENAME, "EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
+ db_set_b(NULL, MODULENAME, "UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
+ db_set_dw(NULL, MODULENAME, "EventsToLoad", count);
}
}
break;
diff --git a/plugins/IEHistory/src/services.cpp b/plugins/IEHistory/src/services.cpp
index fd24bb9243..464072b8e3 100644
--- a/plugins/IEHistory/src/services.cpp
+++ b/plugins/IEHistory/src/services.cpp
@@ -34,8 +34,8 @@ INT_PTR ShowContactHistoryService(WPARAM wParam, LPARAM)
HWND parent = nullptr;
historyDlg = WindowList_Find(hOpenWindowsList, (MCONTACT)wParam);
if (historyDlg == nullptr){
- int count = db_get_dw(NULL, ModuleName, "EventsToLoad", 0);
- int loadInBackground = db_get_b(NULL, ModuleName, "UseWorkerThread", 0);
+ int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0);
+ int loadInBackground = db_get_b(NULL, MODULENAME, "UseWorkerThread", 0);
HistoryWindowData *data;
data = (HistoryWindowData *)malloc(sizeof(HistoryWindowData));
data->contact = (MCONTACT)wParam;
diff --git a/plugins/IEHistory/src/stdafx.h b/plugins/IEHistory/src/stdafx.h
index 484b43b461..2ab6a12c79 100644
--- a/plugins/IEHistory/src/stdafx.h
+++ b/plugins/IEHistory/src/stdafx.h
@@ -70,20 +70,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# define sntprintf snwprintf
#endif
-#define ModuleName "IEHistory"
+#define MODULENAME "IEHistory"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(ModuleName)
- {}
+ CMPlugin();
};
extern HICON hIcon; //history icon
extern MWindowList hOpenWindowsList;
-extern PLUGININFOEX pluginInfo;
-
extern BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD);
#endif