diff options
Diffstat (limited to 'plugins/AddContactPlus/src')
-rw-r--r-- | plugins/AddContactPlus/src/addcontactplus.h | 2 | ||||
-rw-r--r-- | plugins/AddContactPlus/src/main.cpp | 33 |
2 files changed, 17 insertions, 18 deletions
diff --git a/plugins/AddContactPlus/src/addcontactplus.h b/plugins/AddContactPlus/src/addcontactplus.h index 6e9d90e9fd..a42f0d14bb 100644 --- a/plugins/AddContactPlus/src/addcontactplus.h +++ b/plugins/AddContactPlus/src/addcontactplus.h @@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <m_utils.h>
#include <m_addcontact.h>
-#include "m_toolbar.h"
+#include "m_toptoolbar.h"
#include "m_updater.h"
#include "m_addcontactplus.h"
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 56d8b0ad1b..de529836c9 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -108,21 +108,6 @@ static int OnAccListChanged(WPARAM, LPARAM) mi.ptszName = LPGENT("&Add Contact...");
mi.pszService = MS_ADDCONTACTPLUS_SHOW;
hMainMenuItem = Menu_AddMainMenuItem(&mi);
-
- if (ServiceExists(MS_TB_ADDBUTTON))
- {
- TBButton tbb = {0};
-
- tbb.cbSize = sizeof(TBButton);
- tbb.tbbFlags = TBBF_VISIBLE | TBBF_SHOWTOOLTIP;
- tbb.pszButtonID = "acplus_btn";
- tbb.pszButtonName = Translate("Add Contact");
- tbb.pszServiceName = MS_ADDCONTACTPLUS_SHOW;
- tbb.pszTooltipUp = Translate("Add Contact");
- tbb.hPrimaryIconHandle = hIconLibItem;
- tbb.defPos = 10100;
- hToolBarItem = (HANDLE)CallService(MS_TB_ADDBUTTON, 0, (LPARAM)&tbb);
- }
}
else
{
@@ -130,7 +115,7 @@ static int OnAccListChanged(WPARAM, LPARAM) return 0;
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMainMenuItem, 0);
- CallService(MS_TB_REMOVEBUTTON, (WPARAM)hToolBarItem, 0);
+ CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hToolBarItem, 0);
hMainMenuItem = 0;
}
@@ -138,6 +123,19 @@ static int OnAccListChanged(WPARAM, LPARAM) return 0;
}
+static int CreateButton(WPARAM, LPARAM)
+{
+ TTBButton tbb = {0};
+ tbb.cbSize = sizeof(tbb);
+ tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ tbb.name = "Add Contact";
+ tbb.pszService = MS_ADDCONTACTPLUS_SHOW;
+ tbb.pszTooltipUp = "Add Contact";
+ tbb.hIconHandleUp = hIconLibItem;
+ hToolBarItem = TopToolbar_AddButton(&tbb);
+ return 0;
+}
+
static int OnModulesLoaded(WPARAM, LPARAM)
{
if (ServiceExists(MS_UPDATE_REGISTERFL))
@@ -171,7 +169,8 @@ static int OnModulesLoaded(WPARAM, LPARAM) Hotkey_Register(&hkd);
OnAccListChanged(0, 0);
-
+
+ HookEvent(ME_TTB_MODULELOADED, CreateButton);
return 0;
}
|