summaryrefslogtreecommitdiff
path: root/plugins/ListeningTo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-26 18:21:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-26 18:21:10 +0000
commit68924bfc1a213e619563c2cffb6d44b5b5346f6d (patch)
tree139f501b225080e4f895dbd40083df5956c3e339 /plugins/ListeningTo
parentb7a7d90f054d48dfda64e8a11d4f5cbb3fe2a521 (diff)
next slice of cutting out unused menu features - popupPosition
git-svn-id: http://svn.miranda-ng.org/main/trunk@14400 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r--plugins/ListeningTo/src/commons.h1
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp28
-rw-r--r--plugins/ListeningTo/src/options.h20
3 files changed, 26 insertions, 23 deletions
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h
index 8ac3c7d235..895d445d3b 100644
--- a/plugins/ListeningTo/src/commons.h
+++ b/plugins/ListeningTo/src/commons.h
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA.
#include <m_protosvc.h>
#include <m_langpack.h>
#include <m_database.h>
+#include <m_clistint.h>
#include <m_options.h>
#include <m_xstatus.h>
#include <m_clui.h>
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 8ca0d1aead..116786208f 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA.
#include "commons.h"
+CLIST_INTERFACE *pcli;
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -56,10 +57,10 @@ int TopToolBarLoaded(WPARAM wParam, LPARAM lParam);
int SettingChanged(WPARAM wParam,LPARAM lParam);
INT_PTR MainMenuClicked(WPARAM wParam, LPARAM lParam);
-BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal = FALSE);
+bool ListeningToEnabled(char *proto, bool ignoreGlobal = false);
INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam);
INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam);
-INT_PTR EnableListeningTo(char *proto = NULL,BOOL enabled = FALSE);
+INT_PTR EnableListeningTo(char *proto = NULL, bool enabled = false);
INT_PTR GetTextFormat(WPARAM wParam,LPARAM lParam);
TCHAR* GetParsedFormat(LISTENINGTOINFO *lti);
INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam);
@@ -112,6 +113,7 @@ static IconItem iconList[] =
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
CoInitialize(NULL);
@@ -157,7 +159,7 @@ extern "C" int __declspec(dllexport) Unload(void)
void UpdateGlobalStatusMenus()
{
- BOOL enabled = ListeningToEnabled(NULL, TRUE);
+ bool enabled = ListeningToEnabled(NULL, true);
Menu_SetChecked(proto_items[0].hMenu, enabled);
Menu_EnableItem(proto_items[0].hMenu, opts.enable_sending);
@@ -193,7 +195,7 @@ void RebuildMenu()
CLISTMENUITEM mi = { 0 };
mi.position = 100000 + i;
mi.hParentMenu = hMainMenuGroup;
- mi.popupPosition = 500080000 + i;
+ mi.position = 500080000 + i;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.ptszName = text;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR
@@ -299,7 +301,7 @@ int ModulesLoaded(WPARAM, LPARAM)
hMainMenuGroup = Menu_AddMainMenuItem(&mi);
mi.hParentMenu = hMainMenuGroup;
- mi.popupPosition = 500080000;
+ // mi.popupPosition = 500080000; !!!!!!!!!!!!!!!
mi.position = 0;
mi.pszService = MS_LISTENINGTO_MAINMENU;
mi.hIcon = NULL;
@@ -307,7 +309,7 @@ int ModulesLoaded(WPARAM, LPARAM)
// Add all protos
mi.ptszName = LPGENT("Send to all protocols");
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR
- | (ListeningToEnabled(NULL, TRUE) ? CMIF_CHECKED : 0)
+ | (ListeningToEnabled(NULL, true) ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
proto_items.resize(1);
proto_items[0].hMenu = Menu_AddMainMenuItem(&mi);
@@ -441,14 +443,14 @@ int PreShutdown(WPARAM, LPARAM)
static INT_PTR TopToolBarClick(WPARAM, LPARAM)
{
- EnableListeningTo(NULL, !ListeningToEnabled(NULL, TRUE));
+ EnableListeningTo(NULL, !ListeningToEnabled(NULL, true));
return 0;
}
// Toptoolbar hook to put an icon in the toolbar
int TopToolBarLoaded(WPARAM, LPARAM)
{
- BOOL enabled = ListeningToEnabled(NULL, TRUE);
+ BOOL enabled = ListeningToEnabled(NULL, true);
CreateServiceFunction(MS_LISTENINGTO_TTB, TopToolBarClick);
@@ -477,7 +479,7 @@ INT_PTR MainMenuClicked(WPARAM wParam, LPARAM lParam)
return 0;
}
-BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
+bool ListeningToEnabled(char *proto, bool ignoreGlobal)
{
if (!ignoreGlobal && !opts.enable_sending)
return FALSE;
@@ -498,7 +500,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
{
char setting[256];
mir_snprintf(setting, "%sEnabled", proto);
- return (BOOL) db_get_b(NULL, MODULE_NAME, setting, FALSE);
+ return db_get_b(NULL, MODULE_NAME, setting, false) != 0;
}
}
@@ -684,7 +686,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL)
}
}
-INT_PTR EnableListeningTo(char *proto,BOOL enabled)
+INT_PTR EnableListeningTo(char *proto, bool enabled)
{
if (!loaded)
return -1;
@@ -727,12 +729,12 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled)
INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
{
- return EnableListeningTo((char*)wParam,(BOOL)lParam);
+ return EnableListeningTo((char*)wParam, lParam != 0);
}
INT_PTR HotkeysEnable(WPARAM,LPARAM lParam)
{
- return EnableListeningTo(lParam, TRUE);
+ return EnableListeningTo(lParam, true);
}
INT_PTR HotkeysDisable(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/ListeningTo/src/options.h b/plugins/ListeningTo/src/options.h
index b0848e871c..8c14185eb3 100644
--- a/plugins/ListeningTo/src/options.h
+++ b/plugins/ListeningTo/src/options.h
@@ -42,22 +42,22 @@ Boston, MA 02111-1307, USA.
struct Options {
- BOOL enable_sending;
- BOOL enable_music;
- BOOL enable_radio;
- BOOL enable_video;
- BOOL enable_others;
+ bool enable_sending;
+ bool enable_music;
+ bool enable_radio;
+ bool enable_video;
+ bool enable_others;
TCHAR templ[1024];
TCHAR unknown[128];
- BOOL override_contact_template;
- BOOL show_adv_icon;
+ bool override_contact_template;
+ bool show_adv_icon;
int adv_icon_slot;
- BOOL get_info_from_watrack;
- BOOL enable_other_players;
- BOOL enable_code_injection;
+ bool get_info_from_watrack;
+ bool enable_other_players;
+ bool enable_code_injection;
int time_to_pool;
WORD xstatus_set;