summaryrefslogtreecommitdiff
path: root/plugins/NotifyAnything
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-09-05 19:45:09 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-09-05 19:45:09 +0000
commitad7c3e6fbecda86cac28f611a3766c2418a2a52d (patch)
treee934efc9c0aa8d5f8948403f9fd10367e62b5b13 /plugins/NotifyAnything
parenta57f3c5fa73644405b181343343f049e41e6db3c (diff)
Fixed broken settings (from r9470)
git-svn-id: http://svn.miranda-ng.org/main/trunk@10376 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NotifyAnything')
-rw-r--r--plugins/NotifyAnything/res/NotifyAnything.rc32
-rw-r--r--plugins/NotifyAnything/src/main.cpp18
-rw-r--r--plugins/NotifyAnything/src/options.cpp38
3 files changed, 44 insertions, 44 deletions
diff --git a/plugins/NotifyAnything/res/NotifyAnything.rc b/plugins/NotifyAnything/res/NotifyAnything.rc
index 03f1df6c9e..a879c459a5 100644
--- a/plugins/NotifyAnything/res/NotifyAnything.rc
+++ b/plugins/NotifyAnything/res/NotifyAnything.rc
@@ -13,13 +13,11 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
-#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
@@ -53,15 +51,16 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
NA_OPTIONS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 229
VERTGUIDE, 13
- VERTGUIDE, 55
- VERTGUIDE, 61
+ VERTGUIDE, 76
+ VERTGUIDE, 81
+ VERTGUIDE, 222
TOPMARGIN, 7
BOTTOMMARGIN, 184
END
@@ -82,26 +81,27 @@ BEGIN
GROUPBOX "Security",IDC_STATIC,7,7,222,77
CONTROL "Only listen to localhost",NA_LOCAL_CHECK,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,13,19,209,10
GROUPBOX "Sound",IDC_STATIC,7,91,222,43
- CONTROL "Play sounds",NA_SOUND_CHECK,"Button",BS_AUTO3STATE | WS_GROUP | WS_TABSTOP,13,102,114,10
- CONTROL "Use internal speaker",NA_PCSPEAKER_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,118,127,10
+ CONTROL "Play sounds",NA_SOUND_CHECK,"Button",BS_AUTO3STATE | WS_GROUP | WS_TABSTOP,13,102,209,10
+ CONTROL "Use internal speaker",NA_PCSPEAKER_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,118,209,10
GROUPBOX "Debug",IDC_STATIC,7,142,222,42
CONTROL "Log to file",NA_LOG_CHECK,"Button",BS_AUTO3STATE | WS_GROUP | WS_TABSTOP,13,152,98,10
- CONTROL "Message debugging",NA_DEBUG_MSG_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,152,102,10
- EDITTEXT NA_PORT,49,31,40,14,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "Port:",IDC_STATIC,13,33,17,8
- LTEXT "(Default is 12001)",IDC_STATIC,95,33,89,8
+ CONTROL "Message debugging",NA_DEBUG_MSG_CHECK,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,118,152,102,10
+ EDITTEXT NA_PORT,81,31,40,14,ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "Port:",IDC_STATIC,13,33,63,8,0,WS_EX_RIGHT
+ LTEXT "(Default is 12001)",IDC_STATIC,131,34,91,8
CONTROL "Allow actions to execute programs",NA_ALLOW_EXECUTE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,66,207,10
- EDITTEXT NA_PASSWORD,49,48,77,14,ES_PASSWORD | ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,13,51,34,8
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,66,209,10
+ EDITTEXT NA_PASSWORD,81,48,77,14,ES_PASSWORD | ES_AUTOHSCROLL
+ LTEXT "Password:",IDC_STATIC,13,51,63,8,0,WS_EX_RIGHT
EDITTEXT NA_LOG_FILENAME,13,165,187,13,ES_AUTOHSCROLL
PUSHBUTTON "...",NA_LOG_BROWSE,206,165,17,13
END
-#endif // English (U.S.) resources
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
+
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp
index 92d2dc2c87..3eecb41673 100644
--- a/plugins/NotifyAnything/src/main.cpp
+++ b/plugins/NotifyAnything/src/main.cpp
@@ -113,7 +113,7 @@ void dbg_msg(std::tstring str, int type)
str = strip(str);
if (g_settings.debug_messages)
- PUShowMessageT((TCHAR*)str.c_str(), type);
+ CallServiceSync(MS_POPUP_SHOWMESSAGE, (WPARAM)str.c_str(), (LPARAM)type);
if (g_settings.log_to_file) {
time_t t_;
@@ -409,8 +409,7 @@ void processSingleAction(const std::tstring &what, bool &closeflag)
args = strip(args);
dir = /*unquote(*/strip(dir)/*)*/;
- if ((int)ShellExecute(0, decode_se_arg(verb), decode_se_arg(file),
- decode_se_arg(args), decode_se_arg(dir), SW_SHOWNORMAL) <= 32)
+ if ((int)ShellExecute(0, decode_se_arg(verb), decode_se_arg(file), decode_se_arg(args), decode_se_arg(dir), SW_SHOWNORMAL) <= 32)
throw _T("Failed: ") + what;
}
else if (what == _T("close"))
@@ -436,10 +435,9 @@ void processAction(const std::tstring &what, bool &closeflag)
}
}
-static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- popup_t *pd = 0;
- pd = (popup_t *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)pd);
+ popup_t *pd = (popup_t *)PUGetPluginData(hWnd);
if (!pd)
return FALSE;
@@ -517,7 +515,7 @@ int showMessage(const popup_t &msg)
ppd.colorBack = msg.background;
ppd.colorText = msg.foreground;
ppd.lchIcon = getIcon(msg.icon);
- ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
+ ppd.PluginWindowProc = PopupDlgProc;
ppd.iSeconds = msg.delay;
EnterCS(&g_popups_cs);
@@ -1008,11 +1006,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- return 0;
-}
-
extern "C" int __declspec(dllexport) Load()
{
g_firstrun = true;
@@ -1032,7 +1025,6 @@ extern "C" int __declspec(dllexport) Load()
load_settings();
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
- HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
start_threads();
return 0;
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp
index ad12c25e8a..bf7009a0f4 100644
--- a/plugins/NotifyAnything/src/options.cpp
+++ b/plugins/NotifyAnything/src/options.cpp
@@ -7,15 +7,26 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
+ if(g_settings.local_only) {
+ CheckDlgButton(hwndDlg, NA_LOCAL_CHECK, BST_CHECKED);
+ }
+ if(g_settings.log_to_file) {
+ CheckDlgButton(hwndDlg, NA_LOG_CHECK, BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, NA_DEBUG_MSG_CHECK), TRUE);
+ }
+ if(g_settings.debug_messages) {
+ CheckDlgButton(hwndDlg, NA_DEBUG_MSG_CHECK, BST_CHECKED);
+ }
+ if(g_settings.use_pcspeaker) {
+ CheckDlgButton(hwndDlg, NA_PCSPEAKER_CHECK, BST_CHECKED);
+ }
+ if(g_settings.allow_execute) {
+ CheckDlgButton(hwndDlg, NA_ALLOW_EXECUTE, BST_CHECKED);
+ }
+
{
TCHAR buf[10];
- CheckDlgButton(hwndDlg, NA_LOCAL_CHECK, g_settings.local_only ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, NA_DEBUG_MSG_CHECK, g_settings.debug_messages ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, NA_LOG_CHECK, g_settings.log_to_file ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(hwndDlg, NA_LOG_FILENAME, g_settings.log_filename.c_str());
- EnableWindow(GetDlgItem(hwndDlg, NA_DEBUG_MSG_CHECK), IsDlgButtonChecked(hwndDlg, NA_LOG_CHECK) ? 1 : 0);
- CheckDlgButton(hwndDlg, NA_PCSPEAKER_CHECK, g_settings.use_pcspeaker ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, NA_ALLOW_EXECUTE, g_settings.allow_execute ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(hwndDlg, NA_PORT, _itot(g_settings.port, buf, 10));
SetDlgItemText(hwndDlg, NA_PASSWORD, g_settings.password.c_str());
UINT state;
@@ -43,11 +54,8 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case NA_PASSWORD:
case NA_LOG_FILENAME:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
-
- if (HIWORD(wParam) == BN_CLICKED) {
- switch (LOWORD(wParam)) {
- case NA_LOG_BROWSE:
+ case NA_LOG_BROWSE:
+ if (HIWORD(wParam) == BN_CLICKED) {
TCHAR szTemp[MAX_PATH + 1], szTemp1[MAX_PATH + 1], szProfileDir[MAX_PATH + 1];
GetDlgItemText(hwndDlg, NA_LOG_FILENAME, szTemp, MAX_PATH);
OPENFILENAME ofn = { 0 };
@@ -58,7 +66,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
ofn.lpstrFilter = TranslateT("Log (*.log)\0*.log\0Text (*.txt)\0*.txt\0All Files (*.*)\0*.*\0");
ofn.nFilterIndex = 1;
// Use profile directory as default, if path is not specified
- CallService(MS_DB_GETPROFILEPATH, (WPARAM)MAX_PATH, (LPARAM)szProfileDir);
+ CallService(MS_DB_GETPROFILEPATHT, (WPARAM)MAX_PATH, (LPARAM)szProfileDir);
ofn.lpstrInitialDir = szProfileDir;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = _T("log");
@@ -148,12 +156,12 @@ void load_settings()
g_settings.port = db_get_dw(NULL, PlugName, "port", 12001);
DBVARIANT dbv;
- if (!db_get(NULL, PlugName, "password", &dbv)) {
+ if (!db_get_ts(NULL, PlugName, "password", &dbv)) {
g_settings.password = dbv.ptszVal;
db_free(&dbv);
}
- if (!db_get(NULL, PlugName, "log_filename", &dbv)) {
+ if (!db_get_ts(NULL, PlugName, "log_filename", &dbv)) {
g_settings.log_filename = dbv.ptszVal;
db_free(&dbv);
}
@@ -161,7 +169,7 @@ void load_settings()
g_settings.log_filename = g_mirandaDir + _T("\\") + _T(LOG_ID) + _T(".log");
}
-int OptionsInitialize(WPARAM wParam, LPARAM lParam)
+int OptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.pszTemplate = MAKEINTRESOURCEA(NA_OPTIONS);