summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-02-28 16:10:27 -0800
committerMerov Linden <merov@lindenlab.com>2014-02-28 16:10:27 -0800
commit0fb59172f7c8c2ad2d3f4f77e14108fc16accdc7 (patch)
tree05987db9fba2f6d70221ba3eb20c62f4cb51d210 /indra/newview
parent209ed601dd6cf9af66eb44d71ab0d28ec94fb81e (diff)
ACME-1335, ACME-1336 : Add info text to the Friends tab in Facebook when no friends are visible
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterfacebook.cpp46
-rw-r--r--indra/newview/llfloaterfacebook.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_friends.xml19
3 files changed, 59 insertions, 7 deletions
diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp
index 5acc5260d2..9a08f5d581 100644
--- a/indra/newview/llfloaterfacebook.cpp
+++ b/indra/newview/llfloaterfacebook.cpp
@@ -752,6 +752,7 @@ void LLFacebookCheckinPanel::clearAndClose()
///////////////////////////
LLFacebookFriendsPanel::LLFacebookFriendsPanel() :
+mFriendsStatusCaption(NULL),
mSecondLifeFriends(NULL),
mSuggestedFriends(NULL)
{
@@ -764,6 +765,8 @@ LLFacebookFriendsPanel::~LLFacebookFriendsPanel()
BOOL LLFacebookFriendsPanel::postBuild()
{
+ mFriendsStatusCaption = getChild<LLTextBox>("facebook_friends_status");
+
mSecondLifeFriends = getChild<LLAvatarList>("second_life_friends");
mSecondLifeFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
@@ -815,13 +818,42 @@ bool LLFacebookFriendsPanel::updateSuggestedFriendList()
void LLFacebookFriendsPanel::showFriendsAccordionsIfNeeded()
{
- // Expand and show accordions if needed, else - hide them
- getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches());
- getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches());
-
- // Rearrange accordions
- LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
- accordion->arrange();
+ // Show / hide the status text : needs to be done *before* showing / hidding the accordions
+ if (!mSecondLifeFriends->filterHasMatches() && !mSuggestedFriends->filterHasMatches())
+ {
+ // Show some explanation text if the lists are empty...
+ mFriendsStatusCaption->setVisible(true);
+ if (LLFacebookConnect::instance().isConnected())
+ {
+ //...you're connected to FB but have no friends :(
+ mFriendsStatusCaption->setText(getString("facebook_friends_empty"));
+ }
+ else
+ {
+ //...you're not connected to FB
+ mFriendsStatusCaption->setText(getString("facebook_friends_no_connected"));
+ }
+ // Hide the lists
+ getChild<LLAccordionCtrlTab>("friends_accordion")->setVisible(false);
+ getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(false);
+ getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(false);
+ }
+ else
+ {
+ // We have something in the lists, hide that
+ mFriendsStatusCaption->setVisible(false);
+
+ // Show the lists
+ LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
+ accordion->setVisible(true);
+
+ // Expand and show accordions if needed, else - hide them
+ getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches());
+ getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches());
+
+ // Rearrange accordions
+ accordion->arrange();
+ }
}
void LLFacebookFriendsPanel::changed(U32 mask)
diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h
index 39264c8bff..8eff46412d 100644
--- a/indra/newview/llfloaterfacebook.h
+++ b/indra/newview/llfloaterfacebook.h
@@ -143,6 +143,7 @@ private:
void updateFacebookList(bool visible);
bool onConnectedToFacebook(const LLSD& data);
+ LLTextBox * mFriendsStatusCaption;
LLAvatarList* mSecondLifeFriends;
LLAvatarList* mSuggestedFriends;
};
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
index 9d5c86c79d..23820d209a 100644
--- a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
+++ b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
@@ -4,6 +4,12 @@
layout="topleft"
follows="all"
name="panel_facebook_friends">
+ <string
+ name="facebook_friends_empty"
+ value="You do not have any Facebook friend who are also Second Life resident. You can go to the Status panel and let them know you're in Second Life!" />
+ <string
+ name="facebook_friends_no_connected"
+ value="You're currently not connected to Facebook. Please go to the Account tab to connect and enable this feature." />
<accordion
background_visible="true"
bg_alpha_color="DkGray2"
@@ -50,4 +56,17 @@
width="307" />
</accordion_tab>
</accordion>
+ <text
+ layout="topleft"
+ word_wrap="true"
+ height="64"
+ width="290"
+ follows="top|left|right"
+ font="SansSerif"
+ left="9"
+ name="facebook_friends_status"
+ top="21"
+ type="string">
+ Not connected to Facebook.
+ </text>
</panel>