summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatersocial.cpp77
-rw-r--r--indra/newview/llfloatersocial.h23
-rw-r--r--indra/newview/skins/default/xui/en/floater_social.xml1
-rw-r--r--indra/newview/skins/default/xui/en/panel_social_account.xml20
4 files changed, 113 insertions, 8 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index c8c203fc25..66624f6355 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -48,6 +48,7 @@
static LLRegisterPanelClassWrapper<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
static LLRegisterPanelClassWrapper<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
static LLRegisterPanelClassWrapper<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
+static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel");
const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg";
@@ -609,6 +610,82 @@ void LLSocialCheckinPanel::clearAndClose()
}
}
+///////////////////////////
+//LLSocialAccountPanel//////
+///////////////////////////
+
+LLSocialAccountPanel::LLSocialAccountPanel() :
+mAccountCaptionLabel(NULL),
+mAccountNameLabel(NULL),
+mPanelButtons(NULL),
+mConnectButton(NULL),
+mUseAnotherAccountButton(NULL),
+mDisconnectButton(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this));
+ mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this));
+}
+
+BOOL LLSocialAccountPanel::postBuild()
+{
+ mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
+ mAccountNameLabel = getChild<LLTextBox>("account_name_label");
+ mPanelButtons = getChild<LLUICtrl>("panel_buttons");
+ mConnectButton = getChild<LLUICtrl>("connect_btn");
+ mUseAnotherAccountButton = getChild<LLUICtrl>("use_another_account_btn");
+ mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
+
+ hideConnectButton();
+
+ return LLPanel::postBuild();
+}
+
+void LLSocialAccountPanel::showConnectButton()
+{
+ if(!mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(TRUE);
+ LLRect mLayoutStackRect = mPanelButtons->getRect();
+ F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
+ mLayoutStackRect.translate(0, -(mConnectButton->getRect().getHeight() + deltaTopPadding));
+ mPanelButtons->setRect(mLayoutStackRect);
+
+ mUseAnotherAccountButton->setVisible(FALSE);
+ mDisconnectButton->setVisible(FALSE);
+ }
+}
+
+void LLSocialAccountPanel::hideConnectButton()
+{
+ if(mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(FALSE);
+ LLRect mLayoutStackRect = mPanelButtons->getRect();
+ F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop;
+ mLayoutStackRect.translate(0, mConnectButton->getRect().getHeight() + deltaTopPadding);
+ mPanelButtons->setRect(mLayoutStackRect);
+
+ mUseAnotherAccountButton->setVisible(TRUE);
+ mDisconnectButton->setVisible(TRUE);
+ }
+}
+
+void LLSocialAccountPanel::onConnect()
+{
+ hideConnectButton();
+}
+
+void LLSocialAccountPanel::onUseAnotherAccount()
+{
+
+}
+
+void LLSocialAccountPanel::onDisconnect()
+{
+ showConnectButton();
+}
+
////////////////////////
//LLFloaterSocial///////
////////////////////////
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index f1deeb423d..cdd8a71b79 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -115,6 +115,29 @@ private:
bool mMapCheckBoxValue;
};
+class LLSocialAccountPanel : public LLPanel
+{
+public:
+ LLSocialAccountPanel();
+ BOOL postBuild();
+
+private:
+ void onConnect();
+ void onUseAnotherAccount();
+ void onDisconnect();
+
+ void showConnectButton();
+ void hideConnectButton();
+
+ LLTextBox * mAccountCaptionLabel;
+ LLTextBox * mAccountNameLabel;
+ LLUICtrl * mPanelButtons;
+ LLUICtrl * mConnectButton;
+ LLUICtrl * mUseAnotherAccountButton;
+ LLUICtrl * mDisconnectButton;
+};
+
+
class LLFloaterSocial : public LLFloater
{
public:
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml
index 7f52a8c0da..eb209eb314 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_social.xml
@@ -59,6 +59,7 @@
name="panel_social_place"/>
<panel
filename="panel_social_account.xml"
+ class="llsocialaccountpanel"
follows="all"
label="ACCOUNT"
help_topic="panel_social_account"
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml
index 639e601f9d..838a9ba064 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_account.xml
@@ -28,40 +28,44 @@
type="string">
[secondlife:/// Philippe Bossut]
</text>
+
+ <panel
+ layout="topleft"
+ name="panel_buttons"
+ height="345"
+ left="9">
<button
layout="topleft"
follows="left|top"
top_pad="9"
- left="9"
- visible="false"
- height="0"
+ visible="true"
+ height="23"
label="Connect..."
name="connect_btn"
width="210">
-
+ <commit_callback function="SocialSharing.Connect"/>
</button>
<button
layout="topleft"
follows="left|top"
top_pad="9"
- left="9"
height="23"
label="Use another account..."
name="use_another_account_btn"
width="210">
-
+ <commit_callback function="SocialSharing.UseAnotherAccount"/>
</button>
<button
layout="topleft"
follows="left|top"
top_pad="11"
- left="9"
height="23"
label="Disconnect"
name="disconnect_btn"
width="210">
-
+ <commit_callback function="SocialSharing.Disconnect"/>
</button>
+ </panel>
</panel>