From bee5369b2f2fc0208b1a0645c2702ed1cea43c55 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 6 Jun 2013 20:08:46 -0700 Subject: ACME-464 : Fixed : We connect to FB when bringing up the Upload to FB Snapshot panel --- indra/newview/llfloatersnapshot.cpp | 12 +++++++++++- indra/newview/llpanelsnapshotfacebook.cpp | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index d8d62e5bbb..8405d8aeec 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -37,6 +37,7 @@ #include "llcriticaldamp.h" #include "llfloaterperms.h" #include "llui.h" +#include "llfacebookconnect.h" #include "llfocusmgr.h" #include "llbutton.h" #include "llcombobox.h" @@ -2245,7 +2246,16 @@ void LLFloaterSnapshot::update() { changed |= LLSnapshotLivePreview::onIdle(*iter); } - if(changed) + + // We need to pool on facebook connection as it might change any time + static bool s_facebook_connected = false; + if (LLFacebookConnect::instance().getConnected() != s_facebook_connected) + { + s_facebook_connected = LLFacebookConnect::instance().getConnected(); + changed = true; + } + + if (changed) { lldebugs << "changed" << llendl; inst->impl.updateControls(inst); diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index faeabf0a07..7c8fc044c0 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -85,6 +85,10 @@ BOOL LLPanelSnapshotFacebook::postBuild() // virtual void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { + if (!LLFacebookConnect::instance().getConnected()) + { + LLFacebookConnect::instance().getConnectionToFacebook(); + } updateControls(key); LLPanelSnapshot::onOpen(key); } @@ -100,6 +104,7 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info) // virtual void LLPanelSnapshotFacebook::updateCustomResControls() { + LLPanelSnapshot::updateCustomResControls(); const bool is_connected = LLFacebookConnect::instance().getConnected(); getChild("post_btn")->setEnabled(is_connected); } -- cgit v1.2.3