ACME-621 : Add autoconnect to FBC in the social floater, disable Post buttons when not connected.

meow-7.2.2
Merov Linden 2013-06-26 21:14:11 -07:00
parent de89e38454
commit 7fc98de12c
2 changed files with 13 additions and 4 deletions

View File

@ -79,7 +79,7 @@ void LLSocialStatusPanel::draw()
if (mMessageTextEditor && mPostStatusButton)
{
std::string message = mMessageTextEditor->getValue().asString();
mPostStatusButton->setEnabled(!message.empty());
mPostStatusButton->setEnabled(!message.empty() && LLFacebookConnect::instance().isConnected());
}
LLPanel::draw();
@ -123,6 +123,7 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
BOOL LLSocialPhotoPanel::postBuild()
{
mPostButton = getChild<LLUICtrl>("post_btn");
mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
@ -256,11 +257,8 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
return previewp;
}
void LLSocialPhotoPanel::updateControls()
{
LLSnapshotLivePreview* previewp = getPreviewView();
BOOL got_bytes = previewp && previewp->getDataSize() > 0;
BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
@ -363,6 +361,8 @@ void LLSocialPhotoPanel::draw()
mThumbnailPlaceholder->draw();
gGL.popUIMatrix();
}
mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
}
void LLSocialPhotoPanel::onSend()
@ -404,6 +404,7 @@ LLSocialCheckinPanel::LLSocialCheckinPanel() :
BOOL LLSocialCheckinPanel::postBuild()
{
// Keep pointers to widgets so we don't traverse the UI hierarchy too often
mPostButton = getChild<LLUICtrl>("post_place_btn");
mMapLoadingIndicator = getChild<LLUICtrl>("map_loading_indicator");
mMapPlaceholder = getChild<LLIconCtrl>("map_placeholder");
mMapCheckBox = getChild<LLCheckBoxCtrl>("add_place_view_cb");
@ -445,6 +446,7 @@ void LLSocialCheckinPanel::draw()
mMapCheckBox->setEnabled(true);
mMapCheckBox->set(mMapCheckBoxValue);
}
mPostButton->setEnabled(LLFacebookConnect::instance().isConnected());
LLPanel::draw();
}
@ -495,6 +497,9 @@ void LLFloaterSocial::onCancel()
BOOL LLFloaterSocial::postBuild()
{
// Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
LLFacebookConnect::instance().getConnectionToFacebook();
// Keep tab of the Photo Panel
mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("social_photo_tab"));
return LLFloater::postBuild();
}

View File

@ -75,6 +75,9 @@ class LLSocialPhotoPanel : public LLPanel
LLUICtrl* mThumbnailPlaceholder;
bool mNeedRefresh;
private:
LLUICtrl* mPostButton;
};
class LLSocialCheckinPanel : public LLPanel
@ -87,6 +90,7 @@ public:
private:
std::string mMapUrl;
LLPointer<LLViewerFetchedTexture> mMapTexture;
LLUICtrl* mPostButton;
LLUICtrl* mMapLoadingIndicator;
LLIconCtrl* mMapPlaceholder;
LLCheckBoxCtrl* mMapCheckBox;