diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-24 23:32:20 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-24 23:32:20 +0000 |
commit | 79412831126e49d990a44506af1ae69f78797d6c (patch) | |
tree | 9b08aab70ee1be9fc36adb51cf4d3f4337991383 /plugins/Weather/src/weather_opt.cpp | |
parent | 2e7f9dcf085ba41ab37bd3234c5fd27781896114 (diff) |
Weather: - minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather_opt.cpp')
-rw-r--r-- | plugins/Weather/src/weather_opt.cpp | 83 |
1 files changed, 41 insertions, 42 deletions
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 4733e8cb1d..fd36410b99 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -250,49 +250,10 @@ void SaveOptions(void) // misc stuff
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
}
-
-//============ OPTION INITIALIZATION ============
-
-// register the weather option pages
-int OptInit(WPARAM wParam, LPARAM)
-{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInst;
-
- // plugin options
- odp.position = 95600;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pfnDlgProc = OptionsProc;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTitle = _T(WEATHERPROTOTEXT);
- odp.ptszTab = LPGENT("General");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- Options_AddPage(wParam, &odp);
-
- // text options
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_TEXTOPT);
- odp.pfnDlgProc = DlgProcText;
- odp.ptszTab = LPGENT("Display");
- Options_AddPage(wParam, &odp);
-
- // if popup service exists, load the weather popup options
- if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
- odp.position = 100000000;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
- odp.ptszGroup = LPGENT("Popups");
- odp.groupPosition = 910000000;
- odp.ptszTab = NULL;
- odp.pfnDlgProc = DlgPopupOpts;
- Options_AddPage(wParam, &odp);
- }
-
- return 0;
-}
-
//============ MAIN OPTIONS ============
// weather options
-INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
+static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
TCHAR str[512];
@@ -377,7 +338,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) opt.UpdateTime = (WORD)_ttoi(str);
if (opt.UpdateTime < 1) opt.UpdateTime = 1;
KillTimer(NULL, timerId);
- timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, (TIMERPROC)timerProc);
+ timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, timerProc);
// other general options
GetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign, _countof(opt.DegreeSign));
@@ -458,7 +419,7 @@ static const char *varname[8] = { "C", "b", "B", "N", "X", "E", "H", "S" }; static const int cname[8] = { IDC_CTEXT, IDC_BTITLE, IDC_BTEXT, IDC_NTEXT, IDC_XTEXT, IDC_ETEXT, IDC_HTEXT, IDC_BTITLE2 };
static TCHAR* const *var[8] = { &opt.cText, &opt.bTitle, &opt.bText, &opt.nText, &opt.xText, &opt.eText, &opt.hText, &opt.sText };
-INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
RECT rc, pos;
HWND button;
@@ -603,3 +564,41 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) return FALSE;
}
+
+//============ OPTION INITIALIZATION ============
+
+// register the weather option pages
+int OptInit(WPARAM wParam, LPARAM)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.hInstance = hInst;
+
+ // plugin options
+ odp.position = 95600;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+ odp.pfnDlgProc = OptionsProc;
+ odp.ptszGroup = LPGENT("Network");
+ odp.ptszTitle = _T(WEATHERPROTOTEXT);
+ odp.ptszTab = LPGENT("General");
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ Options_AddPage(wParam, &odp);
+
+ // text options
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_TEXTOPT);
+ odp.pfnDlgProc = DlgProcText;
+ odp.ptszTab = LPGENT("Display");
+ Options_AddPage(wParam, &odp);
+
+ // if popup service exists, load the weather popup options
+ if ((ServiceExists(MS_POPUP_ADDPOPUPT))) {
+ odp.position = 100000000;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP);
+ odp.ptszGroup = LPGENT("Popups");
+ odp.groupPosition = 910000000;
+ odp.ptszTab = NULL;
+ odp.pfnDlgProc = DlgPopupOpts;
+ Options_AddPage(wParam, &odp);
+ }
+
+ return 0;
+}
|