From 2b66eeb4a61235fae4c29ecd98890b8b47badafe Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 01:38:50 +0200 Subject: STORM-2073: Fixed: Do not post our status if we press the "Connect" button otherwise we end up double posting. --- indra/newview/llfloaterfacebook.cpp | 7 +++++-- indra/newview/llfloaterfacebook.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 516cf5c15c..d8cc070fd0 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -156,7 +156,8 @@ void LLFacebookStatusPanel::onSend() { LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - + + pressedConnect = FALSE; // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -186,7 +187,8 @@ bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) switch (data.get("enum").asInteger()) { case LLFacebookConnect::FB_CONNECTED: - sendStatus(); + if(!pressedConnect) + sendStatus(); break; case LLFacebookConnect::FB_POSTED: @@ -293,6 +295,7 @@ void LLFacebookStatusPanel::onConnect() { LLFacebookConnect::instance().checkConnectionToFacebook(true); + pressedConnect = TRUE; //Clear only the facebook browser cookies so that the facebook login screen appears LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 86e3a148b9..e1526db18d 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -62,6 +62,8 @@ private: void showDisconnectedLayout(); void showConnectedLayout(); + bool pressedConnect; + LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; LLUICtrl * mPanelButtons; -- cgit v1.2.3 From 5bdf2a0cda79e7cf67818489e8d3a86232863758 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 04:06:15 +0200 Subject: STORM-2060/STORM-2076: Fixed: Whole detection logic not working because of reasons i cannot seem to understand in this hypercube like snapshot floater. --- indra/newview/llfloatersnapshot.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 3f9243381c..31b743b7e8 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -814,13 +814,13 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); bool width_changed; - if(original_width != width) + if(getHeightSpinner(view)->isDirty()) { - width_changed = TRUE; + width_changed = FALSE; } else { - width_changed = FALSE; + width_changed = TRUE; } updateSpinners(view, previewp, width, height, width_changed); // may change width and height @@ -952,6 +952,8 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view // static void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed) { + getWidthSpinner(view)->resetDirty(); + getHeightSpinner(view)->resetDirty(); if (checkImageSize(previewp, width, height, is_width_changed, previewp->getMaxImageSize())) { setImageSizeSpinnersValues(view, width, height); -- cgit v1.2.3 From 417362e9d8555b77c8510430e2a4b3e8901be2b3 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:04:50 +0200 Subject: STORM-2060/STORM-2076: Changed: Code to a more appropiate, shorter version. Thanks Oz. --- indra/newview/llfloatersnapshot.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 31b743b7e8..8037c22173 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -813,16 +813,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); - bool width_changed; - if(getHeightSpinner(view)->isDirty()) - { - width_changed = FALSE; - } - else - { - width_changed = TRUE; - } - updateSpinners(view, previewp, width, height, width_changed); // may change width and height + updateSpinners(view, previewp, width, height, !getHeightSpinner(view)->isDirty()); // may change width and height if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) { -- cgit v1.2.3 From 887510c335ebd83dc7f61753443f2e35dc2a69e2 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:07:01 +0200 Subject: Changed: Updated contributions file. --- doc/contributions.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 3b995bcb31..4035dc7da2 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1009,10 +1009,11 @@ NiranV Dean STORM-2060 STORM-2061 STORM-2063 - STORM-2064 STORM-2065 STORM-2066 STORM-2068 + STORM-2073 + STORM-2076 BUG-372 BUG-1179 BUG-6835 @@ -1020,6 +1021,7 @@ NiranV Dean BUG-6839 BUG-6840 BUG-6958 + BUG-7020 Nounouch Hapmouche VWR-238 Ollie Kubrick -- cgit v1.2.3 From 7e5ede1678ef6b167602b3d8d0660c5e89e319f5 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:56:18 +0200 Subject: STORM-2060/STORM-2076: Added: Commenting to explain why we use the height spinner instead of the width one. --- indra/newview/llfloatersnapshot.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 8037c22173..8677028942 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1,4 +1,4 @@ -/** +/** * @file llfloatersnapshot.cpp * @brief Snapshot preview window, allowing saving, e-mailing, etc. * @@ -813,6 +813,10 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL previewp->getSize(width, height); + // We use the height spinner here because we come here via the aspect ratio + // checkbox as well and we want height always changing to width by default. + // If we use the width spinner we would change width according to height by + // default, that is not what we want. updateSpinners(view, previewp, width, height, !getHeightSpinner(view)->isDirty()); // may change width and height if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height) -- cgit v1.2.3 From 0a134e749d01b711ca38a91044efb787cd815701 Mon Sep 17 00:00:00 2001 From: NiranV Date: Wed, 20 Aug 2014 16:57:30 +0200 Subject: Fixed: Line endings. --- indra/newview/llfloaterfacebook.cpp | 260 ++++++++++++++++++------------------ indra/newview/llfloaterfacebook.h | 34 ++--- 2 files changed, 147 insertions(+), 147 deletions(-) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index d8cc070fd0..33422fb5fd 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -98,27 +98,27 @@ S32 compute_jpeg_quality(S32 width, S32 height) LLFacebookStatusPanel::LLFacebookStatusPanel() : mMessageTextEditor(NULL), mPostButton(NULL), - mCancelButton(NULL), - mAccountCaptionLabel(NULL), - mAccountNameLabel(NULL), - mPanelButtons(NULL), - mConnectButton(NULL), + mCancelButton(NULL), + mAccountCaptionLabel(NULL), + mAccountNameLabel(NULL), + mPanelButtons(NULL), + mConnectButton(NULL), mDisconnectButton(NULL) { - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2)); mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); } BOOL LLFacebookStatusPanel::postBuild() { - mAccountCaptionLabel = getChild("account_caption_label"); - mAccountNameLabel = getChild("account_name_label"); - mPanelButtons = getChild("panel_buttons"); - mConnectButton = getChild("connect_btn"); + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); mDisconnectButton = getChild("disconnect_btn"); mMessageTextEditor = getChild("status_message"); @@ -130,15 +130,15 @@ BOOL LLFacebookStatusPanel::postBuild() void LLFacebookStatusPanel::draw() { - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + + //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress + bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; + mDisconnectButton->setEnabled(!disconnecting); + + //Disable the 'connect' button when a connection is in progress + bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; + mConnectButton->setEnabled(!connecting); if (mMessageTextEditor && mPostButton && mCancelButton) { @@ -171,18 +171,18 @@ void LLFacebookStatusPanel::onSend() bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) { - if(LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } + if(LLFacebookConnect::instance().isConnected()) + { + //In process of disconnecting so leave the layout as is + if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) + { + showConnectedLayout(); + } + } + else + { + showDisconnectedLayout(); + } switch (data.get("enum").asInteger()) { @@ -209,102 +209,102 @@ void LLFacebookStatusPanel::sendStatus() } } -void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) -{ - if(visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); - - //Connected - if(LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); - } -} - -bool LLFacebookStatusPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if(info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLFacebookStatusPanel::showConnectButton() -{ - if(!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLFacebookStatusPanel::hideConnectButton() -{ - if(mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLFacebookStatusPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLFacebookStatusPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLFacebookStatusPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); - - pressedConnect = TRUE; - //Clear only the facebook browser cookies so that the facebook login screen appears - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -void LLFacebookStatusPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); - - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +void LLFacebookStatusPanel::onVisibilityChange(BOOL visible) +{ + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this)); + + //Connected + if(LLFacebookConnect::instance().isConnected()) + { + showConnectedLayout(); + } + //Check if connected (show disconnected layout in meantime) + else + { + showDisconnectedLayout(); + } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + } +} + +bool LLFacebookStatusPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + //Strings of format [http://www.somewebsite.com Click Me] become clickable text + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + +void LLFacebookStatusPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLFacebookStatusPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLFacebookStatusPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLFacebookStatusPanel::showConnectedLayout() +{ + LLFacebookConnect::instance().loadFacebookInfo(); + + mAccountCaptionLabel->setText(getString("facebook_connected")); + hideConnectButton(); +} + +void LLFacebookStatusPanel::onConnect() +{ + LLFacebookConnect::instance().checkConnectionToFacebook(true); + + pressedConnect = TRUE; + //Clear only the facebook browser cookies so that the facebook login screen appears + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +void LLFacebookStatusPanel::onDisconnect() +{ + LLFacebookConnect::instance().disconnectFromFacebook(); + + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); } void LLFacebookStatusPanel::clearAndClose() diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index e1526db18d..6fe7a6541b 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -51,23 +51,23 @@ public: void clearAndClose(); private: - void onVisibilityChange(BOOL new_visibility); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - bool pressedConnect; - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; + void onVisibilityChange(BOOL new_visibility); + bool onFacebookConnectInfoChange(); + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); + + bool pressedConnect; + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; LLUICtrl * mDisconnectButton; LLUICtrl* mMessageTextEditor; LLUICtrl* mPostButton; -- cgit v1.2.3