Exemplo n.º 1
0
void CVkProto::UnInitMenus()
{
	debugLogA("CVkProto::UnInitMenus");
	for (int i = 0; i < PMI_COUNT; i++)
		Menu_RemoveItem(g_hProtoMenuItems[i]);
	
	for (int i = 0; i < CHMI_COUNT; i++)
		Menu_RemoveItem(g_hContactHistoryMenuItems[i]);

	for (int i = 0; i < CMI_COUNT; i++)
		Menu_RemoveItem(g_hContactMenuItems[i]);
}
Exemplo n.º 2
0
void MSN_RemoveContactMenus(void)
{
	Menu_RemoveItem(hBlockMenuItem);
	Menu_RemoveItem(hLiveSpaceMenuItem);
#ifdef OBSOLETE
	Menu_RemoveItem(hNetmeetingMenuItem);
	DestroyServiceFunction(hNetMeeting);
#endif
	Menu_RemoveItem(hChatInviteMenuItem);
	Menu_RemoveItem(hOpenInboxMenuItem);

	DestroyServiceFunction(hBlockCom);
	DestroyServiceFunction(hSendHotMail);
	DestroyServiceFunction(hInviteChat);
	DestroyServiceFunction(hViewProfile);
}
Exemplo n.º 3
0
MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis)
{
	if (pThis == NULL)
		return 0;

	if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE)) {
		if (pThis->m_hMainMenuItem != NULL) {
			Menu_RemoveItem(pThis->m_hMainMenuItem);
			pThis->m_hMainMenuItem = NULL;
		}
		return cli.pfnGetProtocolMenu(pThis->m_szModuleName);
	}

	TIntMenuObject *pmo = GetMenuObjbyId(hMainMenuObject);
	if (pmo == NULL)
		return NULL;

	mir_cslock lck(csMenuHook);
	for (TMO_IntMenuItem *p = pmo->m_items.first; p != NULL; p = p->next)
		if (!mir_strcmp(p->UniqName, pThis->m_szModuleName))
			return p;

	// create protocol root in the main menu
	CMenuItem mi;
	mi.name.t = pThis->m_tszUserName;
	mi.position = 500090000;
	mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
	mi.hIcolibItem = pThis->m_hProtoIcon;
	return pThis->m_hMainMenuItem = Menu_AddMainMenuItem(&mi);
}
Exemplo n.º 4
0
void CJabberProto::GlobalMenuUninit()
{
    if (m_phMenuResourceItems) {
        for (int i = 0; i < m_nMenuResourceItems; i++)
            Menu_RemoveItem(m_phMenuResourceItems[i]);
        mir_free(m_phMenuResourceItems);
        m_phMenuResourceItems = NULL;
    }
    m_nMenuResourceItems = 0;
}
Exemplo n.º 5
0
/**
 * Helper function to remove all menu items backward (first item second group).
 * Note: since miranda 0.8 genmenu is part of core (we don't need to check for).
 *
 * @param	pItems		- poiter to HGENMENU array
 * @param	Count		- number of array elements
 *
 * @return	0 on success, -1 on failure
 **/
INT_PTR RemoveMenuItems(HGENMENU *pItems, int Count)
{
	if (!Count || !pItems) {
		return -1;
	}
	while (Count--) {
		if (pItems[Count]) {
			Menu_RemoveItem(pItems[Count]);
			pItems[Count] = NULL;
		}
	}
	return 0;
}
Exemplo n.º 6
0
void g_MenuUninit(void)
{
    DestroyHookableEvent(hStatusMenuInit);

    Menu_RemoveItem(g_hMenuRequestAuth);
    Menu_RemoveItem(g_hMenuGrantAuth);
    Menu_RemoveItem(g_hMenuRevokeAuth);
    Menu_RemoveItem(g_hMenuConvert);
    Menu_RemoveItem(g_hMenuRosterAdd);
    Menu_RemoveItem(g_hMenuLogin);
    Menu_RemoveItem(g_hMenuRefresh);
    Menu_RemoveItem(g_hMenuAddBookmark);

    WindowList_Destroy(hDialogsList);
}
Exemplo n.º 7
0
MIR_APP_DLL(void) KillModuleMenus(int _hLang)
{
	if (!bIsGenMenuInited)
		return;

	KillMenuItemsParam param(_hLang);

	mir_cslock lck(csMenuHook);
	for (int i = 0; i < g_menus.getCount(); i++)
		MO_RecursiveWalkMenu(g_menus[i]->m_items.first, (pfnWalkFunc)KillMenuItems, &param);

	for (int k = 0; k < param.arItems.getCount(); k++)
		Menu_RemoveItem(param.arItems[k]);
}
Exemplo n.º 8
0
void g_MenuUninit(void)
{
	Menu_RemoveItem(g_hContactMenuItems[ICMI_AUTH_REQUEST]);
	Menu_RemoveItem(g_hContactMenuItems[ICMI_AUTH_GRANT]);
	Menu_RemoveItem(g_hContactMenuItems[ICMI_AUTH_REVOKE]);
	Menu_RemoveItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST]);
	Menu_RemoveItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS]);
	Menu_RemoveItem(g_hContactMenuItems[ICMI_OPEN_PROFILE]);
}
Exemplo n.º 9
0
static int OnContactMenuBuild(WPARAM wParam, LPARAM)
{
	int i;
	OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);

	if (!hMoveToGroupItem) {
		CMenuItem mi;
		SET_UID(mi, 0x403c548, 0x4ac6, 0x4ced, 0xa7, 0x6c, 0x4e, 0xb9, 0xc8, 0xba, 0x94, 0x5);
		mi.position = 100000;
		mi.name.a = LPGEN("&Move to group");
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);

		hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
	}

	for (i=0; i < lphGroupsItems.getCount(); i++)
		Menu_RemoveItem((HGENMENU)lphGroupsItems[i]);
	lphGroupsItems.destroy();

	ptrT szContactGroup(db_get_tsa(wParam, "CList", "Group"));

	int pos = 1000;

	AddGroupItem(hMoveToGroupItem, TranslateT("<Root group>"), pos, -1, !szContactGroup);

	pos += 100000; // Separator

	for (i=0; ; i++) {
		char intname[20];
		_itoa(i, intname, 10);

		DBVARIANT dbv;
		if (db_get_ts(NULL, "CListGroups", intname, &dbv))
			break;

		if (dbv.ptszVal[0])
			groups.insert(new GroupItemSort(dbv.ptszVal + 1, i + 1));

		mir_free(dbv.ptszVal);
	}

	for (i=0; i < groups.getCount(); i++) {
		bool checked = szContactGroup && !mir_tstrcmp(szContactGroup, groups[i].name);
		AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked);
	}

	return 0;
}
Exemplo n.º 10
0
static int OnContactMenuBuild(WPARAM wParam, LPARAM)
{
	OBJLIST<GroupItemSort> groups(10, GroupItemSort::compare);
	for (int i = 0; i < lphGroupsItems.getCount(); i++)
		Menu_RemoveItem((HGENMENU)lphGroupsItems[i]);
	lphGroupsItems.destroy();

	ptrT szContactGroup(db_get_tsa(wParam, "CList", "Group"));

	int pos = 1000;

	AddGroupItem(hMoveToGroupItem, TranslateT("<Root group>"), pos, -1, !szContactGroup);

	pos += 100000; // Separator

	for (int i = 0;; i++) {
		char intname[20];
		_itoa(i, intname, 10);

		DBVARIANT dbv;
		if (db_get_ts(NULL, "CListGroups", intname, &dbv))
			break;

		if (dbv.ptszVal[0])
			groups.insert(new GroupItemSort(dbv.ptszVal + 1, i + 1));

		mir_free(dbv.ptszVal);
	}

	for (int i = 0; i < groups.getCount(); i++) {
		bool checked = szContactGroup && !mir_tstrcmp(szContactGroup, groups[i].name);
		AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked);
	}

	return 0;
}
Exemplo n.º 11
0
void CYahooProto::MenuUninit(void)
{
	Menu_RemoveItem(hShowProfileMenuItem);
}
Exemplo n.º 12
0
int UnloadFavoriteContactMenu()
{
	Menu_RemoveItem(hFavoriteContactMenu); hFavoriteContactMenu = NULL;
	return 0;
}