//-TT Group count on the contacts tab
parent
5de06c9469
commit
a451b98af4
|
|
@ -30,6 +30,7 @@
|
|||
#include "fscontactsfloater.h"
|
||||
|
||||
// libs
|
||||
#include "llagent.h"
|
||||
#include "llavatarname.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloater.h"
|
||||
|
|
@ -44,6 +45,7 @@
|
|||
#include "llgroupactions.h"
|
||||
#include "llgrouplist.h"
|
||||
#include "llsidetray.h"
|
||||
#include "llstartup.h"
|
||||
|
||||
static const std::string FRIENDS_TAB_NAME = "friends_panel";
|
||||
static const std::string GROUP_TAB_NAME = "groups_panel";
|
||||
|
|
@ -127,10 +129,9 @@ BOOL FSFloaterContacts::postBuild()
|
|||
mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg"));
|
||||
|
||||
mGroupList->setDoubleClickCallback(boost::bind(&FSFloaterContacts::onGroupChatButtonClicked, this));
|
||||
// mGroupList->setCommitCallback(boost::bind(&FSFloaterContacts::updateButtons, this));
|
||||
mGroupList->setCommitCallback(boost::bind(&FSFloaterContacts::updateButtons, this));
|
||||
mGroupList->setReturnCallback(boost::bind(&FSFloaterContacts::onGroupChatButtonClicked, this));
|
||||
|
||||
|
||||
mGroupsTab->childSetAction("chat_btn", boost::bind(&FSFloaterContacts::onGroupChatButtonClicked, this));
|
||||
mGroupsTab->childSetAction("info_btn", boost::bind(&FSFloaterContacts::onGroupInfoButtonClicked, this));
|
||||
mGroupsTab->childSetAction("activate_btn", boost::bind(&FSFloaterContacts::onGroupActivateButtonClicked, this));
|
||||
|
|
@ -141,6 +142,15 @@ BOOL FSFloaterContacts::postBuild()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void FSFloaterContacts::updateButtons()
|
||||
{
|
||||
std::vector<LLPanel*> items;
|
||||
mGroupList->getItems(items);
|
||||
|
||||
mGroupsTab->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d", gAgent.mGroups.count())); // items.end()));//
|
||||
mGroupsTab->getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d", gMaxAgentGroups));
|
||||
}
|
||||
|
||||
void FSFloaterContacts::onOpen(const LLSD& key)
|
||||
{
|
||||
if (key.asString() == "friends")
|
||||
|
|
@ -150,6 +160,8 @@ void FSFloaterContacts::onOpen(const LLSD& key)
|
|||
else if (key.asString() == "groups")
|
||||
{
|
||||
childShowTab("friends_and_groups", "groups_panel");
|
||||
mGroupsTab->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d", gAgent.mGroups.count())); // items.end()));//
|
||||
mGroupsTab->getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d", gMaxAgentGroups));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ private:
|
|||
void onGroupLeaveButtonClicked();
|
||||
void onGroupCreateButtonClicked();
|
||||
void onGroupSearchButtonClicked();
|
||||
|
||||
void updateButtons();
|
||||
|
||||
LLTabContainer* mTabContainer;
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,4 +73,69 @@
|
|||
label="Invite..."
|
||||
name="invite_btn"
|
||||
width="80" />-->
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
bottom_delta="35"
|
||||
follows="top|right"
|
||||
height="26"
|
||||
layout="topleft"
|
||||
right="-10"
|
||||
name="groupcount"
|
||||
width="80">
|
||||
You belong to
|
||||
[COUNT] out of
|
||||
[MAX] groups.
|
||||
</text>
|
||||
<!-- <text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
left="12"
|
||||
name="group_label"
|
||||
top="24"
|
||||
width="50">
|
||||
Total groups:
|
||||
</text>
|
||||
<text
|
||||
follows="top|left|right"
|
||||
font="SansSerifBigBold"
|
||||
height="29"
|
||||
layout="topleft"
|
||||
left="45"
|
||||
name="group_count"
|
||||
text_color="LtGray"
|
||||
top="22"
|
||||
value="42"
|
||||
use_ellipses="true"
|
||||
word_wrap="true"
|
||||
visible="false"
|
||||
width="255" />
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
left="12"
|
||||
name="group_label"
|
||||
top="24"
|
||||
width="248">
|
||||
of :
|
||||
</text> <text
|
||||
follows="top|left|right"
|
||||
font="SansSerifBigBold"
|
||||
height="29"
|
||||
layout="topleft"
|
||||
left="45"
|
||||
name="group_count_max"
|
||||
text_color="LtGray"
|
||||
top="22"
|
||||
value="42"
|
||||
use_ellipses="true"
|
||||
word_wrap="true"
|
||||
visible="false"
|
||||
width="255" /> -->
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue