Ejemplo n.º 1
0
void CJabberDlgBookmarks::OnProtoRefresh(WPARAM, LPARAM)
{
	m_lvBookmarks.DeleteAllItems();

	JABBER_LIST_ITEM *item = NULL;
	LISTFOREACH(i, m_proto, LIST_BOOKMARK)
	{
		if (item = m_proto->ListGetItemPtrFromIndex(i)) {
			int itemType = mir_tstrcmpi(item->type, _T("conference")) ? 1 : 0;
			int iItem = m_lvBookmarks.AddItem(item->name, itemType, (LPARAM)item->jid, itemType);
			m_lvBookmarks.SetItem(iItem, 1, item->jid);
			if (itemType == 0)
				m_lvBookmarks.SetItem(iItem, 2, item->nick);
		}
	}

	if (item) {
		m_btnEdit.Enable();
		m_btnRemove.Enable();
	}

	m_btnAdd.Enable();
}
Ejemplo n.º 2
0
	void EnableControls()
	{
		m_btnSave.Enable(m_proto->m_bJabberOnline && m_proto->m_notes.IsModified());
		m_btnEdit.Enable(m_lstNotes.GetCurSel() != LB_ERR);
		m_btnRemove.Enable(m_lstNotes.GetCurSel() != LB_ERR);
	}