summaryrefslogtreecommitdiff
path: root/plugins/QuickContacts
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/QuickContacts
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/QuickContacts')
-rw-r--r--plugins/QuickContacts/src/dialog.cpp28
-rw-r--r--plugins/QuickContacts/src/options.cpp18
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp16
-rw-r--r--plugins/QuickContacts/src/stdafx.h6
4 files changed, 35 insertions, 33 deletions
diff --git a/plugins/QuickContacts/src/dialog.cpp b/plugins/QuickContacts/src/dialog.cpp
index e51d2734e2..2b2e112b07 100644
--- a/plugins/QuickContacts/src/dialog.cpp
+++ b/plugins/QuickContacts/src/dialog.cpp
@@ -132,7 +132,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
BOOL metacontactsEnabled = db_mc_isEnabled();
// Read last-sent-to contact from db and set handle as window-userdata
- HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1);
+ HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULENAME, "LastSentTo", -1);
SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG_PTR)hlastsent);
// enumerate all contacts and write them to the array
@@ -160,7 +160,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
char setting[128];
mir_snprintf(setting, "ShowOffline%s", pszProto);
- if (!db_get_b(NULL, MODULE_NAME, setting, FALSE))
+ if (!db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
// Check if proto offline
@@ -179,7 +179,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
char setting[128];
mir_snprintf(setting, "ShowOffline%s", META_PROTO);
- if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
+ if (db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
}
}
@@ -525,13 +525,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETEXTENDEDUI, TRUE, 0);
- Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE_NAME, "window");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULENAME, "window");
LoadContacts(hwndDlg, FALSE);
EnableButtons(hwndDlg, NULL);
- if (db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)) {
- int pos = GetItemPos((MCONTACT)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1));
+ if (db_get_b(NULL, MODULENAME, "EnableLastSentTo", 0)) {
+ int pos = GetItemPos((MCONTACT)db_get_dw(NULL, MODULENAME, "LastSentTo", -1));
if (pos != -1) {
SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_SETCURSEL, (WPARAM)pos, 0);
EnableButtons(hwndDlg, contacts[pos]->hcontact);
@@ -559,7 +559,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
Clist_ContactDoubleClicked(hContact);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
@@ -578,7 +578,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CallService(MS_MSG_SENDMESSAGEW, hContact, 0);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -599,7 +599,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CallService(MS_FILE_SENDFILE, hContact, 0);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
@@ -620,7 +620,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CallService(MS_URL_SENDURL, hContact, 0);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
@@ -641,7 +641,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
@@ -662,7 +662,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0);
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
}
break;
@@ -692,7 +692,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
Clist_MenuProcessCommand(LOWORD(ret), MPCF_CONTACTMENU, hContact);
}
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD)hContact);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", (DWORD)hContact);
}
break;
@@ -726,7 +726,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case WM_CLOSE:
- Utils_SaveWindowPosition(hwndDlg, NULL, MODULE_NAME, "window");
+ Utils_SaveWindowPosition(hwndDlg, NULL, MODULENAME, "window");
DestroyWindow(hwndDlg);
break;
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp
index 3904fb0756..ff274eee58 100644
--- a/plugins/QuickContacts/src/options.cpp
+++ b/plugins/QuickContacts/src/options.cpp
@@ -37,14 +37,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// Initializations needed by options
void LoadOptions()
{
- opts.last_sent_enable = db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", TRUE);
- opts.last_sent_msg_type = db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL);
- opts.hide_from_offline_proto = db_get_b(NULL, MODULE_NAME, "HideOfflineFromOfflineProto", TRUE);
- opts.group_append = db_get_b(NULL, MODULE_NAME, "AppendGroupName", FALSE);
- opts.group_column = db_get_b(NULL, MODULE_NAME, "GroupColumn", FALSE);
- opts.group_column_left = db_get_b(NULL, MODULE_NAME, "GroupColumnLeft", FALSE);
- opts.hide_subcontacts = db_get_b(NULL, MODULE_NAME, "HideSubcontacts", TRUE);
- opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
+ opts.last_sent_enable = db_get_b(NULL, MODULENAME, "EnableLastSentTo", TRUE);
+ opts.last_sent_msg_type = db_get_w(NULL, MODULENAME, "MsgTypeRec", TYPE_GLOBAL);
+ opts.hide_from_offline_proto = db_get_b(NULL, MODULENAME, "HideOfflineFromOfflineProto", TRUE);
+ opts.group_append = db_get_b(NULL, MODULENAME, "AppendGroupName", FALSE);
+ opts.group_column = db_get_b(NULL, MODULENAME, "GroupColumn", FALSE);
+ opts.group_column_left = db_get_b(NULL, MODULENAME, "GroupColumnLeft", FALSE);
+ opts.hide_subcontacts = db_get_b(NULL, MODULENAME, "HideSubcontacts", TRUE);
+ opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULENAME, "KeepSubcontactsFromOffline", TRUE);
}
int InitOptionsCallback(WPARAM wParam, LPARAM)
@@ -90,7 +90,7 @@ static OptPageControl controls[] = {
static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = SaveOptsDlgProc(controls, _countof(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ int ret = SaveOptsDlgProc(controls, _countof(controls), MODULENAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index a367cd4da9..06312e4f2c 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -37,7 +37,7 @@ int hksAction = 0;
// Functions ////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo = {
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -50,9 +50,13 @@ PLUGININFOEX pluginInfo = {
{0xf93ba59c, 0x4f48, 0x4f2e, {0x8a, 0x91, 0x77, 0xa2, 0x80, 0x15, 0x27, 0xa3}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -141,17 +145,17 @@ static int EventAdded(WPARAM wparam, LPARAM hDbEvent)
DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) || (dbei.flags & DBEF_READ)
- || !db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)
- || db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
+ || !db_get_b(NULL, MODULENAME, "EnableLastSentTo", 0)
+ || db_get_w(NULL, MODULENAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
return 0;
- db_set_dw(NULL, MODULE_NAME, "LastSentTo", (UINT_PTR)wparam);
+ db_set_dw(NULL, MODULENAME, "LastSentTo", (UINT_PTR)wparam);
return 0;
}
extern "C" __declspec(dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
CreateServiceFunction(MS_QC_SHOW_DIALOG, ShowDialog);
diff --git a/plugins/QuickContacts/src/stdafx.h b/plugins/QuickContacts/src/stdafx.h
index 842eee329e..f5abdae0e6 100644
--- a/plugins/QuickContacts/src/stdafx.h
+++ b/plugins/QuickContacts/src/stdafx.h
@@ -51,13 +51,11 @@ Boston, MA 02111-1307, USA.
#include "options.h"
#include "version.h"
-#define MODULE_NAME "QuickContacts"
+#define MODULENAME "QuickContacts"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE_NAME)
- {}
+ CMPlugin();
};
//add a new hotkey so it has a default and can be changed in the options dialog