Unfinished code related to Contact Groups

This commit is contained in:
CharleyLevenque
2010-10-02 12:05:14 -04:00
parent 3fa7780d51
commit 8a78a06a10
3 changed files with 44 additions and 15 deletions

View File

@@ -20,7 +20,7 @@
#include "llcombobox.h" //Combo dropdowns
#include "llscrolllistctrl.h" //List box for filenames
#include "lluictrlfactory.h" //Loads the XUI
#include "llresmgr.h"
// project includes
#include "llviewercontrol.h"
#include "llviewerwindow.h"
@@ -84,8 +84,13 @@ void ASFloaterContactGroups::onBtnSave(void* userdata)
LLScrollListCtrl* scroller = self->getChild<LLScrollListCtrl>("group_scroll_list");
if(scroller != NULL)
{
for (S32 i = self->mSelectedUUIDs.count(); i > 0; --i)
for (S32 i = (self->mSelectedUUIDs.count() - 1); i >= 0; --i)
{
std::string i_str;
LLResMgr::getInstance()->getIntegerString(i_str, i);
LLChat msg("Adding index " + i_str + ": " + self->mSelectedUUIDs.get(i).asString());
LLFloaterChat::addChat(msg);
self->addContactMember(scroller->getValue().asString(), self->mSelectedUUIDs.get(i));
}
}

View File

@@ -241,12 +241,11 @@ void LLPanelFriends::populateContactGroupSelect()
void LLPanelFriends::setContactGroup(std::string contact_grp)
{
if (contact_grp != "All")
{
filterContacts();
categorizeContacts();
}
else refreshNames(LLFriendObserver::ADD);
LLChat msg("Group set to " + contact_grp);
LLFloaterChat::addChat(msg);
refreshNames(LLFriendObserver::ADD);
refreshUI();
categorizeContacts();
}
void LLPanelFriends::categorizeContacts()
@@ -264,17 +263,45 @@ void LLPanelFriends::categorizeContacts()
std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
{
BOOL show_entry = (contact_groups[group_name][(*itr)->getUUID().asString()].size() != 0);
BOOL show_entry = false;//contact_groups[group_name].has((*itr)->getUUID().asString());
S32 count = contact_groups[group_name].size();
int i;
for(i = 0; i < count; i++)
{
if (contact_groups[group_name][i].asString() == (*itr)->getUUID().asString())
{
show_entry = true;
break;
}
}
if (!show_entry)
{
LLChat msg("False: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');");
LLFloaterChat::addChat(msg);
mFriendsList->deleteItems((*itr)->getValue());
}
else
{
LLChat msg("True: contact_groups['" + group_name + "'].has('" + (*itr)->getUUID().asString() + "');");
LLFloaterChat::addChat(msg);
}
}
}
else
{
LLChat msg("Group set to all.");
LLFloaterChat::addChat(msg);
}
refreshUI();
}
else
{
LLChat msg("Null combo.");
LLFloaterChat::addChat(msg);
}
}
void LLPanelFriends::filterContacts()
@@ -325,10 +352,7 @@ void LLPanelFriends::onChangeContactGroup(LLUICtrl* ctrl, void* user_data)
if(panelp)
{
LLComboBox* combo = panelp->getChild<LLComboBox>("buddy_group_combobox");
if (combo->getValue().asString() != "All")
{
panelp->setContactGroup(combo->getValue().asString());
}
panelp->setContactGroup(combo->getValue().asString());
}
}
// --

View File

@@ -44,9 +44,9 @@
height="18" left="-235" name="buddy_search_lineedit"
tool_tip="The friend name you want to search for" width="130" />
<pad bottom="-7" height="0" left="-90" width="1" />
<!--<button bottom_delta="-25" follows="top|right" height="22" label="Set Contact"
<button bottom_delta="-25" follows="top|right" height="22" label="Set Contact"
left_delta="0" name="assign_btn" tool_tip="Asign a friend to a Contact Group"
width="80" />-->
width="80" />
<button bottom_delta="-25" follows="top|right" height="22" label="IM/Call"
left_delta="0" name="im_btn" tool_tip="Open Instant Message session"
width="80" />