From b3ec2513d67356a200c56e3f9dd0a3e9e72d26c9 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 7 May 2014 04:18:34 +0000 Subject: Added hotkey support for checking all feeds git-svn-id: http://svn.miranda-ng.org/main/trunk@9135 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Common.h | 9 +++++---- plugins/NewsAggregator/Src/NewsAggregator.cpp | 12 +++++++++++- plugins/NewsAggregator/Src/Services.cpp | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'plugins/NewsAggregator/Src') diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index 48371e702f..09eb380307 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. #include #include #include +#include #include #include @@ -149,15 +150,15 @@ MCONTACT GetContactByURL(const TCHAR *url); // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_ADDFEED "NewsAggregator/AddNewsFeed" -// Add new Feed channel +// Change Feed channel // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_CHANGEFEED "NewsAggregator/ChangeNewsFeed" -// Import Feed chanels from file +// Import Feed channels from file // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_IMPORTFEEDS "NewsAggregator/ImportFeeds" -// Export Feed chanels to file +// Export Feed channels to file // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_EXPORTFEEDS "NewsAggregator/ExportFeeds" @@ -165,6 +166,6 @@ MCONTACT GetContactByURL(const TCHAR *url); // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_CHECKFEED "NewsAggregator/CheckFeed" -// Check Feed info +// Enable/disable getting feed info // WPARAM = LPARAM = NULL #define MS_NEWSAGGREGATOR_ENABLED "NewsAggregator/Enabled" \ No newline at end of file diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp index e1bd14eba6..2d045613cd 100644 --- a/plugins/NewsAggregator/Src/NewsAggregator.cpp +++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp @@ -71,7 +71,7 @@ extern "C" __declspec(dllexport) int Load(void) PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = MODULE; pd.type = PROTOTYPE_VIRTUAL; - CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); + CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); CreateProtoServiceFunction(MODULE, PS_GETNAME, NewsAggrGetName); CreateProtoServiceFunction(MODULE, PS_GETCAPS, NewsAggrGetCaps); @@ -89,6 +89,16 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_NEWSAGGREGATOR_CHECKFEED, CheckFeed); CreateServiceFunction(MS_NEWSAGGREGATOR_CHANGEFEED, ChangeFeed); CreateServiceFunction(MS_NEWSAGGREGATOR_ENABLED, EnableDisable); + + HOTKEYDESC hkd = { sizeof(hkd) }; + hkd.dwFlags = HKD_TCHAR; + hkd.pszName = "NewsAggregator/CheckAllFeeds"; + hkd.ptszDescription = LPGENT("Check All Feeds"); + hkd.ptszSection = LPGENT("News Aggregator"); + hkd.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS; + hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'O') | HKF_MIRANDA_LOCAL; + Hotkey_Register(&hkd); + return 0; } diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 9a130b5f17..54d7914ca9 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -79,6 +79,8 @@ int NewsAggrPreShutdown(WPARAM wParam, LPARAM lParam) KillTimer(NULL, timerId); NetlibUnInit(); + + CallService(MS_HOTKEY_UNREGISTER, 0, (LPARAM)"NewsAggregator/CheckAllFeeds"); return 0; } -- cgit v1.2.3