From 095c53fa060b3d336b408e8b87f30518c8db36cd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 17 Jul 2013 17:50:54 -0700 Subject: ACME-731 Create the llsocialaccountpanel class to handle input/feedback. --- indra/newview/llfloatersocial.cpp | 77 ++++++++++++++++++++++ indra/newview/llfloatersocial.h | 23 +++++++ .../skins/default/xui/en/floater_social.xml | 1 + .../skins/default/xui/en/panel_social_account.xml | 20 +++--- 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 t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); +static LLRegisterPanelClassWrapper 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("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); + mUseAnotherAccountButton = getChild("use_another_account_btn"); + mDisconnectButton = getChild("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"/> [secondlife:/// Philippe Bossut] + + + -- cgit v1.2.3