summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-03 15:41:50 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-03 15:41:50 +0200
commit5599547f4f28d95ff6d15a517d0ba0df1fb8d6ff (patch)
tree03961b3fc6cd7b38dd5277e2058ef17155a2e0bc /indra
parent4a3eeda1ea5b555d15758dd7abee9b11c980e5b3 (diff)
parent6d292f0e816fcb571e73619aabdc9a7cfe179467 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llavatarlist.cpp35
-rw-r--r--indra/newview/llavatarlist.h7
-rw-r--r--indra/newview/llchiclet.cpp10
-rw-r--r--indra/newview/lllandmarkactions.cpp6
-rw-r--r--indra/newview/lllandmarkactions.h2
-rw-r--r--indra/newview/llpanelpeople.cpp54
-rw-r--r--indra/newview/llpanelpeople.h6
-rw-r--r--indra/newview/llparticipantlist.cpp13
-rw-r--r--indra/newview/llparticipantlist.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_im_control_panel.xml9
11 files changed, 140 insertions, 6 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 7b2dc02864..8609ba8b1c 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -239,11 +239,46 @@ void LLAvatarList::refresh()
bool dirty = add_limit_exceeded || (have_filter && !have_names);
setDirty(dirty);
+ // Refreshed all items, lets send refresh_complete signal.
+ if(!dirty)
+ {
+ std::vector<LLSD> cur_values;
+ getValues(cur_values);
+ mRefreshCompleteSignal(this, LLSD((S32)cur_values.size()));
+ }
+
// Commit if we've added/removed items.
if (modified)
onCommit();
}
+bool LLAvatarList::filterHasMatches()
+{
+ uuid_vector_t values = getIDs();
+
+ for (uuid_vector_t::const_iterator it=values.begin(); it != values.end(); it++)
+ {
+ std::string name;
+ const LLUUID& buddy_id = *it;
+ BOOL have_name = gCacheName->getFullName(buddy_id, name);
+
+ // If name has not been loaded yet we consider it as a match.
+ // When the name will be loaded the filter will be applied again(in refresh()).
+
+ if (have_name && !findInsensitive(name, mNameFilter))
+ {
+ continue;
+ }
+
+ return true;
+ }
+ return false;
+}
+
+boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commit_signal_t::slot_type& cb)
+{
+ return mRefreshCompleteSignal.connect(cb);
+}
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 51d3760d39..195d9e5b55 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -82,6 +82,11 @@ public:
const std::string getIconParamName() const{return mIconParamName;}
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
+ // Return true if filter has at least one match.
+ bool filterHasMatches();
+
+ boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb);
+
protected:
void refresh();
@@ -107,6 +112,8 @@ private:
uuid_vector_t mIDs;
LLAvatarListItem::ContextMenu* mContextMenu;
+
+ commit_signal_t mRefreshCompleteSignal;
};
/** Abstract comparator for avatar items */
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index a854eb852f..1049348684 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -830,13 +830,21 @@ LLChicletPanel::~LLChicletPanel()
void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
LLUUID session_id = data["session_id"].asUUID();
+ S32 unread = data["num_unread"].asInteger();
+
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ if (im_floater && im_floater->getVisible())
+ {
+ unread = 0;
+ }
+
std::list<LLChiclet*> chiclets = LLIMChiclet::sFindChicletsSignal(session_id);
std::list<LLChiclet *>::iterator iter;
for (iter = chiclets.begin(); iter != chiclets.end(); iter++) {
LLChiclet* chiclet = *iter;
if (chiclet != NULL)
{
- chiclet->setCounter(data["num_unread"].asInteger());
+ chiclet->setCounter(unread);
}
else
{
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
index 0b07dd4f21..319212f604 100644
--- a/indra/newview/lllandmarkactions.cpp
+++ b/indra/newview/lllandmarkactions.cpp
@@ -135,13 +135,13 @@ public:
// Returns true if the given inventory item is a landmark pointing to the current parcel.
// Used to find out if there is at least one landmark from current parcel.
-class LLFistAgentParcelLandmark : public LLInventoryCollectFunctor
+class LLFirstAgentParcelLandmark : public LLInventoryCollectFunctor
{
private:
bool mFounded;// to avoid unnecessary check
public:
- LLFistAgentParcelLandmark(): mFounded(false){}
+ LLFirstAgentParcelLandmark(): mFounded(false){}
/*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
@@ -202,7 +202,7 @@ bool LLLandmarkActions::landmarkAlreadyExists()
//static
bool LLLandmarkActions::hasParcelLandmark()
{
- LLFistAgentParcelLandmark get_first_agent_landmark;
+ LLFirstAgentParcelLandmark get_first_agent_landmark;
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
fetch_landmarks(cats, items, get_first_agent_landmark);
diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h
index 312426cab0..1c524c820c 100644
--- a/indra/newview/lllandmarkactions.h
+++ b/indra/newview/lllandmarkactions.h
@@ -55,7 +55,7 @@ public:
static bool landmarkAlreadyExists();
/**
- * @brief Checks whether landmark exists for current parcel.
+ * @brief Checks whether landmark exists for current agent parcel.
*/
static bool hasParcelLandmark();
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 0d16b0a041..2f8fae0f5d 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -42,6 +42,7 @@
#include "llpanelpeople.h"
// newview
+#include "llaccordionctrl.h"
#include "llaccordionctrltab.h"
#include "llagent.h"
#include "llavataractions.h"
@@ -516,6 +517,9 @@ BOOL LLPanelPeople::postBuild()
// call this method in case some list is empty and buttons can be in inconsistent state
updateButtons();
+ mOnlineFriendList->setRefreshCompleteCallback(boost::bind(&LLPanelPeople::onFriendListRefreshComplete, this, _1, _2));
+ mAllFriendList->setRefreshCompleteCallback(boost::bind(&LLPanelPeople::onFriendListRefreshComplete, this, _1, _2));
+
return TRUE;
}
@@ -560,6 +564,8 @@ void LLPanelPeople::updateFriendList()
mOnlineFriendList->setDirty();
mAllFriendList->setDirty();
+
+ showFriendsAccordionsIfNeeded();
}
void LLPanelPeople::updateNearbyList()
@@ -813,6 +819,8 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
mAllFriendList->setNameFilter(mFilterSubString);
mRecentList->setNameFilter(mFilterSubString);
mGroupList->setNameFilter(mFilterSubString);
+
+ showFriendsAccordionsIfNeeded();
}
void LLPanelPeople::onTabSelected(const LLSD& param)
@@ -1125,3 +1133,49 @@ void LLPanelPeople::onOpen(const LLSD& key)
else
reSelectedCurrentTab();
}
+
+void LLPanelPeople::showAccordion(const std::string name, bool show)
+{
+ if(name.empty())
+ {
+ llwarns << "No name provided" << llendl;
+ return;
+ }
+
+ LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
+ tab->setVisible(show);
+ if(show)
+ {
+ // expand accordion
+ tab->changeOpenClose(false);
+ }
+}
+
+void LLPanelPeople::showFriendsAccordionsIfNeeded()
+{
+ if(FRIENDS_TAB_NAME == getActiveTabName())
+ {
+ // Expand and show accordions if needed, else - hide them
+ showAccordion("tab_online", mOnlineFriendList->filterHasMatches());
+ showAccordion("tab_all", mAllFriendList->filterHasMatches());
+
+ // Rearrange accordions
+ LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
+ accordion->arrange();
+ }
+}
+
+void LLPanelPeople::onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param)
+{
+ if(ctrl == mOnlineFriendList)
+ {
+ showAccordion("tab_online", param.asInteger());
+ }
+ else if(ctrl == mAllFriendList)
+ {
+ showAccordion("tab_all", param.asInteger());
+ }
+
+ LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
+ accordion->arrange();
+}
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index dc0aaeb70f..9bf9befe90 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -124,6 +124,12 @@ private:
void onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAvatarList* avatar_list);
+ void showAccordion(const std::string name, bool show);
+
+ void showFriendsAccordionsIfNeeded();
+
+ void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param);
+
LLFilterEditor* mFilterEditor;
LLTabContainer* mTabContainer;
LLAvatarList* mOnlineFriendList;
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 918c7989ed..133f13aab8 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -34,6 +34,8 @@
// common includes
#include "lltrans.h"
+#include "llavataractions.h"
+#include "llagent.h"
#include "llparticipantlist.h"
#include "llavatarlist.h"
@@ -53,6 +55,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
mSpeakerMgr->addListener(mSpeakerClearListener, "clear");
mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList));
//Lets fill avatarList with existing speakers
LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs();
@@ -67,6 +70,16 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
mAvatarList->sortByName();
}
+void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list)
+{
+ LLUUID clicked_id = list->getSelectedUUID();
+
+ if (clicked_id.isNull() || clicked_id == gAgent.getID())
+ return;
+
+ LLAvatarActions::startIM(clicked_id);
+}
+
LLParticipantList::~LLParticipantList()
{
delete mSpeakerAddListener;
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 68aae0aee5..a3a55303c0 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -74,6 +74,8 @@ class LLParticipantList
LLAvatarList* mAvatarList;
};
private:
+ void onAvatarListDoubleClicked(LLAvatarList* list);
+
LLSpeakerMgr* mSpeakerMgr;
LLAvatarList* mAvatarList;
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index c314fce42d..c4324b425a 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -28,10 +28,10 @@
name="panel_im_control_panel"
layout="topleft"
top_delta="-3"
- width="146"
height="305"
follows="left"
label="IM Control Panel"
+ auto_resize="false"
user_resize="false" />
<layout_panel height="305"
width="200"
diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
index a9396661e0..04ee1a19cb 100644
--- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
@@ -5,26 +5,31 @@
border="false">
<avatar_icon name="avatar_icon"
+ follows="left|top"
width="96"
height="96" />
<button name="view_profile_btn"
+ follows="left|bottom"
label="View Profile"
left_delta="3"
width="125"
height="20" />
<button name="add_friend_btn"
+ follows="left|bottom"
label="Add Friend"
width="125"
height="20" />
<button name="call_btn"
+ follows="left|bottom"
label="Call"
width="125"
height="20" />
<button
+ follows="left|bottom"
height="20"
label="End Call"
name="end_call_btn"
@@ -33,6 +38,7 @@
<button
enabled="false"
+ follows="left|bottom"
name="voice_ctrls_btn"
label="Open Voice Controls"
width="125"
@@ -40,14 +46,17 @@
visible="false"/>
<button name="teleport_btn"
+ follows="left|bottom"
label="Teleport"
width="125"
height="20" />
<button name="share_btn"
+ follows="left|bottom"
label="Share"
width="125"
height="20" />
<button name="pay_btn"
+ follows="left|bottom"
label="Pay"
width="125"
height="20" />