Skip to content
Snippets Groups Projects
Commit 0a134e74 authored by NiranV's avatar NiranV
Browse files

Fixed: Line endings.

parent 7e5ede16
No related branches found
No related tags found
No related merge requests found
...@@ -98,27 +98,27 @@ S32 compute_jpeg_quality(S32 width, S32 height) ...@@ -98,27 +98,27 @@ S32 compute_jpeg_quality(S32 width, S32 height)
LLFacebookStatusPanel::LLFacebookStatusPanel() : LLFacebookStatusPanel::LLFacebookStatusPanel() :
mMessageTextEditor(NULL), mMessageTextEditor(NULL),
mPostButton(NULL), mPostButton(NULL),
mCancelButton(NULL), mCancelButton(NULL),
mAccountCaptionLabel(NULL), mAccountCaptionLabel(NULL),
mAccountNameLabel(NULL), mAccountNameLabel(NULL),
mPanelButtons(NULL), mPanelButtons(NULL),
mConnectButton(NULL), mConnectButton(NULL),
mDisconnectButton(NULL) mDisconnectButton(NULL)
{ {
mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this));
mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this));
setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2));
mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this));
} }
BOOL LLFacebookStatusPanel::postBuild() BOOL LLFacebookStatusPanel::postBuild()
{ {
mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label"); mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
mAccountNameLabel = getChild<LLTextBox>("account_name_label"); mAccountNameLabel = getChild<LLTextBox>("account_name_label");
mPanelButtons = getChild<LLUICtrl>("panel_buttons"); mPanelButtons = getChild<LLUICtrl>("panel_buttons");
mConnectButton = getChild<LLUICtrl>("connect_btn"); mConnectButton = getChild<LLUICtrl>("connect_btn");
mDisconnectButton = getChild<LLUICtrl>("disconnect_btn"); mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
mMessageTextEditor = getChild<LLUICtrl>("status_message"); mMessageTextEditor = getChild<LLUICtrl>("status_message");
...@@ -130,15 +130,15 @@ BOOL LLFacebookStatusPanel::postBuild() ...@@ -130,15 +130,15 @@ BOOL LLFacebookStatusPanel::postBuild()
void LLFacebookStatusPanel::draw() void LLFacebookStatusPanel::draw()
{ {
LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
//Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
mDisconnectButton->setEnabled(!disconnecting); mDisconnectButton->setEnabled(!disconnecting);
//Disable the 'connect' button when a connection is in progress //Disable the 'connect' button when a connection is in progress
bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
mConnectButton->setEnabled(!connecting); mConnectButton->setEnabled(!connecting);
if (mMessageTextEditor && mPostButton && mCancelButton) if (mMessageTextEditor && mPostButton && mCancelButton)
{ {
...@@ -171,18 +171,18 @@ void LLFacebookStatusPanel::onSend() ...@@ -171,18 +171,18 @@ void LLFacebookStatusPanel::onSend()
bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
{ {
if(LLFacebookConnect::instance().isConnected()) if(LLFacebookConnect::instance().isConnected())
{ {
//In process of disconnecting so leave the layout as is //In process of disconnecting so leave the layout as is
if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING)
{ {
showConnectedLayout(); showConnectedLayout();
} }
} }
else else
{ {
showDisconnectedLayout(); showDisconnectedLayout();
} }
switch (data.get("enum").asInteger()) switch (data.get("enum").asInteger())
{ {
...@@ -209,102 +209,102 @@ void LLFacebookStatusPanel::sendStatus() ...@@ -209,102 +209,102 @@ void LLFacebookStatusPanel::sendStatus()
} }
} }
void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) void LLFacebookStatusPanel::onVisibilityChange(BOOL visible)
{ {
if(visible) if(visible)
{ {
LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1));
LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this));
//Connected //Connected
if(LLFacebookConnect::instance().isConnected()) if(LLFacebookConnect::instance().isConnected())
{ {
showConnectedLayout(); showConnectedLayout();
} }
//Check if connected (show disconnected layout in meantime) //Check if connected (show disconnected layout in meantime)
else else
{ {
showDisconnectedLayout(); showDisconnectedLayout();
} }
if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
(LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
{ {
LLFacebookConnect::instance().checkConnectionToFacebook(); LLFacebookConnect::instance().checkConnectionToFacebook();
} }
} }
else else
{ {
LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
} }
} }
bool LLFacebookStatusPanel::onFacebookConnectInfoChange() bool LLFacebookStatusPanel::onFacebookConnectInfoChange()
{ {
LLSD info = LLFacebookConnect::instance().getInfo(); LLSD info = LLFacebookConnect::instance().getInfo();
std::string clickable_name; std::string clickable_name;
//Strings of format [http://www.somewebsite.com Click Me] become clickable text //Strings of format [http://www.somewebsite.com Click Me] become clickable text
if(info.has("link") && info.has("name")) if(info.has("link") && info.has("name"))
{ {
clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
} }
mAccountNameLabel->setText(clickable_name); mAccountNameLabel->setText(clickable_name);
return false; return false;
} }
void LLFacebookStatusPanel::showConnectButton() void LLFacebookStatusPanel::showConnectButton()
{ {
if(!mConnectButton->getVisible()) if(!mConnectButton->getVisible())
{ {
mConnectButton->setVisible(TRUE); mConnectButton->setVisible(TRUE);
mDisconnectButton->setVisible(FALSE); mDisconnectButton->setVisible(FALSE);
} }
} }
void LLFacebookStatusPanel::hideConnectButton() void LLFacebookStatusPanel::hideConnectButton()
{ {
if(mConnectButton->getVisible()) if(mConnectButton->getVisible())
{ {
mConnectButton->setVisible(FALSE); mConnectButton->setVisible(FALSE);
mDisconnectButton->setVisible(TRUE); mDisconnectButton->setVisible(TRUE);
} }
} }
void LLFacebookStatusPanel::showDisconnectedLayout() void LLFacebookStatusPanel::showDisconnectedLayout()
{ {
mAccountCaptionLabel->setText(getString("facebook_disconnected")); mAccountCaptionLabel->setText(getString("facebook_disconnected"));
mAccountNameLabel->setText(std::string("")); mAccountNameLabel->setText(std::string(""));
showConnectButton(); showConnectButton();
} }
void LLFacebookStatusPanel::showConnectedLayout() void LLFacebookStatusPanel::showConnectedLayout()
{ {
LLFacebookConnect::instance().loadFacebookInfo(); LLFacebookConnect::instance().loadFacebookInfo();
mAccountCaptionLabel->setText(getString("facebook_connected")); mAccountCaptionLabel->setText(getString("facebook_connected"));
hideConnectButton(); hideConnectButton();
} }
void LLFacebookStatusPanel::onConnect() void LLFacebookStatusPanel::onConnect()
{ {
LLFacebookConnect::instance().checkConnectionToFacebook(true); LLFacebookConnect::instance().checkConnectionToFacebook(true);
pressedConnect = TRUE; pressedConnect = TRUE;
//Clear only the facebook browser cookies so that the facebook login screen appears //Clear only the facebook browser cookies so that the facebook login screen appears
LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
} }
void LLFacebookStatusPanel::onDisconnect() void LLFacebookStatusPanel::onDisconnect()
{ {
LLFacebookConnect::instance().disconnectFromFacebook(); LLFacebookConnect::instance().disconnectFromFacebook();
LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
} }
void LLFacebookStatusPanel::clearAndClose() void LLFacebookStatusPanel::clearAndClose()
......
...@@ -51,23 +51,23 @@ class LLFacebookStatusPanel : public LLPanel ...@@ -51,23 +51,23 @@ class LLFacebookStatusPanel : public LLPanel
void clearAndClose(); void clearAndClose();
private: private:
void onVisibilityChange(BOOL new_visibility); void onVisibilityChange(BOOL new_visibility);
bool onFacebookConnectInfoChange(); bool onFacebookConnectInfoChange();
void onConnect(); void onConnect();
void onUseAnotherAccount(); void onUseAnotherAccount();
void onDisconnect(); void onDisconnect();
void showConnectButton(); void showConnectButton();
void hideConnectButton(); void hideConnectButton();
void showDisconnectedLayout(); void showDisconnectedLayout();
void showConnectedLayout(); void showConnectedLayout();
bool pressedConnect; bool pressedConnect;
LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountCaptionLabel;
LLTextBox * mAccountNameLabel; LLTextBox * mAccountNameLabel;
LLUICtrl * mPanelButtons; LLUICtrl * mPanelButtons;
LLUICtrl * mConnectButton; LLUICtrl * mConnectButton;
LLUICtrl * mDisconnectButton; LLUICtrl * mDisconnectButton;
LLUICtrl* mMessageTextEditor; LLUICtrl* mMessageTextEditor;
LLUICtrl* mPostButton; LLUICtrl* mPostButton;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment