diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-09-05 19:45:09 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-09-05 19:45:09 +0000 |
commit | ad7c3e6fbecda86cac28f611a3766c2418a2a52d (patch) | |
tree | e934efc9c0aa8d5f8948403f9fd10367e62b5b13 /plugins/NotifyAnything/src | |
parent | a57f3c5fa73644405b181343343f049e41e6db3c (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/src')
-rw-r--r-- | plugins/NotifyAnything/src/main.cpp | 18 | ||||
-rw-r--r-- | plugins/NotifyAnything/src/options.cpp | 38 |
2 files changed, 28 insertions, 28 deletions
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);
|