summaryrefslogtreecommitdiff
path: root/plugins/Alarms/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/Alarms/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/Alarms/src')
-rw-r--r--plugins/Alarms/src/alarm_win.cpp12
-rwxr-xr-xplugins/Alarms/src/alarmlist.cpp92
-rw-r--r--plugins/Alarms/src/alarms.cpp18
-rwxr-xr-xplugins/Alarms/src/frame.cpp20
-rwxr-xr-xplugins/Alarms/src/options.cpp58
-rwxr-xr-xplugins/Alarms/src/stdafx.h7
6 files changed, 107 insertions, 100 deletions
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 0379da801b..940f9857a7 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -37,7 +37,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULE, "Notify");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULENAME, "Notify");
SetFocus(GetDlgItem(hwndDlg, IDC_SNOOZE));
wd = new WindowData;
@@ -52,7 +52,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
r.left += 20;
SetWindowPos(hwndDlg, nullptr, r.left, r.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "Notify");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "Notify");
}
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)wd);
@@ -191,7 +191,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
return TRUE;
case WM_MOVE:
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "Notify");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "Notify");
break;
case WMU_ADDSNOOZER:
@@ -350,7 +350,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM)
title_font_id.cbSize = sizeof(FontIDW);
wcsncpy_s(title_font_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(title_font_id.name, LPGENW("Title"), _TRUNCATE);
- strncpy_s(title_font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(title_font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(title_font_id.prefix, "FontTitle", _TRUNCATE);
wcsncpy_s(title_font_id.backgroundGroup, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(title_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
@@ -361,7 +361,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM)
window_font_id.cbSize = sizeof(FontIDW);
wcsncpy_s(window_font_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(window_font_id.name, LPGENW("Window"), _TRUNCATE);
- strncpy_s(window_font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(window_font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(window_font_id.prefix, "FontWindow", _TRUNCATE);
wcsncpy_s(window_font_id.backgroundGroup, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(window_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
@@ -370,7 +370,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM)
Font_RegisterW(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDW);
- strncpy_s(bk_colour_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(bk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
wcsncpy_s(bk_colour_id.group, LPGENW("Alarms"), _TRUNCATE);
wcsncpy_s(bk_colour_id.name, LPGENW("Background"), _TRUNCATE);
strncpy_s(bk_colour_id.setting, "BkColour", _TRUNCATE);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index 0cbacdff46..485a02d6e8 100755
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -229,7 +229,7 @@ bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ, int selected_days)
void LoadAlarms()
{
- int num_alarms = db_get_w(0, MODULE, "Count", 0);
+ int num_alarms = db_get_w(0, MODULENAME, "Count", 0);
char buff[256];
DBVARIANT dbv;
ALARM alarm;
@@ -243,69 +243,69 @@ void LoadAlarms()
memset(&alarm, 0, sizeof(ALARM));
mir_snprintf(buff, "Title%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szTitle = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Desc%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szDesc = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Occ%d", i);
- alarm.occurrence = (Occurrence)db_get_w(0, MODULE, buff, 0);
+ alarm.occurrence = (Occurrence)db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STHour%d", i);
- alarm.time.wHour = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wHour = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STMinute%d", i);
- alarm.time.wMinute = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMinute = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STSecond%d", i);
- alarm.time.wSecond = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wSecond = db_get_w(0, MODULENAME, buff, 0);
switch (alarm.occurrence) {
case OC_ONCE:
mir_snprintf(buff, "STYear%d", i);
- alarm.time.wYear = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wYear = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STMonth%d", i);
- alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMonth = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_WEEKLY:
mir_snprintf(buff, "STDayOfWeek%d", i);
- alarm.time.wDayOfWeek = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDayOfWeek = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_WEEKDAYS:
break;
case OC_SELECTED_DAYS:
mir_snprintf(buff, "SelectedDays%d", i);
- alarm.day_mask = db_get_dw(0, MODULE, buff, alarm.day_mask);
+ alarm.day_mask = db_get_dw(0, MODULENAME, buff, alarm.day_mask);
break;
case OC_DAILY:
break;
case OC_MONTHLY:
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
case OC_YEARLY:
mir_snprintf(buff, "STMonth%d", i);
- alarm.time.wMonth = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wMonth = db_get_w(0, MODULENAME, buff, 0);
mir_snprintf(buff, "STDay%d", i);
- alarm.time.wDay = db_get_w(0, MODULE, buff, 0);
+ alarm.time.wDay = db_get_w(0, MODULENAME, buff, 0);
break;
}
if (UpdateAlarm(alarm.time, alarm.occurrence, alarm.day_mask)) {
mir_snprintf(buff, "ActionFlags%d", i);
- alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND);
+ alarm.action = (unsigned short)db_get_dw(0, MODULENAME, buff, AAF_POPUP | AAF_SOUND);
if (alarm.action & AAF_COMMAND) {
mir_snprintf(buff, "ActionCommand%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szCommand = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
mir_snprintf(buff, "ActionParams%d", i);
- if (!db_get_ws(0, MODULE, buff, &dbv)) {
+ if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
alarm.szCommandParams = mir_wstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -313,22 +313,22 @@ void LoadAlarms()
}
mir_snprintf(buff, "SoundNum%d", i);
- alarm.sound_num = (int)db_get_b(0, MODULE, buff, 1);
+ alarm.sound_num = (int)db_get_b(0, MODULENAME, buff, 1);
mir_snprintf(buff, "Snoozer%d", i);
- alarm.snoozer = db_get_b(0, MODULE, buff, 0) == 1;
+ alarm.snoozer = db_get_b(0, MODULENAME, buff, 0) == 1;
mir_snprintf(buff, "Hidden%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_HIDDEN : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_HIDDEN : 0);
mir_snprintf(buff, "Suspended%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_SUSPENDED : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_SUSPENDED : 0);
mir_snprintf(buff, "NoStartup%d", i);
- alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_NOSTARTUP : 0);
+ alarm.flags |= (db_get_b(0, MODULENAME, buff, 0) == 1 ? ALF_NOSTARTUP : 0);
mir_snprintf(buff, "Flags%d", i);
- alarm.flags = db_get_dw(0, MODULE, buff, alarm.flags);
+ alarm.flags = db_get_dw(0, MODULENAME, buff, alarm.flags);
alarm.id = next_alarm_id++;
alarms.push_back(&alarm);
@@ -391,10 +391,10 @@ void SaveAlarms()
//quick and dirty solution, feel free to rewrite
//TODO: this should be done on "delete" button press instead, and for selected alrams only
std::list<char*> settings;
- db_enum_settings(0, &db_enum_settings_sub_cb, MODULE, &settings);
+ db_enum_settings(0, &db_enum_settings_sub_cb, MODULENAME, &settings);
for (std::list<char*>::iterator i = settings.begin(), end = settings.end(); i != end; ++i)
{
- db_unset(0, MODULE, *i);
+ db_unset(0, MODULENAME, *i);
mir_free(*i);
}
}
@@ -403,18 +403,18 @@ void SaveAlarms()
ALARM *i;
for (alarms.reset(); i = alarms.current(); alarms.next(), index++) {
mir_snprintf(buff, "Title%d", index);
- db_set_ws(0, MODULE, buff, i->szTitle);
+ db_set_ws(0, MODULENAME, buff, i->szTitle);
mir_snprintf(buff, "Desc%d", index);
- db_set_ws(0, MODULE, buff, i->szDesc);
+ db_set_ws(0, MODULENAME, buff, i->szDesc);
mir_snprintf(buff, "Occ%d", index);
- db_set_w(0, MODULE, buff, i->occurrence);
+ db_set_w(0, MODULENAME, buff, i->occurrence);
mir_snprintf(buff, "STHour%d", index);
- db_set_w(0, MODULE, buff, i->time.wHour);
+ db_set_w(0, MODULENAME, buff, i->time.wHour);
mir_snprintf(buff, "STMinute%d", index);
- db_set_w(0, MODULE, buff, i->time.wMinute);
+ db_set_w(0, MODULENAME, buff, i->time.wMinute);
mir_snprintf(buff, "STSecond%d", index);
- db_set_w(0, MODULE, buff, i->time.wSecond);
+ db_set_w(0, MODULENAME, buff, i->time.wSecond);
switch (i->occurrence) {
case OC_DAILY:
@@ -423,47 +423,47 @@ void SaveAlarms()
break;
case OC_SELECTED_DAYS:
mir_snprintf(buff, "SelectedDays%d", index);
- db_set_dw(0, MODULE, buff, i->day_mask);
+ db_set_dw(0, MODULENAME, buff, i->day_mask);
break;
case OC_WEEKLY:
mir_snprintf(buff, "STDayOfWeek%d", index);
- db_set_w(0, MODULE, buff, i->time.wDayOfWeek);
+ db_set_w(0, MODULENAME, buff, i->time.wDayOfWeek);
break;
case OC_ONCE:
mir_snprintf(buff, "STYear%d", index);
- db_set_w(0, MODULE, buff, i->time.wYear);
+ db_set_w(0, MODULENAME, buff, i->time.wYear);
case OC_YEARLY:
mir_snprintf(buff, "STMonth%d", index);
- db_set_w(0, MODULE, buff, i->time.wMonth);
+ db_set_w(0, MODULENAME, buff, i->time.wMonth);
case OC_MONTHLY:
mir_snprintf(buff, "STDay%d", index);
- db_set_w(0, MODULE, buff, i->time.wDay);
+ db_set_w(0, MODULENAME, buff, i->time.wDay);
break;
}
mir_snprintf(buff, "ActionFlags%d", index);
- db_set_dw(0, MODULE, buff, i->action);
+ db_set_dw(0, MODULENAME, buff, i->action);
if (i->action & AAF_COMMAND) {
if (mir_wstrlen(i->szCommand)) {
mir_snprintf(buff, "ActionCommand%d", index);
- db_set_ws(0, MODULE, buff, i->szCommand);
+ db_set_ws(0, MODULENAME, buff, i->szCommand);
if (mir_wstrlen(i->szCommandParams)) {
mir_snprintf(buff, "ActionParams%d", index);
- db_set_ws(0, MODULE, buff, i->szCommandParams);
+ db_set_ws(0, MODULENAME, buff, i->szCommandParams);
}
}
}
mir_snprintf(buff, "SoundNum%d", index);
- db_set_b(0, MODULE, buff, i->sound_num);
+ db_set_b(0, MODULENAME, buff, i->sound_num);
mir_snprintf(buff, "Snoozer%d", index);
- db_set_b(0, MODULE, buff, i->snoozer ? 1 : 0);
+ db_set_b(0, MODULENAME, buff, i->snoozer ? 1 : 0);
mir_snprintf(buff, "Flags%d", index);
- db_set_dw(0, MODULE, buff, i->flags);
+ db_set_dw(0, MODULENAME, buff, i->flags);
}
- db_set_w(0, MODULE, "Count", index);
+ db_set_w(0, MODULENAME, "Count", index);
}
void copy_list(AlarmList &copy)
@@ -692,7 +692,7 @@ void DoAlarm(ALARM *alarm)
void WriteLastCheckTime()
{
// save last-check time
- db_set_blob(NULL, MODULE, "LastCheck", &last_check, sizeof(SYSTEMTIME));
+ db_set_blob(NULL, MODULENAME, "LastCheck", &last_check, sizeof(SYSTEMTIME));
last_saved_check = last_check;
}
@@ -785,7 +785,7 @@ void InitList()
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
dbv.cpbVal = sizeof(SYSTEMTIME);
- if (!db_get(NULL, MODULE, "LastCheck", &dbv)) {
+ if (!db_get(NULL, MODULENAME, "LastCheck", &dbv)) {
memcpy(&last_check, dbv.pbVal, sizeof(SYSTEMTIME));
db_free(&dbv);
}
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp
index 76d0a069b5..ae2d88cfde 100644
--- a/plugins/Alarms/src/alarms.cpp
+++ b/plugins/Alarms/src/alarms.cpp
@@ -23,7 +23,9 @@ int &hLangpack(g_plugin.m_hLang);
HANDLE hTopToolbarButton;
-PLUGININFOEX pluginInfo = {
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -36,11 +38,17 @@ PLUGININFOEX pluginInfo = {
{0x4dd7762b, 0xd612, 0x4f84, {0xaa, 0x86, 0x6, 0x8f, 0x17, 0x85, 0x9b, 0x6d}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
@@ -119,7 +127,7 @@ static int InitTopToolbarButton(WPARAM, LPARAM)
TTBButton ttb = {};
ttb.hIconUp = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_TBUP));
ttb.hIconDn = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_TBDN));
- ttb.pszService = MODULE "/NewAlarm";
+ ttb.pszService = MODULENAME "/NewAlarm";
ttb.dwFlags = TTBBF_VISIBLE;
ttb.name = ttb.pszTooltipUp = LPGEN("Set alarm");
hTopToolbarButton = TopToolbar_AddButton(&ttb);
@@ -144,7 +152,7 @@ static int MainDeInit(WPARAM, LPARAM)
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
// ensure datetime picker is loaded
@@ -167,6 +175,8 @@ extern "C" int __declspec(dllexport) Load(void)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp
index c23d8e31ea..69759eb1d6 100755
--- a/plugins/Alarms/src/frame.cpp
+++ b/plugins/Alarms/src/frame.cpp
@@ -46,13 +46,13 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_SHOWWINDOW:
if (wParam) {
- db_set_b(0, MODULE, "ReminderFrameVisible", 1);
- Utils_RestoreWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ db_set_b(0, MODULENAME, "ReminderFrameVisible", 1);
+ Utils_RestoreWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
PostMessage(hwnd, WM_SIZE, 0, 0);
}
else {
- db_set_b(0, MODULE, "ReminderFrameVisible", 0);
- Utils_SaveWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ db_set_b(0, MODULENAME, "ReminderFrameVisible", 0);
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
}
break;
case WM_SIZE:
@@ -68,7 +68,7 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP
break;
case WM_CLOSE:
- Utils_SaveWindowPosition(hwnd, 0, MODULE, "reminders_window");
+ Utils_SaveWindowPosition(hwnd, 0, MODULENAME, "reminders_window");
ShowWindow(hwnd, SW_HIDE);
FixMainMenu();
return TRUE;
@@ -519,7 +519,7 @@ int CreateFrame()
///////////////////////
// create menu item
- CreateServiceFunction(MODULE "/ShowHideReminders", ShowHideMenuFunc);
+ CreateServiceFunction(MODULENAME "/ShowHideReminders", ShowHideMenuFunc);
CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENW("Alarms"), 0);
@@ -528,7 +528,7 @@ int CreateFrame()
SET_UID(mi, 0x27556ea9, 0xfa19, 0x4c2e, 0xb0, 0xc9, 0x48, 0x2, 0x5c, 0x17, 0xba, 0x5);
mi.hIcolibItem = hIconMenuShowHide;
mi.name.a = LPGEN("Show reminders");
- mi.pszService = MODULE "/ShowHideReminders";
+ mi.pszService = MODULENAME "/ShowHideReminders";
mi.position = 500010000;
hMenuShowReminders = Menu_AddMainMenuItem(&mi);
/////////////////////
@@ -542,7 +542,7 @@ int CreateFrame()
else ShowWindow(hwnd_frame, SW_HIDE);
}
else {
- if (db_get_b(0, MODULE, "ReminderFrameVisible", 1) == 1) {
+ if (db_get_b(0, MODULENAME, "ReminderFrameVisible", 1) == 1) {
ShowWindow(hwnd_frame, SW_SHOW);
RefreshReminderFrame();
}
@@ -558,13 +558,13 @@ int CreateFrame()
font_id.cbSize = sizeof(font_id);
strncpy_s(font_id.group, LPGEN("Frames"), _TRUNCATE);
strncpy_s(font_id.name, LPGEN("Alarm reminders"), _TRUNCATE);
- strncpy_s(font_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(font_id.prefix, "Font", _TRUNCATE);
font_id.order = 0;
Font_Register(&font_id);
framebk_colour_id.cbSize = sizeof(ColourID);
- strncpy_s(framebk_colour_id.dbSettingsGroup, MODULE, _TRUNCATE);
+ strncpy_s(framebk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(framebk_colour_id.group, LPGEN("Frames"), _TRUNCATE);
strncpy_s(framebk_colour_id.name, LPGEN("Alarm reminders"), _TRUNCATE);
strncpy_s(framebk_colour_id.setting, "clFrameBack", _TRUNCATE);
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index 91880d9a80..3dc22dccba 100755
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -68,7 +68,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
delete param;
- Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_RestoreWindowPositionNoSize(hwndDlg, 0, MODULENAME, "AddEdit");
if (GetDlgCtrlID((HWND)wParam) != IDC_TITLE) {
SetFocus(GetDlgItem(hwndDlg, IDC_TITLE));
@@ -701,7 +701,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
else add_edit_alarm->sound_num = 0;
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "AddEdit");
// self-add (setting stored in invisible checkbox - see comments in WM_INITDIALOG
if (IsDlgButtonChecked(hwndDlg, IDC_CHK_INVIS)) {
@@ -734,7 +734,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP
delete add_edit_alarm;
}
- Utils_SaveWindowPosition(hwndDlg, 0, MODULE, "AddEdit");
+ Utils_SaveWindowPosition(hwndDlg, 0, MODULENAME, "AddEdit");
// deal with modal and non-modal modes
PostMessage(hwndDlg, WMU_MYDESTROY, 0, 0);
@@ -820,7 +820,7 @@ void AddMenuItem()
SET_UID(mi, 0xd50b94e4, 0x8edd, 0x4083, 0x91, 0x93, 0x7c, 0x6a, 0xb8, 0x1, 0x41, 0xb9);
mi.hIcolibItem = IcoLib_GetIconHandle("alarms_menu_set");
mi.name.a = "Set alarm";
- mi.pszService = MODULE "/NewAlarm";
+ mi.pszService = MODULENAME "/NewAlarm";
mi.position = 500010000;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
@@ -830,7 +830,7 @@ void AddMenuItem()
int OptionsModulesLoaded(WPARAM, LPARAM)
{
- CreateServiceFunction(MODULE "/NewAlarm", NewAlarmMenuFunc);
+ CreateServiceFunction(MODULENAME "/NewAlarm", NewAlarmMenuFunc);
AddMenuItem();
@@ -1224,36 +1224,36 @@ int OptInit(WPARAM wParam, LPARAM)
void LoadOptions()
{
- options.use_popup_module = (db_get_b(0, MODULE, "UsePopupModule", 0) == 1);
- options.snooze_minutes = (int)db_get_dw(0, MODULE, "SnoozeMinutes", 10);
- options.row_height = (int)db_get_dw(0, MODULE, "RowHeight", 20);
- options.indent = (int)db_get_dw(0, MODULE, "Indent", 5);
- options.aw_trans = (int)db_get_b(0, MODULE, "Transparency", 0);
- options.aw_roundcorners = (db_get_b(0, MODULE, "RoundCorners", 1) == 1);
- options.aw_dontstealfocus = (db_get_b(0, MODULE, "DontStealFocus", 1) == 1);
- options.auto_showhide = (db_get_b(0, MODULE, "AutoShowHide", 0) == 1);
- options.hide_with_clist = (db_get_b(0, MODULE, "HideWithClist", 0) == 1);
- options.loop_sound = (db_get_b(0, MODULE, "LoopSound", 1) == 1);
- options.auto_size_vert = (db_get_b(0, MODULE, "AutoSize", 0) == 1);
- options.reminder_period = (int)db_get_dw(0, MODULE, "ReminderPeriod", 8);
+ options.use_popup_module = (db_get_b(0, MODULENAME, "UsePopupModule", 0) == 1);
+ options.snooze_minutes = (int)db_get_dw(0, MODULENAME, "SnoozeMinutes", 10);
+ options.row_height = (int)db_get_dw(0, MODULENAME, "RowHeight", 20);
+ options.indent = (int)db_get_dw(0, MODULENAME, "Indent", 5);
+ options.aw_trans = (int)db_get_b(0, MODULENAME, "Transparency", 0);
+ options.aw_roundcorners = (db_get_b(0, MODULENAME, "RoundCorners", 1) == 1);
+ options.aw_dontstealfocus = (db_get_b(0, MODULENAME, "DontStealFocus", 1) == 1);
+ options.auto_showhide = (db_get_b(0, MODULENAME, "AutoShowHide", 0) == 1);
+ options.hide_with_clist = (db_get_b(0, MODULENAME, "HideWithClist", 0) == 1);
+ options.loop_sound = (db_get_b(0, MODULENAME, "LoopSound", 1) == 1);
+ options.auto_size_vert = (db_get_b(0, MODULENAME, "AutoSize", 0) == 1);
+ options.reminder_period = (int)db_get_dw(0, MODULENAME, "ReminderPeriod", 8);
HookEvent(ME_SYSTEM_MODULESLOADED, OptionsModulesLoaded);
}
void SaveOptions()
{
- db_set_b(0, MODULE, "UsePopupModule", options.use_popup_module ? 1 : 0);
- db_set_dw(0, MODULE, "SnoozeMinutes", options.snooze_minutes);
- db_set_dw(0, MODULE, "RowHeight", options.row_height);
- db_set_dw(0, MODULE, "Indent", options.indent);
- db_set_b(0, MODULE, "Transparency", options.aw_trans);
- db_set_b(0, MODULE, "RoundCorners", options.aw_roundcorners ? 1 : 0);
- db_set_b(0, MODULE, "DontStealFocus", options.aw_dontstealfocus ? 1 : 0);
- db_set_b(0, MODULE, "AutoShowHide", options.auto_showhide ? 1 : 0);
- db_set_b(0, MODULE, "HideWithClist", options.hide_with_clist ? 1 : 0);
- db_set_b(0, MODULE, "LoopSound", options.loop_sound ? 1 : 0);
- db_set_b(0, MODULE, "AutoSize", options.auto_size_vert ? 1 : 0);
- db_set_dw(0, MODULE, "ReminderPeriod", options.reminder_period);
+ db_set_b(0, MODULENAME, "UsePopupModule", options.use_popup_module ? 1 : 0);
+ db_set_dw(0, MODULENAME, "SnoozeMinutes", options.snooze_minutes);
+ db_set_dw(0, MODULENAME, "RowHeight", options.row_height);
+ db_set_dw(0, MODULENAME, "Indent", options.indent);
+ db_set_b(0, MODULENAME, "Transparency", options.aw_trans);
+ db_set_b(0, MODULENAME, "RoundCorners", options.aw_roundcorners ? 1 : 0);
+ db_set_b(0, MODULENAME, "DontStealFocus", options.aw_dontstealfocus ? 1 : 0);
+ db_set_b(0, MODULENAME, "AutoShowHide", options.auto_showhide ? 1 : 0);
+ db_set_b(0, MODULENAME, "HideWithClist", options.hide_with_clist ? 1 : 0);
+ db_set_b(0, MODULENAME, "LoopSound", options.loop_sound ? 1 : 0);
+ db_set_b(0, MODULENAME, "AutoSize", options.auto_size_vert ? 1 : 0);
+ db_set_dw(0, MODULENAME, "ReminderPeriod", options.reminder_period);
}
INT_PTR NewAlarmMenuFunc(WPARAM, LPARAM)
diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h
index 26575d45a4..149933f902 100755
--- a/plugins/Alarms/src/stdafx.h
+++ b/plugins/Alarms/src/stdafx.h
@@ -49,16 +49,13 @@ typedef struct ALARM_tag {
#include "alarm_win.h"
#include "time_utils.h"
-#define MODULE "Alarm"
+#define MODULENAME "Alarm"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
extern HANDLE hTopToolbarButton;
-
#endif