Awesomize buddy search
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* @file llfloaterfriends.cpp
|
* @file llfloaterfriends.cpp
|
||||||
* @author Phoenix
|
* @author Phoenix
|
||||||
* @date 2005-01-13
|
* @date 2005-01-13
|
||||||
@@ -310,17 +310,16 @@ void LLPanelFriends::categorizeContacts()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelFriends::filterContacts()
|
void LLPanelFriends::filterContacts(const std::string& search_name)
|
||||||
{
|
{
|
||||||
std::string friend_name;
|
std::string friend_name;
|
||||||
std::string search_name;
|
|
||||||
|
|
||||||
search_name = LLPanelFriends::getChild<LLLineEditor>("buddy_search_lineedit")->getValue().asString();
|
|
||||||
|
|
||||||
if ((search_name != "" /*&& search_name != mLastContactSearch*/))
|
if ((search_name != "" /*&& search_name != mLastContactSearch*/))
|
||||||
{
|
{
|
||||||
mLastContactSearch = search_name;
|
if (search_name.find(mLastContactSearch) == std::string::npos)
|
||||||
refreshNames(LLFriendObserver::ADD);
|
{
|
||||||
|
refreshNames(LLFriendObserver::ADD);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
|
std::vector<LLScrollListItem*> vFriends = mFriendsList->getAllData(); // all of it.
|
||||||
for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
|
for (std::vector<LLScrollListItem*>::iterator itr = vFriends.begin(); itr != vFriends.end(); ++itr)
|
||||||
@@ -337,17 +336,16 @@ void LLPanelFriends::filterContacts()
|
|||||||
refreshUI();
|
refreshUI();
|
||||||
}
|
}
|
||||||
else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD);
|
else if (search_name == "" && search_name != mLastContactSearch) refreshNames(LLFriendObserver::ADD);
|
||||||
|
mLastContactSearch = search_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPanelFriends::onContactSearchKeystroke(LLLineEditor* caller, void* user_data)
|
//static
|
||||||
|
void LLPanelFriends::onContactSearchEdit(const std::string& search_string, void* user_data)
|
||||||
{
|
{
|
||||||
if (caller)
|
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
|
||||||
|
if (panelp)
|
||||||
{
|
{
|
||||||
LLPanelFriends* panelp = (LLPanelFriends*)caller->getParent();
|
panelp->filterContacts(search_string);
|
||||||
if (panelp)
|
|
||||||
{
|
|
||||||
panelp->filterContacts();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,10 +375,10 @@ BOOL LLPanelFriends::postBuild()
|
|||||||
// <dogmode>
|
// <dogmode>
|
||||||
// Contact search and group system.
|
// Contact search and group system.
|
||||||
// 09/05/2010 - Charley Levenque
|
// 09/05/2010 - Charley Levenque
|
||||||
LLLineEditor* contact = getChild<LLLineEditor>("buddy_search_lineedit");
|
LLSearchEditor* contact = getChild<LLSearchEditor>("buddy_search_lineedit");
|
||||||
if (contact)
|
if (contact)
|
||||||
{
|
{
|
||||||
contact->setKeystrokeCallback(&onContactSearchKeystroke);
|
contact->setSearchCallback(&onContactSearchEdit, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
getChild<LLTextBox>("s_num")->setValue("0");
|
getChild<LLTextBox>("s_num")->setValue("0");
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ private:
|
|||||||
typedef std::map<LLUUID, S32> rights_map_t;
|
typedef std::map<LLUUID, S32> rights_map_t;
|
||||||
void refreshNames(U32 changed_mask);
|
void refreshNames(U32 changed_mask);
|
||||||
// <dogmode> Contacts search and group system
|
// <dogmode> Contacts search and group system
|
||||||
void filterContacts();
|
void filterContacts(const std::string& search_name);
|
||||||
void categorizeContacts();
|
void categorizeContacts();
|
||||||
void setContactGroup(std::string contact_grp);
|
void setContactGroup(std::string contact_grp);
|
||||||
std::string cleanFileName(std::string filename);
|
std::string cleanFileName(std::string filename);
|
||||||
@@ -136,7 +136,7 @@ private:
|
|||||||
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
|
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
|
||||||
static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
|
static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
|
||||||
static void onMaximumSelect(void* user_data);
|
static void onMaximumSelect(void* user_data);
|
||||||
static void onContactSearchKeystroke(LLLineEditor* caller, void* user_data);
|
static void onContactSearchEdit(const std::string& search_string, void* user_data);
|
||||||
static void onClickIM(void* user_data);
|
static void onClickIM(void* user_data);
|
||||||
static void onClickAssign(void* user_data);
|
static void onClickAssign(void* user_data);
|
||||||
static void onClickExpand(void* user_data);
|
static void onClickExpand(void* user_data);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
All
|
All
|
||||||
</combo_item>
|
</combo_item>
|
||||||
</combo_box-->
|
</combo_box-->
|
||||||
<line_editor bottom_delta="0" enabled="true" follows="right|top" font="SansSerif"
|
<search_editor bottom_delta="0" enabled="true" follows="right|top" font="SansSerif"
|
||||||
height="18" left="-255" name="buddy_search_lineedit"
|
height="18" left="-255" name="buddy_search_lineedit"
|
||||||
tool_tip="The friend name you want to search for" width="130" />
|
tool_tip="The friend name you want to search for" width="130" />
|
||||||
<button bottom_delta="-3" follows="top|right" height="22" label="0"
|
<button bottom_delta="-3" follows="top|right" height="22" label="0"
|
||||||
|
|||||||
Reference in New Issue
Block a user