ACME-731 Create the llsocialaccountpanel class to handle input/feedback.

meow-7.2.2
Gilbert Gonzales 2013-07-17 17:50:54 -07:00
parent 9988e4739f
commit 095c53fa06
4 changed files with 113 additions and 8 deletions

View File

@ -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///////
////////////////////////

View File

@ -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:

View File

@ -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"

View File

@ -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>