meow-7.2.2
Gilbert Gonzales 2013-06-07 12:35:29 -07:00
commit 24dd0e561f
4 changed files with 38 additions and 10 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

@ -55,6 +55,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
private:
/*virtual*/ void updateCustomResControls(); ///< Show/hide facebook custom controls
/*virtual*/ std::string getWidthSpinnerName() const { return "facebook_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "facebook_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "facebook_keep_aspect_check"; }
@ -84,6 +85,11 @@ BOOL LLPanelSnapshotFacebook::postBuild()
// virtual
void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
{
if (!LLFacebookConnect::instance().getConnected())
{
LLFacebookConnect::instance().getConnectionToFacebook();
}
updateControls(key);
LLPanelSnapshot::onOpen(key);
}
@ -91,7 +97,16 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
void LLPanelSnapshotFacebook::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot);
const bool is_connected = LLFacebookConnect::instance().getConnected();
getChild<LLUICtrl>("post_btn")->setEnabled(have_snapshot && is_connected);
}
// virtual
void LLPanelSnapshotFacebook::updateCustomResControls()
{
LLPanelSnapshot::updateCustomResControls();
const bool is_connected = LLFacebookConnect::instance().getConnected();
getChild<LLUICtrl>("post_btn")->setEnabled(is_connected);
}
void LLPanelSnapshotFacebook::onSend()

View File

@ -5974,16 +5974,18 @@ void handle_report_abuse()
void handle_facebook_connect()
{
if (LLFacebookConnect::instance().getConnected())
{
LLFacebookConnect::instance().disconnectFromFacebook();
}
else
if (!LLFacebookConnect::instance().getConnected())
{
LLFacebookConnect::instance().getConnectionToFacebook();
}
}
bool enable_facebook_connect()
{
// The menu item will be disabled if we are already connected
return !LLFacebookConnect::instance().getConnected();
}
void handle_facebook_checkin()
{
@ -6003,9 +6005,6 @@ void handle_facebook_checkin()
LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, "");
}
//bool is_facebook_connected();
void handle_buy_currency()
{
LLBuyCurrencyHTML::openCurrencyFloater();
@ -8758,6 +8757,8 @@ void initialize_menus()
// Facebook Connect
commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect));
enable.add("Facebook.EnableConnect", boost::bind(&enable_facebook_connect));
// Facebook Checkin
commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin));
}

View File

@ -20,6 +20,8 @@
name="ConnectToFacebook">
<menu_item_call.on_click
function="Facebook.Connect" />
<menu_item_call.on_enable
function="Facebook.EnableConnect" />
</menu_item_call>
<menu_item_call
label="Check in to Facebook..."