summaryrefslogtreecommitdiff
path: root/plugins/Alarms
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Alarms')
-rw-r--r--plugins/Alarms/src/alarmlist.cpp11
-rw-r--r--plugins/Alarms/src/icons.cpp40
-rw-r--r--plugins/Alarms/src/options.cpp4
3 files changed, 22 insertions, 33 deletions
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index 4a65c58406..0057cad393 100644
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -532,16 +532,11 @@ void ShowPopup(ALARM *alarm) {
memset(data, 0, sizeof(ALARM));
copy_alarm_data(data, alarm);
- POPUPDATAT ppd;
-
- ZeroMemory(&ppd, sizeof(ppd));
- ppd.lchContact = 0;
+ POPUPDATAT ppd = { 0 };
ppd.lchIcon = hIconMenuSet;
lstrcpy(ppd.lptzContactName, data->szTitle);
lstrcpy(ppd.lptzText, data->szDesc);
- ppd.colorBack = 0;
- ppd.colorText = 0;
ppd.PluginWindowProc = (WNDPROC)PopupAlarmDlgProc;
ppd.PluginData = data;
ppd.iSeconds = -1;
@@ -614,9 +609,7 @@ void DoAlarm(ALARM *alarm) {
if (alarm->action & AAF_SYSTRAY)
{
- CLISTEVENT cle = {0};
- cle.cbSize = sizeof(cle);
- cle.hContact = 0;
+ CLISTEVENT cle = { sizeof(cle) };
cle.hIcon = hIconSystray;
cle.ptszTooltip = alarm->szTitle;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
diff --git a/plugins/Alarms/src/icons.cpp b/plugins/Alarms/src/icons.cpp
index d1f1fc7e93..d02534df31 100644
--- a/plugins/Alarms/src/icons.cpp
+++ b/plugins/Alarms/src/icons.cpp
@@ -1,8 +1,6 @@
#include "common.h"
#include "icons.h"
-HANDLE hIcoLibIconsChanged;
-
HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
int ReloadIcons(WPARAM wParam, LPARAM lParam)
@@ -10,7 +8,7 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam)
hIconMenuSet = Skin_GetIcon("alarms_menu_set");
hIconList1 = Skin_GetIcon("alarms_list1");
hIconList2 = Skin_GetIcon("alarms_list2");
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
hIconMenuShowHide = Skin_GetIcon("alarms_menu_showhide");
RefreshReminderFrame();
@@ -19,44 +17,42 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam)
void InitIcons()
{
- SKINICONDESC sid = {0};
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInst, path, MAX_PATH);
- sid.cbSize = sizeof(SKINICONDESC);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = "Alarms";
+ sid.ptszDefaultFile = path;
+ sid.flags = SIDF_PATH_TCHAR;
- sid.pszDescription = "Menu: Set Alarm";
+ sid.pszDescription = LPGEN("Menu: Set Alarm");
sid.pszName = "alarms_menu_set";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 0;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
- sid.pszDescription = "Reminder: Soon";
+ sid.pszDescription = LPGEN("Reminder: Soon");
sid.pszName = "alarms_list1";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 1;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS ); Skin_AddIcon(&sid);
+ sid.iDefaultIndex = -IDI_LIST1;
- sid.pszDescription = "Reminder: Very Soon";
+ sid.pszDescription = LPGEN("Reminder: Very Soon");
sid.pszName = "alarms_list2";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 2;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ sid.iDefaultIndex = -IDI_LIST2;
Skin_AddIcon(&sid);
- sid.pszDescription = "Alarm: System Tray";
+ sid.pszDescription = LPGEN("Alarm: System Tray");
sid.pszName = "alarms_systray";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 3;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- sid.pszDescription = "Menu: Show/Hide Reminders";
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
+ sid.pszDescription = LPGEN("Menu: Show/Hide Reminders");
sid.pszName = "alarms_menu_showhide";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 4;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
hIconMenuShowHide = Skin_GetIcon("alarms_menu_showhide");
@@ -67,5 +63,5 @@ void InitIcons()
hIconList2 = Skin_GetIcon("alarms_list2");
hIconSystray = Skin_GetIcon("alarms_systray");
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index 9670795a4e..6c547a4d5c 100644
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -693,8 +693,8 @@ void AddMenuItem()
if (hMainMenuItem) return;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_ALL;
- mi.hIcon = hIconMenuSet;
+ mi.flags = CMIM_ALL | CMIF_ICONFROMICOLIB;
+ mi.icolibItem = Skin_GetIconHandle("alarms_menu_set");;
mi.pszName = "Set Alarm";
mi.pszService = MODULE "/NewAlarm";
mi.position = 500010000;