summaryrefslogtreecommitdiff
path: root/plugins/Weather/src/weather.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-01-13 15:24:40 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-01-13 15:24:40 +0000
commit44d565bb91b211f80c6f21fb92804084af37d4db (patch)
treed10b1024ca960a681691f4d2e2f440f863b9ab36 /plugins/Weather/src/weather.cpp
parent1534bf7c811cc1eee460e0e4d89fa99ee585845a (diff)
added toptoolbar support
fixed autoupdate saving setting cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@3095 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather.cpp')
-rw-r--r--plugins/Weather/src/weather.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp
index 4d7abb15f7..d4f1f8547e 100644
--- a/plugins/Weather/src/weather.cpp
+++ b/plugins/Weather/src/weather.cpp
@@ -56,6 +56,8 @@ BOOL ThreadRunning;
// variable to determine if module loaded
BOOL ModuleLoaded;
+HANDLE hTBButton = NULL;
+
// plugin info
static const PLUGININFOEX pluginInfoEx =
{
@@ -69,7 +71,7 @@ static const PLUGININFOEX pluginInfoEx =
__AUTHORWEB,
UNICODE_AWARE,
// {6B612A34-DCF2-4e32-85CF-B6FD006B745E}
- {0x6b612a34, 0xdcf2, 0x4e32, { 0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e}}
+ {0x6b612a34, 0xdcf2, 0x4e32, {0x85, 0xcf, 0xb6, 0xfd, 0x0, 0x6b, 0x74, 0x5e}}
};
extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
@@ -102,6 +104,21 @@ int WeatherShutdown(WPARAM wParam,LPARAM lParam)
return 0;
}
+int OnToolbarLoaded(WPARAM wParam, LPARAM lParam)
+{
+ TTBButton tbb = {0};
+ tbb.cbSize = sizeof(TTBButton);
+ tbb.name = LPGEN("Enable/disable auto update");
+ tbb.pszService = MS_WEATHER_ENABLED;
+ tbb.pszTooltipUp = LPGEN("Auto Update Enabled");
+ tbb.pszTooltipDn = LPGEN("Auto Update Disabled");
+ tbb.hIconHandleUp = GetIconHandle("main");
+ tbb.hIconHandleDn = GetIconHandle("disabled");
+ tbb.dwFlags = (db_get_b(NULL, WEATHERPROTONAME, "AutoUpdate", 1) ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON | TTBBF_VISIBLE;
+ hTBButton = TopToolbar_AddButton(&tbb);
+ return 0;
+}
+
// weather protocol initialization function
// run after the event ME_SYSTEM_MODULESLOADED occurs
int WeatherInit(WPARAM wParam,LPARAM lParam)
@@ -121,6 +138,8 @@ int WeatherInit(WPARAM wParam,LPARAM lParam)
// weather user detail
HookEvent(ME_USERINFO_INITIALISE, UserInfoInit);
+ HookEvent(ME_TTB_MODULELOADED, OnToolbarLoaded);
+
hDataWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);