ACME-464 : Fixed : We connect to FB when bringing up the Upload to FB Snapshot panel

meow-7.2.2
Merov Linden 2013-06-06 20:08:46 -07:00
parent 4163603a11
commit bee5369b2f
2 changed files with 16 additions and 1 deletions

View File

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

View File

@ -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<LLUICtrl>("post_btn")->setEnabled(is_connected);
}