summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloatersocial.cpp13
-rw-r--r--indra/newview/llfloatersocial.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 9e7b131abf..b717dc0f40 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -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();
}
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index b7792e10c1..1848481084 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -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;