summaryrefslogtreecommitdiff
path: root/plugins/GmailNotifier/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/GmailNotifier/src/main.cpp')
-rw-r--r--plugins/GmailNotifier/src/main.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp
index 77480035dc..ca9ce6a3b5 100644
--- a/plugins/GmailNotifier/src/main.cpp
+++ b/plugins/GmailNotifier/src/main.cpp
@@ -51,7 +51,7 @@ INT_PTR GetStatus(WPARAM wParam, LPARAM lParam)
INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, pluginName, wParam);
+ mir_strncpy((char*)lParam, MODULE_NAME, wParam);
return 0;
}
@@ -93,26 +93,26 @@ extern "C" int __declspec(dllexport) Load()
HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser);
PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
- pd.szName = pluginName;
+ pd.szName = MODULE_NAME;
pd.type = PROTOTYPE_VIRTUAL;
Proto_RegisterModule(&pd);
- CreateProtoServiceFunction(pluginName, PS_GETCAPS, GetCaps);
- CreateProtoServiceFunction(pluginName, PS_GETSTATUS, GetStatus);
- CreateProtoServiceFunction(pluginName, PS_GETNAME, GetName);
+ CreateProtoServiceFunction(MODULE_NAME, PS_GETCAPS, GetCaps);
+ CreateProtoServiceFunction(MODULE_NAME, PS_GETSTATUS, GetStatus);
+ CreateProtoServiceFunction(MODULE_NAME, PS_GETNAME, GetName);
CreateServiceFunction("GmailMNotifier/Notifying", Notifying);
- opt.circleTime = db_get_dw(NULL, pluginName, "circleTime", 30);
- opt.notifierOnTray = db_get_dw(NULL, pluginName, "notifierOnTray", TRUE);
- opt.notifierOnPop = db_get_dw(NULL, pluginName, "notifierOnPop", TRUE);
- opt.popupDuration = db_get_dw(NULL, pluginName, "popupDuration", -1);
- opt.popupBgColor = db_get_dw(NULL, pluginName, "popupBgColor", RGB(173, 206, 247));
- opt.popupTxtColor = db_get_dw(NULL, pluginName, "popupTxtColor", RGB(0, 0, 0));
- opt.OpenUsePrg = db_get_dw(NULL, pluginName, "OpenUsePrg", 0);
- opt.ShowCustomIcon = db_get_dw(NULL, pluginName, "ShowCustomIcon", FALSE);
- opt.UseOnline = db_get_dw(NULL, pluginName, "UseOnline", FALSE);
- opt.AutoLogin = db_get_dw(NULL, pluginName, "AutoLogin", TRUE);
- opt.LogThreads = db_get_dw(NULL, pluginName, "LogThreads", FALSE);
+ opt.circleTime = db_get_dw(NULL, MODULE_NAME, "circleTime", 30);
+ opt.notifierOnTray = db_get_dw(NULL, MODULE_NAME, "notifierOnTray", TRUE);
+ opt.notifierOnPop = db_get_dw(NULL, MODULE_NAME, "notifierOnPop", TRUE);
+ opt.popupDuration = db_get_dw(NULL, MODULE_NAME, "popupDuration", -1);
+ opt.popupBgColor = db_get_dw(NULL, MODULE_NAME, "popupBgColor", RGB(173, 206, 247));
+ opt.popupTxtColor = db_get_dw(NULL, MODULE_NAME, "popupTxtColor", RGB(0, 0, 0));
+ opt.OpenUsePrg = db_get_dw(NULL, MODULE_NAME, "OpenUsePrg", 0);
+ opt.ShowCustomIcon = db_get_dw(NULL, MODULE_NAME, "ShowCustomIcon", FALSE);
+ opt.UseOnline = db_get_dw(NULL, MODULE_NAME, "UseOnline", FALSE);
+ opt.AutoLogin = db_get_dw(NULL, MODULE_NAME, "AutoLogin", TRUE);
+ opt.LogThreads = db_get_dw(NULL, MODULE_NAME, "LogThreads", FALSE);
DBVARIANT dbv;
if (db_get_s(NULL, "Icons", "GmailMNotifier40076", &dbv)) {
@@ -126,23 +126,25 @@ extern "C" int __declspec(dllexport) Load()
BuildList();
ID_STATUS_NONEW = opt.UseOnline ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE;
for (int i = 0; i < acc_num; i++)
- db_set_dw(acc[i].hContact, pluginName, "Status", ID_STATUS_NONEW);
+ db_set_dw(acc[i].hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
hTimer = SetTimer(NULL, 0, opt.circleTime * 60000, TimerProc);
hMirandaStarted = HookEvent(ME_SYSTEM_MODULESLOADED, OnMirandaStart);
hOptionsInitial = HookEvent(ME_OPT_INITIALISE, OptInit);
- CreateServiceFunction("GmailMNotifier/MenuCommand", PluginMenuCommand);
+
+ CreateServiceFunction(MODULE_NAME "/MenuCommand", PluginMenuCommand);
CLISTMENUITEM mi = { 0 };
mi.position = -0x7FFFFFFF;
mi.flags = 0;
- mi.hIcon = Skin_LoadProtoIcon(pluginName, ID_STATUS_ONLINE);
- mi.pszName = LPGEN("&Check all Gmail inboxes");
- mi.pszContactOwner = pluginName;
- mi.pszService = "GmailMNotifier/MenuCommand";
+ mi.icolibItem = Skin_LoadProtoIcon(MODULE_NAME, ID_STATUS_ONLINE);
+ mi.name.a = LPGEN("&Check all Gmail inboxes");
+ mi.pszService = MODULE_NAME "/MenuCommand";
Menu_AddMainMenuItem(&mi);
- mi.pszName = LPGEN("&Check Gmail inbox");
- Menu_AddContactMenuItem(&mi);
+
+ mi.name.a = LPGEN("&Check Gmail inbox");
+ mi.pszService = "/MenuCommand";
+ Menu_AddContactMenuItem(&mi, MODULE_NAME);
return 0;
}