From 409a401ebb59fcf28ba25aaeab44ca8d00960c84 Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Mon, 5 Dec 2011 14:56:33 -0800 Subject: VWR-17587: Added "Fly/Land on holding up/down" option under Move preferences --- indra/newview/skins/default/xui/en/panel_preferences_move.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index d9067b41c7..198fcf9355 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -129,6 +129,16 @@ name="tap_tap_hold_to_run" width="237" top_pad="0"/> + Date: Mon, 4 Jun 2012 11:23:38 -0400 Subject: STORM-1838 Add "Request Teleport" option to the menu when right-clicking on avatars in the Nearby list --- indra/newview/llavataractions.cpp | 13 ++++++ indra/newview/llavataractions.h | 5 +++ indra/newview/llpanelpeoplemenus.cpp | 1 + indra/newview/llviewermessage.cpp | 48 ++++++++++++++++++++++ .../skins/default/xui/en/menu_people_nearby.xml | 7 ++++ .../newview/skins/default/xui/en/notifications.xml | 23 +++++++++++ 6 files changed, 97 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f618af9536..8df30da68a 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -71,6 +71,7 @@ #include "llcallingcard.h" #include "llslurl.h" // IDEVO #include "llsidepanelinventory.h" +#include "llavatarname.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -395,6 +396,18 @@ void LLAvatarActions::pay(const LLUUID& id) } } +// static +void LLAvatarActions::requestTeleport(const LLUUID& id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_RequestTeleport); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, id); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); +} + // static void LLAvatarActions::kick(const LLUUID& id) { diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 748b7cb3d1..1eee9ea81f 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -108,6 +108,11 @@ public: */ static void pay(const LLUUID& id); + /** + * Request teleport from other avatar + */ + static void requestTeleport(const LLUUID& id); + /** * Share items with the avatar. */ diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index f12c4de2f7..c703ae8768 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -67,6 +67,7 @@ LLContextMenu* NearbyMenu::createMenu() registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id)); registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); + registrar.add("Avatar.RequestTeleport", boost::bind(&LLAvatarActions::requestTeleport, id)); enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2)); enable_registrar.add("Avatar.CheckItem", boost::bind(&NearbyMenu::checkContextMenuItem, this, _2)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 854e2bea52..f4f7148340 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1992,6 +1992,54 @@ bool lure_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration lure_callback_reg("TeleportOffered", lure_callback); +bool teleport_requested_callback(const LLSD& notification, const LLSD& response) +{ + LLUUID from_id = notification["payload"]["from_id"].asUUID(); + std::string from_name; + gCacheName->getFullName(from_id, from_name); + + if(from_id.isNull() || (LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name))) + { + return false; + } + + S32 option = 0; + if (response.isInteger()) + { + option = response.asInteger(); + } + else + { + option = LLNotificationsUtil::getSelectedOption(notification, response); + } + + switch(option) + { + // Yes + case 0: + { + LLAvatarActions::offerTeleport(from_id); + } + break; + + // No + case 1: + default: + break; + + // Block + case 2: + { + LLMute mute(from_id, from_name, LLMute::AGENT); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + break; + } + return false; +} + +static LLNotificationFunctorRegistration teleport_requested_callback_reg("TeleportRequested", teleport_requested_callback); + bool goto_url_callback(const LLSD& notification, const LLSD& response) { std::string url = notification["payload"]["url"].asString(); diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index d2e35e4cc0..cff383cab1 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -70,6 +70,13 @@ + + + + +[NAME] is requesting to be teleported your to your location. + +Will you permit this? + confirm +
+
+ + Date: Mon, 11 Mar 2013 14:19:05 -0700 Subject: Clean up moving llalignedarray and fast memcpy to llcommon --- indra/newview/llface.cpp | 3 +++ indra/newview/llpolymesh.cpp | 26 ++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 86e5f20812..5f86205175 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -64,6 +64,8 @@ BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) +//#pragma GCC diagnostic ignored "-Wuninitialized" + /* For each vertex, given: B - binormal @@ -1982,6 +1984,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, //_mm_prefetch((char*)dst, _MM_HINT_NTA); + LLVector4a res0; //,res1,res2,res3; LLVector4a texIdx; diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 5f5258bbce..916f3d8e06 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -983,12 +983,26 @@ LLVector4a *LLPolyMesh::getScaledBinormals() //----------------------------------------------------------------------------- void LLPolyMesh::initializeForMorph() { - LLVector4a::memcpyNonAliased16((F32*) mCoords, (F32*) mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mScaledNormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); - LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2)); + // Must insure that src and dst of copies below + // are actually 16b aligned...the 16b mod 0 size + // is assumed from the data being LLVector4a + // + ll_assert_aligned(mCoords,16); + ll_assert_aligned(mNormals,16); + ll_assert_aligned(mScaledNormals,16); + ll_assert_aligned(mBinormals,16); + ll_assert_aligned(mScaledBinormals,16); + ll_assert_aligned(mTexCoords,16); + ll_assert_aligned(mSharedData->mBaseCoords,16); + ll_assert_aligned(mSharedData->mBaseNormals,16); + ll_assert_aligned(mSharedData->mTexCoords,16); + + ll_memcpy_nonaliased_aligned_16((char*)mCoords, (char*)mSharedData->mBaseCoords, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mNormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mScaledNormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mBinormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mScaledBinormals, (char*)mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); + ll_memcpy_nonaliased_aligned_16((char*)mTexCoords, (char*)mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2)); for (U32 i = 0; i < mSharedData->mNumVertices; ++i) { -- cgit v1.2.3 From 352138a8486623575ee015c89f3263103b30bef4 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 12 Mar 2013 00:56:51 +0100 Subject: ACME-99 FIX Populate the FB tab friends list with FB data --- indra/newview/llpanelpeople.cpp | 93 +++++++++++++++++++++- indra/newview/llpanelpeople.h | 5 ++ .../newview/skins/default/xui/en/panel_people.xml | 19 ++--- 3 files changed, 104 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 85f54b06eb..491b8dd7c5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -64,9 +64,11 @@ #include "llvoiceclient.h" #include "llworld.h" #include "llspeakers.h" +#include "llfloaterwebcontent.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 +#define FBCTEST_LIST_UPDATE_INTERVAL 0.25 static const std::string NEARBY_TAB_NAME = "nearby_panel"; static const std::string FRIENDS_TAB_NAME = "friends_panel"; @@ -489,6 +491,45 @@ public: } }; +/** + * Periodically updates the FBC test list after a login is initiated. + * + * The period is defined by FBCTEST_LIST_UPDATE_INTERVAL constant. + */ +class LLFbcTestListUpdater : public LLAvatarListUpdater +{ + LOG_CLASS(LLFbcTestListUpdater); + +public: + LLFbcTestListUpdater(callback_t cb) + : LLAvatarListUpdater(cb, FBCTEST_LIST_UPDATE_INTERVAL) + { + setActive(false); + } + + /*virtual*/ void setActive(bool val) + { + if (val) + { + // update immediately and start regular updates + update(); + mEventTimer.start(); + } + else + { + // stop regular updates + mEventTimer.stop(); + } + } + + /*virtual*/ BOOL tick() + { + update(); + return FALSE; + } +private: +}; + //============================================================================= LLPanelPeople::LLPanelPeople() @@ -502,6 +543,7 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), + mFbcTestText(NULL), mNearbyGearButton(NULL), mFriendsGearButton(NULL), mGroupsGearButton(NULL), @@ -511,6 +553,7 @@ LLPanelPeople::LLPanelPeople() mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this)); + mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList, this)); mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); @@ -522,6 +565,7 @@ LLPanelPeople::~LLPanelPeople() delete mNearbyListUpdater; delete mFriendListUpdater; delete mRecentListUpdater; + delete mFbcTestListUpdater; if(LLVoiceClient::instanceExists()) { @@ -533,7 +577,7 @@ LLPanelPeople::~LLPanelPeople() if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die(); if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die(); if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die(); - + if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -598,6 +642,8 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); + + mFbcTestText = getChild(FBCTEST_TAB_NAME)->getChild("fbctest_label"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -823,6 +869,40 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } +void LLPanelPeople::updateFbcTestList() +{ + if (!mFbcTestText) + return; + + if (mFbcTestBrowserHandle.get()) + { + // get the browser data (from the title bar, of course!) + std::string title = mFbcTestBrowserHandle.get()->getTitle(); + + // if the data is ready (if it says the magic word) + if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ") + { + // get the list of friends' names from the title bar + std::vector names = LLStringUtil::getTokens(title.substr(8), ","); + + // display the names in the list + std::string label; + for (std::vector::const_iterator i = names.begin() + 1; i != names.end(); ++i) + { + label += *i; + label += "\n"; + } + mFbcTestText->setText(label); + + // close the browser window + mFbcTestBrowserHandle.get()->die(); + + // stop updating + mFbcTestListUpdater->setActive(false); + } + } +} + void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) { // To make sure we're referencing the right widget (a child of the button bar). @@ -1564,7 +1644,16 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) void LLPanelPeople::onLoginFbcButtonClicked() { - LLWeb::loadURLInternal("https://cryptic-ridge-1632.herokuapp.com/"); + LLFloaterWebContent::Params p; + p.url("https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 4df5df2574..010fb5ca77 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -73,6 +73,7 @@ private: void updateFriendList(); void updateNearbyList(); void updateRecentList(); + void updateFbcTestList(); bool isItemsFreeOfFriends(const uuid_vec_t& uuids); @@ -145,16 +146,20 @@ private: LLAvatarList* mRecentList; LLGroupList* mGroupList; LLNetMap* mMiniMap; + + LLTextBox* mFbcTestText; LLHandle mGroupPlusMenuHandle; LLHandle mNearbyViewSortMenuHandle; LLHandle mFriendsViewSortMenuHandle; LLHandle mGroupsViewSortMenuHandle; LLHandle mRecentViewSortMenuHandle; + LLHandle mFbcTestBrowserHandle; Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; + Updater* mFbcTestListUpdater; Updater* mButtonsUpdater; LLMenuButton* mNearbyGearButton; diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 781a1d773f..cbb6aff4ea 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -585,17 +585,14 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="fbctest_panel" top="0" width="313"> - + Date: Tue, 12 Mar 2013 04:51:52 -0700 Subject: Add pragma warning disable for linux only to work-around spurious used before set warnings from GCC 4.3.4 on Vector4a with empty ctor --- indra/newview/llface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 86e5f20812..73ae3743fc 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,6 +53,12 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" +#if LL_LINUX +// Work-around spurious used before init warning on Vector4a +// +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif + extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 -- cgit v1.2.3 From 8af4974a02f1ad0c34c7e9cd17d0c2487231468e Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 06:19:26 -0700 Subject: Disable more warnings to try to get llface.cpp to compile in the TC linux farm --- indra/newview/llface.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 73ae3743fc..f0393dcc5c 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -57,6 +57,8 @@ // Work-around spurious used before init warning on Vector4a // #pragma GCC diagnostic ignored "-Wuninitialized" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-function" #endif extern BOOL gGLDebugLoggingEnabled; -- cgit v1.2.3 From d66aa0974abddbaa56be5d1535de4e09576324bc Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 08:14:19 -0700 Subject: Remove pragma diags which ALSO cause gcc-4.1 to warning and thus error out. *sigh* --- indra/newview/llface.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f0393dcc5c..86e5f20812 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,14 +53,6 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" -#if LL_LINUX -// Work-around spurious used before init warning on Vector4a -// -#pragma GCC diagnostic ignored "-Wuninitialized" -#pragma GCC diagnostic ignored "-Wunused-variable" -#pragma GCC diagnostic ignored "-Wunused-function" -#endif - extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 -- cgit v1.2.3 From 5a51a43f23f89b88e7f9b3e16d019a23196131f6 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 08:45:10 -0700 Subject: Fix eol at eof on wl param files. --- indra/newview/llwlanimator.h | 1 + indra/newview/llwlparammanager.h | 1 + indra/newview/llwlparamset.cpp | 3 ++- indra/newview/llwlparamset.h | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 5223b45343..810f4cf7e5 100644 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -137,3 +137,4 @@ private: }; #endif // LL_WL_ANIMATOR_H + diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 72422500fc..e13aed98ed 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -412,3 +412,4 @@ inline LLVector4 LLWLParamManager::getRotatedLightDir(void) const } #endif + diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 745cdae441..b307f19e8a 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -406,4 +406,5 @@ void LLWLParamSet::updateHashedNames() { mParamHashedNames.push_back(LLStaticHashedString(iter->first)); } -} \ No newline at end of file +} + diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index 3e9f77ba6c..6e5f1d3a4b 100644 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -243,3 +243,4 @@ inline F32 LLWLParamSet::getCloudScrollY() { #endif // LL_WLPARAM_SET_H + -- cgit v1.2.3 From 35383790fb250532fa7701638d39a8f1c6a0cf76 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Tue, 12 Mar 2013 04:40:51 -0700 Subject: Merge pragma warning hack to fix linux build --- indra/newview/llface.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 5f86205175..c3cb914120 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,6 +53,12 @@ #include "llviewershadermgr.h" #include "llvoavatar.h" +#if LL_LINUX +// Work-around spurious used before init warning on Vector4a +// +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif + extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 @@ -64,8 +70,6 @@ BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) -//#pragma GCC diagnostic ignored "-Wuninitialized" - /* For each vertex, given: B - binormal -- cgit v1.2.3 From 08ae21f52dbbe6245ac8deee0fdfd5df4d3dba53 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 13 Mar 2013 17:07:22 -0500 Subject: MAINT-2410 Extra Particle Parameters -- viewer implementation Reviewed by Kelly and Graham --- indra/newview/lldrawpoolalpha.cpp | 38 +++-- indra/newview/llspatialpartition.cpp | 4 +- indra/newview/llspatialpartition.h | 2 + indra/newview/llviewerobject.cpp | 21 ++- indra/newview/llviewerobject.h | 8 +- indra/newview/llviewerpartsim.cpp | 27 +++- indra/newview/llviewerpartsim.h | 9 +- indra/newview/llviewerpartsource.cpp | 75 ++++++++- indra/newview/llviewerpartsource.h | 4 +- indra/newview/llvograss.cpp | 7 +- indra/newview/llvograss.h | 1 + indra/newview/llvopartgroup.cpp | 305 +++++++++++++++++++++++++---------- indra/newview/llvopartgroup.h | 6 +- indra/newview/llvovolume.cpp | 6 +- 14 files changed, 388 insertions(+), 125 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 313b310e1e..6fa16825df 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -394,10 +394,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if (group->mSpatialPartition->mRenderByGroup && !group->isDead()) { - bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. - // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group"); + LLFastTimer t(FTM_RENDER_ALPHA_GROUP_LOOP); + + bool draw_glow_for_this_partition = mVertexShaderLevel > 0; // no shaders = no glow. + + bool disable_cull = group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_PARTICLE || + group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE; + + LLGLDisable cull(disable_cull ? GL_CULL_FACE : 0); LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; @@ -498,32 +503,31 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - params.mVertexBuffer->setBuffer(mask); - params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); - gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_PUSH("Alpha Push Verts"); + { + LLFastTimer t(FTM_RENDER_ALPHA_PUSH); + gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor); + params.mVertexBuffer->setBuffer(mask); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + } // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && draw_glow_for_this_partition && params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) { + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GLOW("Alpha Glow"); + LLFastTimer t(FTM_RENDER_ALPHA_GLOW); // install glow-accumulating blend mode gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) - emissive_shader->bind(); - - // glow doesn't use vertex colors from the mesh data - params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); + params.mVertexBuffer->setBuffer(mask | LLVertexBuffer::MAP_EMISSIVE); // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); - - // restore our alpha blend mode - gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - - current_shader->bind(); } if (tex_setup) @@ -536,6 +540,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLVertexBuffer::unbind(); if (!light_enabled) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index dd69172184..1ec56eb5f8 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4654,7 +4654,9 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mGroup(NULL), mFace(NULL), mDistance(0.f), - mDrawMode(LLRender::TRIANGLES) + mDrawMode(LLRender::TRIANGLES), + mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), + mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA) { mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index b5543c4a37..08e77855c4 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -119,6 +119,8 @@ public: LL_ALIGN_16(LLFace* mFace); //associated face F32 mDistance; U32 mDrawMode; + U32 mBlendFuncSrc; + U32 mBlendFuncDst; struct CompareTexture { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b1a60197a2..09cc4a1121 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1553,6 +1553,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, dp->setPassFlags(value); dp->unpackUUID(owner_id, "Owner"); + mOwnerID = owner_id; + if (value & 0x80) { dp->unpackVector3(new_angv, "Omega"); @@ -1626,13 +1628,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, retval |= checkMediaURL(media_url); // - // Unpack particle system data + // Unpack particle system data (legacy) // if (value & 0x8) { - unpackParticleSource(*dp, owner_id); + unpackParticleSource(*dp, owner_id, true); } - else + else if (!(value & 0x400)) { deleteParticleSource(); } @@ -1697,7 +1699,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // keep local flags and overwrite remote-controlled flags mFlags = (mFlags & FLAGS_LOCAL) | flags; - // ...new objects that should come in selected need to be added to the selected list + // ...new objects that should come in selected need to be added to the selected list mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); } break; @@ -4604,7 +4606,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own } } -void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id) +void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy) { if (!mPartSourcep.isNull() && mPartSourcep->isDead()) { @@ -4613,7 +4615,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ if (mPartSourcep) { // If we've got one already, just update the existing source (or remove it) - if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp)) + if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp, legacy)) { mPartSourcep->setDead(); mPartSourcep = NULL; @@ -4621,7 +4623,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ } else { - LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp); + LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp, legacy); //If the owner is muted, don't create the system if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! @@ -5467,6 +5469,11 @@ F32 LLAlphaObject::getPartSize(S32 idx) return 0.f; } +void LLAlphaObject::getBlendFunc(S32 face, U32& src, U32& dst) +{ + +} + // virtual void LLStaticViewerObject::updateDrawable(BOOL force_damped) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 97cf0a4850..cab617b745 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -584,6 +584,7 @@ public: } EPhysicsShapeType; LLUUID mID; + LLUUID mOwnerID; //null if unknown // unique within region, not unique across regions // Local ID = 0 is not used @@ -662,7 +663,7 @@ protected: BOOL isOnMap(); void unpackParticleSource(const S32 block_num, const LLUUID& owner_id); - void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id); + void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy); void deleteParticleSource(); void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id); @@ -826,9 +827,12 @@ public: LLStrider& verticesp, LLStrider& normalsp, LLStrider& texcoordsp, - LLStrider& colorsp, + LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) = 0; + virtual void getBlendFunc(S32 face, U32& src, U32& dst); + F32 mDepth; }; diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 61cdfd7818..21f1d2619c 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -80,12 +80,31 @@ LLViewerPart::LLViewerPart() : mImagep(NULL) { mPartSourcep = NULL; - + mParent = NULL; + mChild = NULL; ++LLViewerPartSim::sParticleCount2 ; } LLViewerPart::~LLViewerPart() { + if (mPartSourcep.notNull() && mPartSourcep->mLastPart == this) + { + mPartSourcep->mLastPart = NULL; + } + + //patch up holes in the ribbon + if (mParent) + { + llassert(mParent->mChild == this); + mParent->mChild = mChild; + } + + if (mChild) + { + llassert (mChild->mParent == this); + mChild->mParent = mParent; + } + mPartSourcep = NULL; --LLViewerPartSim::sParticleCount2 ; @@ -367,6 +386,9 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) part->mScale += frac*part->mEndScale; } + // Do glow interpolation + part->mGlow.mV[3] = (U8) (lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + // Set the last update time to now. part->mLastUpdateTime = cur_time; @@ -623,6 +645,9 @@ void LLViewerPartSim::updateSimulation() { static LLFrameTimer update_timer; + //reset VBO cursor + LLVOPartGroup::sVBSlotCursor = 0; + const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f); if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES))) diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index c91fcf0691..095de2060c 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -65,15 +65,22 @@ public: LLVPCallback mVPCallback; // Callback function for more complicated behaviors LLPointer mPartSourcep; // Particle source used for this object - + + LLViewerPart* mParent; // particle to connect to if this is part of a particle ribbon + LLViewerPart* mChild; // child particle for clean reference destruction // Current particle state (possibly used for rendering) LLPointer mImagep; LLVector3 mPosAgent; LLVector3 mVelocity; LLVector3 mAccel; + LLVector3 mAxis; LLColor4 mColor; LLVector2 mScale; + F32 mStartGlow; + F32 mEndGlow; + LLColor4U mGlow; + static U32 sNextPartID; }; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index b311f659fb..8c49ce646d 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -52,6 +52,8 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) : static U32 id_seed = 0; mID = ++id_seed; + mLastPart = NULL; + mDelay = 0 ; } @@ -279,6 +281,22 @@ void LLViewerPartSourceScript::update(const F32 dt) { part->mFlags |= LLPartData::LL_PART_HUD; } + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK && mLastPart) + { //set previous particle's parent to this particle to chain ribbon together + mLastPart->mParent = part; + part->mChild = mLastPart; + part->mAxis = LLVector3(0,0,1); + + if (mSourceObjectp.notNull()) + { + LLQuaternion rot = mSourceObjectp->getRenderRotation(); + part->mAxis *= rot; + } + } + + mLastPart = part; + part->mMaxAge = mPartSysData.mPartData.mMaxAge; part->mStartColor = mPartSysData.mPartData.mStartColor; part->mEndColor = mPartSysData.mPartData.mEndColor; @@ -290,6 +308,13 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mAccel = mPartSysData.mPartAccel; + part->mBlendFuncDest = mPartSysData.mPartData.mBlendFuncDest; + part->mBlendFuncSource = mPartSysData.mPartData.mBlendFuncSource; + + part->mStartGlow = mPartSysData.mPartData.mStartGlow; + part->mEndGlow = mPartSysData.mPartData.mEndGlow; + part->mGlow = LLColor4U(0, 0, 0, (U8) (part->mStartGlow*255.f)); + if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { part->mPosAgent = mPosAgent; @@ -430,28 +455,51 @@ LLPointer LLViewerPartSourceScript::unpackPSS(LLViewer } -LLPointer LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp) +LLPointer LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp, bool legacy) { if (!pssp) { LLPointer new_pssp = new LLViewerPartSourceScript(source_objp); - if (!new_pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!new_pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } + } + else + { + if (!new_pssp->mPartSysData.unpack(dp)) + { + return NULL; + } } + if (new_pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(new_pssp->mPartSysData.mTargetUUID); new_pssp->setTargetObject(target_objp); } + return new_pssp; } else { - if (!pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } } + else + { + if (!pssp->mPartSysData.unpack(dp)) + { + return NULL; + } + } + if (pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(pssp->mPartSysData.mTargetUUID); @@ -569,6 +617,11 @@ void LLViewerPartSourceSpiral::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); LLViewerPartSim::getInstance()->addPart(part); } @@ -721,6 +774,12 @@ void LLViewerPartSourceBeam::update(const F32 dt) part->mPosAgent = mPosAgent; part->mVelocity = mTargetPosAgent - mPosAgent; + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } } @@ -825,6 +884,12 @@ void LLViewerPartSourceChat::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 28702d36a2..12e926173b 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -76,6 +76,7 @@ public: LLVector3 mLastUpdatePosAgent; LLPointer mSourceObjectp; U32 mID; + LLViewerPart* mLastPart; //last particle emitted (for making particle ribbons) protected: U32 mType; @@ -85,7 +86,6 @@ protected: F32 mLastPartTime; LLUUID mOwnerUUID; LLPointer mImagep; - // Particle information U32 mPartFlags; // Flags for the particle U32 mDelay ; //delay to start particles @@ -114,7 +114,7 @@ public: // Returns a new particle source to attach to an object... static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, const S32 block_num); - static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp); + static LLPointer unpackPSS(LLViewerObject *source_objp, LLPointer pssp, LLDataPacker &dp, bool legacy); static LLPointer createPSS(LLViewerObject *source_objp, const LLPartSysData& particle_parameters); LLViewerTexture *getImage() const { return mImagep; } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 4dca87652d..ed62abe4ef 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -476,6 +476,7 @@ void LLVOGrass::getGeometry(S32 idx, LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) { if(!mNumBlades)//stop rendering grass @@ -708,7 +709,11 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(index_count); facep->setVertexBuffer(buffer); facep->setPoolType(LLDrawPool::POOL_ALPHA); - object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, indicesp); + + //dummy parameter (unused by this implementation) + LLStrider emissivep; + + object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, emissivep, indicesp); vertex_count += facep->getGeomCount(); index_count += facep->getIndicesCount(); diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index b9835b8802..1fe9990cea 100644 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -63,6 +63,7 @@ public: LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp); void updateFaceSize(S32 idx) { } diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 1a9769f09d..53d67347d1 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -49,17 +49,11 @@ const F32 MAX_PART_LIFETIME = 120.f; extern U64 gFrameTime; LLPointer LLVOPartGroup::sVB = NULL; -S32 LLVOPartGroup::sVBSlotFree[]; -S32* LLVOPartGroup::sVBSlotCursor = NULL; +S32 LLVOPartGroup::sVBSlotCursor = 0; void LLVOPartGroup::initClass() { - for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i) - { - sVBSlotFree[i] = i; - } - - sVBSlotCursor = sVBSlotFree; + } //static @@ -122,36 +116,33 @@ void LLVOPartGroup::destroyGL() //static S32 LLVOPartGroup::findAvailableVBSlot() { - if (sVBSlotCursor >= sVBSlotFree+LL_MAX_PARTICLE_COUNT) + if (sVBSlotCursor >= LL_MAX_PARTICLE_COUNT) { //no more available slots return -1; } - S32 ret = *sVBSlotCursor; - sVBSlotCursor++; - - return ret; + return sVBSlotCursor++; } bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) { - while (start < end) + /*while (start < end) { if (*start == idx) { //not allocated (in free list) return false; } ++start; - } + }*/ //allocated (not in free list) - return true; + return false; } //static void LLVOPartGroup::freeVBSlot(S32 idx) { - llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); + /*llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); llassert(sVBSlotCursor > sVBSlotFree); llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT)); @@ -159,7 +150,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx) { sVBSlotCursor--; *sVBSlotCursor = idx; - } + }*/ } LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) @@ -189,6 +180,7 @@ F32 LLVOPartGroup::getBinRadius() void LLVOPartGroup::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { const LLVector3& pos_agent = getPositionAgent(); + newMin.load3( (pos_agent - mScale).mV); newMax.load3( (pos_agent + mScale).mV); LLVector4a pos; @@ -273,6 +265,16 @@ F32 LLVOPartGroup::getPartSize(S32 idx) return 0.f; } +void LLVOPartGroup::getBlendFunc(S32 idx, U32& src, U32& dst) +{ + if (idx < (S32) mViewerPartGroupp->mParticles.size()) + { + LLViewerPart* part = mViewerPartGroupp->mParticles[idx]; + src = part->mBlendFuncSource; + dst = part->mBlendFuncDest; + } +} + LLVector3 LLVOPartGroup::getCameraPosition() const { return gAgentCamera.getCameraPositionAgent(); @@ -332,13 +334,42 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) mDepth = 0.f; S32 i = 0 ; LLVector3 camera_agent = getCameraPosition(); + + F32 max_scale = 0.f; + + for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) { const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; + + //remember the largest particle + max_scale = llmax(max_scale, part->mScale.mV[0], part->mScale.mV[1]); + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //include ribbon segment length in scale + const LLVector3* pos_agent = NULL; + if (part->mParent) + { + pos_agent = &(part->mParent->mPosAgent); + } + else if (part->mPartSourcep.notNull()) + { + pos_agent = &(part->mPartSourcep->mPosAgent); + } + + if (pos_agent) + { + F32 dist = (*pos_agent-part->mPosAgent).length(); + + max_scale = llmax(max_scale, dist); + } + } + LLVector3 part_pos_agent(part->mPosAgent); LLVector3 at(part_pos_agent - camera_agent); + F32 camera_dist_squared = at.lengthSquared(); F32 inv_camera_dist_squared; if (camera_dist_squared > 1.f) @@ -411,6 +442,9 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) facep->setSize(0, 0); } + //record max scale (used to stretch bounding box for visibility culling) + mScale.set(max_scale, max_scale, max_scale); + mDrawable->movePartition(); LLPipeline::sCompiles++; return TRUE; @@ -478,74 +512,129 @@ BOOL LLVOPartGroup::lineSegmentIntersect(const LLVector3& start, const LLVector3 void LLVOPartGroup::getGeometry(const LLViewerPart& part, LLStrider& verticesp) { - LLVector4a part_pos_agent; - part_pos_agent.load3(part.mPosAgent.mV); - LLVector4a camera_agent; - camera_agent.load3(getCameraPosition().mV); - LLVector4a at; - at.setSub(part_pos_agent, camera_agent); - LLVector4a up(0, 0, 1); - LLVector4a right; - - right.setCross3(at, up); - right.normalize3fast(); - up.setCross3(right, at); - up.normalize3fast(); - - if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) { - LLVector4a normvel; - normvel.load3(part.mVelocity.mV); - normvel.normalize3fast(); - LLVector2 up_fracs; - up_fracs.mV[0] = normvel.dot3(right).getF32(); - up_fracs.mV[1] = normvel.dot3(up).getF32(); - up_fracs.normalize(); - LLVector4a new_up; - LLVector4a new_right; - - //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; - LLVector4a t = right; - t.mul(up_fracs.mV[0]); - new_up = up; - new_up.mul(up_fracs.mV[1]); - new_up.add(t); - - //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; - t = right; - t.mul(up_fracs.mV[1]); - new_right = up; - new_right.mul(up_fracs.mV[0]); - t.sub(new_right); - - up = new_up; - right = t; - up.normalize3fast(); - right.normalize3fast(); + LLVector4a axis, pos, paxis, ppos; + F32 scale, pscale; + + pos.load3(part.mPosAgent.mV); + axis.load3(part.mAxis.mV); + scale = part.mScale.mV[0]; + + if (part.mParent) + { + ppos.load3(part.mParent->mPosAgent.mV); + paxis.load3(part.mParent->mAxis.mV); + pscale = part.mParent->mScale.mV[0]; + } + else + { //use source object as position + + if (part.mPartSourcep->mSourceObjectp.notNull()) + { + LLVector3 v = LLVector3(0,0,1); + v *= part.mPartSourcep->mSourceObjectp->getRenderRotation(); + paxis.load3(v.mV); + ppos.load3(part.mPartSourcep->mPosAgent.mV); + pscale = part.mStartScale.mV[0]; + } + else + { //no source object, no parent, nothing to draw + ppos = pos; + pscale = scale; + paxis = axis; + } + } + + LLVector4a p0, p1, p2, p3; + + scale *= 0.5f; + pscale *= 0.5f; + + axis.mul(scale); + paxis.mul(pscale); + + p0.setAdd(pos, axis); + p1.setSub(pos,axis); + p2.setAdd(ppos, paxis); + p3.setSub(ppos, paxis); + + (*verticesp++) = p2; + (*verticesp++) = p3; + (*verticesp++) = p0; + (*verticesp++) = p1; } + else + { + LLVector4a part_pos_agent; + part_pos_agent.load3(part.mPosAgent.mV); + LLVector4a camera_agent; + camera_agent.load3(getCameraPosition().mV); + LLVector4a at; + at.setSub(part_pos_agent, camera_agent); + LLVector4a up(0, 0, 1); + LLVector4a right; + + right.setCross3(at, up); + right.normalize3fast(); + up.setCross3(right, at); + up.normalize3fast(); - right.mul(0.5f*part.mScale.mV[0]); - up.mul(0.5f*part.mScale.mV[1]); + if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + { + LLVector4a normvel; + normvel.load3(part.mVelocity.mV); + normvel.normalize3fast(); + LLVector2 up_fracs; + up_fracs.mV[0] = normvel.dot3(right).getF32(); + up_fracs.mV[1] = normvel.dot3(up).getF32(); + up_fracs.normalize(); + LLVector4a new_up; + LLVector4a new_right; + + //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; + LLVector4a t = right; + t.mul(up_fracs.mV[0]); + new_up = up; + new_up.mul(up_fracs.mV[1]); + new_up.add(t); + + //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + t = right; + t.mul(up_fracs.mV[1]); + new_right = up; + new_right.mul(up_fracs.mV[0]); + t.sub(new_right); + + up = new_up; + right = t; + up.normalize3fast(); + right.normalize3fast(); + } + right.mul(0.5f*part.mScale.mV[0]); + up.mul(0.5f*part.mScale.mV[1]); - //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) - // this works because there is actually a 4th float stored after the vertex position which is used as a texture index - // also, somebody please VECTORIZE THIS - LLVector4a ppapu; - LLVector4a ppamu; + //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) + // this works because there is actually a 4th float stored after the vertex position which is used as a texture index + // also, somebody please VECTORIZE THIS - ppapu.setAdd(part_pos_agent, up); - ppamu.setSub(part_pos_agent, up); + LLVector4a ppapu; + LLVector4a ppamu; - verticesp->setSub(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setSub(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; + ppapu.setAdd(part_pos_agent, up); + ppamu.setSub(part_pos_agent, up); + + verticesp->setSub(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setSub(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + } } @@ -555,6 +644,7 @@ void LLVOPartGroup::getGeometry(S32 idx, LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp) { if (idx >= (S32) mViewerPartGroupp->mParticles.size()) @@ -566,10 +656,40 @@ void LLVOPartGroup::getGeometry(S32 idx, getGeometry(part, verticesp); - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; + LLColor4U pcolor; + LLColor4U color = part.mColor; + + LLColor4U pglow; + + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //make sure color blends properly + if (part.mParent) + { + pglow = part.mParent->mGlow; + pcolor = part.mParent->mColor; + } + else + { + pglow = LLColor4U(0, 0, 0, (U8) (255.f*part.mStartGlow)); + pcolor = part.mStartColor; + } + } + else + { + pglow = part.mGlow; + pcolor = color; + } + + *colorsp++ = pcolor; + *colorsp++ = pcolor; + *colorsp++ = color; + *colorsp++ = color; + + *emissivep++ = pglow; + *emissivep++ = pglow; + *emissivep++ = part.mGlow; + *emissivep++ = part.mGlow; + if (!(part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)) { //not fullbright, needs normal @@ -712,10 +832,13 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider normalsp; LLStrider texcoordsp; LLStrider colorsp; + LLStrider emissivep; buffer->getVertexStrider(verticesp); buffer->getNormalStrider(normalsp); buffer->getColorStrider(colorsp); + buffer->getEmissiveStrider(emissivep); + LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass]; @@ -724,7 +847,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLFace* facep = *i; LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject(); - if (!facep->isState(LLFace::PARTICLE)) + //if (!facep->isState(LLFace::PARTICLE)) { //set the indices of this face S32 idx = LLVOPartGroup::findAvailableVBSlot(); if (idx >= 0) @@ -733,7 +856,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(idx*6); facep->setVertexBuffer(LLVOPartGroup::sVB); facep->setPoolType(LLDrawPool::POOL_ALPHA); - facep->setState(LLFace::PARTICLE); + //facep->setState(LLFace::PARTICLE); } else { @@ -748,8 +871,9 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider cur_norm = normalsp + geom_idx; LLStrider cur_tc = texcoordsp + geom_idx; LLStrider cur_col = colorsp + geom_idx; + LLStrider cur_glow = emissivep + geom_idx; - object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_idx); + object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx); llassert(facep->getGeomCount() == 4); llassert(facep->getIndicesCount() == 6); @@ -765,9 +889,16 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) bool batched = false; + U32 bf_src = LLRender::BF_SOURCE_ALPHA; + U32 bf_dst = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + + object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst); + if (idx >= 0 && draw_vec[idx]->mTexture == facep->getTexture() && - draw_vec[idx]->mFullbright == fullbright) + draw_vec[idx]->mFullbright == fullbright && + draw_vec[idx]->mBlendFuncDst == bf_dst && + draw_vec[idx]->mBlendFuncSrc == bf_src) { if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) { @@ -799,6 +930,8 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) info->mExtents[0] = group->mObjectExtents[0]; info->mExtents[1] = group->mObjectExtents[1]; info->mVSize = vsize; + info->mBlendFuncDst = bf_dst; + info->mBlendFuncSrc = bf_src; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index ce05a0282e..3c2e0344a2 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -42,8 +42,7 @@ public: //vertex buffer for holding all particles static LLPointer sVB; - static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT]; - static S32* sVBSlotCursor; + static S32 sVBSlotCursor; static void initClass(); static void restoreGL(); @@ -57,6 +56,7 @@ public: LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_EMISSIVE | LLVertexBuffer::MAP_TEXTURE_INDEX }; @@ -91,10 +91,12 @@ public: LLStrider& normalsp, LLStrider& texcoordsp, LLStrider& colorsp, + LLStrider& emissivep, LLStrider& indicesp); void updateFaceSize(S32 idx) { } F32 getPartSize(S32 idx); + void getBlendFunc(S32 idx, U32& src, U32& dst); LLUUID getPartOwner(S32 idx); LLUUID getPartSource(S32 idx); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 597fb03526..0df0e653ae 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -384,7 +384,6 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, } else { - // CORY TO DO: Figure out how to get the value here if (update_type != OUT_TERSE_IMPROVED) { LLVolumeParams volume_params; @@ -453,6 +452,11 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, mFaceMappingChanged = TRUE; mTexAnimMode = 0; } + + if (value & 0x400) + { //particle system (new) + unpackParticleSource(*dp, mOwnerID, false); + } } else { -- cgit v1.2.3 From 3a08b4e3889753e74b35a643b4753912cebe3c5a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 13 Mar 2013 17:35:37 -0700 Subject: Now using the FBC Test panel you can select the '+' button to view FBC app settings, send a FBC app invite or send a facebook message. --- indra/newview/llpanelpeople.cpp | 37 +++++++++++++++++++++++++++++++++++++ indra/newview/llpanelpeople.h | 4 ++++ 2 files changed, 41 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 491b8dd7c5..dfc48145dc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -557,6 +557,8 @@ LLPanelPeople::LLPanelPeople() mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); + mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); + mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); } LLPanelPeople::~LLPanelPeople() @@ -717,6 +719,7 @@ BOOL LLPanelPeople::postBuild() mFriendsGearButton = getChild("friends_viewsort_btn"); mGroupsGearButton = getChild("groups_viewsort_btn"); mRecentGearButton = getChild("recent_viewsort_btn"); + mFBCGearButton = getChild("fbc_options_btn"); LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); @@ -749,6 +752,13 @@ BOOL LLPanelPeople::postBuild() mRecentGearButton->setMenu(recent_view_sort); } + LLToggleableMenu* fbc_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_gear_fbc.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if(fbc_menu) + { + mFBCMenuHandle = fbc_menu->getHandle(); + mFBCGearButton->setMenu(fbc_menu); + } + LLVoiceClient::getInstance()->addObserver(this); // call this method in case some list is empty and buttons can be in inconsistent state @@ -1656,4 +1666,31 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onFacebookAppRequestClicked() +{ + LLFloaterWebContent::Params p; + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } +} + +void LLPanelPeople::onFacebookAppSendClicked() +{ + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); + + if (browser) + { + // start checking the browser to see if the data is available yet + mFbcTestBrowserHandle = browser->getHandle(); + mFbcTestListUpdater->setActive(true); + } +} // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 010fb5ca77..feb32d1f69 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -115,6 +115,8 @@ private: void onRecentViewSortMenuItemClicked(const LLSD& userdata); void onLoginFbcButtonClicked(); + void onFacebookAppRequestClicked(); + void onFacebookAppSendClicked(); //returns false only if group is "none" bool isRealGroup(); @@ -154,6 +156,7 @@ private: LLHandle mFriendsViewSortMenuHandle; LLHandle mGroupsViewSortMenuHandle; LLHandle mRecentViewSortMenuHandle; + LLHandle mFBCMenuHandle; LLHandle mFbcTestBrowserHandle; Updater* mFriendListUpdater; @@ -166,6 +169,7 @@ private: LLMenuButton* mFriendsGearButton; LLMenuButton* mGroupsGearButton; LLMenuButton* mRecentGearButton; + LLMenuButton* mFBCGearButton; std::string mFilterSubString; std::string mFilterSubStringOrig; -- cgit v1.2.3 From 85257154a3ba001ecadacf4d81baa6f9c187a041 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 14 Mar 2013 14:01:39 -0700 Subject: Rollback fix for Maestro 'Jitter Bug' which is causing issues elsewhere --- indra/newview/llagentcamera.cpp | 23 ++++--- indra/newview/lldrawable.cpp | 106 +++++++++++++++++++-------------- indra/newview/llfasttimerview.cpp | 4 +- indra/newview/llfloatercolorpicker.cpp | 5 +- indra/newview/llfloatersnapshot.cpp | 5 +- indra/newview/llfolderviewitem.cpp | 7 +-- indra/newview/llfollowcam.cpp | 17 +++--- indra/newview/llhudnametag.cpp | 3 +- indra/newview/llmaniprotate.cpp | 18 +++--- indra/newview/llmanipscale.cpp | 5 +- indra/newview/llmaniptranslate.cpp | 13 ++-- indra/newview/llnetmap.cpp | 3 +- indra/newview/llselectmgr.cpp | 9 --- indra/newview/lltexturectrl.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 3 +- indra/newview/llvoavatar.cpp | 12 ++-- indra/newview/llvovolume.cpp | 5 +- indra/newview/llworldmapview.cpp | 4 +- 18 files changed, 121 insertions(+), 125 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a40d9cd318..9025c7af8b 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -179,7 +179,7 @@ LLAgentCamera::LLAgentCamera() : clearGeneralKeys(); clearOrbitKeys(); - clearPanKeys(); + clearPanKeys(); } // Requires gSavedSettings to be initialized. @@ -192,9 +192,6 @@ void LLAgentCamera::init() mDrawDistance = gSavedSettings.getF32("RenderFarClip"); - const F32 SMOOTHING_HALF_LIFE = 0.02f; - LLCriticalDamp::setInterpolantConstant(InterpDeltaCameraSmoothingHalfLife, gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE); - LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW); // Leave at 0.1 meters until we have real near clip management LLViewerCamera::getInstance()->setNear(0.1f); @@ -340,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLVector3 agent_at_axis = gAgent.getAtAxis(); agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector()); agent_at_axis.normalize(); - gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(InterpDeltaSmall))); + gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f))); } setFocusOnAvatar(TRUE, ANIMATE); @@ -1249,7 +1246,7 @@ void LLAgentCamera::updateCamera() gAgentCamera.clearPanKeys(); // lerp camera focus offset - mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(InterpDeltaCameraFocusHalfLife)); + mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); if ( mCameraMode == CAMERA_MODE_FOLLOW ) { @@ -1364,8 +1361,10 @@ void LLAgentCamera::updateCamera() mCameraSmoothingStop = mCameraSmoothingStop || in_build_mode; if (cameraThirdPerson() && !mCameraSmoothingStop) - { - F32 smoothing = LLCriticalDamp::getInterpolant(InterpDeltaCameraSmoothingHalfLife); + { + const F32 SMOOTHING_HALF_LIFE = 0.02f; + + F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1395,7 +1394,7 @@ void LLAgentCamera::updateCamera() } - mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(InterpDeltaFovZoomHalfLife)); + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -1810,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mTargetCameraDistance != mCurrentCameraDistance) { - F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaCameraZoomHalfLife); + F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE); mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt); } @@ -1828,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (isAgentAvatarValid()) { LLVector3d camera_lag_d; - F32 lag_interp = LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife); + F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE); LLVector3 target_lag; LLVector3 vel = gAgent.getVelocity(); @@ -1873,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife)); + mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f)); } camera_lag_d.setVec(mCameraLag); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index dc0e256ebb..d29181a3ce 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -492,83 +492,97 @@ F32 LLDrawable::updateXform(BOOL undamped) BOOL damped = !undamped; // Position - LLVector3 old_pos = mXform.getPosition(); - - // get agent position or parent-relative position as appropriate - // - LLVector3 target_pos = mXform.isRoot() ? mVObjp->getPositionAgent() : mVObjp->getPosition(); - + LLVector3 old_pos(mXform.getPosition()); + LLVector3 target_pos; + if (mXform.isRoot()) + { + // get root position in your agent's region + target_pos = mVObjp->getPositionAgent(); + } + else + { + // parent-relative position + target_pos = mVObjp->getPosition(); + } + // Rotation LLQuaternion old_rot(mXform.getRotation()); LLQuaternion target_rot = mVObjp->getRotation(); - //scaling LLVector3 target_scale = mVObjp->getScale(); LLVector3 old_scale = mCurrentScale; LLVector3 dest_scale = target_scale; - LLVector3 scale_vec = old_scale-target_scale; - - static const F32 dot_threshold = 1.0f - FLT_EPSILON; - - F32 dist_squared = dist_vec_squared(old_pos, target_pos); - - bool translated = dist_squared > 0.0f; - bool rotated = !mVObjp->getAngularVelocity().isExactlyZero() || (dot(old_rot, target_rot) < dot_threshold); - bool scaled = (scale_vec * scale_vec) > MIN_INTERPOLATE_DISTANCE_SQUARED; - // Damping + // Damping + F32 dist_squared = 0.f; + F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); + if (damped && isVisible()) { - F32 lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaObjectDampingConstant); + F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); - dist_squared = dist_vec_squared(new_pos, old_pos); + dist_squared = dist_vec_squared(new_pos, target_pos); LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot); - dist_squared += fabs(1.f - dot(new_rot, old_rot)) * 10.f; + // FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes. + dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f; LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt); - dist_squared += dist_vec_squared(new_scale, old_scale); + dist_squared += dist_vec_squared(new_scale, target_scale); - // If our lerp isn't moving too far, substitue the lerp'd pos for our target for this frame - // - if (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED) + if ((dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED * camdist2) && + (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED)) { // interpolate target_pos = new_pos; target_rot = new_rot; target_scale = new_scale; } - else + else if (mVObjp->getAngularVelocity().isExactlyZero()) { - llinfos << "skipping update due to overly large lerp" << llendl; + // snap to final position (only if no target omega is applied) + dist_squared = 0.0f; + if (getVOVolume() && !isRoot()) + { //child prim snapping to some position, needs a rebuild + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } } } + else + { + // The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275 + // dist_squared = dist_vec_squared(old_pos, target_pos); - if (translated || rotated || scaled) - { - if (scaled) - { - mCurrentScale = target_scale; - } + // The following fixes MAINT-2247 but causes MAINT-2275 + //dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f; + //dist_squared += dist_vec_squared(old_scale, target_scale); + } + LLVector3 vec = mCurrentScale-target_scale; + + if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) + { //scale change requires immediate rebuild + mCurrentScale = target_scale; + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } + else if (!isRoot() && + (!mVObjp->getAngularVelocity().isExactlyZero() || + dist_squared > 0.f)) + { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild dist_squared = 1.f; //keep this object on the move list - - //child prim moving relative to parent, tag as needing to be rendered atomically - // - if (!isRoot() && !isState(LLDrawable::ANIMATED_CHILD)) + if (!isState(LLDrawable::ANIMATED_CHILD)) { setState(LLDrawable::ANIMATED_CHILD); - } - - // Mark any components that need to be rebuilt based on what change transpired - // - if (!rotated && !scaled) - gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); - else gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE); - - mVObjp->dirtySpatialGroup(); + mVObjp->dirtySpatialGroup(); + } } + else if (!isRoot() + && ( dist_vec_squared(old_pos, target_pos) > 0.f + || (1.f - dot(old_rot, target_rot)) > 0.f)) + { // update child prims moved from LSL + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } else if (!getVOVolume() && !isAvatar()) { movePartition(); @@ -767,7 +781,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 643ce63f29..e7a3f9b390 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -940,7 +940,7 @@ void LLFastTimerView::draw() } //interpolate towards new maximum - last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(0.1f)); if (last_max - cur_max <= 1 || cur_max - last_max <= 1) { last_max = cur_max; @@ -948,7 +948,7 @@ void LLFastTimerView::draw() F32 alpha_target = last_max > cur_max ? llmin((F32) last_max/ (F32) cur_max - 1.f,1.f) : llmin((F32) cur_max/ (F32) last_max - 1.f,1.f); - alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f)); if (mHoverID != NULL) { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 10d31df22c..d6ebe44daa 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -525,11 +525,11 @@ void LLFloaterColorPicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); @@ -1113,4 +1113,3 @@ void LLFloaterColorPicker::stopUsingPipette() LLToolMgr::getInstance()->clearTransientTool(); } } - diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 103eaace88..d8d62e5bbb 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -478,7 +478,7 @@ void LLSnapshotLivePreview::draw() { if (mFlashAlpha < 1.f) { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); } else { @@ -487,7 +487,7 @@ void LLSnapshotLivePreview::draw() } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish) * 0.5f); + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } // Draw shining animation if appropriate. @@ -2500,4 +2500,3 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) } return TRUE; } - diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 23241b57c4..3aa16b4413 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1293,7 +1293,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) // animate current height towards target height if (llabs(mCurHeight - mTargetHeight) > 1.f) { - mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? InterpDeltaFolderOpenTime : InterpDeltaFolderCloseTime)); + mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); requestArrange(); @@ -2538,11 +2538,11 @@ void LLFolderViewFolder::draw() } else if (mIsOpen) { - mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f)); } else { - mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f)); } bool possibly_has_children = false; @@ -2899,4 +2899,3 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde } } } - diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index a3c1996512..b670af1782 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -148,16 +148,14 @@ LLFollowCamParams::~LLFollowCamParams() { } //--------------------------------------------------------- void LLFollowCamParams::setPositionLag( F32 p ) { - mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaPositionLag, mPositionLag); + mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); } //--------------------------------------------------------- void LLFollowCamParams::setFocusLag( F32 f ) { - mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaFocusLag, mFocusLag); + mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); } @@ -186,7 +184,6 @@ void LLFollowCamParams::setPitch( F32 p ) void LLFollowCamParams::setBehindnessLag( F32 b ) { mBehindnessLag = llclamp(b, FOLLOW_CAM_MIN_BEHINDNESS_LAG, FOLLOW_CAM_MAX_BEHINDNESS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaBehindnessLag, mBehindnessLag); } //--------------------------------------------------------- @@ -331,11 +328,11 @@ void LLFollowCam::update() F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance; */ - F32 focusLagLerp = LLCriticalDamp::getInterpolant(InterpDeltaFocusLag); + F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag ); focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp ); mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent); } - mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); }// if focus is not locked --------------------------------------------- @@ -418,7 +415,7 @@ void LLFollowCam::update() //------------------------------------------------------------------------------------------------- if ( distanceFromPositionToIdealPosition > mPositionThreshold ) { - F32 positionPullLerp = LLCriticalDamp::getInterpolant(InterpDeltaPositionLag); + F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag ); simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp ); } @@ -438,7 +435,7 @@ void LLFollowCam::update() updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent); mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent); - mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); } // if position is not locked ----------------------------------------------------------- @@ -493,7 +490,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos if ( cameraOffsetAngle > mBehindnessMaxAngle ) { - F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(InterpDeltaBehindnessLag); + F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag); cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT)); cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it constraint_active = TRUE; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index b94681b340..482294c8a6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -980,7 +980,7 @@ void LLHUDNameTag::updateAll() // { // continue; // } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(InterpDeltaPositionDampingTC)); + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); } } @@ -1083,4 +1083,3 @@ F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) return width; } } - diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 748ac7a16e..826e8d560a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -240,7 +240,7 @@ void LLManipRotate::render() if (mManipPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { // selected part @@ -251,7 +251,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); @@ -262,7 +262,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); @@ -273,13 +273,13 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else if (mManipPart == LL_NO_PART) { if (mHighlightedPart == LL_NO_PART) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } LLGLEnable cull_face(GL_CULL_FACE); @@ -294,7 +294,7 @@ void LLManipRotate::render() { if (mHighlightedPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); @@ -312,7 +312,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -330,7 +330,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part @@ -346,7 +346,7 @@ void LLManipRotate::render() if (mHighlightedPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 9802d5503e..00a0bf8894 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -535,11 +535,11 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) { if (mHighlightedPart == MANIPULATOR_IDS[i]) { - mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else { - mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } @@ -2082,4 +2082,3 @@ BOOL LLManipScale::canAffectSelection() } return can_scale; } - diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 9d287e7a03..0228807dc8 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1922,18 +1922,18 @@ void LLManipTranslate::renderTranslationHandles() { if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } } @@ -2323,4 +2323,3 @@ BOOL LLManipTranslate::canAffectSelection() } return can_move; } - diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 274497f2b5..1bda7640bd 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -162,7 +162,7 @@ void LLNetMap::draw() static LLUICachedControl auto_center("MiniMapAutoCenter", true); if (auto_center) { - mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f)); } // Prepare a scissor region @@ -987,4 +987,3 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); } } - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cf9d95455e..343316d30a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6108,14 +6108,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { - // Lines require an even number of verts so repeat the first - // vert if we don't meet that requirement - // - if (mSilhouetteVertices.size() & 0x1) - { - mSilhouetteVertices.push_back(mSilhouetteVertices[0]); - } - for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; @@ -7555,4 +7547,3 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } - diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 8c5844eca7..ec36cf48c2 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3f97659c66..9ffc64312d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1033,7 +1033,7 @@ void render_hud_attachments() // clamp target zoom level to reasonable values gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level - gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { @@ -1593,4 +1593,3 @@ void display_cleanup() { gDisconnectedImagep = NULL; } - diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d28da507ea..4efd59685e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2913,7 +2913,7 @@ void LLVOAvatar::idleUpdateWindEffect() LLVector3 velocity = getVelocity(); F32 speed = velocity.length(); //RN: velocity varies too much frame to frame for this to work - mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f)); mLastVel = velocity; LLVector4 wind; wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity); @@ -2934,10 +2934,13 @@ void LLVOAvatar::idleUpdateWindEffect() wind.mV[VW] = llmin(0.025f + (speed * 0.015f) + hover_strength, 0.5f); F32 interp; - interp = LLCriticalDamp::getInterpolant(InterpDeltaSmall); - if (wind.mV[VW] <= mWindVec.mV[VW]) + if (wind.mV[VW] > mWindVec.mV[VW]) { - interp *= 2.0f; + interp = LLCriticalDamp::getInterpolant(0.2f); + } + else + { + interp = LLCriticalDamp::getInterpolant(0.4f); } mWindVec = lerp(mWindVec, wind, interp); @@ -3798,6 +3801,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // Set the root rotation, but do so incrementally so that it // lags in time by some fixed amount. + //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG); F32 pelvis_lag_time = 0.f; if (self_in_mouselook) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3c831bafa0..7adf18b6d0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1268,7 +1268,7 @@ BOOL LLVOVolume::calcLOD() else { distance = mDrawable->mDistanceWRTCamera; - radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); } //hold onto unmodified distance for debugging @@ -2990,8 +2990,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p //transform view vector into volume space view_vector -= getRenderPosition(); - // WTF...why is silhouette generation touching a variable used all over the place?! - //mDrawable->mDistanceWRTCamera = view_vector.length(); + mDrawable->mDistanceWRTCamera = view_vector.length(); LLQuaternion worldRot = getRenderRotation(); view_vector = view_vector * ~worldRot; if (!isVolumeGlobal()) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7c3bc5988c..eeaa30aafb 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -302,8 +302,8 @@ void LLWorldMapView::draw() mVisibleRegions.clear(); // animate pan if necessary - sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); - sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); + sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); const S32 width = getRect().getWidth(); const S32 height = getRect().getHeight(); -- cgit v1.2.3 From e8dfa28697c177e8ed08ff76a9b81f920805a92f Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 14 Mar 2013 14:12:26 -0700 Subject: Rollback Maestro interp changes --- indra/newview/llagentcamera.cpp | 23 ++++---- indra/newview/lldrawable.cpp | 104 +++++++++++++++++++-------------- indra/newview/llfasttimerview.cpp | 4 +- indra/newview/llfloatercolorpicker.cpp | 5 +- indra/newview/llfloatersnapshot.cpp | 5 +- indra/newview/llfolderviewitem.cpp | 7 +-- indra/newview/llfollowcam.cpp | 17 +++--- indra/newview/llhudnametag.cpp | 3 +- indra/newview/llmaniprotate.cpp | 18 +++--- indra/newview/llmanipscale.cpp | 5 +- indra/newview/llmaniptranslate.cpp | 13 ++--- indra/newview/llnetmap.cpp | 3 +- indra/newview/llselectmgr.cpp | 9 --- indra/newview/lltexturectrl.cpp | 4 +- indra/newview/llviewerdisplay.cpp | 3 +- indra/newview/llvoavatar.cpp | 12 ++-- indra/newview/llworldmapview.cpp | 4 +- 17 files changed, 118 insertions(+), 121 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a40d9cd318..9025c7af8b 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -179,7 +179,7 @@ LLAgentCamera::LLAgentCamera() : clearGeneralKeys(); clearOrbitKeys(); - clearPanKeys(); + clearPanKeys(); } // Requires gSavedSettings to be initialized. @@ -192,9 +192,6 @@ void LLAgentCamera::init() mDrawDistance = gSavedSettings.getF32("RenderFarClip"); - const F32 SMOOTHING_HALF_LIFE = 0.02f; - LLCriticalDamp::setInterpolantConstant(InterpDeltaCameraSmoothingHalfLife, gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE); - LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW); // Leave at 0.1 meters until we have real near clip management LLViewerCamera::getInstance()->setNear(0.1f); @@ -340,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLVector3 agent_at_axis = gAgent.getAtAxis(); agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector()); agent_at_axis.normalize(); - gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(InterpDeltaSmall))); + gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f))); } setFocusOnAvatar(TRUE, ANIMATE); @@ -1249,7 +1246,7 @@ void LLAgentCamera::updateCamera() gAgentCamera.clearPanKeys(); // lerp camera focus offset - mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(InterpDeltaCameraFocusHalfLife)); + mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); if ( mCameraMode == CAMERA_MODE_FOLLOW ) { @@ -1364,8 +1361,10 @@ void LLAgentCamera::updateCamera() mCameraSmoothingStop = mCameraSmoothingStop || in_build_mode; if (cameraThirdPerson() && !mCameraSmoothingStop) - { - F32 smoothing = LLCriticalDamp::getInterpolant(InterpDeltaCameraSmoothingHalfLife); + { + const F32 SMOOTHING_HALF_LIFE = 0.02f; + + F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1395,7 +1394,7 @@ void LLAgentCamera::updateCamera() } - mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(InterpDeltaFovZoomHalfLife)); + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -1810,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mTargetCameraDistance != mCurrentCameraDistance) { - F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaCameraZoomHalfLife); + F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE); mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt); } @@ -1828,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (isAgentAvatarValid()) { LLVector3d camera_lag_d; - F32 lag_interp = LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife); + F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE); LLVector3 target_lag; LLVector3 vel = gAgent.getVelocity(); @@ -1873,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(InterpDeltaCameraLagHalfLife)); + mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f)); } camera_lag_d.setVec(mCameraLag); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 235da41998..d29181a3ce 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -492,83 +492,97 @@ F32 LLDrawable::updateXform(BOOL undamped) BOOL damped = !undamped; // Position - LLVector3 old_pos = mXform.getPosition(); - - // get agent position or parent-relative position as appropriate - // - LLVector3 target_pos = mXform.isRoot() ? mVObjp->getPositionAgent() : mVObjp->getPosition(); - + LLVector3 old_pos(mXform.getPosition()); + LLVector3 target_pos; + if (mXform.isRoot()) + { + // get root position in your agent's region + target_pos = mVObjp->getPositionAgent(); + } + else + { + // parent-relative position + target_pos = mVObjp->getPosition(); + } + // Rotation LLQuaternion old_rot(mXform.getRotation()); LLQuaternion target_rot = mVObjp->getRotation(); - //scaling LLVector3 target_scale = mVObjp->getScale(); LLVector3 old_scale = mCurrentScale; LLVector3 dest_scale = target_scale; - LLVector3 scale_vec = old_scale-target_scale; - - static const F32 dot_threshold = 1.0f - FLT_EPSILON; - - F32 dist_squared = dist_vec_squared(old_pos, target_pos); - - bool translated = dist_squared > 0.0f; - bool rotated = !mVObjp->getAngularVelocity().isExactlyZero() || (dot(old_rot, target_rot) < dot_threshold); - bool scaled = (scale_vec * scale_vec) > MIN_INTERPOLATE_DISTANCE_SQUARED; - // Damping + // Damping + F32 dist_squared = 0.f; + F32 camdist2 = (mDistanceWRTCamera * mDistanceWRTCamera); + if (damped && isVisible()) { - F32 lerp_amt = LLCriticalDamp::getInterpolant(InterpDeltaObjectDampingConstant); + F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); - dist_squared = dist_vec_squared(new_pos, old_pos); + dist_squared = dist_vec_squared(new_pos, target_pos); LLQuaternion new_rot = nlerp(lerp_amt, old_rot, target_rot); - dist_squared += fabs(1.f - dot(new_rot, old_rot)) * 10.f; + // FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes. + dist_squared += (1.f - dot(new_rot, target_rot)) * 10.f; LLVector3 new_scale = lerp(old_scale, target_scale, lerp_amt); - dist_squared += dist_vec_squared(new_scale, old_scale); + dist_squared += dist_vec_squared(new_scale, target_scale); - // If our lerp isn't moving too far, substitue the lerp'd pos for our target for this frame - // - if (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED) + if ((dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED * camdist2) && + (dist_squared <= MAX_INTERPOLATE_DISTANCE_SQUARED)) { // interpolate target_pos = new_pos; target_rot = new_rot; target_scale = new_scale; } - else + else if (mVObjp->getAngularVelocity().isExactlyZero()) { - llinfos << "skipping update due to overly large lerp" << llendl; + // snap to final position (only if no target omega is applied) + dist_squared = 0.0f; + if (getVOVolume() && !isRoot()) + { //child prim snapping to some position, needs a rebuild + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } } } + else + { + // The following fixes MAINT-1742 but breaks vehicles similar to MAINT-2275 + // dist_squared = dist_vec_squared(old_pos, target_pos); - if (translated || rotated || scaled) - { - if (scaled) - { - mCurrentScale = target_scale; - } + // The following fixes MAINT-2247 but causes MAINT-2275 + //dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f; + //dist_squared += dist_vec_squared(old_scale, target_scale); + } + LLVector3 vec = mCurrentScale-target_scale; + + if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) + { //scale change requires immediate rebuild + mCurrentScale = target_scale; + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } + else if (!isRoot() && + (!mVObjp->getAngularVelocity().isExactlyZero() || + dist_squared > 0.f)) + { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild dist_squared = 1.f; //keep this object on the move list - - //child prim moving relative to parent, tag as needing to be rendered atomically - // - if (!isRoot() && !isState(LLDrawable::ANIMATED_CHILD)) + if (!isState(LLDrawable::ANIMATED_CHILD)) { setState(LLDrawable::ANIMATED_CHILD); - } - - // Mark any components that need to be rebuilt based on what change transpired - // - if (!rotated && !scaled) - gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); - else gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE); - - mVObjp->dirtySpatialGroup(); + mVObjp->dirtySpatialGroup(); + } } + else if (!isRoot() + && ( dist_vec_squared(old_pos, target_pos) > 0.f + || (1.f - dot(old_rot, target_rot)) > 0.f)) + { // update child prims moved from LSL + gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); + } else if (!getVOVolume() && !isAvatar()) { movePartition(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 643ce63f29..e7a3f9b390 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -940,7 +940,7 @@ void LLFastTimerView::draw() } //interpolate towards new maximum - last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(0.1f)); if (last_max - cur_max <= 1 || cur_max - last_max <= 1) { last_max = cur_max; @@ -948,7 +948,7 @@ void LLFastTimerView::draw() F32 alpha_target = last_max > cur_max ? llmin((F32) last_max/ (F32) cur_max - 1.f,1.f) : llmin((F32) cur_max/ (F32) last_max - 1.f,1.f); - alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f)); if (mHoverID != NULL) { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 10d31df22c..d6ebe44daa 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -525,11 +525,11 @@ void LLFloaterColorPicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); @@ -1113,4 +1113,3 @@ void LLFloaterColorPicker::stopUsingPipette() LLToolMgr::getInstance()->clearTransientTool(); } } - diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 103eaace88..d8d62e5bbb 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -478,7 +478,7 @@ void LLSnapshotLivePreview::draw() { if (mFlashAlpha < 1.f) { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); } else { @@ -487,7 +487,7 @@ void LLSnapshotLivePreview::draw() } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaSmallish) * 0.5f); + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); } // Draw shining animation if appropriate. @@ -2500,4 +2500,3 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) } return TRUE; } - diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 23241b57c4..3aa16b4413 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1293,7 +1293,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) // animate current height towards target height if (llabs(mCurHeight - mTargetHeight) > 1.f) { - mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? InterpDeltaFolderOpenTime : InterpDeltaFolderCloseTime)); + mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); requestArrange(); @@ -2538,11 +2538,11 @@ void LLFolderViewFolder::draw() } else if (mIsOpen) { - mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f)); } else { - mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f)); } bool possibly_has_children = false; @@ -2899,4 +2899,3 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde } } } - diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index a3c1996512..b670af1782 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -148,16 +148,14 @@ LLFollowCamParams::~LLFollowCamParams() { } //--------------------------------------------------------- void LLFollowCamParams::setPositionLag( F32 p ) { - mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaPositionLag, mPositionLag); + mPositionLag = llclamp(p, FOLLOW_CAM_MIN_POSITION_LAG, FOLLOW_CAM_MAX_POSITION_LAG); } //--------------------------------------------------------- void LLFollowCamParams::setFocusLag( F32 f ) { - mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaFocusLag, mFocusLag); + mFocusLag = llclamp(f, FOLLOW_CAM_MIN_FOCUS_LAG, FOLLOW_CAM_MAX_FOCUS_LAG); } @@ -186,7 +184,6 @@ void LLFollowCamParams::setPitch( F32 p ) void LLFollowCamParams::setBehindnessLag( F32 b ) { mBehindnessLag = llclamp(b, FOLLOW_CAM_MIN_BEHINDNESS_LAG, FOLLOW_CAM_MAX_BEHINDNESS_LAG); - LLCriticalDamp::setInterpolantConstant(InterpDeltaBehindnessLag, mBehindnessLag); } //--------------------------------------------------------- @@ -331,11 +328,11 @@ void LLFollowCam::update() F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance; */ - F32 focusLagLerp = LLCriticalDamp::getInterpolant(InterpDeltaFocusLag); + F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag ); focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp ); mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent); } - mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); }// if focus is not locked --------------------------------------------- @@ -418,7 +415,7 @@ void LLFollowCam::update() //------------------------------------------------------------------------------------------------- if ( distanceFromPositionToIdealPosition > mPositionThreshold ) { - F32 positionPullLerp = LLCriticalDamp::getInterpolant(InterpDeltaPositionLag); + F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag ); simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp ); } @@ -438,7 +435,7 @@ void LLFollowCam::update() updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent); mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent); - mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(InterpDeltaTeeny)); + mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); } // if position is not locked ----------------------------------------------------------- @@ -493,7 +490,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos if ( cameraOffsetAngle > mBehindnessMaxAngle ) { - F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(InterpDeltaBehindnessLag); + F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag); cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT)); cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it constraint_active = TRUE; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index b94681b340..482294c8a6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -980,7 +980,7 @@ void LLHUDNameTag::updateAll() // { // continue; // } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(InterpDeltaPositionDampingTC)); + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); } } @@ -1083,4 +1083,3 @@ F32 LLHUDNameTag::LLHUDTextSegment::getWidth(const LLFontGL* font) return width; } } - diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 748ac7a16e..826e8d560a 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -240,7 +240,7 @@ void LLManipRotate::render() if (mManipPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { // selected part @@ -251,7 +251,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); @@ -262,7 +262,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); @@ -273,13 +273,13 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else if (mManipPart == LL_NO_PART) { if (mHighlightedPart == LL_NO_PART) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } LLGLEnable cull_face(GL_CULL_FACE); @@ -294,7 +294,7 @@ void LLManipRotate::render() { if (mHighlightedPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); @@ -312,7 +312,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -330,7 +330,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part @@ -346,7 +346,7 @@ void LLManipRotate::render() if (mHighlightedPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 9802d5503e..00a0bf8894 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -535,11 +535,11 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) { if (mHighlightedPart == MANIPULATOR_IDS[i]) { - mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else { - mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } @@ -2082,4 +2082,3 @@ BOOL LLManipScale::canAffectSelection() } return can_scale; } - diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 9d287e7a03..0228807dc8 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1922,18 +1922,18 @@ void LLManipTranslate::renderTranslationHandles() { if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(InterpDeltaManipulatorScaleHalfLife)); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } } @@ -2323,4 +2323,3 @@ BOOL LLManipTranslate::canAffectSelection() } return can_move; } - diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 274497f2b5..1bda7640bd 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -162,7 +162,7 @@ void LLNetMap::draw() static LLUICachedControl auto_center("MiniMapAutoCenter", true); if (auto_center) { - mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f)); } // Prepare a scissor region @@ -987,4 +987,3 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL)); } } - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cf9d95455e..343316d30a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6108,14 +6108,6 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { - // Lines require an even number of verts so repeat the first - // vert if we don't meet that requirement - // - if (mSilhouetteVertices.size() & 0x1) - { - mSilhouetteVertices.push_back(mSilhouetteVertices[0]); - } - for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; @@ -7555,4 +7547,3 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } - diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 8c5844eca7..ec36cf48c2 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaContextFadeTime)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3f97659c66..9ffc64312d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1033,7 +1033,7 @@ void render_hud_attachments() // clamp target zoom level to reasonable values gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level - gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { @@ -1593,4 +1593,3 @@ void display_cleanup() { gDisconnectedImagep = NULL; } - diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d28da507ea..4efd59685e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2913,7 +2913,7 @@ void LLVOAvatar::idleUpdateWindEffect() LLVector3 velocity = getVelocity(); F32 speed = velocity.length(); //RN: velocity varies too much frame to frame for this to work - mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(InterpDeltaTeenier)); + mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f)); mLastVel = velocity; LLVector4 wind; wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity); @@ -2934,10 +2934,13 @@ void LLVOAvatar::idleUpdateWindEffect() wind.mV[VW] = llmin(0.025f + (speed * 0.015f) + hover_strength, 0.5f); F32 interp; - interp = LLCriticalDamp::getInterpolant(InterpDeltaSmall); - if (wind.mV[VW] <= mWindVec.mV[VW]) + if (wind.mV[VW] > mWindVec.mV[VW]) { - interp *= 2.0f; + interp = LLCriticalDamp::getInterpolant(0.2f); + } + else + { + interp = LLCriticalDamp::getInterpolant(0.4f); } mWindVec = lerp(mWindVec, wind, interp); @@ -3798,6 +3801,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // Set the root rotation, but do so incrementally so that it // lags in time by some fixed amount. + //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG); F32 pelvis_lag_time = 0.f; if (self_in_mouselook) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7c3bc5988c..eeaa30aafb 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -302,8 +302,8 @@ void LLWorldMapView::draw() mVisibleRegions.clear(); // animate pan if necessary - sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); - sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(InterpDeltaSmaller)); + sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); + sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); const S32 width = getRect().getWidth(); const S32 height = getRect().getHeight(); -- cgit v1.2.3 From aec007f8bd21d2133130fc6157202101c2424a6c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 14 Mar 2013 11:09:39 -0700 Subject: forgot to add new .xml file for the gear menu in the FBC Test panel. Also cleaned up the code I added. --- indra/newview/llpanelpeople.cpp | 29 ++++++++------------- indra/newview/llpanelpeople.h | 2 ++ .../newview/skins/default/xui/en/menu_gear_fbc.xml | 30 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_gear_fbc.xml (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index dfc48145dc..ab82273ccd 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1652,10 +1652,8 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -void LLPanelPeople::onLoginFbcButtonClicked() +void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { - LLFloaterWebContent::Params p; - p.url("https://cryptic-ridge-1632.herokuapp.com/"); LLFloater* browser = LLFloaterReg::showInstance("web_content", p); if (browser) @@ -1666,31 +1664,24 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onLoginFbcButtonClicked() +{ + LLFloaterWebContent::Params p; + p.url("https://cryptic-ridge-1632.herokuapp.com/"); + openFacebookWeb(p); +} + void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + openFacebookWeb(p); } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index feb32d1f69..39cdbc9bd7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -30,6 +30,7 @@ #include #include "llcallingcard.h" // for avatar tracker +#include "llfloaterwebcontent.h" #include "llvoiceclient.h" class LLAvatarList; @@ -117,6 +118,7 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); + void openFacebookWeb(LLFloaterWebContent::Params& p); //returns false only if group is "none" bool isRealGroup(); diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml new file mode 100644 index 0000000000..b05ba46107 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From cc2e0caa5f26baf29ce6cccb120ea95621cfe038 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 14 Mar 2013 13:22:23 -0500 Subject: Fix for broken LoD. Reviewed by Graham. --- indra/newview/lldrawable.cpp | 2 +- indra/newview/llvovolume.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index dc0e256ebb..235da41998 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -767,7 +767,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } pos -= camera.getOrigin(); - mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f); + mDistanceWRTCamera = llround(pos.magVec(), 0.01f); mVObjp->updateLOD(); } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3ce32b40bb..9dcdd467e7 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1299,9 +1299,9 @@ BOOL LLVOVolume::calcLOD() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && mDrawable->getFace(0)) { - //setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail)); + setDebugText(llformat("%.2f:%.2f, %d", mDrawable->mDistanceWRTCamera, radius, cur_detail)); - setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); + //setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); } if (cur_detail != mLOD) @@ -2993,7 +2993,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p //transform view vector into volume space view_vector -= getRenderPosition(); - mDrawable->mDistanceWRTCamera = view_vector.length(); + //mDrawable->mDistanceWRTCamera = view_vector.length(); LLQuaternion worldRot = getRenderRotation(); view_vector = view_vector * ~worldRot; if (!isVolumeGlobal()) -- cgit v1.2.3 From 830e3ea0ec83070b56b805e43cb3ad261c413802 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 15 Mar 2013 16:30:11 -0700 Subject: [MAINT-2386] Viewer crashes when user move landmarks from Inventory -> Landmarks or Places to Favorite bar - Fixed a bug where the viewer would crash when adding multiple landmarks to an empty favorites bar [Reviewer] Kelly --- indra/newview/llfavoritesbar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 4cbc9cab4a..eb2b4b1ba2 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -/** +]/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * @@ -546,6 +546,10 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con bool insert_before = true; if (!mItems.empty()) { + // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, + // the viewer would crash when casting mLastTab below, as mLastTab is still null when the + // second landmark is being added. + // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function dest = dynamic_cast(mLandingTab); if (!dest) { @@ -616,6 +620,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con cb); } + // [MAINT-2386] Ensure the favorite button has been created and is valid. + // This also ensures that mLastTab will be valid when dropping multiple + // landmarks to an empty favorites bar. + updateButtons(); + llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } -- cgit v1.2.3 From 5216e9579f05b133b0cbd3fda9d5f7322ed4aacf Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 18 Mar 2013 11:39:24 -0700 Subject: Found an errant right bracket at the top of the file -- whoopsie! --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index eb2b4b1ba2..b5f5a1d169 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -]/** +/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * -- cgit v1.2.3 From 79edd066a4ddce341b556642bf6b98ef761d59f6 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Mon, 18 Mar 2013 17:00:29 -0700 Subject: MAINT-2497 FIX (Viewer) - viewer side change that goes with server side fix - adds direction when you set a TP landing point --- indra/newview/llfloaterland.cpp | 9 +++++++-- indra/newview/llviewermessage.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 5f58577a7c..22dd688be1 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2025,6 +2025,10 @@ void LLPanelLandOptions::refresh() mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); mSnapshotCtrl->setEnabled( can_change_identity ); + // find out where we're looking and convert that to an angle in degrees on a regular compass (not the internal representation) + LLVector3 user_look_at = parcel->getUserLookAt(); + U32 user_look_at_angle = ( (U32)( ( atan2(user_look_at[1], -user_look_at[0]) + F_PI * 2 ) * RAD_TO_DEG + 0.5) - 90) % 360; + LLVector3 pos = parcel->getUserLocation(); if (pos.isExactlyZero()) { @@ -2032,10 +2036,11 @@ void LLPanelLandOptions::refresh() } else { - mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d", + mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)", llround(pos.mV[VX]), llround(pos.mV[VY]), - llround(pos.mV[VZ]))); + llround(pos.mV[VZ]), + user_look_at_angle)); } mSetBtn->setEnabled( can_change_landing_point ); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6e02fafd01..bdb09b4c6f 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4065,7 +4065,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { LLTracker::stopTracking(NULL); } - else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() ) + else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() && look_at.isExactlyZero()) { //look at the beacon LLVector3 global_agent_pos = agent_pos; -- cgit v1.2.3 From a8245c51b9cd6fac1d26932dbb1fcf052f00da18 Mon Sep 17 00:00:00 2001 From: Maestro Linden Date: Tue, 19 Mar 2013 19:25:24 +0000 Subject: MAINT-2506 added viewer support for PERMISSION_SILENT_ESTATE_MANAGEMENT and PERMISSION_OVERRIDE_ANIMATIONS. Reviewed by Simon. --- indra/newview/app_settings/keywords.ini | 2 ++ indra/newview/llviewermessage.cpp | 10 ++++++++-- indra/newview/skins/default/xui/en/strings.xml | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 0b346286c8..56b549ab62 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -92,6 +92,8 @@ PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to req PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to modify estate settings without notifying the owner +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to change agent's default animations DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bdb09b4c6f..d7d82e1d67 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -160,7 +160,10 @@ const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] = "ChangePermissions", "TrackYourCamera", "ControlYourCamera", - "TeleportYourAgent" + "TeleportYourAgent", + "ExperiencePlaceholder", + "ManageEstateSilently", + "ChangeYourDefaultAnimations" }; const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = @@ -176,7 +179,10 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] = FALSE, // ChangePermissions FALSE, // TrackYourCamera, FALSE, // ControlYourCamera - FALSE // TeleportYourAgent + FALSE, // TeleportYourAgent + FALSE, // ExperiencePlaceholder + FALSE, // ManageEstateSilently + FALSE // ChangeYourDefaultAnimations }; bool friendship_offer_callback(const LLSD& notification, const LLSD& response) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0f4424a7f9..6be044d03c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -404,8 +404,11 @@ Please try logging in again in a minute. Add and remove joints with other objects Change its permissions Track your camera - Control your camera - Teleport you + Control your camera + Teleport you + Manage your estates silently + Change your default animations + Not Connected -- cgit v1.2.3 From 5dbb0a31da9bb3fb5ff7c5ead5d90808f9e4b797 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 11:37:11 -0700 Subject: MAINT-2510 : Time can go backwards for viewer animation, assert fires. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 306f29f703..7a857ea7be 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -288,7 +288,7 @@ public: ~LLMeshSkinInfoResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, @@ -313,7 +313,7 @@ public: ~LLMeshDecompositionResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, @@ -338,7 +338,7 @@ public: ~LLMeshPhysicsShapeResponder() { - llassert(mProcessed); + //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 } virtual void completedRaw(U32 status, const std::string& reason, -- cgit v1.2.3 From 8e54ae95d1417f51edd6c68c389fd6cd7322ca52 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 15:25:14 -0700 Subject: Prototype code for "simple imposter" mode rendering of avatars. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 26 ++- indra/newview/lldrawpoolavatar.cpp | 135 ++++++------- indra/newview/llviewermenu.cpp | 59 ++++++ indra/newview/llvoavatar.cpp | 221 ++++++++++++++++----- indra/newview/llvoavatar.h | 29 ++- indra/newview/pipeline.cpp | 14 +- .../skins/default/xui/en/menu_attachment_other.xml | 35 ++++ .../skins/default/xui/en/menu_avatar_other.xml | 39 +++- indra/newview/skins/default/xui/en/menu_viewer.xml | 9 + 9 files changed, 440 insertions(+), 127 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d2c3c6089c..21c278fd3b 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9370,7 +9370,7 @@ RenderAutoMuteRenderCostLimit Comment - Maximum render cost before an avatar is automatically visually muted (0 for no limit). + Maximum render weight before an avatar is automatically visually muted (0 to not use this limit). Persist 1 Type @@ -9381,7 +9381,7 @@ RenderAutoMuteSurfaceAreaLimit Comment - Maximum surface area of attachments before an avatar is automatically visually muted (0 for no limit). + Maximum surface area of attachments before an avatar is automatically visually muted (0 to not use this limit). Persist 1 Type @@ -9389,6 +9389,28 @@ Value 0 + RenderAutoMuteEnabled + + Comment + Apply visual muting to high cost, non-friends, not in IM, or somewhat distant avatars + Persist + 1 + Type + Boolean + Value + 0 + + RenderAutoMuteVisibilityRank + + Comment + Number of avatars to show normally for visual muting mode. + Persist + 1 + Type + U32 + Value + 0 + RenderAutoHideSurfaceAreaLimit diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index d5afa25c9c..3d7407ab54 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1163,88 +1163,85 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } else if (pass >= 3 && pass <= 9) { //render rigged attachments - if (!avatarp->isVisuallyMuted()) + if (!avatarp->isVisuallyMuted()) // These details are skipped for visually muted (plain imposter) avatars { - if (pass == 3) - { - if (is_deferred_render) - { - renderDeferredRiggedSimple(avatarp); - } - else - { - renderRiggedSimple(avatarp); - } - } + if (pass == 3) // To do - use switch statement + { + if (is_deferred_render) + { + renderDeferredRiggedSimple(avatarp); + } + else + { + renderRiggedSimple(avatarp); + } + } else if (pass == 4) - { - if (is_deferred_render) - { - renderDeferredRiggedBump(avatarp); - } - else - { - renderRiggedFullbright(avatarp); - } - } + { + if (is_deferred_render) + { + renderDeferredRiggedBump(avatarp); + } + else + { + renderRiggedFullbright(avatarp); + } + } else if (pass == 5) - { - renderRiggedShinySimple(avatarp); - } + { + renderRiggedShinySimple(avatarp); + } else if (pass == 6) - { - renderRiggedFullbrightShiny(avatarp); - } - else if (pass >= 7 && pass < 9) - { - if (pass == 7) - { - renderRiggedAlpha(avatarp); - } - else if (pass == 8) - { - renderRiggedFullbrightAlpha(avatarp); - } - } + { + renderRiggedFullbrightShiny(avatarp); + } + else if (pass == 7) + { + renderRiggedAlpha(avatarp); + } + else if (pass == 8) + { + renderRiggedFullbrightAlpha(avatarp); + } else if (pass == 9) - { - renderRiggedGlow(avatarp); - } + { + renderRiggedGlow(avatarp); + } } } else { - if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) - { - LLMatrix4 rot_mat; - LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); - LLMatrix4 cfr(OGL_TO_CFR_ROTATION); - rot_mat *= cfr; + if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) + { + LLMatrix4 rot_mat; + LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); + LLMatrix4 cfr(OGL_TO_CFR_ROTATION); + rot_mat *= cfr; - LLVector4 wind; - wind.setVec(avatarp->mWindVec); - wind.mV[VW] = 0; - wind = wind * rot_mat; - wind.mV[VW] = avatarp->mWindVec.mV[VW]; - - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV); - F32 phase = -1.f * (avatarp->mRipplePhase); - - F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f); - LLVector4 sin_params(freq, freq, freq, phase); - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV); - - LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f); - gravity = gravity * rot_mat; - sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV); - } + LLVector4 wind; + wind.setVec(avatarp->mWindVec); + wind.mV[VW] = 0; + wind = wind * rot_mat; + wind.mV[VW] = avatarp->mWindVec.mV[VW]; + + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_WIND, 1, wind.mV); + F32 phase = -1.f * (avatarp->mRipplePhase); + + F32 freq = 7.f + (noise1(avatarp->mRipplePhase) * 2.f); + LLVector4 sin_params(freq, freq, freq, phase); + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_SINWAVE, 1, sin_params.mV); + + LLVector4 gravity(0.f, 0.f, -CLOTHING_GRAVITY_EFFECT, 0.f); + gravity = gravity * rot_mat; + sVertexProgram->uniform4fv(LLViewerShaderMgr::AVATAR_GRAVITY, 1, gravity.mV); + } - if( !single_avatar || (avatarp == single_avatar) ) - { - avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + if( !single_avatar || (avatarp == single_avatar) ) + { + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + } } } -} void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4c99e65c99..aab4d93882 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2934,6 +2934,63 @@ bool enable_object_unmute() } } + +// 0 = normal, 1 = always, 2 = never +class LLAvatarCheckImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + return (avatar->getVisualMuteSettings() == LLVOAvatar::VISUAL_MUTE_NOT_SET); + case 1: + return (avatar->getVisualMuteSettings() == LLVOAvatar::ALWAYS_VISUAL_MUTE); + case 2: + return (avatar->getVisualMuteSettings() == LLVOAvatar::NEVER_VISUAL_MUTE); + default: + return false; + } + } // handleEvent() +}; + +// 0 = normal, 1 = always, 2 = never +class LLAvatarSetImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 1: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 2: + avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); + return true; + default: + return false; + } + } // handleEvent() +}; + + class LLObjectMute : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8644,6 +8701,8 @@ void initialize_menus() view_listener_t::addMenu( new LLCheckPanelPeopleTab(), "SideTray.CheckPanelPeopleTab"); // Avatar pie menu + view_listener_t::addMenu(new LLAvatarCheckImposterMode(), "Avatar.CheckImposterMode"); + view_listener_t::addMenu(new LLAvatarSetImposterMode(), "Avatar.SetImposterMode"); view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact"); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7d099d690a..cce4925e0a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -62,6 +62,7 @@ #include "llhudmanager.h" #include "llhudnametag.h" #include "llhudtext.h" // for mText/mDebugText +#include "llimview.h" #include "llinitparam.h" #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" @@ -784,6 +785,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastPelvisToFoot = 0.0f; mPelvisFixup = 0.0f; mLastPelvisFixup = 0.0f; + + mCachedVisualMute = !isSelf(); + mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0; + mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET; + + F32 color_value = (F32) (getID().mData[0]); + mMutedAVColor = calcMutedAVColor(color_value, 0, 256); } std::string LLVOAvatar::avString() const @@ -3435,24 +3443,82 @@ void LLVOAvatar::slamPosition() mRoot.updateWorldMatrixChildren(); } -bool LLVOAvatar::isVisuallyMuted() const +bool LLVOAvatar::isVisuallyMuted() { - bool ret = false; + bool muted = false; + + // Priority order (highest priority first) + // * own avatar is never visually muted + // * if on the "always draw normally" list, draw them normally + // * if on the "always visually mute" list, mute them + // * draw them normally if they meet the following criteria: + // - within the closest N avatars OR on friends list OR in an IM chat + // - AND aren't over the thresholds + // * otherwise visually mute all other avatars if (!isSelf()) { + static LLCachedControl render_mute_enabled(gSavedSettings, "RenderAutoMuteEnabled"); static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - - U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5)); + static LLCachedControl visibility_rank(gSavedSettings, "RenderAutoMuteVisibilityRank"); + + if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) + { // Always want to see this AV as an imposter + muted = true; + } + else if (mVisuallyMuteSetting == NEVER_VISUAL_MUTE) + { // Never show as imposter + muted = false; + } + else if (render_mute_enabled) + { + F64 now = LLFrameTimer::getTotalSeconds(); + + if (now < mCachedVisualMuteUpdateTime) + { // Use cached mute value + muted = mCachedVisualMute; + } + else + { // Determine if visually muted or not + + U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5)); - ret = LLMuteList::getInstance()->isMuted(getID()) || - (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || - (mVisualComplexity > max_cost && max_render_cost > 0); + muted = LLMuteList::getInstance()->isMuted(getID()) || + (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || + (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || + (mVisualComplexity > max_cost && max_render_cost > 0); + + // Could be part of the grand || collection above, but yanked out to make the logic visible + if (!muted) + { + if (visibility_rank > 0) + { // They are above the visibilty rank - mute them + muted = (mVisibilityRank > visibility_rank); + } + + if (muted || // Don't mute friends or IMs + visibility_rank == 0) + { + muted = !(LLAvatarTracker::instance().isBuddy(getID())); + if (muted) + { // Not a friend, so they are muted ... are they in an IM? + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,getID()); + muted = !gIMMgr->hasSession(session_id); + } + } + } + + // Save visual mute state and set interval for updating + const F64 SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES = 1.5; + mCachedVisualMuteUpdateTime = now + SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES; + mCachedVisualMute = muted; + } + } } - return ret; + return muted; } //------------------------------------------------------------------------ @@ -3509,7 +3575,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // the rest should only be done occasionally for far away avatars //-------------------------------------------------------------------- - if (visible && (!isSelf() || isVisuallyMuted()) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) + bool visually_muted = isVisuallyMuted(); + if (visible && (!isSelf() || visually_muted) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { const LLVector4a* ext = mDrawable->getSpatialExtents(); LLVector4a size; @@ -3518,8 +3585,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); - if (isVisuallyMuted()) - { // muted avatars update at 16 hz + if (visually_muted) + { // visually muted avatars update at 16 hz mUpdatePeriod = 16; } else if (mVisibilityRank <= LLVOAvatar::sMaxVisible || @@ -4295,23 +4362,23 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) { - bool muted = isVisuallyMuted(); + bool visually_muted = isVisuallyMuted(); if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_HEAD]->render(mAdjustedPixelArea, TRUE, mIsDummy); first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_UPPER_BODY]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy || muted) + if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy || visually_muted) { num_indices += mMeshLOD[MESH_ID_LOWER_BODY]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -8396,7 +8463,7 @@ void LLVOAvatar::updateImpostors() LLCharacter::sAllowInstancesChange = TRUE ; } -BOOL LLVOAvatar::isImpostor() const +BOOL LLVOAvatar::isImpostor() { return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; } @@ -8441,15 +8508,13 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d angle.mV[2] = da; } + void LLVOAvatar::idleUpdateRenderCost() { static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - static const U32 ARC_BODY_PART_COST = 200; static const U32 ARC_LIMIT = 20000; - static std::set all_textures; - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES)) { //set debug text to attachment geometry bytes here so render cost will override setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea)); @@ -8460,6 +8525,69 @@ void LLVOAvatar::idleUpdateRenderCost() return; } + calculateUpdateRenderCost(); // Update mVisualComplexity if needed + + doRenderCostNagging(max_render_cost); // Remind the user their AV is too complex + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) + { + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); + setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity)); + F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); + F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f); + mText->setColor(LLColor4(red,green,0,1)); + } +} + + +// Remind the user about their expensive avatar +void LLVOAvatar::doRenderCostNagging(U32 max_render_cost) +{ + if (isSelf()) + { + static S32 sOldComplexity = 0; + static F64 sLastRenderCostNagTime = 0.0; + + const F64 RENDER_NAG_INTERVAL = 60.0; + + F64 now = LLFrameTimer::getTotalSeconds(); + if (sLastRenderCostNagTime > 0.0 && + (now - sLastRenderCostNagTime) > RENDER_NAG_INTERVAL && + sOldComplexity != mVisualComplexity) + { + sOldComplexity = mVisualComplexity; + + if (max_render_cost > 0) + { //pop up notification that you have exceeded a render cost limit + if (mVisualComplexity > max_render_cost+max_render_cost/2) + { + LLNotificationsUtil::add("ExceededHighDetailRenderCost"); + sLastRenderCostNagTime = now; + } + else if (mVisualComplexity > max_render_cost) + { + LLNotificationsUtil::add("ExceededMidDetailRenderCost"); + sLastRenderCostNagTime = now; + } + else if (mVisualComplexity > max_render_cost/2) + { + LLNotificationsUtil::add("ExceededLowDetailRenderCost"); + sLastRenderCostNagTime = now; + } + } + } + } +} + + +// Calculations for mVisualComplexity value +void LLVOAvatar::calculateUpdateRenderCost() +{ + static const U32 ARC_BODY_PART_COST = 200; + + // Diagnostic list of all textures on our avatar + static std::set all_textures; + if (mVisualComplexityStale) { mVisualComplexityStale = FALSE; @@ -8526,8 +8654,6 @@ void LLVOAvatar::idleUpdateRenderCost() } - - // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. // Could be wrapped in a debug option if output becomes problematic. @@ -8568,34 +8694,37 @@ void LLVOAvatar::idleUpdateRenderCost() } } - if (isSelf() && max_render_cost > 0 && mVisualComplexity != cost) - { //pop up notification that you have exceeded a render cost limit - if (cost > max_render_cost+max_render_cost/2) - { - LLNotificationsUtil::add("ExceededHighDetailRenderCost"); - } - else if (cost > max_render_cost) - { - LLNotificationsUtil::add("ExceededMidDetailRenderCost"); - } - else if (cost > max_render_cost/2) - { - LLNotificationsUtil::add("ExceededLowDetailRenderCost"); - } - } - mVisualComplexity = cost; } +} - - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) - { - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity)); - F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); - F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f); - mText->setColor(LLColor4(red,green,0,1)); - } + +// static +LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) +{ + F32 clamped_value = llmin(value, (F32) range_high); + clamped_value = llmax(value, (F32) range_low); + F32 spectrum = (clamped_value / range_high); // spectrum is between 0 and 1.f + + // Array of colors. These are arranged so only one RGB color changes between each step, + // and it loops back to red so there is an even distribution. It is not a heat map + const S32 NUM_SPECTRUM_COLORS = 7; + static LLColor4 * spectrum_color[NUM_SPECTRUM_COLORS] = { &LLColor4::red, &LLColor4::magenta, &LLColor4::blue, &LLColor4::cyan, &LLColor4::green, &LLColor4::yellow, &LLColor4::red }; + + spectrum = spectrum * (NUM_SPECTRUM_COLORS - 1); // Scale to range of number of colors + S32 spectrum_index_1 = floor(spectrum); // Desired color will be after this index + S32 spectrum_index_2 = spectrum_index_1 + 1; // and before this index (inclusive) + F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1) + + LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween); + //new_color.normalize(); + + //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color + // << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 + // << " and fractBetween " << fractBetween + // << llendl; + + return new_color; } // static diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 386d9d7746..0e7bf7a6c9 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,7 +253,14 @@ public: static void invalidateNameTags(); void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); + void doRenderCostNagging(U32 max_render_cost); + void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } + + S32 getVisualComplexity() { return mVisualComplexity; }; + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + void idleUpdateBelowWater(); //-------------------------------------------------------------------- @@ -304,11 +311,14 @@ public: return mPhases; } + static LLColor4 calcMutedAVColor(F32 value, S32 range_low, S32 range_high); + protected: BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); F32 calcMorphAmount(); + private: BOOL mFirstFullyVisible; BOOL mFullyLoaded; @@ -317,6 +327,7 @@ private: S32 mFullyLoadedFrameCounter; S32 mVisualComplexity; BOOL mVisualComplexityStale; + LLColor4 mMutedAVColor; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; @@ -437,7 +448,16 @@ private: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); - bool isVisuallyMuted() const; + bool isVisuallyMuted(); + + enum VisualMuteSettings + { + VISUAL_MUTE_NOT_SET = 0, + ALWAYS_VISUAL_MUTE = 1, + NEVER_VISUAL_MUTE = 2 + }; + void setVisualMuteSettings(VisualMuteSettings set) { mVisuallyMuteSetting = set; }; + VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; }; U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -461,6 +481,11 @@ private: S32 mUpdatePeriod; S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. + bool mCachedVisualMute; // cached return value for isVisuallyMuted() + F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute + + VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV + //-------------------------------------------------------------------- // Morph masks //-------------------------------------------------------------------- @@ -493,7 +518,7 @@ private: // Impostors //-------------------------------------------------------------------- public: - BOOL isImpostor() const; + BOOL isImpostor(); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index df7a3c7593..61e42bbcee 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2862,7 +2862,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) llassert(vobj); // trying to catch a bad assumption if (vobj) // this test may not be needed, see above { - const LLVOAvatar* av = vobj->asAvatar(); + LLVOAvatar* av = vobj->asAvatar(); if (av && av->isImpostor()) { return; @@ -10103,11 +10103,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); - bool muted = avatar->isVisuallyMuted(); + bool visually_muted = avatar->isVisuallyMuted(); pushRenderTypeMask(); - if (muted) + if (visually_muted) { andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); } @@ -10251,7 +10251,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) F32 old_alpha = LLDrawPoolAvatar::sMinimumAlpha; - if (muted) + if (visually_muted) { //disable alpha masking for muted avatars (get whole skin silhouette) LLDrawPoolAvatar::sMinimumAlpha = 0.f; } @@ -10282,7 +10282,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLDisable blend(GL_BLEND); - if (muted) + if (visually_muted) { gGL.setColorMask(true, true); @@ -10317,8 +10317,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) gGL.diffuseColor4ub(64,64,64,255); } else - { //blue visually muted avatar - gGL.diffuseColor4ub(72,61,139,255); + { // Visually muted avatar + gGL.diffuseColor4fv( avatar->getMutedAVColor().mV ); } { diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 00d4b1dab1..87fa7c3f00 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -104,8 +104,43 @@ + + + + + + + + + + + + + + + + + + - @@ -95,8 +97,43 @@ + + + + + + + + + + + + + + + + +
+ + + + Date: Wed, 20 Mar 2013 15:25:41 -0700 Subject: Don't assert on HTTP_NOT_FOUND for some mesh data. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 7a857ea7be..809f85a7b5 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2177,7 +2177,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, // and (somewhat more optional than the others) retries // again after some set period of time - llassert(status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); + llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); if (status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR) { //retry -- cgit v1.2.3 From c9bdc734fd9d48de263999226c49b557d5c5af81 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 11:29:32 -0700 Subject: MAINT-2518 : Viewer LLViewerTextureList::removeImageFromList() shouldn't crash Reviewed by Kelly. --- indra/newview/llviewertexturelist.cpp | 60 ++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 82d990cf97..466d75233b 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -515,15 +515,17 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) llassert_always(mInitialized) ; llassert(image); if (image->isInImageList()) - { - llerrs << "LLViewerTextureList::addImageToList - Image already in list" << llendl; + { // Flag is already set? + llwarns << "LLViewerTextureList::addImageToList - image " << image->getID() << " already in list" << llendl; } - if((mImageList.insert(image)).second != true) + else { - llerrs << "Error happens when insert image to mImageList!" << llendl ; + if((mImageList.insert(image)).second != true) + { + llwarns << "Error happens when insert image " << image->getID() << " into mImageList!" << llendl ; + } + image->setInImageList(TRUE) ; } - - image->setInImageList(TRUE) ; } void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) @@ -531,24 +533,46 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) assert_main_thread(); llassert_always(mInitialized) ; llassert(image); - if (!image->isInImageList()) + + S32 count = 0; + if (image->isInImageList()) { - llinfos << "RefCount: " << image->getNumRefs() << llendl ; + count = mImageList.erase(image) ; + if(count != 1) + { + llwarns << "Image " << image->getID() + << " had mInImageList set but mImageList.erase() returned " << count + << llendl; + } + } + else + { // Something is wrong, image is expected in list or callers should check first + llwarns << "Calling removeImageFromList() for " << image->getID() + << " but doesn't have mInImageList set" + << " ref count is " << image->getNumRefs() + << llendl; uuid_map_t::iterator iter = mUUIDMap.find(image->getID()); - if(iter == mUUIDMap.end() || iter->second != image) + if(iter == mUUIDMap.end()) + { + llwarns << "Image " << image->getID() << " is also not in mUUIDMap!" << llendl ; + } + else if (iter->second != image) + { + llwarns << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << llendl ; + } + else { - llinfos << "Image is not in mUUIDMap!" << llendl ; + llwarns << "Image " << image->getID() << " was in mUUIDMap with same pointer" << llendl ; + } + count = mImageList.erase(image) ; + if(count != 0) + { // it was in the list already? + llwarns << "Image " << image->getID() + << " had mInImageList false but mImageList.erase() returned " << count + << llendl; } - llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; } - S32 count = mImageList.erase(image) ; - if(count != 1) - { - llinfos << image->getID() << llendl ; - llerrs << "Error happens when remove image from mImageList: " << count << llendl ; - } - image->setInImageList(FALSE) ; } -- cgit v1.2.3 From fcf894af255e8b931af09883aa8ee2a900199d39 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 13:13:09 -0700 Subject: Lighten imposter avatar colors a bit per feedeback. --- indra/newview/llvoavatar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cce4925e0a..76df6dc0ed 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8717,7 +8717,8 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1) LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween); - //new_color.normalize(); + new_color.normalize(); + new_color *= 0.9f; //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color // << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 -- cgit v1.2.3 From 395f8baf03622f3a36b03b8e31679e3b594b1757 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 14:03:39 -0700 Subject: Fix simple bug in LLAvatarSetImposterMode::handleEvent() --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index aab4d93882..2d18600540 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2979,7 +2979,7 @@ class LLAvatarSetImposterMode : public view_listener_t avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); return true; case 1: - avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE); return true; case 2: avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); -- cgit v1.2.3 From e1d133d73f93f52193397c5fe9cbfa532f4359ed Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 16:54:21 -0700 Subject: MAINT-1452 : Viewer floods the log file with hundreds of exactly the same lines. Reviewed by Kelly --- indra/newview/llvovolume.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e0ed13a3a7..426ad8bc21 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1157,28 +1157,38 @@ void LLVOVolume::sculpt() S32 current_discard = getVolume()->getSculptLevel() ; if(current_discard < -2) { - static S32 low_sculpty_discard_warning_count = 100; - if (++low_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 low_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) low_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( low_sculpty_discard_warning_count < 10 || + (low_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is less than -2." << llendl; - low_sculpty_discard_warning_count = 0; + << " is less than -2." + << " Hit this " << low_sculpty_discard_warning_count << " times" + << llendl; } + low_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; } else if (current_discard > MAX_DISCARD_LEVEL) { - static S32 high_sculpty_discard_warning_count = 100; - if (++high_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 high_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) high_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( high_sculpty_discard_warning_count < 10 || + (high_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl; - high_sculpty_discard_warning_count = 0; + << " is more than than allowed max of " << MAX_DISCARD_LEVEL + << ". Hit this " << high_sculpty_discard_warning_count << " times" + << llendl; } + high_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; -- cgit v1.2.3 From 6bb7fd40d0fdc7902f1ac9db06a479121c177d0d Mon Sep 17 00:00:00 2001 From: Maestro Linden Date: Tue, 26 Mar 2013 21:25:10 +0000 Subject: MAINT-2507 Added syntax highlighting for new particle system settings (from MAINT-2410). Reviewed by Kelly. --- indra/newview/app_settings/keywords.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 56b549ab62..ef0f78d4d4 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -131,6 +131,7 @@ PSYS_PART_FOLLOW_VELOCITY_MASK PSYS_PART_TARGET_POS_MASK PSYS_PART_EMISSIVE_MASK PSYS_PART_TARGET_LINEAR_MASK +PSYS_PART_RIBBON_MASK PSYS_SRC_PATTERN PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN @@ -147,12 +148,24 @@ PSYS_SRC_ACCEL PSYS_SRC_TEXTURE PSYS_SRC_TARGET_KEY PSYS_SRC_OMEGA +PSYS_PART_BLEND_FUNC_SOURCE +PSYS_PART_BLEND_FUNC_DEST +PSYS_PART_START_GLOW +PSYS_PART_END_GLOW PSYS_SRC_PATTERN_DROP PSYS_SRC_PATTERN_EXPLODE PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY +PSYS_PART_BF_ONE +PSYS_PART_BF_ZERO +PSYS_PART_BF_DEST_COLOR +PSYS_PART_BF_SOURCE_COLOR +PSYS_PART_BF_ONE_MINUS_DEST_COLOR +PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR +PSYS_PART_BF_SOURCE_ALPHA +PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type OBJECT_NAME Used with llGetObjectDetails to get an object's name -- cgit v1.2.3 From d8dc74b83349752768d99b77c92a284955ee04e4 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 28 Mar 2013 16:06:07 -0700 Subject: MAINT-2426 : Viewer support for new simulator AvatarRenderInfo capability. Reviewed by Kelly --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 4 + indra/newview/llavatarrenderinfoaccountant.cpp | 360 +++++++++++++++++++++++++ indra/newview/llavatarrenderinfoaccountant.h | 54 ++++ indra/newview/llspatialpartition.cpp | 2 + indra/newview/llviewerregion.cpp | 5 + indra/newview/llviewerregion.h | 4 + indra/newview/llvoavatar.cpp | 3 + indra/newview/llvoavatar.h | 23 +- indra/newview/llvovolume.cpp | 2 + 10 files changed, 455 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llavatarrenderinfoaccountant.cpp create mode 100644 indra/newview/llavatarrenderinfoaccountant.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bd0169fb2f..cb96dfeb48 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -113,6 +113,7 @@ set(viewer_SOURCE_FILES llavatariconctrl.cpp llavatarlist.cpp llavatarlistitem.cpp + llavatarrenderinfoaccountant.cpp llavatarpropertiesprocessor.cpp llblockedlistitem.cpp llblocklist.cpp @@ -702,6 +703,7 @@ set(viewer_HEADER_FILES llavatarlist.h llavatarlistitem.h llavatarpropertiesprocessor.h + llavatarrenderinfoaccountant.h llblockedlistitem.h llblocklist.h llbox.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4745157c8b..7404d2d228 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -97,6 +97,7 @@ #include "llupdaterservice.h" #include "llfloatertexturefetchdebugger.h" #include "llspellcheck.h" +#include "llavatarrenderinfoaccountant.h" // Linden library includes #include "llavatarnamecache.h" @@ -4587,6 +4588,9 @@ void LLAppViewer::idle() gObjectList.updateApparentAngles(gAgent); } + // Update AV render info + LLAvatarRenderInfoAccountant::idle(); + { LLFastTimer t(FTM_AUDIO_UPDATE); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp new file mode 100644 index 0000000000..04a79f7d4c --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -0,0 +1,360 @@ +/** + * @file llavatarrenderinfoaccountant.cpp + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Precompiled header +#include "llviewerprecompiledheaders.h" +// associated header +#include "llavatarrenderinfoaccountant.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llcharacter.h" +#include "llhttpclient.h" +#include "lltimer.h" +#include "llviewerobjectlist.h" +#include "llviewerregion.h" +#include "llvoavatar.h" +#include "llworld.h" + + +// Use this for debugging +//#define LL_AVATAR_RENDER_INFO_LOG_SPAM + +static const std::string KEY_AGENTS = "agents"; // map +static const std::string KEY_WEIGHT = "weight"; // integer +static const std::string KEY_GEOMETRY = "geometry"; // integer +static const std::string KEY_SURFACE = "surface"; // float + +static const std::string KEY_IDENTIFIER = "identifier"; +static const std::string KEY_MESSAGE = "message"; +static const std::string KEY_ERROR = "error"; + + +// Send data updates about once per minute, only need per-frame resolution +LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; + + +// HTTP responder class for GET request for avatar render weight information +class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight GET: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight GET error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_AGENTS)) + { + const LLSD & agents = content[KEY_AGENTS]; + if (agents.isMap()) + { + LLSD::map_const_iterator report_iter = agents.beginMap(); + while (report_iter != agents.endMap()) + { + LLUUID target_agent_id = LLUUID(report_iter->first); + const LLSD & agent_info_map = report_iter->second; + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && + avatarp->isAvatar() && + agent_info_map.isMap()) + { // Extract the data for this avatar + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + if (agent_info_map.has(KEY_GEOMETRY)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentGeometryBytes(agent_info_map[KEY_GEOMETRY].asInteger()); + } + if (agent_info_map.has(KEY_SURFACE)) + { + ((LLVOAvatar *) avatarp)->setReportedAttachmentSurfaceArea((F32) agent_info_map[KEY_SURFACE].asReal()); + } + } + report_iter++; + } + } + } // has "agents" + else if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight info recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// HTTP responder class for POST request for avatar render weight information +class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight POST: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight POST error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + if (content.isMap()) + { + if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info POST error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight POST result recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // Build the render info to POST to the region + LLSD report = LLSD::emptyMap(); + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) + { + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + avatar->getRezzedStatus() == 2 && // Fully rezzed + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + { + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + } + if (avatar->getAttachmentGeometryBytes() > 0) + { + info[KEY_GEOMETRY] = (S32) avatar->getAttachmentGeometryBytes(); + } + if (avatar->getAttachmentSurfaceArea() > 0.f) + { + info[KEY_SURFACE] = avatar->getAttachmentSurfaceArea(); + } + if (info.size() > 0) + { + agents[avatar->getID().asString()] = info; + } + + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + } + iter++; + } + + report[KEY_AGENTS] = agents; + if (agents.size() > 0) + { + LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + } + } +} + + + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + // First send a request to get the latest data + LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + } +} + + +// static +// Called every frame - send render weight requests to every region +void LLAvatarRenderInfoAccountant::idle() +{ + if (sRenderInfoReportTimer.hasExpired()) + { + const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds + const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + + S32 num_avs = LLCharacter::sInstances.size(); + + // Check all regions and see if it's time to fetch/send data + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + if (regionp && + regionp->isAlive() && + regionp->capabilitiesReceived() && // Region has capability URLs available + regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + { + sendRenderInfoToRegion(regionp); + getRenderInfoFromRegion(regionp); + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); + } + } + + // We scanned all the regions, reset the request timer. + sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } +} + + +// static +// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region +// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// are returned for a new LLViewerRegion, and is the earliest time to get render info +void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() +{ + #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM + llinfos << "Viewer has new region capabilities" << llendl; + #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + + sRenderInfoReportTimer.resetWithExpiry(0.f); +} + diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h new file mode 100644 index 0000000000..5b4a4d3db2 --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -0,0 +1,54 @@ +/** + * @file llavatarrenderinfoaccountant.h + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#if ! defined(LL_llavatarrenderinfoaccountant_H) +#define LL_llavatarrenderinfoaccountant_H + +class LLViewerRegion; + +// Class to gather avatar rendering information +// that is sent to or fetched from regions. +class LLAvatarRenderInfoAccountant +{ +public: + LLAvatarRenderInfoAccountant() {}; + ~LLAvatarRenderInfoAccountant() {}; + + static void sendRenderInfoToRegion(LLViewerRegion * regionp); + static void getRenderInfoFromRegion(LLViewerRegion * regionp); + + static void expireRenderInfoReportTimer(); + + static void idle(); + +private: + // Send data updates about once per minute, only need per-frame resolution + static LLFrameTimer sRenderInfoReportTimer; +}; + +#endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */ diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 759e1a7b4c..1d30b19308 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1404,7 +1404,9 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) if (bridge->mAvatar.notNull()) { bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; + bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; + bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); } } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e4234a538d..eb5a0b8d37 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llavatarrenderinfoaccountant.h" #include "llcallingcard.h" #include "llcaphttpsender.h" #include "llcapabilitylistener.h" @@ -333,6 +334,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE + + mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired + setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer)); } @@ -1514,6 +1518,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("AgentState"); capabilityNames.append("AttachmentResources"); capabilityNames.append("AvatarPickerSearch"); + capabilityNames.append("AvatarRenderInfo"); capabilityNames.append("CharacterProperties"); capabilityNames.append("ChatSessionRequest"); capabilityNames.append("CopyInventoryFromNotecard"); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index c9fffaf30e..2d3a622e42 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -365,6 +365,8 @@ public: LLDynamicArray mMapAvatars; LLDynamicArray mMapAvatarIDs; + LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + private: LLViewerRegionImpl * mImpl; @@ -421,6 +423,8 @@ private: BOOL mReleaseNotesRequested; LLSD mSimulatorFeatures; + + LLFrameTimer mRenderInfoRequestTimer; }; inline BOOL LLViewerRegion::getAllowDamage() const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e5d44eb1f..1fc20fd207 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -662,6 +662,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSpecialRenderMode(0), mAttachmentGeometryBytes(0), mAttachmentSurfaceArea(0.f), + mReportedVisualComplexity(-1), + mReportedAttachmentGeometryBytes(-1), + mReportedAttachmentSurfaceArea(-1.f), mTurning(FALSE), mPelvisToFoot(0.f), mLastSkeletonSerialNum( 0 ), diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 0e7bf7a6c9..495d3e9483 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -257,9 +257,20 @@ public: void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } - S32 getVisualComplexity() { return mVisualComplexity; }; - S32 getUpdatePeriod() { return mUpdatePeriod; }; - const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + + S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + S32 getReportedAttachmentGeometryBytes() { return mReportedAttachmentGeometryBytes; }; //number of bytes in attached geometry + void setReportedAttachmentGeometryBytes(S32 value) { mReportedAttachmentGeometryBytes = value; }; + F32 getReportedAttachmentSurfaceArea() { return mReportedAttachmentSurfaceArea; }; //estimated surface area of attachments + void setReportedAttachmentSurfaceArea(F32 value) { mReportedAttachmentSurfaceArea = value; }; + + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + void idleUpdateBelowWater(); @@ -469,9 +480,13 @@ public: static void restoreGL(); BOOL mIsDummy; // for special views S32 mSpecialRenderMode; // special lighting - U32 mAttachmentGeometryBytes; //number of bytes in attached geometry + S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments + S32 mReportedVisualComplexity; // Numbers as reported by the SL server + S32 mReportedAttachmentGeometryBytes; //number of bytes in attached geometry + F32 mReportedAttachmentSurfaceArea; //estimated surface area of attachments + private: bool shouldAlphaMask(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 426ad8bc21..71ee2da216 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4242,7 +4242,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; + pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; + pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); } group->mGeometryBytes = 0; -- cgit v1.2.3 From ecbcef1224899d7f61860289fc079aae284a3360 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 29 Mar 2013 01:42:50 +0100 Subject: changed url to pdp15.lindenlab.com --- indra/newview/llpanelpeople.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ab82273ccd..10a783053b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1667,21 +1667,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::onLoginFbcButtonClicked() { LLFloaterWebContent::Params p; - p.url("https://cryptic-ridge-1632.herokuapp.com/"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/"); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://cryptic-ridge-1632.herokuapp.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/"); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 67726254a7d638a61025cbff53d88378f9b0ef04 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 29 Mar 2013 21:40:23 +0100 Subject: added response to successful FBC authentication --- indra/newview/llpanelpeople.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 10a783053b..8f138a821a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -78,6 +78,8 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; +static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -890,19 +892,18 @@ void LLPanelPeople::updateFbcTestList() std::string title = mFbcTestBrowserHandle.get()->getTitle(); // if the data is ready (if it says the magic word) - if (title.length() > 8 && title.substr(0, 8) == "FBCTEST ") + if (title.length() >= 2 && title[0] == ':') { - // get the list of friends' names from the title bar - std::vector names = LLStringUtil::getTokens(title.substr(8), ","); - - // display the names in the list - std::string label; - for (std::vector::const_iterator i = names.begin() + 1; i != names.end(); ++i) + // success! :) + if (title[1] == ')') + { + mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); + } + // failure :( + else if (title[1] == '(') { - label += *i; - label += "\n"; + mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); } - mFbcTestText->setText(label); // close the browser window mFbcTestBrowserHandle.get()->die(); @@ -1667,21 +1668,21 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::onLoginFbcButtonClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://pdp15.lindenlab.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=https://pdp15.lindenlab.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 11aed44bab1da46e0fadb458464e3cfd7ea2be43 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 29 Mar 2013 15:28:41 -0700 Subject: Using curl to access pdp with the has-acces-token API and then upon receipt will open the webview when no token exists for the user. --- indra/newview/llpanelpeople.cpp | 42 ++++++++++++++++++++++++++++++++++++++--- indra/newview/llpanelpeople.h | 2 +- 2 files changed, 40 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 10a783053b..e229fd3cf3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1664,11 +1664,47 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) } } +class LLFacebookLogin : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) + { + llinfos << content << llendl; + + bool has_token = content["has_access_token"].asBoolean(); + + //use the token to pull down graph data + if(has_token) + { + + } + //request user to login + else + { + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); + mPanelPeople->openFacebookWeb(p); + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + void LLPanelPeople::onLoginFbcButtonClicked() { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=https://pdp15.lindenlab.com/authenticate/" + gAgentID.asString()); - openFacebookWeb(p); + LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this)); } void LLPanelPeople::onFacebookAppRequestClicked() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 39cdbc9bd7..dadd273603 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -55,6 +55,7 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + void openFacebookWeb(LLFloaterWebContent::Params& p); // internals class Updater; @@ -118,7 +119,6 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); - void openFacebookWeb(LLFloaterWebContent::Params& p); //returns false only if group is "none" bool isRealGroup(); -- cgit v1.2.3 From bdf8cacc4cd216d7df8212177587a21979d2a883 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 1 Apr 2013 14:35:12 -0700 Subject: MAINT-2511 : Mesh requests not handling time outs. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 809f85a7b5..5154809240 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -288,7 +288,14 @@ public: ~LLMeshSkinInfoResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -313,7 +320,14 @@ public: ~LLMeshDecompositionResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshDecomposition(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -338,7 +352,14 @@ public: ~LLMeshPhysicsShapeResponder() { - //llassert(mProcessed); this will assert due to a timeout (not handled?) MAINT-2511 + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -1984,7 +2005,7 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } @@ -2047,7 +2068,7 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } @@ -2111,7 +2132,7 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } -- cgit v1.2.3 From 4fe3e00aad663d1afd35007b4e8093ae4e58e92e Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 02:10:04 +0100 Subject: added request to /get-friends/ after FB login --- indra/newview/llpanelpeople.cpp | 67 +++++++++++++++++++++++++++++++++++------ indra/newview/llpanelpeople.h | 3 ++ 2 files changed, 61 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 01d68cb9a0..87bede76bc 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -896,8 +896,11 @@ void LLPanelPeople::updateFbcTestList() { // success! :) if (title[1] == ')') - { + { mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); + + // get the friends + getFacebookFriends(); } // failure :( else if (title[1] == '(') @@ -1665,13 +1668,28 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) } } -class LLFacebookLogin : public LLHTTPClient::Responder +void LLPanelPeople::showFacebookFriends(const LLSD& friends) +{ + std::string text = "Facebook Friends"; + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + { + std::string name = (*i)["name"].asString(); + std::string id = (*i)["id"].asString(); + + text += "\n" + name + " (" + id + ")"; + } + + // display the facebook friend data on the test text box + mFbcTestText->setText(text); +} + +class FacebookLoginResponder : public LLHTTPClient::Responder { public: LLPanelPeople * mPanelPeople; - LLFacebookLogin(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -1686,15 +1704,41 @@ public: //use the token to pull down graph data if(has_token) { - + mPanelPeople->getFacebookFriends(); } //request user to login else { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); mPanelPeople->openFacebookWeb(p); -} + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + +class FacebookFriendsResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) + { + llinfos << content << llendl; + + // display the friend data + mPanelPeople->showFacebookFriends(content["friends"]); } else { @@ -1703,9 +1747,14 @@ public: } }; +void LLPanelPeople::getFacebookFriends() +{ + LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this)); +} + void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get("https://pdp15.lindenlab.com/has-access-token/" + gAgentID.asString(), new LLFacebookLogin(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this)); } void LLPanelPeople::onFacebookAppRequestClicked() @@ -1718,7 +1767,7 @@ void LLPanelPeople::onFacebookAppRequestClicked() void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Test&link=http://www.cnet.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dadd273603..86bcac3ede 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -55,7 +55,10 @@ public: // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + void openFacebookWeb(LLFloaterWebContent::Params& p); + void showFacebookFriends(const LLSD& friends); + void getFacebookFriends(); // internals class Updater; -- cgit v1.2.3 From 0a4ab0c64790b82edba369891a1983cd4b7f84f2 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 1 Apr 2013 23:08:16 -0700 Subject: Some not so clean code to use to show facebook friends using the existing avatar list. --- indra/newview/llavatarlist.cpp | 36 +++++++++++++++++++++ indra/newview/llavatarlist.h | 27 +++++++++++++--- indra/newview/llpanelpeople.cpp | 37 ++++------------------ indra/newview/llpanelpeople.h | 2 ++ .../newview/skins/default/xui/en/panel_people.xml | 36 +++++++++++++++++---- 5 files changed, 96 insertions(+), 42 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 771419f60a..37de2d5793 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -624,3 +624,39 @@ void LLAvalineListItem::setName(const std::string& name) LLAvatarListItem::setAvatarToolTip(formatted_phone); } } + +/************************************************************************/ +/* class LLAvatarListSocial */ +/************************************************************************/ + +static LLDefaultChildRegistry::Register s("avatar_list_social"); + +LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p) +{ + +} + +void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) +{ + LLAvatarListItem* item = new LLAvatarListItem(); + // This sets the name as a side effect + item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); + item->setAvatarName(name); + item->setOnline(mIgnoreOnlineStatus ? true : is_online); + item->showLastInteractionTime(mShowLastInteractionTime); + + item->setAvatarIconVisible(mShowIcons); + item->setShowInfoBtn(mShowInfoBtn); + item->setShowProfileBtn(mShowProfileBtn); + item->showSpeakingIndicator(mShowSpeakingIndicator); + item->setShowPermissions(mShowPermissions); + + item->setDoubleClickCallback(boost::bind(&LLAvatarListSocial::onItemDoubleClicked, this, _1, _2, _3, _4)); + + addItem(item, id, pos); +} + +void LLAvatarListSocial::refresh() +{ + +} diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 4814a88a79..cbe5956493 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -97,10 +97,12 @@ public: void addAvalineItem(const LLUUID& item_id, const LLUUID& session_id, const std::string& item_name); void handleDisplayNamesOptionChanged(); -protected: - void refresh(); + - void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); +protected: + virtual void refresh(); + virtual void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + void computeDifference( const uuid_vec_t& vnew, uuid_vec_t& vadded, @@ -110,8 +112,6 @@ protected: void onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask); void updateAvatarNames(); -private: - bool isAvalineItemSelected(); bool mIgnoreOnlineStatus; @@ -205,4 +205,21 @@ private: bool mIsHideNumber; }; +class LLAvatarListSocial : public LLAvatarList +{ + public: + struct Params : public LLInitParam::Block + { + + }; + + LLAvatarListSocial(const Params&); + + void addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + + protected: + /*virtual*/ void refresh(); +}; + + #endif // LL_LLAVATARLIST_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 01d68cb9a0..7a3e6abb7f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -647,7 +647,9 @@ BOOL LLPanelPeople::postBuild() mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); - mFbcTestText = getChild(FBCTEST_TAB_NAME)->getChild("fbctest_label"); + LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -883,35 +885,10 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (!mFbcTestText) - return; - - if (mFbcTestBrowserHandle.get()) - { - // get the browser data (from the title bar, of course!) - std::string title = mFbcTestBrowserHandle.get()->getTitle(); - - // if the data is ready (if it says the magic word) - if (title.length() >= 2 && title[0] == ':') - { - // success! :) - if (title[1] == ')') - { - mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); - } - // failure :( - else if (title[1] == '(') - { - mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); - } - - // close the browser window - mFbcTestBrowserHandle.get()->die(); - - // stop updating - mFbcTestListUpdater->setActive(false); - } - } + mFacebookFriends->addSocialItem(LLUUID(), "TEST", false); + + // stop updating + mFbcTestListUpdater->setActive(false); } void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dadd273603..a00b5be516 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -34,6 +34,7 @@ #include "llvoiceclient.h" class LLAvatarList; +class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; @@ -149,6 +150,7 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; + LLAvatarListSocial* mFacebookFriends; LLNetMap* mMiniMap; LLTextBox* mFbcTestText; diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index cbb6aff4ea..f3334fd767 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -585,14 +585,36 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="fbctest_panel" top="0" width="313"> - + + height="172" + min_height="150" + name="tab_facebook" + title="Facebook Friends"> + + + Date: Mon, 1 Apr 2013 23:48:51 -0700 Subject: removing the facebook test label which appends friends names. Now using the avatar list widgit. --- indra/newview/llpanelpeople.cpp | 15 +++------------ indra/newview/llpanelpeople.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 05dcdd97fa..c7e10d67db 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -545,7 +545,6 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mFbcTestText(NULL), mNearbyGearButton(NULL), mFriendsGearButton(NULL), mGroupsGearButton(NULL), @@ -648,7 +647,6 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); @@ -885,9 +883,6 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (!mFbcTestText) - return; - if (mFbcTestBrowserHandle.get()) { // get the browser data (from the title bar, of course!) @@ -899,15 +894,13 @@ void LLPanelPeople::updateFbcTestList() // success! :) if (title[1] == ')') { - mFbcTestText->setText(std::string("okay, now we can get the list of friends!")); - // get the friends getFacebookFriends(); } // failure :( else if (title[1] == '(') { - mFbcTestText->setText(std::string("hmm, the authentication failed somehow")); + llinfos << "authentication failed" << llendl; } // close the browser window @@ -1678,11 +1671,9 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = (*i)["name"].asString(); std::string id = (*i)["id"].asString(); - text += "\n" + name + " (" + id + ")"; + text = name + " (" + id + ")"; + mFacebookFriends->addSocialItem(LLUUID(NULL), text, false); } - - // display the facebook friend data on the test text box - mFbcTestText->setText(text); } class FacebookLoginResponder : public LLHTTPClient::Responder diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dab5d74f77..45ed7e1039 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -155,8 +155,6 @@ private: LLGroupList* mGroupList; LLAvatarListSocial* mFacebookFriends; LLNetMap* mMiniMap; - - LLTextBox* mFbcTestText; LLHandle mGroupPlusMenuHandle; LLHandle mNearbyViewSortMenuHandle; -- cgit v1.2.3 From 37b57559538aede47d46274208a6974d93caad1c Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 21:07:46 +0100 Subject: updated to work with new /get-friends/ response format --- indra/newview/llavatarlist.cpp | 10 ++++++---- indra/newview/llpanelpeople.cpp | 34 +++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 37de2d5793..a407515621 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -626,7 +626,7 @@ void LLAvalineListItem::setName(const std::string& name) } /************************************************************************/ -/* class LLAvatarListSocial */ +/* class LLAvatarListSocial */ /************************************************************************/ static LLDefaultChildRegistry::Register s("avatar_list_social"); @@ -638,10 +638,12 @@ LLAvatarListSocial::LLAvatarListSocial(const Params& p) : LLAvatarList(p) void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { + LLAvatarName avatar_name; + bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); + LLAvatarListItem* item = new LLAvatarListItem(); - // This sets the name as a side effect - item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); - item->setAvatarName(name); + item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect + item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c7e10d67db..183714b436 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1665,14 +1665,16 @@ void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { - std::string text = "Facebook Friends"; + mFacebookFriends->clear(); + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) { - std::string name = (*i)["name"].asString(); - std::string id = (*i)["id"].asString(); + const LLSD& fb_friend = *i; - text = name + " (" + id + ")"; - mFacebookFriends->addSocialItem(LLUUID(NULL), text, false); + std::string name = fb_friend["name"].asString(); + LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL); + + mFacebookFriends->addSocialItem(agent_id, name, false); } } @@ -1692,20 +1694,19 @@ public: { llinfos << content << llendl; + // use the token to pull down graph data bool has_token = content["has_access_token"].asBoolean(); - - //use the token to pull down graph data - if(has_token) + if (has_token) { mPanelPeople->getFacebookFriends(); } - //request user to login + // request user to login else { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + LLFloaterWebContent::Params p; + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); mPanelPeople->openFacebookWeb(p); -} + } } else { @@ -1731,7 +1732,14 @@ public: llinfos << content << llendl; // display the friend data - mPanelPeople->showFacebookFriends(content["friends"]); + if (content.has("friends")) + { + mPanelPeople->showFacebookFriends(content["friends"]); + } + else if (content.has("error")) + { + llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl; + } } else { -- cgit v1.2.3 From 0c55af934d19145993c6ec0756397fa75f9a9842 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 2 Apr 2013 21:46:00 +0100 Subject: added display of FB name to SL user in FBCTEST list --- indra/newview/llavatarlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index a407515621..fb6d042807 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -643,7 +643,7 @@ void LLAvatarListSocial::addSocialItem(const LLUUID& id, const std::string& name LLAvatarListItem* item = new LLAvatarListItem(); item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect - item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName : name); + item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); -- cgit v1.2.3 From caad92499e2a2f8419e4c217c74f54cf4f2be54c Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 01:10:19 +0100 Subject: updated to account for new routes in FBC Services --- indra/newview/llpanelpeople.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 183714b436..d2e764df13 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1678,33 +1678,31 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } } -class FacebookLoginResponder : public LLHTTPClient::Responder +class FacebookConnectedResponder : public LLHTTPClient::Responder { public: LLPanelPeople * mPanelPeople; + bool mShowLoginIfNotConnected; - FacebookLoginResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {} /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { - // in case of invalid characters, the avatar picker returns a 400 - // just set it to process so it displays 'not found' - if (isGoodStatus(status) || status == 400) + if (isGoodStatus(status)) { llinfos << content << llendl; - // use the token to pull down graph data - bool has_token = content["has_access_token"].asBoolean(); - if (has_token) + // pull down graph data if already contected + if (content["connected"]) { mPanelPeople->getFacebookFriends(); } - // request user to login - else + // show the facebook login page + else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/authenticate/" + gAgentID.asString()); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect"); mPanelPeople->openFacebookWeb(p); } } @@ -1725,9 +1723,7 @@ public: /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { - // in case of invalid characters, the avatar picker returns a 400 - // just set it to process so it displays 'not found' - if (isGoodStatus(status) || status == 400) + if (isGoodStatus(status)) { llinfos << content << llendl; @@ -1738,7 +1734,7 @@ public: } else if (content.has("error")) { - llinfos << "failed to get facebook friends. reason: " << content["error"] << llendl; + llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl; } } else @@ -1750,25 +1746,25 @@ public: void LLPanelPeople::getFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/get-friends/" + gAgentID.asString(), new FacebookFriendsResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get(FBC_SERVICES_URL + "/has-access-token/" + gAgentID.asString(), new FacebookLoginResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/"); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/"); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From 21e8d2ca30842422eb5eef469c9e1bb91c0c847b Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 02:11:11 +0100 Subject: updated to use POST for connect and disconnect, instead of Webkit --- indra/newview/llpanelpeople.cpp | 132 ++++++++++++++++++++++++++++++++-------- indra/newview/llpanelpeople.h | 7 ++- 2 files changed, 112 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d2e764df13..ebf7002fc1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -536,6 +536,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), + mConnectedToFbc(false), mFilterSubString(LLStringUtil::null), mFilterSubStringOrig(LLStringUtil::null), mFilterEditor(NULL), @@ -885,23 +886,17 @@ void LLPanelPeople::updateFbcTestList() { if (mFbcTestBrowserHandle.get()) { - // get the browser data (from the title bar, of course!) - std::string title = mFbcTestBrowserHandle.get()->getTitle(); + // get the current browser url (from the title bar, of course!) + std::string url = mFbcTestBrowserHandle.get()->getTitle(); - // if the data is ready (if it says the magic word) - if (title.length() >= 2 && title[0] == ':') + // if the browser has redirected from facebook + if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) { - // success! :) - if (title[1] == ')') - { - // get the friends - getFacebookFriends(); - } - // failure :( - else if (title[1] == '(') - { - llinfos << "authentication failed" << llendl; - } + // get the auth code + std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6); + + // finish authenticating on the server + connectToFacebook(auth_code); // close the browser window mFbcTestBrowserHandle.get()->die(); @@ -1669,15 +1664,82 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) { - const LLSD& fb_friend = *i; - - std::string name = fb_friend["name"].asString(); - LLUUID agent_id = fb_friend.has("agent_id") ? fb_friend["agent_id"].asUUID() : LLUUID(NULL); + std::string name = (*i)["name"].asString(); + LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); mFacebookFriends->addSocialItem(agent_id, name, false); } } +void LLPanelPeople::hideFacebookFriends() +{ + mFacebookFriends->clear(); +} + +class FacebookConnectResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + llinfos << content << llendl; + + // grab some graph data now that we are connected + if (content["success"]) + { + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); + } + else if (content.has("error")) + { + llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl; + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + +class FacebookDisconnectResponder : public LLHTTPClient::Responder +{ +public: + + LLPanelPeople * mPanelPeople; + + FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} + + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + llinfos << content << llendl; + + // hide all the facebook stuff + if (content["success"]) + { + mPanelPeople->mConnectedToFbc = false; + mPanelPeople->hideFacebookFriends(); + } + else if (content.has("error")) + { + llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl; + } + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + } + } +}; + class FacebookConnectedResponder : public LLHTTPClient::Responder { public: @@ -1693,16 +1755,17 @@ public: { llinfos << content << llendl; - // pull down graph data if already contected + // grab some graph data if already connected if (content["connected"]) { - mPanelPeople->getFacebookFriends(); + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); } - // show the facebook login page + // show the facebook login page if not connected yet else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL); mPanelPeople->openFacebookWeb(p); } } @@ -1727,7 +1790,7 @@ public: { llinfos << content << llendl; - // display the friend data + // display the list of friends if (content.has("friends")) { mPanelPeople->showFacebookFriends(content["friends"]); @@ -1744,14 +1807,31 @@ public: } }; -void LLPanelPeople::getFacebookFriends() +void LLPanelPeople::loadFacebookFriends() { LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } +void LLPanelPeople::connectToFacebook(const std::string& auth_code) +{ + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); +} + +void LLPanelPeople::disconnectFromFacebook() +{ + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this)); +} + void LLPanelPeople::onLoginFbcButtonClicked() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + if (mConnectedToFbc) + { + disconnectFromFacebook(); + } + else + { + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + } } void LLPanelPeople::onFacebookAppRequestClicked() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 45ed7e1039..914899ca6d 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -59,7 +59,12 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); - void getFacebookFriends(); + void hideFacebookFriends(); + void loadFacebookFriends(); + void connectToFacebook(const std::string& auth_code); + void disconnectFromFacebook(); + + bool mConnectedToFbc; // internals class Updater; -- cgit v1.2.3 From 207db356c21246ca9eb1b255b71623b0a5a4d470 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 03:06:24 +0100 Subject: got it working --- indra/newview/llpanelpeople.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ebf7002fc1..4b4dd27bf2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -893,7 +893,10 @@ void LLPanelPeople::updateFbcTestList() if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) { // get the auth code - std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 6); + std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7); + auth_code = auth_code.substr(0, auth_code.length() - 4); + + llinfos << "extracted code " << auth_code << " from url " << url << llendl; // finish authenticating on the server connectToFacebook(auth_code); @@ -1765,7 +1768,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); mPanelPeople->openFacebookWeb(p); } } @@ -1814,6 +1817,7 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { + llinfos << "attempting to connect to facebook with code " << auth_code << llendl; LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); } @@ -1837,14 +1841,14 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=https://secondlife.com/"); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=https://secondlife.com/"); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } // EOF -- cgit v1.2.3 From ae4dcb2d1cade521f4cb116e3b7aa79475c38cc6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Apr 2013 19:34:44 -0700 Subject: created LLSocialList and LLSocialListItem and linked them up to the facebook tab. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpanelpeople.cpp | 5 +- indra/newview/llpanelpeople.h | 3 +- indra/newview/llsociallist.cpp | 130 +++++++++++++++++++++ indra/newview/llsociallist.h | 98 ++++++++++++++++ .../newview/skins/default/xui/en/panel_people.xml | 2 +- 6 files changed, 236 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llsociallist.cpp create mode 100644 indra/newview/llsociallist.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dff2c04fbc..b303ff3d18 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -483,6 +483,7 @@ set(viewer_SOURCE_FILES llsidetraypanelcontainer.cpp llsky.cpp llslurl.cpp + llsociallist.cpp llspatialpartition.cpp llspeakers.cpp llspeakingindicatormanager.cpp @@ -1050,6 +1051,7 @@ set(viewer_HEADER_FILES llsidetraypanelcontainer.h llsky.h llslurl.h + llsociallist.h llspatialpartition.h llspeakers.h llspeakingindicatormanager.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4b4dd27bf2..cbc5eba65f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,7 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" +#include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" @@ -648,7 +649,7 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - mFacebookFriends = social_tab->getChild("facebook_friends"); + mFacebookFriends = social_tab->getChild("facebook_friends"); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -1670,7 +1671,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = (*i)["name"].asString(); LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); - mFacebookFriends->addSocialItem(agent_id, name, false); + mFacebookFriends->addNewItem(agent_id, name, false); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 914899ca6d..d61eb80f57 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -38,6 +38,7 @@ class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; +class LLSocialList; class LLMenuButton; class LLTabContainer; @@ -158,7 +159,7 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - LLAvatarListSocial* mFacebookFriends; + LLSocialList* mFacebookFriends; LLNetMap* mMiniMap; LLHandle mGroupPlusMenuHandle; diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp new file mode 100644 index 0000000000..3d1d256149 --- /dev/null +++ b/indra/newview/llsociallist.cpp @@ -0,0 +1,130 @@ +sDestroyImmediate +/** +* @file llsociallist.cpp +* @brief Implementation of llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + + +#include "llviewerprecompiledheaders.h" + +#include "llsociallist.h" + +#include "llavatariconctrl.h" +#include "lloutputmonitorctrl.h" +#include "lltextutil.h" + +static LLDefaultChildRegistry::Register r("social_list"); + +LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) +{ + +} + +LLSocialList::~LLSocialList() +{ + +} + +void LLSocialList::draw() +{ + LLFlatListView::draw(); +} + +void LLSocialList::refresh() +{ + +} + +void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) +{ + LLSocialListItem * item = new LLSocialListItem(); + item->setName(name, mNameFilter); + addItem(item, id, pos); +} + +LLSocialListItem::LLSocialListItem() +{ + buildFromFile("panel_avatar_list_item.xml"); +} + +LLSocialListItem::~LLSocialListItem() +{ + +} + +BOOL LLSocialListItem::postBuild() +{ + mIcon = getChild("avatar_icon"); + mLabelTextBox = getChild("avatar_name"); + + mLastInteractionTime = getChild("last_interaction"); + mIconPermissionOnline = getChild("permission_online_icon"); + mIconPermissionMap = getChild("permission_map_icon"); + mIconPermissionEditMine = getChild("permission_edit_mine_icon"); + mIconPermissionEditTheirs = getChild("permission_edit_theirs_icon"); + mSpeakingIndicator = getChild("speaking_indicator"); + mInfoBtn = getChild("info_btn"); + mProfileBtn = getChild("profile_btn"); + + mLastInteractionTime->setVisible(false); + mIconPermissionOnline->setVisible(false); + mIconPermissionMap->setVisible(false); + mIconPermissionEditMine->setVisible(false); + mIconPermissionEditTheirs->setVisible(false); + mSpeakingIndicator->setVisible(false); + mInfoBtn->setVisible(false); + mProfileBtn->setVisible(false); + + return TRUE; +} + +void LLSocialListItem::setName(const std::string& name, const std::string& highlight) +{ + mLabel = name; + LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight); +} + +void LLSocialListItem::setValue(const LLSD& value) +{ + getChildView("selected_icon")->setVisible( value["selected"]); +} + +void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask) +{ + getChildView("hovered_icon")->setVisible( true); + mInfoBtn->setVisible(true); + mProfileBtn->setVisible(true); + + LLPanel::onMouseEnter(x, y, mask); +} + +void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) +{ + getChildView("hovered_icon")->setVisible( false); + mInfoBtn->setVisible(false); + mProfileBtn->setVisible(false); + + LLPanel::onMouseLeave(x, y, mask); +} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h new file mode 100644 index 0000000000..884d6ebd7e --- /dev/null +++ b/indra/newview/llsociallist.h @@ -0,0 +1,98 @@ +/** +* @file llsociallist.h +* @brief Header file for llsociallist +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLSOCIALLIST_H +#define LL_LLSOCIALLIST_H + +#include "llflatlistview.h" +#include "llstyle.h" + + +/** + * Generic list of avatars. + * + * Updates itself when it's dirty, using optional name filter. + * To initiate update, modify the UUID list and call setDirty(). + * + * @see getIDs() + * @see setDirty() + * @see setNameFilter() + */ + +class LLAvatarIconCtrl; +class LLIconCtrl; +class LLOutputMonitorCtrl; + +class LLSocialList : public LLFlatListViewEx +{ +public: + + struct Params : public LLInitParam::Block + { + }; + + LLSocialList(const Params&p); + virtual ~LLSocialList(); + + virtual void draw(); + void refresh(); + void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); + + + + std::string mNameFilter; +}; + +class LLSocialListItem : public LLPanel +{ + public: + LLSocialListItem(); + ~LLSocialListItem(); + + BOOL postBuild(); + void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); + void setValue(const LLSD& value); + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + + LLTextBox * mLabelTextBox; + std::string mLabel; + LLStyle::Params mLabelTextBoxStyle; + + + LLAvatarIconCtrl * mIcon; + LLTextBox * mLastInteractionTime; + LLIconCtrl * mIconPermissionOnline; + LLIconCtrl * mIconPermissionMap; + LLIconCtrl * mIconPermissionEditMine; + LLIconCtrl * mIconPermissionEditTheirs; + LLOutputMonitorCtrl * mSpeakingIndicator; + LLButton * mInfoBtn; + LLButton * mProfileBtn; +}; + + +#endif // LL_LLSOCIALLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index f3334fd767..81946ff7f9 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -602,7 +602,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M min_height="150" name="tab_facebook" title="Facebook Friends"> - Date: Wed, 3 Apr 2013 03:55:53 +0100 Subject: got connectToFacebook working with code and redirect_uri passed as LLSD body in POST request --- indra/newview/llpanelpeople.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index cbc5eba65f..f55459afec 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,6 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -1769,7 +1770,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI); mPanelPeople->openFacebookWeb(p); } } @@ -1818,8 +1819,10 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { - llinfos << "attempting to connect to facebook with code " << auth_code << llendl; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); + LLSD body; + body["code"] = auth_code; + body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() -- cgit v1.2.3 From 859f7b5484df50bb45e10c8d73517205328b6b9c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Apr 2013 20:10:44 -0700 Subject: adding support for showing avatar icon and avatar name + facebook name into LLSocialListItem. Also the info button and profile button should now work --- indra/newview/llsociallist.cpp | 27 ++++++++++++++++++++++++++- indra/newview/llsociallist.h | 4 ++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index 3d1d256149..2402a7c4b8 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -31,7 +31,10 @@ sDestroyImmediate #include "llsociallist.h" +#include "llavataractions.h" +#include "llfloaterreg.h" #include "llavatariconctrl.h" +#include "llavatarnamecache.h" #include "lloutputmonitorctrl.h" #include "lltextutil.h" @@ -60,7 +63,16 @@ void LLSocialList::refresh() void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLSocialListItem * item = new LLSocialListItem(); - item->setName(name, mNameFilter); + LLAvatarName avatar_name; + bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); + + item->mAvatarId = id; + if(id.notNull()) + { + item->mIcon->setValue(id); + } + + item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter); addItem(item, id, pos); } @@ -97,6 +109,9 @@ BOOL LLSocialListItem::postBuild() mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); + mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this)); + mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this)); + return TRUE; } @@ -128,3 +143,13 @@ void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) LLPanel::onMouseLeave(x, y, mask); } + +void LLSocialListItem::onInfoBtnClick() +{ + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); +} + +void LLSocialListItem::onProfileBtnClick() +{ + LLAvatarActions::showProfile(mAvatarId); +} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h index 884d6ebd7e..bc667fc400 100644 --- a/indra/newview/llsociallist.h +++ b/indra/newview/llsociallist.h @@ -77,6 +77,10 @@ class LLSocialListItem : public LLPanel void setValue(const LLSD& value); void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); + void onInfoBtnClick(); + void onProfileBtnClick(); + + LLUUID mAvatarId; LLTextBox * mLabelTextBox; std::string mLabel; -- cgit v1.2.3 From 436bccf58be3e5f3dd5f990304b9aa0f8c9c66f4 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 04:11:43 +0100 Subject: made auth code extraction more robust --- indra/newview/llpanelpeople.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f55459afec..8fc1d378db 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -892,12 +892,24 @@ void LLPanelPeople::updateFbcTestList() std::string url = mFbcTestBrowserHandle.get()->getTitle(); // if the browser has redirected from facebook - if (url.substr(0, FBC_SERVICES_URL.length()) == FBC_SERVICES_URL) + if (url.find(FBC_SERVICES_REDIRECT_URI) == 0) { - // get the auth code - std::string auth_code = url.substr(FBC_SERVICES_URL.length() + 7); - auth_code = auth_code.substr(0, auth_code.length() - 4); - + // find the auth code in the url + std::string begin_string = "code="; + std::string end_string = "#"; + size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length()); + size_t end_index = url.find(end_string, begin_index); + + // extract the auth code from the url + std::string auth_code; + if (end_index != std::string::npos) + { + auth_code = url.substr(begin_index, end_index - begin_index); + } + else + { + auth_code = url.substr(begin_index); + } llinfos << "extracted code " << auth_code << " from url " << url << llendl; // finish authenticating on the server -- cgit v1.2.3 From 06d06454b25fd6b97d81076ce93b573fc53c36f9 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 04:40:11 +0100 Subject: made Facebook Friends list auto-populate --- indra/newview/llpanelpeople.cpp | 23 ++++++++++++++++++++++- indra/newview/llpanelpeople.h | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8fc1d378db..6a83e84da1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -539,6 +539,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), + mTryToConnectToFbc(true), mFilterSubString(LLStringUtil::null), mFilterSubStringOrig(LLStringUtil::null), mFilterEditor(NULL), @@ -633,7 +634,7 @@ BOOL LLPanelPeople::postBuild() mMiniMap = (LLNetMap*)getChildView("Net Map",true); mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ? getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg")); - + mRecentList = getChild(RECENT_TAB_NAME)->getChild("avatar_list"); mRecentList->setNoItemsCommentText(getString("no_recent_people")); mRecentList->setNoItemsMsg(getString("no_recent_people")); @@ -651,6 +652,7 @@ BOOL LLPanelPeople::postBuild() LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); mFacebookFriends = social_tab->getChild("facebook_friends"); + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -922,6 +924,17 @@ void LLPanelPeople::updateFbcTestList() mFbcTestListUpdater->setActive(false); } } + else if (mTryToConnectToFbc) + { + // try to reconnect to facebook! + tryToReconnectToFacebook(); + + // don't try again + mTryToConnectToFbc = false; + + // stop updating + mFbcTestListUpdater->setActive(false); + } } void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) @@ -1829,6 +1842,14 @@ void LLPanelPeople::loadFacebookFriends() LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } +void LLPanelPeople::tryToReconnectToFacebook() +{ + if (!mConnectedToFbc) + { + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false)); + } +} + void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d61eb80f57..2ac83c3677 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,10 +62,12 @@ public: void showFacebookFriends(const LLSD& friends); void hideFacebookFriends(); void loadFacebookFriends(); + void tryToReconnectToFacebook(); void connectToFacebook(const std::string& auth_code); void disconnectFromFacebook(); bool mConnectedToFbc; + bool mTryToConnectToFbc; // internals class Updater; -- cgit v1.2.3 From a8e89fbb46730ca51241f4f0b51d06210e2cf347 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 23:55:25 +0100 Subject: changed FBC Services redirect_uri for testing --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6a83e84da1..93e8411eb7 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/"; +static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator -- cgit v1.2.3 From 819bbce34a2f265287df1e4e9adde90b5a70c8b6 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Apr 2013 00:04:52 +0100 Subject: made FB+SL friends show up as (setAvatarId(id, mSessionID, mIgnoreOnlineStatus, false); // this sets the name as a side effect - item->setAvatarName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name); + item->setAvatarName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index 2402a7c4b8..6cf0851fd7 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -72,7 +72,7 @@ void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->mIcon->setValue(id); } - item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter); + item->setName(has_avatar_name ? name + " (" + avatar_name.mDisplayName + ")" : name, mNameFilter); addItem(item, id, pos); } -- cgit v1.2.3 From 15e2f76615581341a861ed0e37da96170e2aee61 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 3 Apr 2013 16:26:11 -0700 Subject: MAINT-2558 - Add viewer debug setting for more logging on avatar render info. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llavatarrenderinfoaccountant.cpp | 77 +++++++++++++++----------- indra/newview/llavatarrenderinfoaccountant.h | 2 + 3 files changed, 57 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 384e83a2a0..4c6940500e 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9400,6 +9400,17 @@ Value 0 + RenderAutoMuteLogging + + Comment + Show extra information in viewer logs about avatar rendering costs + Persist + 1 + Type + Boolean + Value + 0 + RenderAutoMuteVisibilityRank Comment diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 04a79f7d4c..54144677f4 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -37,15 +37,13 @@ #include "llcharacter.h" #include "llhttpclient.h" #include "lltimer.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" -// Use this for debugging -//#define LL_AVATAR_RENDER_INFO_LOG_SPAM - static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer static const std::string KEY_GEOMETRY = "geometry"; // integer @@ -94,9 +92,10 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + } if (content.isMap()) { @@ -116,10 +115,11 @@ public: agent_info_map.isMap()) { // Extract the data for this avatar - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << " Agent " << target_agent_id - << ": " << agent_info_map << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << " Agent " << target_agent_id + << ": " << agent_info_map << llendl; + } if (agent_info_map.has(KEY_WEIGHT)) { @@ -194,10 +194,11 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Result for avatar weights POST for region " << regionp->getName() - << ": " << content << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + } if (content.isMap()) { @@ -231,12 +232,13 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info to region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + } // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -271,10 +273,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio agents[avatar->getID().asString()] = info; } - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Sending avatar render info for " << avatar->getID() - << ": " << info << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + } } iter++; } @@ -297,12 +300,13 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + } // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -351,10 +355,17 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer() { - #ifdef LL_AVATAR_RENDER_INFO_LOG_SPAM - llinfos << "Viewer has new region capabilities" << llendl; - #endif // LL_AVATAR_RENDER_INFO_LOG_SPAM + if (logRenderInfo()) + { + llinfos << "Viewer has new region capabilities" << llendl; + } sRenderInfoReportTimer.resetWithExpiry(0.f); } +// static +bool LLAvatarRenderInfoAccountant::logRenderInfo() +{ + static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging"); + return render_mute_logging_enabled; +} diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h index 5b4a4d3db2..97dd9f0ad3 100644 --- a/indra/newview/llavatarrenderinfoaccountant.h +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -46,6 +46,8 @@ public: static void idle(); + static bool logRenderInfo(); + private: // Send data updates about once per minute, only need per-frame resolution static LLFrameTimer sRenderInfoReportTimer; -- cgit v1.2.3 From 10dba6b20148868ab630e53ac9aec67d2ed01cc1 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 5 Apr 2013 03:15:35 +0100 Subject: changed routes according to Kelly's and Enkidu's advice --- indra/newview/llpanelpeople.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2ca22a1382..4bcd146ad2 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1741,7 +1741,7 @@ void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false)); } } @@ -1750,12 +1750,12 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); + LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", LLSD(), new FacebookDisconnectResponder(this)); + LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() @@ -1766,7 +1766,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 2465634bf77b7c471106855c347b611bcd8ef2ab Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 5 Apr 2013 21:27:20 +0100 Subject: changed connect to use POST --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4bcd146ad2..29a92525de 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1750,7 +1750,7 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::put(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() -- cgit v1.2.3 From c8883f6a5245056c4f26f2ce4f874549e62b2b29 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 9 Apr 2013 01:15:00 +0100 Subject: updated to use new API routes --- indra/newview/llpanelpeople.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 29a92525de..052637742b 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -888,6 +888,9 @@ void LLPanelPeople::updateFbcTestList() // close the browser window mFbcTestBrowserHandle.get()->die(); + + // get rid of the handle + mFbcTestBrowserHandle = LLHandle(); // stop updating mFbcTestListUpdater->setActive(false); @@ -1716,7 +1719,7 @@ public: llinfos << content << llendl; // display the list of friends - if (content.has("friends")) + if (content.has("friends") && !content.has("error")) { mPanelPeople->showFacebookFriends(content["friends"]); } @@ -1748,14 +1751,17 @@ void LLPanelPeople::tryToReconnectToFacebook() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; + body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLHTTPClient::del(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookDisconnectResponder(this)); + LLSD body; + body["agent_id"] = gAgentID.asString(); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() -- cgit v1.2.3 From 2b8632a81b40ef92a9b3872ad0909575a3bd938a Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 9 Apr 2013 02:01:56 +0100 Subject: changed redirect_uri to pdp15.lindenlab.com/redirect --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 052637742b..a425919390 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,7 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "http://axcho.com/secondlife/"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator -- cgit v1.2.3 From 479c5f4b4aad98dbb654cb03c343b2dce6222922 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 9 Apr 2013 13:24:51 -0700 Subject: adding in logging of building a list of 300 users inside LLAvatarList and LLFolderView to determine drawbacks/benefits and timing. --- indra/newview/llfloaterimcontainer.cpp | 7 +++++-- indra/newview/llpanelpeople.cpp | 17 +++++++++++++++++ indra/newview/llpanelpeople.h | 1 + indra/newview/llparticipantlist.cpp | 14 ++++++++++++++ indra/newview/llparticipantlist.h | 1 + indra/newview/skins/default/xui/en/menu_gear_fbc.xml | 9 ++++++++- 6 files changed, 46 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 7e281bd99b..af8c7e9dc4 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -342,8 +342,11 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked() void LLFloaterIMContainer::onSpeakButtonClicked() { - LLAgent::toggleMicrophone("speak"); - updateSpeakBtnState(); + //LLAgent::toggleMicrophone("speak"); + //updateSpeakBtnState(); + + LLParticipantList* session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + session_model->addTestAvatarAgents(); } void LLFloaterIMContainer::onExpandCollapseButtonClicked() { diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a425919390..493395fdd1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -49,6 +49,7 @@ #include "llavatarlist.h" #include "llavatarlistitem.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "llerror.h" #include "llfloateravatarpicker.h" //#include "llfloaterminiinspector.h" #include "llfriendcard.h" @@ -557,6 +558,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); + mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); @@ -1789,4 +1791,19 @@ void LLPanelPeople::onFacebookAppSendClicked() p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); openFacebookWeb(p); } + +void LLPanelPeople::onFacebookTestAddClicked() +{ + mFacebookFriends->clear(); + + LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; + + for(int i = 0; i < 300; ++i) + { + mFacebookFriends->addNewItem(LLUUID(), "Test", false); + } + + LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL; +} + // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index ffb3f74192..76207108cd 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -124,6 +124,7 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); + void onFacebookTestAddClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index c53760bca1..e05b27e539 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llavatarnamecache.h" +#include "llerror.h" #include "llimview.h" #include "llfloaterimcontainer.h" #include "llparticipantlist.h" @@ -401,6 +402,19 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) adjustParticipant(avatar_id); } + +void LLParticipantList::addTestAvatarAgents() +{ + LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL; + + for(int i = 0; i < 300; ++i) + { + addAvatarIDExceptAgent(LLUUID().generateNewID()); + } + + LL_INFOS("LLParticipantList") << "finished adding 300 users" << LL_ENDL; +} + void LLParticipantList::adjustParticipant(const LLUUID& speaker_id) { LLPointer speakerp = mSpeakerMgr->findSpeaker(speaker_id); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 3a3ae76604..936e289c08 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -50,6 +50,7 @@ public: * @param[in] avatar_id - Avatar UUID to be added into the list */ void addAvatarIDExceptAgent(const LLUUID& avatar_id); + void addTestAvatarAgents(); /** * Refreshes the participant list. diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index b05ba46107..4d8cbb432e 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -26,5 +26,12 @@ - + + + + \ No newline at end of file -- cgit v1.2.3 From 31eb1f6ebb27c016c66a50f3b32917ea7496fb2f Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 10 Apr 2013 00:46:15 +0100 Subject: updated routes URLs --- indra/newview/llpanelpeople.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a425919390..cabc2cf4fe 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -79,8 +79,8 @@ static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; +static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -1737,14 +1737,14 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false)); } } @@ -1754,14 +1754,14 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { LLSD body; body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/disconnect", body, new FacebookDisconnectResponder(this)); + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this)); } void LLPanelPeople::onLoginFbcButtonClicked() @@ -1772,7 +1772,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc", new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 1d3f018e812daf5fb7834258940b13a2239106b4 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 9 Apr 2013 17:04:57 -0700 Subject: MAINT-2417 FIX Update Graphics tab layout --- indra/newview/llfloaterpreference.cpp | 29 ++++--- indra/newview/llfloaterpreference.h | 3 +- .../default/xui/en/panel_preferences_graphics1.xml | 96 +++++++++++++++++++--- 3 files changed, 105 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a28af2101b..cdfaab88eb 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -337,7 +337,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); - mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2)); + mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); @@ -1147,6 +1147,8 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && shaders && @@ -1155,11 +1157,13 @@ void LLFloaterPreference::refreshEnabledState() (ctrl_wind_light->get()) ? TRUE : FALSE; ctrl_deferred->setEnabled(enabled); - + ctrl_deferred2->setEnabled(enabled); + LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); LLComboBox* ctrl_shadow = getChild("ShadowDetail"); + // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); ctrl_ssao->setEnabled(enabled); @@ -1185,6 +1189,7 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -1218,6 +1223,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled windlight @@ -1238,6 +1245,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred @@ -1255,6 +1264,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred SSAO @@ -1299,6 +1310,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled cloth @@ -1327,6 +1340,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); @@ -1578,16 +1592,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("chat_font_size")->setEnabled(TRUE); } -void LLFloaterPreference::onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name) +void LLFloaterPreference::refreshUI() { - std::string ctrl_name = name.asString(); - - if ((ctrl_name =="" )|| !hasChild(ctrl_name, true)) - return; - - LLTextBox* text_box = getChild(name.asString()); - LLSliderCtrl* slider = dynamic_cast(ctrl); - updateSliderText(slider, text_box); + refresh(); } void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 22e80a21cb..cb180f6f1e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -154,8 +154,7 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name); -// void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); + void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); void onCommitMediaEnabled(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 4ed95f0758..7abc67494f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -177,10 +177,86 @@ width="80"> Ultra
+ + + + + Low + + + + m + + + + + width="256" /> Date: Thu, 11 Apr 2013 18:26:48 -0700 Subject: Adding in fast timer for testing creation of 300 avatar list items vs folderview items. --- indra/newview/llpanelpeople.cpp | 4 ++++ indra/newview/llparticipantlist.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2e97e8bab9..b33574bcc3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1792,8 +1792,12 @@ void LLPanelPeople::onFacebookAppSendClicked() openFacebookWeb(p); } +static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); + void LLPanelPeople::onFacebookTestAddClicked() { + LLFastTimer _(FTM_AVATAR_LIST_TEST); + mFacebookFriends->clear(); LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index e05b27e539..b5c9f4a310 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -402,9 +402,13 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& avatar_id) adjustParticipant(avatar_id); } +static LLFastTimer::DeclareTimer FTM_FOLDERVIEW_TEST("add test avatar agents"); + void LLParticipantList::addTestAvatarAgents() { + LLFastTimer _(FTM_FOLDERVIEW_TEST); + LL_INFOS("LLParticipantList") << "start adding 300 users" << LL_ENDL; for(int i = 0; i < 300; ++i) -- cgit v1.2.3 From 9a0cd53bdaf10652236f082a63fe43ec126a9251 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 13 Apr 2013 02:10:13 +0100 Subject: switched to use FacebookConnect and FacebookRedirect capabilities --- indra/newview/llpanelpeople.cpp | 39 +++++++++++++++++++++++++++------------ indra/newview/llpanelpeople.h | 3 +++ indra/newview/llviewerregion.cpp | 2 ++ 3 files changed, 32 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2e97e8bab9..5a4eca87ff 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -81,7 +81,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/fbc/redirect"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -865,12 +865,12 @@ void LLPanelPeople::updateFbcTestList() std::string url = mFbcTestBrowserHandle.get()->getTitle(); // if the browser has redirected from facebook - if (url.find(FBC_SERVICES_REDIRECT_URI) == 0) + if (url.find(getFacebookRedirectURL()) == 0) { // find the auth code in the url std::string begin_string = "code="; std::string end_string = "#"; - size_t begin_index = begin_string.length() + url.find(begin_string, FBC_SERVICES_REDIRECT_URI.length()); + size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length()); size_t end_index = url.find(end_string, begin_index); // extract the auth code from the url @@ -1695,7 +1695,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); mPanelPeople->openFacebookWeb(p); } } @@ -1739,14 +1739,14 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/friends", new FacebookFriendsResponder(this)); + LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false)); } } @@ -1755,17 +1755,32 @@ void LLPanelPeople::connectToFacebook(const std::string& auth_code) LLSD body; body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; - body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/connect", body, new FacebookConnectResponder(this)); + body["redirect_uri"] = getFacebookRedirectURL(); + LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { LLSD body; body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/disconnect", body, new FacebookDisconnectResponder(this)); + LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this)); } +std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) +{ + static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + std::string url = sFacebookConnectUrl + route; + llinfos << url << llendl; + return url; +} + +std::string LLPanelPeople::getFacebookRedirectURL() +{ + static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect"); + llinfos << sFacebookRedirectUrl << llendl; + return sFacebookRedirectUrl; +} + void LLPanelPeople::onLoginFbcButtonClicked() { if (mConnectedToFbc) @@ -1774,21 +1789,21 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString(), new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true)); } } void LLPanelPeople::onFacebookAppRequestClicked() { LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + FBC_SERVICES_URL); + p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); openFacebookWeb(p); } void LLPanelPeople::onFacebookAppSendClicked() { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + FBC_SERVICES_URL); + p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); openFacebookWeb(p); } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 76207108cd..e9581bb5f3 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -66,6 +66,9 @@ public: void connectToFacebook(const std::string& auth_code); void disconnectFromFacebook(); + std::string getFacebookConnectURL(const std::string& route = ""); + std::string getFacebookRedirectURL(); + bool mConnectedToFbc; bool mTryToConnectToFbc; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e4234a538d..5b3b11ae2d 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1522,6 +1522,8 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("EnvironmentSettings"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); + capabilityNames.append("FacebookConnect"); + //capabilityNames.append("FacebookRedirect"); if (gSavedSettings.getBOOL("UseHTTPInventory")) { -- cgit v1.2.3 From 569b75bae934e89bfe872e6d8994a850c0051475 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 11:56:15 -0700 Subject: MAINT-2595 - Viewer spams log at startup with caps issue. Reviewed by Kelly --- indra/newview/llvoicevivox.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9b5d981aa5..ac35bd4287 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -532,25 +532,25 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && (mVoiceEnabled || !mIsInitialized)) + // If we've not received the capability yet, return. + // the password will remain empty, so we'll remain in + // stateIdle + if ( region && + region->capabilitiesReceived() && + (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); - if ( url.empty() ) + if ( !url.empty() ) { - // we've not received the capability yet, so return. - // the password will remain empty, so we'll remain in - // stateIdle - return; - } + LLHTTPClient::post( + url, + LLSD(), + new LLVivoxVoiceAccountProvisionResponder(retries)); - LLHTTPClient::post( - url, - LLSD(), - new LLVivoxVoiceAccountProvisionResponder(retries)); - - setState(stateConnectorStart); + setState(stateConnectorStart); + } } } -- cgit v1.2.3 From c6991c9c75ff125654b68992c61a3c17c39bf5c5 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 13:51:18 -0700 Subject: MAINT-2598 : Viewer logs warning about VoiceServiceConnectionStateChangedEvent --- indra/newview/llvoicevivox.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ac35bd4287..abead02174 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7660,6 +7660,9 @@ void LLVivoxProtocolParser::processResponse(std::string tag) */ // We don't need to process this, but we also shouldn't warn on it, since that confuses people. } + else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) + { // Yet another ignored event + } else { LL_WARNS("VivoxProtocolParser") << "Unknown event type " << eventTypeString << LL_ENDL; -- cgit v1.2.3 From 98f438656b3f4ae8a0b6fbd6327cfff3ef243545 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Apr 2013 16:29:14 -0700 Subject: MAINT-2548 : Add debug viewer render info for AV metrics. Reviewed by Kelly --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llviewerwindow.cpp | 43 ++++++++++++++++++++-- indra/newview/skins/default/xui/en/menu_viewer.xml | 10 +++++ 3 files changed, 61 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c7895fbd99..75c38ad62f 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2136,6 +2136,17 @@ Value 0 + DebugShowAvatarRenderInfo + + Comment + Show avatar render cost information + Persist + 1 + Type + Boolean + Value + 0 + DebugShowColor Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b3bb584881..bb71707db6 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -332,9 +332,10 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - U32 xpos = mWindow->getWorldViewWidthScaled() - 350; - U32 ypos = 64; - const U32 y_inc = 20; + S32 xpos = mWindow->getWorldViewWidthScaled() - 400; + xpos = llmax(xpos, 0); + S32 ypos = 64; + const S32 y_inc = 20; clearText(); @@ -634,6 +635,42 @@ public: LLVertexBuffer::sSetCount = LLImageGL::sUniqueCount = gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; } + if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo")) + { + std::map sorted_avs; + + std::vector::iterator sort_iter = LLCharacter::sInstances.begin(); + while (sort_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast(*sort_iter); + if (avatar && + !avatar->isDead()) // Not dead yet + { + // Stuff into a sorted map so the display is ordered + sorted_avs[avatar->getFullname()] = avatar; + } + sort_iter++; + } + + std::string trunc_name; + std::map::reverse_iterator av_iter = sorted_avs.rbegin(); // Put "A" at the top + while (av_iter != sorted_avs.rend()) + { + LLVOAvatar* avatar = av_iter->second; + + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + trunc_name = utf8str_truncate(avatar->getFullname(), 16); + addText(xpos, ypos, llformat("%s : rez %d, weight %d, bytes %d area %.2f", + trunc_name.c_str(), + avatar->getRezzedStatus(), + avatar->getVisualComplexity(), + avatar->getAttachmentGeometryBytes(), + avatar->getAttachmentSurfaceArea())); + ypos += y_inc; + av_iter++; + } + } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 1197f1ce1f..f66272aa2e 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2205,6 +2205,16 @@ + + + + Date: Wed, 17 Apr 2013 02:53:50 +0100 Subject: updated to use new API as suggested by Don Linden --- indra/newview/llpanelpeople.cpp | 68 +++++++++++++---------------------------- 1 file changed, 21 insertions(+), 47 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 519868612a..75c29558e5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1592,10 +1592,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { - std::string name = (*i)["name"].asString(); - LLUUID agent_id = (*i).has("agent_id") ? (*i)["agent_id"].asUUID() : LLUUID(NULL); + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); mFacebookFriends->addNewItem(agent_id, name, false); } @@ -1621,15 +1621,8 @@ public: llinfos << content << llendl; // grab some graph data now that we are connected - if (content["success"]) - { - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else if (content.has("error")) - { - llinfos << "failed to connect. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); } else { @@ -1653,15 +1646,8 @@ public: llinfos << content << llendl; // hide all the facebook stuff - if (content["success"]) - { - mPanelPeople->mConnectedToFbc = false; - mPanelPeople->hideFacebookFriends(); - } - else if (content.has("error")) - { - llinfos << "failed to disconnect. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->mConnectedToFbc = false; + mPanelPeople->hideFacebookFriends(); } else { @@ -1686,23 +1672,21 @@ public: llinfos << content << llendl; // grab some graph data if already connected - if (content["connected"]) - { - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } + mPanelPeople->mConnectedToFbc = true; + mPanelPeople->loadFacebookFriends(); + } + else + { + llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; + // show the facebook login page if not connected yet - else if (mShowLoginIfNotConnected) + if (status == 404 && mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); mPanelPeople->openFacebookWeb(p); } } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } } }; @@ -1721,14 +1705,7 @@ public: llinfos << content << llendl; // display the list of friends - if (content.has("friends") && !content.has("error")) - { - mPanelPeople->showFacebookFriends(content["friends"]); - } - else if (content.has("error")) - { - llinfos << "failed to get facebook friends. reason: " << content["error"]["message"] << llendl; - } + mPanelPeople->showFacebookFriends(content); } else { @@ -1739,31 +1716,28 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(getFacebookConnectURL("/friends"), new FacebookFriendsResponder(this)); + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this)); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, false)); + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false)); } } void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; - body["agent_id"] = gAgentID.asString(); body["code"] = auth_code; body["redirect_uri"] = getFacebookRedirectURL(); - LLHTTPClient::post(getFacebookConnectURL("/connect"), body, new FacebookConnectResponder(this)); + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() { - LLSD body; - body["agent_id"] = gAgentID.asString(); - LLHTTPClient::post(getFacebookConnectURL("/disconnect"), body, new FacebookDisconnectResponder(this)); + LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); } std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) @@ -1789,7 +1763,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(getFacebookConnectURL(), new FacebookConnectedResponder(this, true)); + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true)); } } -- cgit v1.2.3 From 7f0798fd6dad069aca44b954aa0fb7e49d42198c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 16 Apr 2013 19:34:40 -0700 Subject: adding a new tab in people panel that has a folder view --- indra/newview/llconversationmodel.cpp | 1 + indra/newview/llpanelpeople.cpp | 142 +++++++++++++++++++++ indra/newview/llpanelpeople.h | 18 ++- .../newview/skins/default/xui/en/panel_people.xml | 13 ++ 4 files changed, 173 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..ed434d82d5 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -95,6 +95,7 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation LLUUID participant_id = (participant ? participant->getUUID() : LLUUID()); LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id)); LLEventPumps::instance().obtain("ConversationsEvents").post(event); + LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); } // Virtual action callbacks diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 519868612a..6864381404 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -28,6 +28,8 @@ // libs #include "llavatarname.h" +#include "llconversationview.h" +#include "llfloaterimcontainer.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llmenubutton.h" @@ -48,7 +50,9 @@ #include "llavataractions.h" #include "llavatarlist.h" #include "llavatarlistitem.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" // for LLAvatarTracker +#include "llcallbacklist.h" #include "llerror.h" #include "llfloateravatarpicker.h" //#include "llfloaterminiinspector.h" @@ -58,6 +62,7 @@ #include "llinventoryobserver.h" #include "llnetmap.h" #include "llpanelpeoplemenus.h" +#include "llparticipantlist.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -78,6 +83,7 @@ static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; +static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; @@ -540,6 +546,8 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), + mConversationsRoot(NULL), + mConversationsEventStream("ConversationsEventsTwo"), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -595,6 +603,8 @@ LLPanelPeople::~LLPanelPeople() } if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); + + mConversationsEventStream.stopListening("ConversationsRefresh"); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -678,6 +688,61 @@ BOOL LLPanelPeople::postBuild() mFacebookFriends = social_tab->getChild("facebook_friends"); social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + //===Test START======================================================================== + + LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); + + //Create folder view + LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); + + LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); + folder_view_params.rect.left(0).right(0).top(0).bottom(0); + folder_view_params.parent_panel = friends_tab; + folder_view_params.listener = base_item; + folder_view_params.view_model = &mConversationViewModel; + folder_view_params.root = NULL; + folder_view_params.use_ellipses = false; + folder_view_params.options_menu = "menu_conversation.xml"; + folder_view_params.name = "fbcfolderview"; + mConversationsRoot = LLUICtrlFactory::create(folder_view_params); + mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1)); + + //Create scroller + LLRect scroller_view_rect = socialtwo_tab->getRect(); + //scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); + scroller_params.rect(scroller_view_rect); + + LLScrollContainer* scroller = LLUICtrlFactory::create(scroller_params); + socialtwo_tab->addChildInBack(scroller); + scroller->addChild(mConversationsRoot); + scroller->setFollowsAll(); + mConversationsRoot->setScrollContainer(scroller); + mConversationsRoot->setFollowsAll(); + + //Create a session + //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); + LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel); + item->renameItem("Facebook Friends"); + LLConversationViewSession::Params params; + + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + params.tool_tip = params.name; + params.container = LLFloaterIMContainer::getInstance(); + LLConversationViewSession * widget = LLUICtrlFactory::create(params); + widget->addToFolder(mConversationsRoot); + + mConversationsItems[LLUUID(NULL)] = item; + mConversationsWidgits[LLUUID(NULL)] = widget; + + gIdleCallbacks.addFunction(idle, this); + + //===Test END======================================================================== + + + setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false); @@ -757,6 +822,12 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, updateButtons(); } +void LLPanelPeople::idle(void * user_data) +{ + LLPanelPeople * self = static_cast(user_data); + self->mConversationsRoot->update(); +} + void LLPanelPeople::updateFriendListHelpText() { // show special help text for just created account to help finding friends. EXT-4836 @@ -999,6 +1070,10 @@ LLUUID LLPanelPeople::getCurrentItemID() const if (cur_tab == FBCTEST_TAB_NAME) return LLUUID::null; + if (cur_tab == FBCTESTTWO_TAB_NAME) + return LLUUID::null; + + llassert(0 && "unknown tab selected"); return LLUUID::null; } @@ -1023,6 +1098,8 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const selected_uuids.clear(); // FIXME? else if (cur_tab == FBCTEST_TAB_NAME) return; + else if (cur_tab == FBCTESTTWO_TAB_NAME) + return; else llassert(0 && "unknown tab selected"); @@ -1576,6 +1653,49 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } +bool LLPanelPeople::onConversationModelEvent(const LLSD& event) +{ + std::string type = event.get("type").asString(); + LLUUID session_id = event.get("session_uuid").asUUID(); + LLUUID participant_id = event.get("participant_uuid").asUUID(); + + if(type == "add_participant") + { + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[session_id]); + LLConversationViewSession * session_view = dynamic_cast(mConversationsWidgits[session_id]); + LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id); + + if(participant_model) + { + LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); + participant_view->addToFolder(session_view); + } + + + llinfos << "adding!!!!!!" << llendl; + } + + return false; +} + +LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item) +{ + LLConversationViewParticipant::Params params; + LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); + + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + + //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. + params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); + params.tool_tip = params.name; + params.participant_id = item->getUUID(); + params.folder_indentation = 2; + + return LLUICtrlFactory::create(params); +} + void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { LLFloater* browser = LLFloaterReg::showInstance("web_content", p); @@ -1601,6 +1721,28 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } } +void LLPanelPeople::addTestParticipant() +{ + for(int i = 0; i < 300; ++i) + { + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + addParticipantToModel(session_model, LLUUID().generateNewID(), "Test"); + } + } + +void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name) +{ + LLConversationItemParticipant* participant = NULL; + + // Create a participant model + LLAvatarName avatar_name; + bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name; + + participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel); + session_model->addParticipant(participant); +} + void LLPanelPeople::hideFacebookFriends() { mFacebookFriends->clear(); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index e9581bb5f3..b4582d9a3e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -22,7 +22,7 @@ * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ - */ + */ #ifndef LL_LLPANELPEOPLE_H #define LL_LLPANELPEOPLE_H @@ -30,6 +30,8 @@ #include #include "llcallingcard.h" // for avatar tracker +#include "llconversationmodel.h" +#include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -41,6 +43,7 @@ class LLGroupList; class LLSocialList; class LLMenuButton; class LLTabContainer; +class LLFolderView; class LLPanelPeople : public LLPanel @@ -58,8 +61,12 @@ public: // when voice is available /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + static void idle(void * user_data); + void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); + void addTestParticipant(); + void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); @@ -149,6 +156,9 @@ private: bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); bool isAccordionCollapsedByUser(const std::string& name); + bool onConversationModelEvent(const LLSD& event); + LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item); + LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; @@ -170,6 +180,12 @@ private: Updater* mButtonsUpdater; LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; + + conversations_items_map mConversationsItems; + conversations_widgets_map mConversationsWidgits; + LLConversationViewModel mConversationViewModel; + LLFolderView* mConversationsRoot; + LLEventStream mConversationsEventStream; }; #endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 08c8aef1e9..c4db547a8e 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -725,5 +725,18 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M /> + -- cgit v1.2.3 From 0eb2248f55c835e51705c4dc026e177f3930c5db Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 16 Apr 2013 22:36:32 -0700 Subject: made a separate button to add test users to the folder view list. Also when receiving facebook friends both the avatarlist and folderview will be populated. --- indra/newview/llpanelpeople.cpp | 13 +++++++++---- indra/newview/skins/default/xui/en/menu_gear_fbc.xml | 9 ++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 94b60ca2d6..34d565bbaa 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -567,7 +567,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); - + mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -1670,9 +1670,6 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event) LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); participant_view->addToFolder(session_view); } - - - llinfos << "adding!!!!!!" << llendl; } return false; @@ -1717,7 +1714,15 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); + + //Add to folder view + LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + if(session_model) + { + addParticipantToModel(session_model, agent_id, name); + } } } diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index 4d8cbb432e..d73cee344b 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -28,10 +28,17 @@ parameter="http://www.facebook.com/settings?tab=applications" /> + + + \ No newline at end of file -- cgit v1.2.3 From 6742d90d39fbb5c5bc3b675f37841fd6c8ec09c9 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 17 Apr 2013 11:17:46 -0700 Subject: Some minor cleanups while hunting crashes. Reviewed by Kelly --- indra/newview/llflexibleobject.cpp | 5 ++++- indra/newview/llviewerobject.h | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index bf479dc92e..98c0c0bf51 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -294,6 +294,9 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons void LLVolumeImplFlexible::updateRenderRes() { + if (!mAttributes) + return; + LLDrawable* drawablep = mVO->mDrawable; S32 new_res = mAttributes->getSimulateLOD(); @@ -435,7 +438,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } - if(!mInitialized) + if(!mInitialized || !mAttributes) { //the object is not visible return ; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 1b4291a1d1..40e09a4f41 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -112,14 +112,6 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate protected: ~LLViewerObject(); // use unref() - // TomY: Provide for a list of extra parameter structures, mapped by structure name - struct ExtraParameter - { - BOOL in_use; - LLNetworkData *data; - }; - std::map mExtraParameterList; - public: typedef std::list > child_list_t; typedef std::list > vobj_list_t; @@ -545,6 +537,8 @@ public: std::vector mUnselectedChildrenPositions ; private: + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter; ExtraParameter* createNewParameterEntry(U16 param_type); ExtraParameter* getExtraParameterEntry(U16 param_type) const; ExtraParameter* getExtraParameterEntryCreate(U16 param_type); @@ -782,6 +776,14 @@ private: LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. EObjectUpdateType mLastUpdateType; BOOL mLastUpdateCached; + + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter + { + BOOL in_use; + LLNetworkData *data; + }; + std::map mExtraParameterList; }; /////////////////// -- cgit v1.2.3 From 57d88fdccb397257642530b36cbe918df65b41f4 Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Thu, 18 Apr 2013 18:22:57 -0700 Subject: MAINT-2605 : Eliminate LLControlGroup::set warning in log when starting the viewer --- indra/newview/app_settings/settings.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 75c38ad62f..8e4bf2a384 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14525,5 +14525,18 @@ Value 0 + + VersionChannelName + + Comment + Version information generated by running the viewer + Persist + 1 + Type + String + Value + + + -- cgit v1.2.3 From a505c3734a4a3f644500558030b4496d3cb5a5b5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Apr 2013 18:08:36 -0700 Subject: ACME 162: Implemented a foundation model for the facebook connect folder view. --- indra/newview/CMakeLists.txt | 4 + indra/newview/llconversationmodel.cpp | 1 - indra/newview/llpanelpeople.cpp | 80 +++++------ indra/newview/llpanelpeople.h | 16 ++- indra/newview/llpersonfolderview.cpp | 126 ++++++++++++++++ indra/newview/llpersonfolderview.h | 93 ++++++++++++ indra/newview/llpersonmodelcommon.cpp | 158 +++++++++++++++++++++ indra/newview/llpersonmodelcommon.h | 132 +++++++++++++++++ .../default/xui/en/widgets/person_folder_view.xml | 13 ++ 9 files changed, 577 insertions(+), 46 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h create mode 100644 indra/newview/llpersonmodelcommon.cpp create mode 100644 indra/newview/llpersonmodelcommon.h create mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 02ab1c9ff1..84e8811ce8 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,8 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonmodelcommon.cpp + llpersonfolderview.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -1029,6 +1031,8 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonmodelcommon.h + llpersonfolderview.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index ed434d82d5..c74ce24872 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -95,7 +95,6 @@ void LLConversationItem::postEvent(const std::string& event_type, LLConversation LLUUID participant_id = (participant ? participant->getUUID() : LLUUID()); LLSD event(LLSDMap("type", event_type)("session_uuid", session_id)("participant_uuid", participant_id)); LLEventPumps::instance().obtain("ConversationsEvents").post(event); - LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); } // Virtual action callbacks diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 34d565bbaa..d2d1e602be 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,8 @@ #include "llnetmap.h" #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" +#include "llpersonmodelcommon.h" +#include "llpersonfolderview.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -696,7 +698,6 @@ BOOL LLPanelPeople::postBuild() LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); - folder_view_params.rect.left(0).right(0).top(0).bottom(0); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mConversationViewModel; @@ -709,7 +710,9 @@ BOOL LLPanelPeople::postBuild() //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); - //scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + scroller_view_rect.mTop -= 4; + scroller_view_rect.mRight -=6; + scroller_view_rect.mLeft += 2; LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); scroller_params.rect(scroller_view_rect); @@ -722,21 +725,18 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLConversationItemSession* item = new LLConversationItemSession(LLUUID(NULL), mConversationViewModel); - item->renameItem("Facebook Friends"); - LLConversationViewSession::Params params; - + LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel); + LLPersonFolderView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; params.listener = item; params.tool_tip = params.name; - params.container = LLFloaterIMContainer::getInstance(); - LLConversationViewSession * widget = LLUICtrlFactory::create(params); + LLPersonFolderView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); - mConversationsItems[LLUUID(NULL)] = item; - mConversationsWidgits[LLUUID(NULL)] = widget; - + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; + gIdleCallbacks.addFunction(idle, this); //===Test END======================================================================== @@ -1656,28 +1656,32 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) bool LLPanelPeople::onConversationModelEvent(const LLSD& event) { std::string type = event.get("type").asString(); - LLUUID session_id = event.get("session_uuid").asUUID(); - LLUUID participant_id = event.get("participant_uuid").asUUID(); + LLUUID folder_id = event.get("folder_id").asUUID(); + LLUUID person_id = event.get("person_id").asUUID(); if(type == "add_participant") { - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[session_id]); - LLConversationViewSession * session_view = dynamic_cast(mConversationsWidgits[session_id]); - LLConversationItemParticipant * participant_model = session_model->findParticipant(participant_id); - - if(participant_model) + LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonFolderView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + + if(person_folder_model) { - LLConversationViewParticipant * participant_view = createConversationViewParticipant(participant_model); - participant_view->addToFolder(session_view); + LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + + if(person_model) + { + LLPersonView * participant_view = createConversationViewParticipant(person_model); + participant_view->addToFolder(person_folder_view); + } } } return false; } -LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant(LLConversationItem * item) +LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item) { - LLConversationViewParticipant::Params params; + LLPersonView::Params params; LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); params.name = item->getDisplayName(); @@ -1687,10 +1691,9 @@ LLConversationViewParticipant * LLPanelPeople::createConversationViewParticipant //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); params.tool_tip = params.name; - params.participant_id = item->getUUID(); params.folder_indentation = 2; - return LLUICtrlFactory::create(params); + return LLUICtrlFactory::create(params); } void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) @@ -1718,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - if(session_model) - { - addParticipantToModel(session_model, agent_id, name); - } + //LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); + //if(session_model) + //{ + // addParticipantToModel(session_model, agent_id, name); + //} } } @@ -1730,22 +1733,17 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - addParticipantToModel(session_model, LLUUID().generateNewID(), "Test"); - } + LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } +} -void LLPanelPeople::addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name) +void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name) { - LLConversationItemParticipant* participant = NULL; - - // Create a participant model - LLAvatarName avatar_name; - bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); - std::string avatar_name_string = has_name ? name + " (" + avatar_name.getDisplayName() + ")" : name; + LLPersonModel* person_model = NULL; - participant = new LLConversationItemParticipant(avatar_name_string , agent_id, mConversationViewModel); - session_model->addParticipant(participant); + person_model = new LLPersonModel(name, mConversationViewModel); + person_folder_model->addParticipant(person_model); } void LLPanelPeople::hideFacebookFriends() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b4582d9a3e..935171df2b 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -45,6 +45,14 @@ class LLMenuButton; class LLTabContainer; class LLFolderView; +class LLPersonFolderModel; +class LLPersonFolderView; +class LLPersonView; +class LLPersonModel; + +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; + class LLPanelPeople : public LLPanel , public LLVoiceClientStatusObserver @@ -66,7 +74,7 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); - void addParticipantToModel(LLConversationItemSession * session_model, const LLUUID& agent_id, const std::string& name); + void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); @@ -157,7 +165,7 @@ private: bool isAccordionCollapsedByUser(const std::string& name); bool onConversationModelEvent(const LLSD& event); - LLConversationViewParticipant * createConversationViewParticipant(LLConversationItem * item); + LLPersonView * createConversationViewParticipant(LLPersonModel * item); LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; @@ -181,8 +189,8 @@ private: LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; - conversations_items_map mConversationsItems; - conversations_widgets_map mConversationsWidgits; + person_folder_model_map mPersonFolderModelMap; + person_folder_view_map mPersonFolderViewMap; LLConversationViewModel mConversationViewModel; LLFolderView* mConversationsRoot; LLEventStream mConversationsEventStream; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..e1f1cbb1fa --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,126 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + +static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); + +const LLColor4U DEFAULT_WHITE(255, 255, 255); + +LLPersonFolderView::Params::Params() +{} + +LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) : +LLFolderViewFolder(p) +{ + +} + +S32 LLPersonFolderView::getLabelXPos() +{ + return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; +} + +LLPersonFolderView::~LLPersonFolderView() +{ + +} + +void LLPersonFolderView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerif(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = sFgColor; + F32 right_x = 0; + + drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + + updateLabelRotation(); + drawOpenFolderArrow(default_params, sFgColor); + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} + +// +// LLPersonFolderModel +// + + +LLPersonView::Params::Params() +{} + +LLPersonView::LLPersonView(const LLPersonView::Params& p) : +LLFolderViewItem(p) +{ + +} + +S32 LLPersonView::getLabelXPos() +{ + return getIndentation(); +} + +void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) +{ + LLFolderViewItem::addToFolder(person_folder_view); + //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + person_folder_view->requestArrange(); +} + +LLPersonView::~LLPersonView() +{ + +} + +void LLPersonView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + F32 right_x = 0; + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..de032ac674 --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,93 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +#include "llavatariconctrl.h" +#include "llfolderviewitem.h" + +class LLPersonFolderView : public LLFolderViewFolder +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonFolderView(const LLPersonFolderView::Params& p); + virtual ~LLPersonFolderView(); + + S32 getLabelXPos(); + + +protected: + void draw(); + +private: +}; + +class LLPersonView : public LLFolderViewItem +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonView(const LLPersonView::Params& p); + virtual ~LLPersonView(); + + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + +protected: + void draw(); + +private: + + LLAvatarIconCtrl* mAvatarIcon; + LLButton * mInfoBtn; + + typedef enum e_avatar_item_child { + ALIC_SPEAKER_INDICATOR, + ALIC_INFO_BUTTON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sChildrenWidths[ALIC_COUNT]; + //static void initChildrenWidths(LLConversationViewParticipant* self); + //void updateChildren(); + //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); +}; + +#endif // LL_LLPERSONFOLDERVIEW_H + diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp new file mode 100644 index 0000000000..62208b98c9 --- /dev/null +++ b/indra/newview/llpersonmodelcommon.cpp @@ -0,0 +1,158 @@ +/** +* @file llavatarfolder.cpp +* @brief Implementation of llavatarfolder +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonmodelcommon.h" + +#include "llevents.h" +#include "llsdutil.h" + +// +// LLPersonModelCommon +// + +LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mName(display_name) +{ +} + +LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mName(""), + mID(LLUUID().generateNewID()) +{ +} + +LLPersonModelCommon::~LLPersonModelCommon() +{ + +} + +void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person) +{ + LLUUID folder_id = folder->getID(); + LLUUID person_id = person->getID(); + LLSD event(LLSDMap("type", event_type)("folder_id", folder_id)("person_id", person_id)); + LLEventPumps::instance().obtain("ConversationsEventsTwo").post(event); +} + +// Virtual action callbacks +void LLPersonModelCommon::performAction(LLInventoryModel* model, std::string action) +{ +} + +void LLPersonModelCommon::openItem( void ) +{ +} + +void LLPersonModelCommon::closeItem( void ) +{ +} + +void LLPersonModelCommon::previewItem( void ) +{ +} + +void LLPersonModelCommon::showProperties(void) +{ +} + +// +// LLPersonFolderModel +// + +LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model) +{ + +} + +LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(root_view_model) +{ + +} + +void LLPersonFolderModel::addParticipant(LLPersonModel* participant) +{ + addChild(participant); + postEvent("add_participant", this, participant); +} + +void LLPersonFolderModel::removeParticipant(LLPersonModel* participant) +{ + removeChild(participant); + postEvent("remove_participant", this, participant); +} + +void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) +{ + LLPersonModel* participant = findParticipant(participant_id); + if (participant) + { + removeParticipant(participant); + } +} + +void LLPersonFolderModel::clearParticipants() +{ + clearChildren(); +} + +LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) +{ + LLPersonModel * person_model = NULL; + child_list_t::iterator iter; + + for(iter = mChildren.begin(); iter != mChildren.end(); ++iter) + { + person_model = static_cast(*iter); + + if(person_model->getID() == person_id) + { + break; + } + } + + return iter == mChildren.end() ? NULL : person_model; +} + +// +// LLConversationItemParticipant +// + +LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model) +{ +} + +LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(root_view_model) +{ +} diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h new file mode 100644 index 0000000000..76ea139479 --- /dev/null +++ b/indra/newview/llpersonmodelcommon.h @@ -0,0 +1,132 @@ +/** +* @file llavatarfolder.h +* @brief Header file for llavatarfolder +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONMODELCOMMON_H +#define LL_LLPERSONMODELCOMMON_H + +#include "../llui/llfolderviewitem.h" +#include "../llui/llfolderviewmodel.h" + +class LLPersonFolderModel; +class LLPersonModel; + +// Conversation items: we hold a list of those and create an LLFolderViewItem widget for each +// that we tuck into the mConversationsListPanel. +class LLPersonModelCommon : public LLFolderViewModelItemCommon +{ +public: + + LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model); + LLPersonModelCommon(LLFolderViewModelInterface& root_view_model); + virtual ~LLPersonModelCommon(); + + // Stub those things we won't really be using in this conversation context + virtual const std::string& getName() const { return mName; } + virtual const std::string& getDisplayName() const { return mName; } + virtual const std::string& getSearchableName() const { return mName; } + virtual LLPointer getIcon() const { return NULL; } + virtual LLPointer getOpenIcon() const { return getIcon(); } + virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } + virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + virtual BOOL isItemRenameable() const { return TRUE; } + virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; } + virtual BOOL isItemMovable( void ) const { return FALSE; } + virtual BOOL isItemRemovable( void ) const { return FALSE; } + virtual BOOL isItemInTrash( void) const { return FALSE; } + virtual BOOL removeItem() { return FALSE; } + virtual void removeBatch(std::vector& batch) { } + virtual void move( LLFolderViewModelItem* parent_listener ) { } + virtual BOOL isItemCopyable() const { return FALSE; } + virtual BOOL copyToClipboard() const { return FALSE; } + virtual BOOL cutToClipboard() const { return FALSE; } + virtual BOOL isClipboardPasteable() const { return FALSE; } + virtual void pasteFromClipboard() { } + virtual void pasteLinkFromClipboard() { } + virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } + virtual BOOL isUpToDate() const { return TRUE; } + virtual bool hasChildren() const { return FALSE; } + + virtual bool potentiallyVisible() { return true; } + virtual bool filter( LLFolderViewFilter& filter) { return false; } + virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual bool passedFilter(S32 filter_generation = -1) { return true; } + + // The action callbacks + virtual void performAction(LLInventoryModel* model, std::string action); + virtual void openItem( void ); + virtual void closeItem( void ); + virtual void previewItem( void ); + virtual void selectItem(void) { } + virtual void showProperties(void); + + // This method will be called to determine if a drop can be + // performed, and will set drop to TRUE if a drop is + // requested. + // Returns TRUE if a drop is possible/happened, FALSE otherwise. + virtual BOOL dragOrDrop(MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + std::string& tooltip_msg) { return FALSE; } + + const LLUUID& getID() {return mID;} + void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant); + +protected: + + std::string mName; // Name of the session or the participant + LLUUID mID; +}; + +class LLPersonFolderModel : public LLPersonModelCommon +{ +public: + LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonFolderModel(LLFolderViewModelInterface& root_view_model); + + LLPointer getIcon() const { return NULL; } + void addParticipant(LLPersonModel* participant); + void removeParticipant(LLPersonModel* participant); + void removeParticipant(const LLUUID& participant_id); + void clearParticipants(); + LLPersonModel* findParticipant(const LLUUID& person_id); + +private: +}; + +class LLPersonModel : public LLPersonModelCommon +{ +public: + LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(LLFolderViewModelInterface& root_view_model); + +private: + +}; + + +#endif // LL_LLPERSONMODELCOMMON_H + diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml new file mode 100644 index 0000000000..bf22230ff9 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 74f0d33dc1f81fe3d372da4b11799067349b64e7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Apr 2013 18:52:03 -0700 Subject: ACME-252: Created a folder view for the facebook connect tab --- indra/newview/llpersonfolderview.cpp | 4 ++-- indra/newview/skins/default/xui/en/widgets/person_folder_view.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index e1f1cbb1fa..97b2ce092b 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -43,7 +43,7 @@ LLFolderViewFolder(p) } S32 LLPersonFolderView::getLabelXPos() -{ +{ return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; } @@ -55,7 +55,7 @@ LLPersonFolderView::~LLPersonFolderView() void LLPersonFolderView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml index bf22230ff9..46857ac700 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml @@ -1,13 +1,13 @@ -- cgit v1.2.3 From f8ce67f0e0cd9afe8bd9542ea97d01769b690ffa Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 12:23:09 -0700 Subject: ACME-251 Create AvatarFolderItemView: Changed classes name from LLPersonFolder* to LLPersonTab* --- indra/newview/CMakeLists.txt | 4 +- indra/newview/llpanelpeople.cpp | 16 +-- indra/newview/llpanelpeople.h | 10 +- indra/newview/llpersonfolderview.cpp | 126 --------------------- indra/newview/llpersonfolderview.h | 93 --------------- indra/newview/llpersonmodelcommon.cpp | 20 ++-- indra/newview/llpersonmodelcommon.h | 10 +- indra/newview/llpersontabview.cpp | 126 +++++++++++++++++++++ indra/newview/llpersontabview.h | 93 +++++++++++++++ .../default/xui/en/widgets/person_folder_view.xml | 13 --- .../default/xui/en/widgets/person_tab_view.xml | 13 +++ 11 files changed, 262 insertions(+), 262 deletions(-) delete mode 100644 indra/newview/llpersonfolderview.cpp delete mode 100644 indra/newview/llpersonfolderview.h create mode 100644 indra/newview/llpersontabview.cpp create mode 100644 indra/newview/llpersontabview.h delete mode 100644 indra/newview/skins/default/xui/en/widgets/person_folder_view.xml create mode 100644 indra/newview/skins/default/xui/en/widgets/person_tab_view.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 84e8811ce8..145affeb60 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -453,7 +453,7 @@ set(viewer_SOURCE_FILES llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp llpersonmodelcommon.cpp - llpersonfolderview.cpp + llpersontabview.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -1032,7 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingpathtool.h llpersistentnotificationstorage.h llpersonmodelcommon.h - llpersonfolderview.h + llpersontabview.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d2d1e602be..3f4ff39644 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -64,7 +64,7 @@ #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" #include "llpersonmodelcommon.h" -#include "llpersonfolderview.h" +#include "llpersontabview.h" #include "llsidetraypanelcontainer.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings @@ -725,13 +725,13 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLPersonFolderModel* item = new LLPersonFolderModel("Facebook Friends", mConversationViewModel); - LLPersonFolderView::Params params; + LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel); + LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; params.listener = item; params.tool_tip = params.name; - LLPersonFolderView * widget = LLUICtrlFactory::create(params); + LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); mPersonFolderModelMap[item->getID()] = item; @@ -1661,8 +1661,8 @@ bool LLPanelPeople::onConversationModelEvent(const LLSD& event) if(type == "add_participant") { - LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonFolderView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); if(person_folder_model) { @@ -1733,12 +1733,12 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonFolderModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } -void LLPanelPeople::addParticipantToModel(LLPersonFolderModel * person_folder_model, const LLUUID& agent_id, const std::string& name) +void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model, const LLUUID& agent_id, const std::string& name) { LLPersonModel* person_model = NULL; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 935171df2b..d112ac2ec7 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -45,13 +45,13 @@ class LLMenuButton; class LLTabContainer; class LLFolderView; -class LLPersonFolderModel; -class LLPersonFolderView; +class LLPersonTabModel; +class LLPersonTabView; class LLPersonView; class LLPersonModel; -typedef std::map person_folder_model_map; -typedef std::map person_folder_view_map; +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; class LLPanelPeople : public LLPanel @@ -74,7 +74,7 @@ public: void openFacebookWeb(LLFloaterWebContent::Params& p); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); - void addParticipantToModel(LLPersonFolderModel * session_model, const LLUUID& agent_id, const std::string& name); + void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp deleted file mode 100644 index 97b2ce092b..0000000000 --- a/indra/newview/llpersonfolderview.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/** -* @file llpersonfolderview.cpp -* @brief Implementation of llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonfolderview.h" - -static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); - -const LLColor4U DEFAULT_WHITE(255, 255, 255); - -LLPersonFolderView::Params::Params() -{} - -LLPersonFolderView::LLPersonFolderView(const LLPersonFolderView::Params& p) : -LLFolderViewFolder(p) -{ - -} - -S32 LLPersonFolderView::getLabelXPos() -{ - return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; -} - -LLPersonFolderView::~LLPersonFolderView() -{ - -} - -void LLPersonFolderView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); - - static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); - static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerif(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = sFgColor; - F32 right_x = 0; - - drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); - - updateLabelRotation(); - drawOpenFolderArrow(default_params, sFgColor); - - drawLabel(font, text_left, y, color, right_x); - - LLView::draw(); -} - -// -// LLPersonFolderModel -// - - -LLPersonView::Params::Params() -{} - -LLPersonView::LLPersonView(const LLPersonView::Params& p) : -LLFolderViewItem(p) -{ - -} - -S32 LLPersonView::getLabelXPos() -{ - return getIndentation(); -} - -void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) -{ - LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange - person_folder_view->requestArrange(); -} - -LLPersonView::~LLPersonView() -{ - -} - -void LLPersonView::draw() -{ - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); - F32 text_left = (F32)getLabelXPos(); - F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; - F32 right_x = 0; - - drawLabel(font, text_left, y, color, right_x); - - LLView::draw(); -} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h deleted file mode 100644 index de032ac674..0000000000 --- a/indra/newview/llpersonfolderview.h +++ /dev/null @@ -1,93 +0,0 @@ -/** -* @file llpersonfolderview.h -* @brief Header file for llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONFOLDERVIEW_H -#define LL_LLPERSONFOLDERVIEW_H - -#include "llavatariconctrl.h" -#include "llfolderviewitem.h" - -class LLPersonFolderView : public LLFolderViewFolder -{ - -public: - - struct Params : public LLInitParam::Block - { - Params(); - }; - - LLPersonFolderView(const LLPersonFolderView::Params& p); - virtual ~LLPersonFolderView(); - - S32 getLabelXPos(); - - -protected: - void draw(); - -private: -}; - -class LLPersonView : public LLFolderViewItem -{ - -public: - - struct Params : public LLInitParam::Block - { - Params(); - }; - - LLPersonView(const LLPersonView::Params& p); - virtual ~LLPersonView(); - - S32 getLabelXPos(); - void addToFolder(LLFolderViewFolder * person_folder_view); - -protected: - void draw(); - -private: - - LLAvatarIconCtrl* mAvatarIcon; - LLButton * mInfoBtn; - - typedef enum e_avatar_item_child { - ALIC_SPEAKER_INDICATOR, - ALIC_INFO_BUTTON, - ALIC_COUNT, - } EAvatarListItemChildIndex; - - static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sChildrenWidths[ALIC_COUNT]; - //static void initChildrenWidths(LLConversationViewParticipant* self); - //void updateChildren(); - //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); -}; - -#endif // LL_LLPERSONFOLDERVIEW_H - diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 62208b98c9..764dd08115 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -54,7 +54,7 @@ LLPersonModelCommon::~LLPersonModelCommon() } -void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonFolderModel* folder, LLPersonModel* person) +void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person) { LLUUID folder_id = folder->getID(); LLUUID person_id = person->getID(); @@ -84,34 +84,34 @@ void LLPersonModelCommon::showProperties(void) } // -// LLPersonFolderModel +// LLPersonTabModel // -LLPersonFolderModel::LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(display_name,root_view_model) { } -LLPersonFolderModel::LLPersonFolderModel(LLFolderViewModelInterface& root_view_model) : +LLPersonTabModel::LLPersonTabModel(LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(root_view_model) { } -void LLPersonFolderModel::addParticipant(LLPersonModel* participant) +void LLPersonTabModel::addParticipant(LLPersonModel* participant) { addChild(participant); postEvent("add_participant", this, participant); } -void LLPersonFolderModel::removeParticipant(LLPersonModel* participant) +void LLPersonTabModel::removeParticipant(LLPersonModel* participant) { removeChild(participant); postEvent("remove_participant", this, participant); } -void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) +void LLPersonTabModel::removeParticipant(const LLUUID& participant_id) { LLPersonModel* participant = findParticipant(participant_id); if (participant) @@ -120,12 +120,12 @@ void LLPersonFolderModel::removeParticipant(const LLUUID& participant_id) } } -void LLPersonFolderModel::clearParticipants() +void LLPersonTabModel::clearParticipants() { clearChildren(); } -LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) +LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) { LLPersonModel * person_model = NULL; child_list_t::iterator iter; @@ -144,7 +144,7 @@ LLPersonModel* LLPersonFolderModel::findParticipant(const LLUUID& person_id) } // -// LLConversationItemParticipant +// LLPersonModel // LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 76ea139479..866d863581 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -30,7 +30,7 @@ #include "../llui/llfolderviewitem.h" #include "../llui/llfolderviewmodel.h" -class LLPersonFolderModel; +class LLPersonTabModel; class LLPersonModel; // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each @@ -93,7 +93,7 @@ public: std::string& tooltip_msg) { return FALSE; } const LLUUID& getID() {return mID;} - void postEvent(const std::string& event_type, LLPersonFolderModel* session, LLPersonModel* participant); + void postEvent(const std::string& event_type, LLPersonTabModel* session, LLPersonModel* participant); protected: @@ -101,11 +101,11 @@ protected: LLUUID mID; }; -class LLPersonFolderModel : public LLPersonModelCommon +class LLPersonTabModel : public LLPersonModelCommon { public: - LLPersonFolderModel(std::string display_name, LLFolderViewModelInterface& root_view_model); - LLPersonFolderModel(LLFolderViewModelInterface& root_view_model); + LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonTabModel(LLFolderViewModelInterface& root_view_model); LLPointer getIcon() const { return NULL; } void addParticipant(LLPersonModel* participant); diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp new file mode 100644 index 0000000000..156ff591f9 --- /dev/null +++ b/indra/newview/llpersontabview.cpp @@ -0,0 +1,126 @@ +/** +* @file llpersontabview.cpp +* @brief Implementation of llpersontabview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersontabview.h" + +static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); + +const LLColor4U DEFAULT_WHITE(255, 255, 255); + +LLPersonTabView::Params::Params() +{} + +LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : +LLFolderViewFolder(p) +{ + +} + +S32 LLPersonTabView::getLabelXPos() +{ + return getIndentation() + mArrowSize + 15;//Should be a .xml variable but causes crash; +} + +LLPersonTabView::~LLPersonTabView() +{ + +} + +void LLPersonTabView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerif(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = sFgColor; + F32 right_x = 0; + + drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + + updateLabelRotation(); + drawOpenFolderArrow(default_params, sFgColor); + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} + +// +// LLPersonView +// + + +LLPersonView::Params::Params() +{} + +LLPersonView::LLPersonView(const LLPersonView::Params& p) : +LLFolderViewItem(p) +{ + +} + +S32 LLPersonView::getLabelXPos() +{ + return getIndentation(); +} + +void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) +{ + LLFolderViewItem::addToFolder(person_folder_view); + //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + person_folder_view->requestArrange(); +} + +LLPersonView::~LLPersonView() +{ + +} + +void LLPersonView::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + F32 text_left = (F32)getLabelXPos(); + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; + LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + F32 right_x = 0; + + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h new file mode 100644 index 0000000000..9aabad26fc --- /dev/null +++ b/indra/newview/llpersontabview.h @@ -0,0 +1,93 @@ +/** +* @file llpersontabview.h +* @brief Header file for llpersontabview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONTABVIEW_H +#define LL_LLPERSONTABVIEW_H + +#include "llavatariconctrl.h" +#include "llfolderviewitem.h" + +class LLPersonTabView : public LLFolderViewFolder +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonTabView(const LLPersonTabView::Params& p); + virtual ~LLPersonTabView(); + + S32 getLabelXPos(); + + +protected: + void draw(); + +private: +}; + +class LLPersonView : public LLFolderViewItem +{ + +public: + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLPersonView(const LLPersonView::Params& p); + virtual ~LLPersonView(); + + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + +protected: + void draw(); + +private: + + LLAvatarIconCtrl* mAvatarIcon; + LLButton * mInfoBtn; + + typedef enum e_avatar_item_child { + ALIC_SPEAKER_INDICATOR, + ALIC_INFO_BUTTON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sChildrenWidths[ALIC_COUNT]; + //static void initChildrenWidths(LLConversationViewParticipant* self); + //void updateChildren(); + //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); +}; + +#endif // LL_LLPERSONTABVIEW_H + diff --git a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml b/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml deleted file mode 100644 index 46857ac700..0000000000 --- a/indra/newview/skins/default/xui/en/widgets/person_folder_view.xml +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml new file mode 100644 index 0000000000..46857ac700 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 2ca3612dae3258b489df8e47879f8339e24947ba Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 14:02:36 -0700 Subject: ACME-251 Create AvatarFolderItemView: When making the folderview using LLPersonModelCommon instead of LLConverationItem. Also the .xml file file read in for LLPersonTabView was incorrect, now using person_tab_view.xml. And lastly made a new file called llpersonfolderview which which be the implementation of folderview. --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonfolderview.cpp | 32 +++++++++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 37 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersontabview.cpp | 2 +- 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 145affeb60..52ce82560b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 3f4ff39644..91f7c61088 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -695,7 +695,7 @@ BOOL LLPanelPeople::postBuild() LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); //Create folder view - LLConversationItem* base_item = new LLConversationItem(mConversationViewModel); + LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..e04eda2658 --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,32 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + + diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..f96e45abc6 --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,37 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +#include "llfolderview.h" + +#endif // LL_LLPERSONFOLDERVIEW_H + +class LLPersonFolderView : public LLFolderView +{ + +}; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 156ff591f9..72a95d3f4c 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -29,7 +29,7 @@ #include "llpersontabview.h" -static LLDefaultChildRegistry::Register r_person_folder_view("person_folder_view"); +static LLDefaultChildRegistry::Register r_person_tab_view("person_tab_view"); const LLColor4U DEFAULT_WHITE(255, 255, 255); -- cgit v1.2.3 From 1a5ef465ef4059e05a21aae0aa2c6de610f7485f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 17:14:13 -0700 Subject: ACME-251 Create AvatarFolderItemView: Now the facebook friends tab is using LLPersonFolderViewModel instead of mConversationViewModel --- indra/newview/llpanelpeople.cpp | 8 ++-- indra/newview/llpanelpeople.h | 4 +- indra/newview/llpersonfolderview.cpp | 32 ---------------- indra/newview/llpersonfolderview.h | 37 ------------------ indra/newview/llpersonmodelcommon.h | 73 ++++++++++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 75 deletions(-) delete mode 100644 indra/newview/llpersonfolderview.cpp delete mode 100644 indra/newview/llpersonfolderview.h (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 91f7c61088..02a286b880 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -695,12 +695,12 @@ BOOL LLPanelPeople::postBuild() LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); //Create folder view - LLPersonModelCommon* base_item = new LLPersonModelCommon(mConversationViewModel); + LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; - folder_view_params.view_model = &mConversationViewModel; + folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; @@ -725,7 +725,7 @@ BOOL LLPanelPeople::postBuild() //Create a session //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); - LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mConversationViewModel); + LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = mConversationsRoot; @@ -1742,7 +1742,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(name, mConversationViewModel); + person_model = new LLPersonModel(name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d112ac2ec7..f1fa7ec981 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -30,7 +30,7 @@ #include #include "llcallingcard.h" // for avatar tracker -#include "llconversationmodel.h" +#include "llpersonmodelcommon.h" #include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -191,7 +191,7 @@ private: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - LLConversationViewModel mConversationViewModel; + LLPersonFolderViewModel mPersonFolderViewModel; LLFolderView* mConversationsRoot; LLEventStream mConversationsEventStream; }; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp deleted file mode 100644 index e04eda2658..0000000000 --- a/indra/newview/llpersonfolderview.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** -* @file llpersonfolderview.cpp -* @brief Implementation of llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llpersonfolderview.h" - - diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h deleted file mode 100644 index f96e45abc6..0000000000 --- a/indra/newview/llpersonfolderview.h +++ /dev/null @@ -1,37 +0,0 @@ -/** -* @file llpersonfolderview.h -* @brief Header file for llpersonfolderview -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLPERSONFOLDERVIEW_H -#define LL_LLPERSONFOLDERVIEW_H - -#include "llfolderview.h" - -#endif // LL_LLPERSONFOLDERVIEW_H - -class LLPersonFolderView : public LLFolderView -{ - -}; diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 866d863581..f3454df53f 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -127,6 +127,79 @@ private: }; +//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further + +class LLPersonViewFilter : public LLFolderViewFilter +{ +public: + + enum ESortOrderType + { + SO_NAME = 0, // Sort by name + SO_DATE = 0x1, // Sort by date (most recent) + SO_SESSION_TYPE = 0x2, // Sort by type (valid only for sessions) + SO_DISTANCE = 0x3, // Sort by distance (valid only for participants in nearby chat) + }; + // Default sort order is by type for sessions and by date for participants + static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); + + LLPersonViewFilter() { mEmpty = ""; } + ~LLPersonViewFilter() {} + + bool check(const LLFolderViewModelItem* item) { return true; } + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + void setEmptyLookupMessage(const std::string& message) { } + std::string getEmptyLookupMessage() const { return mEmpty; } + bool showAllResults() const { return true; } + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; } + std::string::size_type getFilterStringSize() const { return 0; } + + bool isActive() const { return false; } + bool isModified() const { return false; } + void clearModified() { } + const std::string& getName() const { return mEmpty; } + const std::string& getFilterText() { return mEmpty; } + void setModified(EFilterModified behavior = FILTER_RESTART) { } + + void setFilterCount(S32 count) { } + S32 getFilterCount() const { return 0; } + void decrementFilterCount() { } + + bool isDefault() const { return true; } + bool isNotDefault() const { return false; } + void markDefault() { } + void resetDefault() { } + + S32 getCurrentGeneration() const { return 0; } + S32 getFirstSuccessGeneration() const { return 0; } + S32 getFirstRequiredGeneration() const { return 0; } +private: + std::string mEmpty; +}; + +class LLPersonViewSort +{ +public: + LLPersonViewSort(U32 order = LLPersonViewFilter::SO_DEFAULT) : mSortOrder(order) { } + + bool operator()(const LLPersonModelCommon* const& a, const LLPersonModelCommon* const& b) const {return false;} + operator U32() const { return mSortOrder; } +private: + // Note: we're treating this value as a sort order bitmask as done in other places in the code (e.g. inventory) + U32 mSortOrder; +}; + + +class LLPersonFolderViewModel + : public LLFolderViewModel +{ +public: + typedef LLFolderViewModel base_t; + + void sort(LLFolderViewFolder* folder) { base_t::sort(folder);} + bool startDrag(std::vector& items) { return false; } // We do not allow drag of conversation items +}; + #endif // LL_LLPERSONMODELCOMMON_H -- cgit v1.2.3 From 6aa08021c75d2674002c766b3bc02ea8773ee35f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 23 Apr 2013 17:15:22 -0700 Subject: Fix build failures on Mac : suppress cruft that tripped gcc --- indra/newview/llpersontabview.cpp | 2 +- indra/newview/llsociallist.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 72a95d3f4c..fff72c7758 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -117,7 +117,7 @@ void LLPersonView::draw() const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); F32 text_left = (F32)getLabelXPos(); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; - LLColor4 color = color = mIsSelected ? sHighlightFgColor : sFgColor; + LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; F32 right_x = 0; drawLabel(font, text_left, y, color, right_x); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp index bcf6d5a63c..9f827cf04f 100644 --- a/indra/newview/llsociallist.cpp +++ b/indra/newview/llsociallist.cpp @@ -1,4 +1,3 @@ -sDestroyImmediate /** * @file llsociallist.cpp * @brief Implementation of llsociallist @@ -37,7 +36,7 @@ sDestroyImmediate #include "llavatarnamecache.h" #include "lloutputmonitorctrl.h" #include "lltextutil.h" - + static LLDefaultChildRegistry::Register r("social_list"); LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) -- cgit v1.2.3 From b9d9a40273dc574c95b3a83587c526eb140c9922 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 17:16:43 -0700 Subject: ACME-251 Create AvatarFolderItemView: forgot to remove deleted files from indra/newview/CMakeLists.txt. --- indra/newview/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 52ce82560b..145affeb60 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,7 +452,6 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp - llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1032,7 +1031,6 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h - llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h -- cgit v1.2.3 From 955cc72f90413d5c28023d7d6a0a4ac58d04e74a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 23 Apr 2013 18:38:54 -0700 Subject: ACME-251 Create AvatarFolderItemView: Re-adding llpersonfolderview.h/cpp and to use a class called LLPersonFolderView to manage the creation of subwidgits and selection of tabs. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llpanelpeople.cpp | 58 +++--------------------- indra/newview/llpanelpeople.h | 19 +------- indra/newview/llpersonfolderview.cpp | 88 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 63 ++++++++++++++++++++++++++ 5 files changed, 161 insertions(+), 69 deletions(-) create mode 100644 indra/newview/llpersonfolderview.cpp create mode 100644 indra/newview/llpersonfolderview.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 145affeb60..52ce82560b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -452,6 +452,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpersistentnotificationstorage.cpp + llpersonfolderview.cpp llpersonmodelcommon.cpp llpersontabview.cpp llphysicsmotion.cpp @@ -1031,6 +1032,7 @@ set(viewer_HEADER_FILES llpathfindingobjectlist.h llpathfindingpathtool.h llpersistentnotificationstorage.h + llpersonfolderview.h llpersonmodelcommon.h llpersontabview.h llphysicsmotion.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 02a286b880..c4ce56cb4f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -63,6 +63,7 @@ #include "llnetmap.h" #include "llpanelpeoplemenus.h" #include "llparticipantlist.h" +#include "llpersonfolderview.h" #include "llpersonmodelcommon.h" #include "llpersontabview.h" #include "llsidetraypanelcontainer.h" @@ -549,7 +550,6 @@ LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), mConversationsRoot(NULL), - mConversationsEventStream("ConversationsEventsTwo"), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -605,8 +605,6 @@ LLPanelPeople::~LLPanelPeople() } if (mFbcTestBrowserHandle.get()) mFbcTestBrowserHandle.get()->die(); - - mConversationsEventStream.stopListening("ConversationsRefresh"); } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -697,7 +695,7 @@ BOOL LLPanelPeople::postBuild() //Create folder view LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); - LLFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); + LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); folder_view_params.parent_panel = friends_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; @@ -705,8 +703,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; - mConversationsRoot = LLUICtrlFactory::create(folder_view_params); - mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPanelPeople::onConversationModelEvent, this, _1)); + mConversationsRoot = LLUICtrlFactory::create(folder_view_params); //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); @@ -734,8 +731,8 @@ BOOL LLPanelPeople::postBuild() LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; + mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); @@ -1653,49 +1650,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -bool LLPanelPeople::onConversationModelEvent(const LLSD& event) -{ - std::string type = event.get("type").asString(); - LLUUID folder_id = event.get("folder_id").asUUID(); - LLUUID person_id = event.get("person_id").asUUID(); - - if(type == "add_participant") - { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); - - if(person_folder_model) - { - LLPersonModel * person_model = person_folder_model->findParticipant(person_id); - - if(person_model) - { - LLPersonView * participant_view = createConversationViewParticipant(person_model); - participant_view->addToFolder(person_folder_view); - } - } - } - - return false; -} - -LLPersonView * LLPanelPeople::createConversationViewParticipant(LLPersonModel * item) -{ - LLPersonView::Params params; - LLRect panel_rect = getChild(FBCTESTTWO_TAB_NAME)->getRect(); - - params.name = item->getDisplayName(); - params.root = mConversationsRoot; - params.listener = item; - - //24 is the the current hight of an item (itemHeight) loaded from conversation_view_participant.xml. - params.rect = LLRect (0, 24, panel_rect.getWidth(), 0); - params.tool_tip = params.name; - params.folder_indentation = 2; - - return LLUICtrlFactory::create(params); -} - void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { LLFloater* browser = LLFloaterReg::showInstance("web_content", p); @@ -1733,7 +1687,7 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mConversationsRoot->mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f1fa7ec981..a448b7935e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -31,7 +31,6 @@ #include "llcallingcard.h" // for avatar tracker #include "llpersonmodelcommon.h" -#include "llevents.h" #include "llfloaterwebcontent.h" #include "llvoiceclient.h" @@ -40,18 +39,10 @@ class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; +class LLPersonFolderView; class LLSocialList; class LLMenuButton; class LLTabContainer; -class LLFolderView; - -class LLPersonTabModel; -class LLPersonTabView; -class LLPersonView; -class LLPersonModel; - -typedef std::map person_folder_model_map; -typedef std::map person_folder_view_map; class LLPanelPeople : public LLPanel @@ -164,9 +155,6 @@ private: bool isAccordionCollapsedByUser(LLUICtrl* acc_tab); bool isAccordionCollapsedByUser(const std::string& name); - bool onConversationModelEvent(const LLSD& event); - LLPersonView * createConversationViewParticipant(LLPersonModel * item); - LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; @@ -189,11 +177,8 @@ private: LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; - person_folder_model_map mPersonFolderModelMap; - person_folder_view_map mPersonFolderViewMap; LLPersonFolderViewModel mPersonFolderViewModel; - LLFolderView* mConversationsRoot; - LLEventStream mConversationsEventStream; + LLPersonFolderView* mConversationsRoot; }; #endif //LL_LLPANELPEOPLE_H diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp new file mode 100644 index 0000000000..d94c8cf32f --- /dev/null +++ b/indra/newview/llpersonfolderview.cpp @@ -0,0 +1,88 @@ +/** +* @file llpersonfolderview.cpp +* @brief Implementation of llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpersonfolderview.h" + +#include "llpersontabview.h" +#include "llpersonmodelcommon.h" + + +LLPersonFolderView::LLPersonFolderView(const Params &p) : +LLFolderView(p), + mConversationsEventStream("ConversationsEventsTwo") +{ + mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); +} + +LLPersonFolderView::~LLPersonFolderView() +{ + mConversationsEventStream.stopListening("ConversationsRefresh"); +} + +bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) +{ + std::string type = event.get("type").asString(); + LLUUID folder_id = event.get("folder_id").asUUID(); + LLUUID person_id = event.get("person_id").asUUID(); + + if(type == "add_participant") + { + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + + if(person_folder_model) + { + LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + + if(person_model) + { + LLPersonView * participant_view = createConversationViewParticipant(person_model); + participant_view->addToFolder(person_folder_view); + } + } + } + + return false; +} + +LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonModel * item) +{ + LLPersonView::Params params; + + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + + //24 should be loaded from .xml somehow + params.rect = LLRect (0, 24, getRect().getWidth(), 0); + params.tool_tip = params.name; + params.folder_indentation = 2; + + return LLUICtrlFactory::create(params); +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h new file mode 100644 index 0000000000..60260dc5ea --- /dev/null +++ b/indra/newview/llpersonfolderview.h @@ -0,0 +1,63 @@ +/** +* @file llpersonfolderview.h +* @brief Header file for llpersonfolderview +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPERSONFOLDERVIEW_H +#define LL_LLPERSONFOLDERVIEW_H + +class LLPersonTabModel; +class LLPersonTabView; +class LLPersonView; +class LLPersonModel; + +typedef std::map person_folder_model_map; +typedef std::map person_folder_view_map; + +#include "llevents.h" +#include "llfolderview.h" + +class LLPersonFolderView : public LLFolderView +{ +public: + struct Params : public LLInitParam::Block + { + Params() + {} + }; + + LLPersonFolderView(const Params &p); + ~LLPersonFolderView(); + + bool onConversationModelEvent(const LLSD &event); + + LLPersonView * createConversationViewParticipant(LLPersonModel * item); + + person_folder_model_map mPersonFolderModelMap; + person_folder_view_map mPersonFolderViewMap; + LLEventStream mConversationsEventStream; +}; + +#endif // LL_LLPERSONFOLDERVIEW_H + -- cgit v1.2.3 From 87ba85eaabbfd5fd7ad8ca8136f4783b1d932264 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 09:35:38 -0700 Subject: =?UTF-8?q?=C3=AF=C2=BB=C2=BFdiff=20-r=2059c7bed66dfd=20indra/llco?= =?UTF-8?q?mmon/lleventapi.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llfloaterwebcontent.cpp | 2 +- indra/newview/llfloaterwebcontent.h | 4 ++-- indra/newview/llmediactrl.cpp | 2 +- indra/newview/llmediactrl.h | 2 +- indra/newview/llnamelistctrl.h | 2 +- indra/newview/lltoast.cpp | 3 ++- indra/newview/lltoast.h | 2 +- indra/newview/lltoastnotifypanel.cpp | 2 +- indra/newview/lltoastnotifypanel.h | 2 +- indra/newview/lltoolselect.h | 2 +- indra/newview/tests/llagentaccess_test.cpp | 2 +- indra/newview/tests/lllogininstance_test.cpp | 2 +- indra/newview/tests/llremoteparcelrequest_test.cpp | 2 +- indra/newview/tests/llsecapi_test.cpp | 2 +- indra/newview/tests/llsechandler_basic_test.cpp | 2 +- indra/newview/tests/llslurl_test.cpp | 2 +- indra/newview/tests/lltranslate_test.cpp | 2 +- indra/newview/tests/llviewerhelputil_test.cpp | 2 +- indra/newview/tests/llviewernetwork_test.cpp | 2 +- indra/newview/tests/llworldmipmap_test.cpp | 2 +- 20 files changed, 22 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 94c3f4149c..3fe2518de6 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -54,7 +54,7 @@ LLFloaterWebContent::_Params::_Params() LLFloaterWebContent::LLFloaterWebContent( const Params& params ) : LLFloater( params ), - INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string)(params.id()), + LLInstanceTracker(params.id()), mWebBrowser(NULL), mAddressCombo(NULL), mSecureLockIcon(NULL), diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 409c15fb0b..86b5a5e00b 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -40,11 +40,11 @@ class LLIconCtrl; class LLFloaterWebContent : public LLFloater, public LLViewerMediaObserver, - public INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string) + public LLInstanceTracker { public: - typedef INSTANCE_TRACKER_KEYED(LLFloaterWebContent, std::string) instance_tracker_t; + typedef LLInstanceTracker instance_tracker_t; LOG_CLASS(LLFloaterWebContent); struct _Params : public LLInitParam::Block<_Params> diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 6362165c77..2075aeed63 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -81,7 +81,7 @@ LLMediaCtrl::Params::Params() LLMediaCtrl::LLMediaCtrl( const Params& p) : LLPanel( p ), - INSTANCE_TRACKER_KEYED(LLMediaCtrl, LLUUID)(LLUUID::generateNewID()), + LLInstanceTracker(LLUUID::generateNewID()), mTextureDepthBytes( 4 ), mBorder(NULL), mFrequentUpdates( true ), diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 4fed21bf22..6c38c1fb56 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -42,7 +42,7 @@ class LLMediaCtrl : public LLPanel, public LLViewerMediaObserver, public LLViewerMediaEventEmitter, - public INSTANCE_TRACKER_KEYED(LLMediaCtrl, LLUUID) + public LLInstanceTracker { LOG_CLASS(LLMediaCtrl); public: diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index d82727f018..92e82b672d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -64,7 +64,7 @@ private: class LLNameListCtrl -: public LLScrollListCtrl, public INSTANCE_TRACKER(LLNameListCtrl) +: public LLScrollListCtrl, public LLInstanceTracker { public: diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 49debe67f6..a26e47e1c8 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -572,7 +572,8 @@ S32 LLToast::notifyParent(const LLSD& info) //static void LLToast::updateClass() { - for (INSTANCE_TRACKER(LLToast)::instance_iter iter = INSTANCE_TRACKER(LLToast)::beginInstances(); iter != INSTANCE_TRACKER(LLToast)::endInstances(); ) + for (LLInstanceTracker::instance_iter iter = LLInstanceTracker::beginInstances(); + iter != LLInstanceTracker::endInstances(); ) { LLToast& toast = *iter++; diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 718b464977..5da7120e84 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -69,7 +69,7 @@ private : * Represents toast pop-up. * This is a parent view for all toast panels. */ -class LLToast : public LLModalDialog, public INSTANCE_TRACKER(LLToast) +class LLToast : public LLModalDialog, public LLInstanceTracker { friend class LLToastLifeTimer; public: diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 9b5ccc0150..94d07b37ef 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -57,7 +57,7 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images) : LLToastPanel(notification), - LLInstanceTracker(notification->getID()) + LLInstanceTracker(notification->getID()) { init(rect, show_images); } diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index 5de75a7a9f..d02171b512 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -47,7 +47,7 @@ class LLNotificationForm; * @deprecated this class will be removed after all toast panel types are * implemented in separate classes. */ -class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker +class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker { public: /** diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index baa27f6071..74dababe8c 100644 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -34,7 +34,7 @@ class LLObjectSelection; -class LLToolSelect : public LLTool, public LLSingleton +class LLToolSelect : public LLTool { public: LLToolSelect( LLToolComposite* composite ); diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 426ad40342..05289f0309 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -40,7 +40,7 @@ static U32 test_preferred_maturity = SIM_ACCESS_PG; LLControlGroup::LLControlGroup(const std::string& name) - : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) +: LLInstanceTracker(name) { } diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 25da5939f1..7705b4c567 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -167,7 +167,7 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid_name) LLControlGroup gSavedSettings("Global"); LLControlGroup::LLControlGroup(const std::string& name) : - INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name){} + LLInstanceTracker(name){} LLControlGroup::~LLControlGroup() {} void LLControlGroup::setBOOL(const std::string& name, BOOL val) {} BOOL LLControlGroup::getBOOL(const std::string& name) { return FALSE; } diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index da273132db..ed66066b0a 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -69,7 +69,7 @@ void LLAgent::sendReliableMessage(void) { } LLUUID gAgentSessionID; LLUUID gAgentID; LLUIColor::LLUIColor(void) { } -LLControlGroup::LLControlGroup(std::string const & name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) { } +LLControlGroup::LLControlGroup(std::string const & name) : LLInstanceTracker(name) { } LLControlGroup::~LLControlGroup(void) { } void LLUrlEntryParcel::processParcelInfo(const LLUrlEntryParcel::LLParcelData& parcel_data) { } diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 83a4149971..703603e2db 100644 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -37,7 +37,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 814010028f..0235400976 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -69,7 +69,7 @@ extern bool _cert_hostname_wildcard_match(const std::string& hostname, const std std::string gFirstName; std::string gLastName; LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index d7debd6c67..09343ef227 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -35,7 +35,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp index c13660332d..fd9527d631 100644 --- a/indra/newview/tests/lltranslate_test.cpp +++ b/indra/newview/tests/lltranslate_test.cpp @@ -295,7 +295,7 @@ LLControlGroup gSavedSettings("test"); std::string LLUI::getLanguage() { return "en"; } std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; } -LLControlGroup::LLControlGroup(const std::string& name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {} std::string LLControlGroup::getString(const std::string& name) { return "dummy"; } LLControlGroup::~LLControlGroup() {} diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 102cad8852..710881d811 100644 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -47,7 +47,7 @@ static std::string gOS; // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) - : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} + : LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 725b5122fb..a1e97ea17e 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -35,7 +35,7 @@ // Mock objects for the dependencies of the code we're testing LLControlGroup::LLControlGroup(const std::string& name) -: INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) {} +: LLInstanceTracker(name) {} LLControlGroup::~LLControlGroup() {} BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, diff --git a/indra/newview/tests/llworldmipmap_test.cpp b/indra/newview/tests/llworldmipmap_test.cpp index a6a2f8d7b9..142d75bcfd 100644 --- a/indra/newview/tests/llworldmipmap_test.cpp +++ b/indra/newview/tests/llworldmipmap_test.cpp @@ -46,7 +46,7 @@ void LLGLTexture::setBoostLevel(S32 ) { } LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string&, FTType, BOOL, LLGLTexture::EBoostLevel, S8, LLGLint, LLGLenum, const LLUUID& ) { return NULL; } -LLControlGroup::LLControlGroup(const std::string& name) : INSTANCE_TRACKER_KEYED(LLControlGroup, std::string)(name) { } +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) { } LLControlGroup::~LLControlGroup() { } std::string LLControlGroup::getString(const std::string& ) { return std::string("test_url"); } LLControlGroup gSavedSettings("test_settings"); -- cgit v1.2.3 From cbd3f4b9974c23dc127e080a090c26645b8aa00c Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 10:24:42 -0700 Subject: Fix crash discovered during other testing. Reviewed by Kelly --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b1b31240e9..83b7cae347 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1235,8 +1235,8 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mLODReqQ.push(req); LLMeshRepository::sLODProcessing++; } + mPendingLOD.erase(iter); } - mPendingLOD.erase(iter); } return true; -- cgit v1.2.3 From cc3361352df3463e9ba16e57c04cc35e65821f33 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 15:34:18 -0700 Subject: Follow-up code cleaning for LLToast work trying to get branch healthy. Reviewed by Kelly --- indra/newview/llfloaterimnearbychathandler.cpp | 13 ++++---- indra/newview/lltoast.cpp | 41 ++++++++++++++++++++++++-- indra/newview/lltoast.h | 1 + indra/newview/llviewerwindow.cpp | 4 +++ 4 files changed, 49 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 9ce5e12897..c4d7bbb7f6 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -187,14 +187,11 @@ void LLFloaterIMNearbyChatScreenChannel::deactivateToast(LLToast* toast) { toast_vec_t::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast->getHandle()); - if (pos == m_active_toasts.end()) + if (pos != m_active_toasts.end()) { - llassert(pos == m_active_toasts.end()); - return; + LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; + m_active_toasts.erase(pos); } - - LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; - m_active_toasts.erase(pos); } void LLFloaterIMNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 timer) @@ -210,8 +207,8 @@ void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool a { // Viewer is quitting. // Immediately stop processing chat messages (EXT-1419). - mStopProcessing = true; -} + mStopProcessing = true; + } else { // The toast is being closed by user (STORM-192). diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index a26e47e1c8..4b60f49573 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -173,8 +173,20 @@ void LLToast::setHideButtonEnabled(bool enabled) //-------------------------------------------------------------------------- LLToast::~LLToast() -{ - mOnToastDestroyedSignal(this); +{ + if(LLApp::isQuitting()) + { + mOnFadeSignal.disconnect_all_slots(); + mOnDeleteToastSignal.disconnect_all_slots(); + mOnToastDestroyedSignal.disconnect_all_slots(); + mOnToastHoverSignal.disconnect_all_slots(); + mToastMouseEnterSignal.disconnect_all_slots(); + mToastMouseLeaveSignal.disconnect_all_slots(); + } + else + { + mOnToastDestroyedSignal(this); + } } //-------------------------------------------------------------------------- @@ -580,3 +592,28 @@ void LLToast::updateClass() toast.updateHoveredState(); } } + +// static +void LLToast::cleanupToasts() +{ + LL_CHECK_MEMORY; + + LLToast * toastp = NULL; + + while (LLInstanceTracker::instanceCount() > 0) + { + { // Need to scope iter to allow deletion + LLInstanceTracker::instance_iter iter = LLInstanceTracker::beginInstances(); + toastp = &(*iter); + } + + //llinfos << "Cleaning up toast id " << toastp->getNotificationID() << llendl; + + // LLToast destructor will remove it from the LLInstanceTracker. + if (!toastp) + break; // Don't get stuck in the loop if a null pointer somehow got on the list + + delete toastp; + } +} + diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 5da7120e84..f02d7c2a1a 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -106,6 +106,7 @@ public: }; static void updateClass(); + static void cleanupToasts(); LLToast(const LLToast::Params& p); virtual ~LLToast(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bb71707db6..136e61389a 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -150,6 +150,7 @@ #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltextureview.h" +#include "lltoast.h" #include "lltool.h" #include "lltoolbarview.h" #include "lltoolcomp.h" @@ -2035,6 +2036,9 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; + LLNotificationsUI::LLToast::cleanupToasts(); + llinfos << "Leftover toast cleaned up." << llendl; + // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); -- cgit v1.2.3 From 7cb2f4f35856d4b51132d3915c05ac69dc3a90d5 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Apr 2013 16:02:12 -0700 Subject: Remove an un-needed LL_CHECK_MEMORY check --- indra/newview/lltoast.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 4b60f49573..d876c9a3f4 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -596,8 +596,6 @@ void LLToast::updateClass() // static void LLToast::cleanupToasts() { - LL_CHECK_MEMORY; - LLToast * toastp = NULL; while (LLInstanceTracker::instanceCount() > 0) -- cgit v1.2.3 From 4921c654939d118cb4f9847512d6e3008c67428f Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 25 Apr 2013 00:10:09 +0100 Subject: added SLApp for fbc --- indra/newview/llpanelpeople.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c4ce56cb4f..04881a12f1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -75,6 +75,8 @@ #include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" +#include "llurlaction.h" +#include "llcommandhandler.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -92,6 +94,36 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; +class LLFacebookConnectHandler : public LLCommandHandler +{ +public: + LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { } + + LLPanelPeople* mPanelPeople; + + bool handle(const LLSD& tokens, const LLSD& query_map, + LLMediaCtrl* web) + { + if (tokens.size() > 0) + { + if (tokens[0].asString() == "connect") + { + if (query_map.has("code")) + { + if (mPanelPeople) + { + mPanelPeople->connectToFacebook(query_map["code"]); + return true; + } + } + } + } + + return false; + } +}; +LLFacebookConnectHandler gFacebookConnectHandler; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -1652,6 +1684,9 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) { + gFacebookConnectHandler.mPanelPeople = this; + LLUrlAction::openURLExternal(p.url); + LLFloater* browser = LLFloaterReg::showInstance("web_content", p); if (browser) -- cgit v1.2.3 From 1787988c47921478598c5f47828f3dde8922ffa6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 24 Apr 2013 17:41:49 -0700 Subject: ACME-251 Create AvatarFolderItemView: Adding in code to make the persontab's function more like accordiontabs --- indra/newview/llpanelpeople.cpp | 13 ++++++++++++- indra/newview/llpersonfolderview.cpp | 19 +++++++++++++++++++ indra/newview/llpersonfolderview.h | 3 ++- indra/newview/llpersontabview.cpp | 17 +++++++++++++++-- indra/newview/llpersontabview.h | 2 ++ 5 files changed, 50 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 04881a12f1..16dc252946 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -753,7 +753,6 @@ BOOL LLPanelPeople::postBuild() mConversationsRoot->setFollowsAll(); //Create a session - //LLSpeakerMgr* speaker_manager = (LLSpeakerMgr*)LLLocalSpeakerMgr::getInstance(); LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); @@ -763,6 +762,18 @@ BOOL LLPanelPeople::postBuild() LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(mConversationsRoot); + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; + mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + + //Create a session + item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); + params.name = item->getDisplayName(); + params.root = mConversationsRoot; + params.listener = item; + params.tool_tip = params.name; + widget = LLUICtrlFactory::create(params); + widget->addToFolder(mConversationsRoot); + mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index d94c8cf32f..dac3dd03c7 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -45,6 +45,25 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } +BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) +{ + LLFolderViewItem * prior_item = getCurSelectedItem(); + LLFolderViewItem * current_item; + + bool selected_item = LLFolderView::handleMouseDown(x, y, mask); + + current_item = getCurSelectedItem(); + + LLPersonTabView * prior_folder = dynamic_cast(prior_item); + + if(prior_folder && current_item != prior_folder) + { + prior_folder->highlight = false; + } + + return selected_item; +} + bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) { std::string type = event.get("type").asString(); diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 60260dc5ea..74e9142a7c 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -51,9 +51,10 @@ public: ~LLPersonFolderView(); bool onConversationModelEvent(const LLSD &event); - LLPersonView * createConversationViewParticipant(LLPersonModel * item); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; LLEventStream mConversationsEventStream; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fff72c7758..20db0572fc 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -37,7 +37,8 @@ LLPersonTabView::Params::Params() {} LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : -LLFolderViewFolder(p) +LLFolderViewFolder(p), +highlight(false) { } @@ -52,6 +53,18 @@ LLPersonTabView::~LLPersonTabView() } +BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask ) +{ + bool selected_item = LLFolderViewFolder::handleMouseDown(x, y, mask); + + if(selected_item) + { + highlight = true; + } + + return selected_item; +} + void LLPersonTabView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); @@ -68,7 +81,7 @@ void LLPersonTabView::draw() LLColor4 color = sFgColor; F32 right_x = 0; - drawHighlight(false, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9aabad26fc..df3f786c69 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -44,7 +44,9 @@ public: virtual ~LLPersonTabView(); S32 getLabelXPos(); + bool highlight; + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); protected: void draw(); -- cgit v1.2.3 From c4a45fca396bea8abf8362b15b5cf0f85e57ad6b Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 25 Apr 2013 11:05:06 -0700 Subject: Enhance "duplicate seed caps" log message ... this needs more investigation. Reviewed by Kelly --- indra/newview/llviewerregion.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 808bc9f3f7..62fb0ed8c1 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -301,12 +301,16 @@ public: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - llinfos<<"BaseCapabilitiesCompleteTracker "<<"Sim sent duplicate seed caps that differs in size - most likely content."<getName() + << " sent duplicate seed caps that differs in size - most likely content. " + << (S32) regionp->getRegionImpl()->mCapabilities.size() << " vs " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() + << llendl; //todo#add cap debug versus original check? - /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); + /* + CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) { - llinfos<<"BaseCapabilitiesCompleteTracker Original "<first<<" "<< iter->second<first << " is " << iter->second << llendl; ++iter; } */ -- cgit v1.2.3 From 06e1b03362d021e5bdce25a20a78663fdaf7650f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Apr 2013 11:33:58 -0700 Subject: ACME-251: Create AvatarFolderItemView: Fixed a bug that was causing facebook friends to not be inserted into the proper friends tab. --- indra/newview/llpersonfolderview.cpp | 2 +- indra/newview/llpersonmodelcommon.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index dac3dd03c7..97f5d5a03a 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -73,7 +73,7 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) if(type == "add_participant") { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[person_id]); + LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[folder_id]); if(person_folder_model) { diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 764dd08115..bea7f3d45e 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -38,7 +38,8 @@ LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), - mName(display_name) + mName(display_name), + mID(LLUUID().generateNewID()) { } -- cgit v1.2.3 From 4562efdc7418923caa88bcf0c68a177f772c044b Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Apr 2013 16:29:02 -0700 Subject: ACME-251: This should be final commit for this task, now the peopletab looks like the accordion tab. --- indra/newview/llpersonfolderview.cpp | 25 ++++++---- indra/newview/llpersontabview.cpp | 58 ++++++++++++++++++++-- indra/newview/llpersontabview.h | 7 +++ .../default/xui/en/widgets/person_tab_view.xml | 4 +- 4 files changed, 77 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 97f5d5a03a..8141eecc35 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,21 +47,24 @@ LLPersonFolderView::~LLPersonFolderView() BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { - LLFolderViewItem * prior_item = getCurSelectedItem(); - LLFolderViewItem * current_item; + LLFolderViewItem * item = getCurSelectedItem(); - bool selected_item = LLFolderView::handleMouseDown(x, y, mask); - - current_item = getCurSelectedItem(); - - LLPersonTabView * prior_folder = dynamic_cast(prior_item); - - if(prior_folder && current_item != prior_folder) + //Will disable highlight on tab + if(item) { - prior_folder->highlight = false; + LLPersonTabView * person_tab= dynamic_cast(item); + if(person_tab) + { + person_tab->highlight = false; + } + else + { + person_tab = dynamic_cast(item->getParent()); + person_tab->highlight = false; + } } - return selected_item; + return LLFolderView::handleMouseDown(x, y, mask); } bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 20db0572fc..3556878b91 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -38,9 +38,11 @@ LLPersonTabView::Params::Params() LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : LLFolderViewFolder(p), -highlight(false) +highlight(false), +mImageHeader(LLUI::getUIImage("Accordion_Off")), +mImageHeaderOver(LLUI::getUIImage("Accordion_Over")), +mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected")) { - } S32 LLPersonTabView::getLabelXPos() @@ -73,7 +75,7 @@ void LLPersonTabView::draw() static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + const LLFontGL * font = LLFontGL::getFontSansSerif(); F32 text_left = (F32)getLabelXPos(); @@ -81,8 +83,9 @@ void LLPersonTabView::draw() LLColor4 color = sFgColor; F32 right_x = 0; - drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); @@ -91,6 +94,53 @@ void LLPersonTabView::draw() LLView::draw(); } +void LLPersonTabView::drawHighlight() +{ + S32 width = getRect().getWidth(); + S32 height = mItemHeight; + S32 x = 1; + S32 y = getRect().getHeight() - mItemHeight; + + //const S32 FOCUS_LEFT = 1; + //const S32 focus_top = getRect().getHeight(); + //const S32 focus_bottom = getRect().getHeight() - mItemHeight; + //static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE); + //static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + + if(highlight) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderFocused->draw(x,y,width,height); + } + else + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bgColor, TRUE);*/ + mImageHeader->draw(x,y,width,height); + } + + if(mIsMouseOverTitle) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderOver->draw(x,y,width,height); + } + +} + // // LLPersonView // diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index df3f786c69..35cb219ce2 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -50,8 +50,15 @@ public: protected: void draw(); + void drawHighlight(); private: + + // Background images + LLPointer mImageHeader; + LLPointer mImageHeaderOver; + LLPointer mImageHeaderFocused; + }; class LLPersonView : public LLFolderViewItem diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index 46857ac700..b36011763a 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -2,11 +2,11 @@ Date: Thu, 25 Apr 2013 17:38:54 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the sub items of the persontab are drawn with different highlights depending on if they are selected or moused over. --- indra/newview/llpersontabview.cpp | 63 +++++++++++----------- indra/newview/llpersontabview.h | 4 ++ .../default/xui/en/widgets/person_tab_view.xml | 2 +- .../skins/default/xui/en/widgets/person_view.xml | 13 +++++ 4 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/person_view.xml (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 3556878b91..dc55f627d6 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -72,19 +72,12 @@ void LLPersonTabView::draw() static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); - static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); - static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - - const LLFontGL * font = LLFontGL::getFontSansSerif(); F32 text_left = (F32)getLabelXPos(); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; LLColor4 color = sFgColor; F32 right_x = 0; - //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); - drawHighlight(); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); @@ -101,41 +94,17 @@ void LLPersonTabView::drawHighlight() S32 x = 1; S32 y = getRect().getHeight() - mItemHeight; - //const S32 FOCUS_LEFT = 1; - //const S32 focus_top = getRect().getHeight(); - //const S32 focus_bottom = getRect().getHeight() - mItemHeight; - //static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE); - //static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - if(highlight) { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sMouseOverColor, TRUE);*/ mImageHeaderFocused->draw(x,y,width,height); } else { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - bgColor, TRUE);*/ mImageHeader->draw(x,y,width,height); } if(mIsMouseOverTitle) { - //reference will remove - /*gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sMouseOverColor, TRUE);*/ mImageHeaderOver->draw(x,y,width,height); } @@ -145,12 +114,15 @@ void LLPersonTabView::drawHighlight() // LLPersonView // +static LLDefaultChildRegistry::Register r_person_view("person_view"); LLPersonView::Params::Params() {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : -LLFolderViewItem(p) +LLFolderViewItem(p), +mImageOver(LLUI::getUIImage("ListItem_Over")), +mImageSelected(LLUI::getUIImage("ListItem_Select")) { } @@ -183,7 +155,34 @@ void LLPersonView::draw() LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; F32 right_x = 0; + drawHighlight(); drawLabel(font, text_left, y, color, right_x); LLView::draw(); } + +void LLPersonView::drawHighlight() +{ + static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE); + + S32 width = getRect().getWidth(); + S32 height = mItemHeight; + S32 x = 1; + S32 y = 0; + + if(mIsSelected) + { + mImageSelected->draw(x, y, width, height); + //Need to find a better color that matches the outline in avatarlistitem + gl_rect_2d(x, + height, + width, + y, + outline_color, FALSE); + } + + if(mIsMouseOverTitle) + { + mImageOver->draw(x, y, width, height); + } +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 35cb219ce2..b246be288a 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -79,9 +79,13 @@ public: protected: void draw(); + void drawHighlight(); private: + LLPointer mImageOver; + LLPointer mImageSelected; + LLAvatarIconCtrl* mAvatarIcon; LLButton * mInfoBtn; diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index b36011763a..d46938d3b7 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -6,7 +6,7 @@ item_top_pad="3" mouse_opaque="true" follows="left|top|right" - text_pad="5" + text_pad="6" text_pad_left="4" text_pad_right="4" arrow_size="10" diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml new file mode 100644 index 0000000000..d46938d3b7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -0,0 +1,13 @@ + + -- cgit v1.2.3 From 228a312cf68088a8388a9318d1c8d23aaa52eaab Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 26 Apr 2013 09:49:48 -0700 Subject: ACME-252 Create AvatarFolderItemView: Corrected person_tab_view.xml and person_view.xml to have the proper parent tag. It was conversation_view_session for both which was wrong. Also updated the selected color for the personview. --- indra/newview/llpersontabview.cpp | 2 +- indra/newview/skins/default/xui/en/widgets/person_tab_view.xml | 2 +- indra/newview/skins/default/xui/en/widgets/person_view.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index dc55f627d6..3093ff9015 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -163,7 +163,7 @@ void LLPersonView::draw() void LLPersonView::drawHighlight() { - static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE); + static LLUIColor outline_color = LLUIColorTable::instance().getColor("EmphasisColor", DEFAULT_WHITE); S32 width = getRect().getWidth(); S32 height = mItemHeight; diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index d46938d3b7..af5aec2c34 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -1,5 +1,5 @@ - - Date: Fri, 26 Apr 2013 10:10:31 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now when connecting to facebook using the + button the fctest two tab is populated. --- indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++-------------------- indra/newview/llpanelpeople.h | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 16dc252946..ab8d090cb6 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -581,7 +581,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), - mConversationsRoot(NULL), + mPersonFolderView(NULL), mTryToConnectToFbc(true), mTabContainer(NULL), mOnlineFriendList(NULL), @@ -735,7 +735,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.use_ellipses = false; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; - mConversationsRoot = LLUICtrlFactory::create(folder_view_params); + mPersonFolderView = LLUICtrlFactory::create(folder_view_params); //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); @@ -747,35 +747,35 @@ BOOL LLPanelPeople::postBuild() LLScrollContainer* scroller = LLUICtrlFactory::create(scroller_params); socialtwo_tab->addChildInBack(scroller); - scroller->addChild(mConversationsRoot); + scroller->addChild(mPersonFolderView); scroller->setFollowsAll(); - mConversationsRoot->setScrollContainer(scroller); - mConversationsRoot->setFollowsAll(); + mPersonFolderView->setScrollContainer(scroller); + mPersonFolderView->setFollowsAll(); //Create a session LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); - params.root = mConversationsRoot; + params.root = mPersonFolderView; params.listener = item; params.tool_tip = params.name; LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(mConversationsRoot); + widget->addToFolder(mPersonFolderView); - mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; - mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; + mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; //Create a session item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); params.name = item->getDisplayName(); - params.root = mConversationsRoot; + params.root = mPersonFolderView; params.listener = item; params.tool_tip = params.name; widget = LLUICtrlFactory::create(params); - widget->addToFolder(mConversationsRoot); + widget->addToFolder(mPersonFolderView); - mConversationsRoot->mPersonFolderModelMap[item->getID()] = item; - mConversationsRoot->mPersonFolderViewMap[item->getID()] = widget; + mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; + mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); @@ -865,7 +865,7 @@ void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, void LLPanelPeople::idle(void * user_data) { LLPanelPeople * self = static_cast(user_data); - self->mConversationsRoot->update(); + self->mPersonFolderView->update(); } void LLPanelPeople::updateFriendListHelpText() @@ -1721,11 +1721,11 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - //LLConversationItemSession * session_model = dynamic_cast(mConversationsItems[LLUUID(NULL)]); - //if(session_model) - //{ - // addParticipantToModel(session_model, agent_id, name); - //} + LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); + if(session_model) + { + addParticipantToModel(session_model, agent_id, name); + } } } @@ -1733,7 +1733,7 @@ void LLPanelPeople::addTestParticipant() { for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mConversationsRoot->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index a448b7935e..497871bedb 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -178,7 +178,7 @@ private: LLHandle< LLFloater > mPicker; LLPersonFolderViewModel mPersonFolderViewModel; - LLPersonFolderView* mConversationsRoot; + LLPersonFolderView* mPersonFolderView; }; #endif //LL_LLPANELPEOPLE_H -- cgit v1.2.3 From e1dbbd0213dd96e28aec2c5e6d9fd821ab144e48 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 26 Apr 2013 21:26:38 +0100 Subject: removed internal browser hack for getting auth code in favor of SLApp-only approach --- indra/newview/llappviewer.cpp | 15 ++++----- indra/newview/llpanelpeople.cpp | 67 +++++------------------------------------ indra/newview/llpanelpeople.h | 2 +- 3 files changed, 16 insertions(+), 68 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 53c694eaca..31f7f61396 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2577,19 +2577,20 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 + LLSLURL option_slurl; if(clp.hasOption("url")) { - LLStartUp::setStartSLURL(LLSLURL(clp.getOption("url")[0])); + option_slurl = LLSLURL(clp.getOption("url")[0]); + LLStartUp::setStartSLURL(option_slurl); if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) { LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid()); - - } + } } else if(clp.hasOption("slurl")) { - LLSLURL start_slurl(clp.getOption("slurl")[0]); - LLStartUp::setStartSLURL(start_slurl); + option_slurl = LLSLURL(clp.getOption("slurl")[0]); + LLStartUp::setStartSLURL(option_slurl); } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); @@ -2686,10 +2687,10 @@ bool LLAppViewer::initConfiguration() // it relies on checking a marker file which will not work when running // out of different directories - if (LLStartUp::getStartSLURL().isValid() && + if (option_slurl.isValid() && (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) { - if (sendURLToOtherInstance(LLStartUp::getStartSLURL().getSLURLString())) + if (sendURLToOtherInstance(option_slurl.getSLURLString())) { // successfully handed off URL to existing instance, exit return false; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ab8d090cb6..86303cee70 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -113,6 +113,7 @@ public: if (mPanelPeople) { mPanelPeople->connectToFacebook(query_map["code"]); + mPanelPeople = NULL; return true; } } @@ -970,46 +971,7 @@ void LLPanelPeople::updateRecentList() void LLPanelPeople::updateFbcTestList() { - if (mFbcTestBrowserHandle.get()) - { - // get the current browser url (from the title bar, of course!) - std::string url = mFbcTestBrowserHandle.get()->getTitle(); - - // if the browser has redirected from facebook - if (url.find(getFacebookRedirectURL()) == 0) - { - // find the auth code in the url - std::string begin_string = "code="; - std::string end_string = "#"; - size_t begin_index = begin_string.length() + url.find(begin_string, getFacebookRedirectURL().length()); - size_t end_index = url.find(end_string, begin_index); - - // extract the auth code from the url - std::string auth_code; - if (end_index != std::string::npos) - { - auth_code = url.substr(begin_index, end_index - begin_index); - } - else - { - auth_code = url.substr(begin_index); - } - llinfos << "extracted code " << auth_code << " from url " << url << llendl; - - // finish authenticating on the server - connectToFacebook(auth_code); - - // close the browser window - mFbcTestBrowserHandle.get()->die(); - - // get rid of the handle - mFbcTestBrowserHandle = LLHandle(); - - // stop updating - mFbcTestListUpdater->setActive(false); - } - } - else if (mTryToConnectToFbc) + if (mTryToConnectToFbc) { // try to reconnect to facebook! tryToReconnectToFacebook(); @@ -1693,19 +1655,10 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -void LLPanelPeople::openFacebookWeb(LLFloaterWebContent::Params& p) +void LLPanelPeople::openFacebookWeb(std::string url) { gFacebookConnectHandler.mPanelPeople = this; - LLUrlAction::openURLExternal(p.url); - - LLFloater* browser = LLFloaterReg::showInstance("web_content", p); - - if (browser) - { - // start checking the browser to see if the data is available yet - mFbcTestBrowserHandle = browser->getHandle(); - mFbcTestListUpdater->setActive(true); - } + LLUrlAction::openURLExternal(url); } void LLPanelPeople::showFacebookFriends(const LLSD& friends) @@ -1827,9 +1780,7 @@ public: // show the facebook login page if not connected yet if (status == 404 && mShowLoginIfNotConnected) { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); - mPanelPeople->openFacebookWeb(p); + mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); } } } @@ -1914,16 +1865,12 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { - LLFloaterWebContent::Params p; - p.url("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); - openFacebookWeb(p); + openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); } void LLPanelPeople::onFacebookAppSendClicked() { - LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); - openFacebookWeb(p); + openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); } static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 497871bedb..95105309d2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,7 +62,7 @@ public: static void idle(void * user_data); - void openFacebookWeb(LLFloaterWebContent::Params& p); + void openFacebookWeb(std::string url); void showFacebookFriends(const LLSD& friends); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); -- cgit v1.2.3 From f36171b8cae93bdaf6d3df2bf964313d1da087b6 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 26 Apr 2013 23:35:28 +0100 Subject: made sendURLToOtherInstance() happen before viewer window actually appears, in the event of an external browser launching a SLApp --- indra/newview/llappviewer.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 31f7f61396..e97c264af3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2577,7 +2577,9 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 + LLSLURL option_slurl; + if(clp.hasOption("url")) { option_slurl = LLSLURL(clp.getOption("url")[0]); @@ -2592,6 +2594,21 @@ bool LLAppViewer::initConfiguration() option_slurl = LLSLURL(clp.getOption("slurl")[0]); LLStartUp::setStartSLURL(option_slurl); } + + //RN: if we received a URL, hand it off to the existing instance. + // don't call anotherInstanceRunning() when doing URL handoff, as + // it relies on checking a marker file which will not work when running + // out of different directories + + if (option_slurl.isValid() && + (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) + { + if (sendURLToOtherInstance(option_slurl.getSLURLString())) + { + // successfully handed off URL to existing instance, exit + return false; + } + } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) @@ -2682,21 +2699,6 @@ bool LLAppViewer::initConfiguration() #endif LLStringUtil::truncate(gWindowTitle, 255); - //RN: if we received a URL, hand it off to the existing instance. - // don't call anotherInstanceRunning() when doing URL handoff, as - // it relies on checking a marker file which will not work when running - // out of different directories - - if (option_slurl.isValid() && - (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) - { - if (sendURLToOtherInstance(option_slurl.getSLURLString())) - { - // successfully handed off URL to existing instance, exit - return false; - } - } - if (!gSavedSettings.getBOOL("AllowMultipleViewers")) { // -- cgit v1.2.3 From 743720f41454af16193789859a5b2048bad30b7e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 26 Apr 2013 18:50:45 -0700 Subject: ACME-272 : Add the top toolbar to the FBC panel 2 --- indra/newview/llpanelpeople.cpp | 8 +- .../newview/skins/default/xui/en/panel_people.xml | 92 +++++++++++++++++++++- 2 files changed, 96 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 86303cee70..12d8f6b83a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -672,6 +672,7 @@ BOOL LLPanelPeople::postBuild() getChild("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); getChild("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); + getChild("fbc_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); mTabContainer = getChild("tabs"); mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); @@ -729,7 +730,8 @@ BOOL LLPanelPeople::postBuild() LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); LLPersonFolderView::Params folder_view_params(LLUICtrlFactory::getDefaultParams()); - folder_view_params.parent_panel = friends_tab; + + folder_view_params.parent_panel = socialtwo_tab; folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; @@ -740,8 +742,8 @@ BOOL LLPanelPeople::postBuild() //Create scroller LLRect scroller_view_rect = socialtwo_tab->getRect(); - scroller_view_rect.mTop -= 4; - scroller_view_rect.mRight -=6; + scroller_view_rect.mTop -= 2+27; // 27 is the height of the top toolbar + scroller_view_rect.mRight -= 4; scroller_view_rect.mLeft += 2; LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams()); scroller_params.rect(scroller_view_rect); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c4db547a8e..9bab2ccb0b 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -633,6 +633,9 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M top="0" right="-1" /> + + + + + + + top="0"> + + + + + + + + -- cgit v1.2.3 From 59880225108ef807ef58ed98357f0706c045ff61 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 10:59:09 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the avatar icon will display but it is not yet functional --- indra/newview/llpanelpeople.cpp | 4 ++-- indra/newview/llpersontabview.cpp | 16 +++++++++++++--- indra/newview/llpersontabview.h | 2 ++ .../newview/skins/default/xui/en/widgets/person_view.xml | 14 +++++++++++++- 4 files changed, 30 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 12d8f6b83a..ef45cc44f7 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -755,7 +755,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - //Create a session + //Create a person tab LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); @@ -768,7 +768,7 @@ BOOL LLPanelPeople::postBuild() mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - //Create a session + //Create a person tab item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); params.name = item->getDisplayName(); params.root = mPersonFolderView; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 3093ff9015..e0bda32308 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -116,20 +116,22 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); -LLPersonView::Params::Params() +LLPersonView::Params::Params() : +avatar_icon("avatar_icon") {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), -mImageSelected(LLUI::getUIImage("ListItem_Select")) +mImageSelected(LLUI::getUIImage("ListItem_Select")), +mAvatarIcon(NULL) { } S32 LLPersonView::getLabelXPos() { - return getIndentation(); + return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -186,3 +188,11 @@ void LLPersonView::drawHighlight() mImageOver->draw(x, y, width, height); } } + +void LLPersonView::initFromParams(const LLPersonView::Params & params) +{ + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); + applyXUILayout(avatar_icon_params, this); + mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); + addChild(mAvatarIcon); +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index b246be288a..e1b34e1da4 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -69,6 +69,7 @@ public: struct Params : public LLInitParam::Block { Params(); + Optional avatar_icon; }; LLPersonView(const LLPersonView::Params& p); @@ -76,6 +77,7 @@ public: S32 getLabelXPos(); void addToFolder(LLFolderViewFolder * person_folder_view); + void initFromParams(const LLPersonView::Params & params); protected: void draw(); diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 13aa26959f..84ad807b83 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -6,8 +6,20 @@ item_top_pad="3" mouse_opaque="true" follows="left|top|right" + icon_pad="4" + icon_width="20" text_pad="6" text_pad_left="4" text_pad_right="4" arrow_size="10" - max_folder_item_overlap="2"/> + max_folder_item_overlap="2"> + + + -- cgit v1.2.3 From 0ce0d897f4e8bed87299b88b3ac24812bfe6afbd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 17:01:47 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the personview contains all icons that the avatarlistitem view contains. --- indra/newview/llpersonfolderview.cpp | 1 - indra/newview/llpersontabview.cpp | 64 +++++++++++++++-- indra/newview/llpersontabview.h | 35 ++++++++-- .../skins/default/xui/en/widgets/person_view.xml | 81 ++++++++++++++++++++++ 4 files changed, 172 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 8141eecc35..636d093e0e 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -104,7 +104,6 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod //24 should be loaded from .xml somehow params.rect = LLRect (0, 24, getRect().getWidth(), 0); params.tool_tip = params.name; - params.folder_indentation = 2; return LLUICtrlFactory::create(params); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index e0bda32308..eaa112e051 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -117,16 +117,32 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); LLPersonView::Params::Params() : -avatar_icon("avatar_icon") +avatar_icon("avatar_icon"), +last_interaction_time_textbox("last_interaction_time_textbox"), +permission_edit_theirs_icon("permission_edit_theirs_icon"), +permission_edit_mine_icon("permission_edit_mine_icon"), +permission_map_icon("permission_map_icon"), +permission_online_icon("permission_online_icon"), +info_btn("info_btn"), +profile_btn("profile_btn"), +output_monitor("output_monitor") {} LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), -mAvatarIcon(NULL) +mAvatarIcon(NULL), +mLastInteractionTimeTextbox(NULL), +mPermissionEditTheirsIcon(NULL), +mPermissionEditMineIcon(NULL), +mPermissionMapIcon(NULL), +mPermissionOnlineIcon(NULL), +mInfoBtn(NULL), +mProfileBtn(NULL), +mOutputMonitorCtrl(NULL) { - + initChildrenWidths(this); } S32 LLPersonView::getLabelXPos() @@ -175,7 +191,7 @@ void LLPersonView::drawHighlight() if(mIsSelected) { mImageSelected->draw(x, y, width, height); - //Need to find a better color that matches the outline in avatarlistitem + //Draw outline gl_rect_2d(x, height, width, @@ -195,4 +211,44 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); addChild(mAvatarIcon); + + LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); + applyXUILayout(last_interaction_time_textbox, this); + mLastInteractionTimeTextbox = LLUICtrlFactory::create(last_interaction_time_textbox); + addChild(mLastInteractionTimeTextbox); + + LLIconCtrl::Params permission_edit_theirs_icon(params.permission_edit_theirs_icon()); + applyXUILayout(permission_edit_theirs_icon, this); + mPermissionEditTheirsIcon = LLUICtrlFactory::create(permission_edit_theirs_icon); + addChild(mPermissionEditTheirsIcon); + + LLIconCtrl::Params permission_map_icon(params.permission_map_icon()); + applyXUILayout(permission_map_icon, this); + mPermissionMapIcon = LLUICtrlFactory::create(permission_map_icon); + addChild(mPermissionMapIcon); + + LLIconCtrl::Params permission_online_icon(params.permission_online_icon()); + applyXUILayout(permission_online_icon, this); + mPermissionOnlineIcon = LLUICtrlFactory::create(permission_online_icon); + addChild(mPermissionOnlineIcon); + + LLButton::Params info_btn(params.info_btn()); + applyXUILayout(info_btn, this); + mInfoBtn = LLUICtrlFactory::create(info_btn); + addChild(mInfoBtn); + + LLButton::Params profile_btn(params.profile_btn()); + applyXUILayout(profile_btn, this); + mProfileBtn = LLUICtrlFactory::create(profile_btn); + addChild(mProfileBtn); + + LLOutputMonitorCtrl::Params output_monitor(params.output_monitor()); + applyXUILayout(output_monitor, this); + mOutputMonitorCtrl = LLUICtrlFactory::create(output_monitor); + addChild(mOutputMonitorCtrl); +} + +void LLPersonView::initChildrenWidths(LLPersonView* self) +{ + } diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index e1b34e1da4..d8d1a65df6 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -28,7 +28,10 @@ #define LL_LLPERSONTABVIEW_H #include "llavatariconctrl.h" +#include "llbutton.h" #include "llfolderviewitem.h" +#include "lloutputmonitorctrl.h" +#include "lltextbox.h" class LLPersonTabView : public LLFolderViewFolder { @@ -70,6 +73,14 @@ public: { Params(); Optional avatar_icon; + Optional last_interaction_time_textbox; + Optional permission_edit_theirs_icon; + Optional permission_edit_mine_icon; + Optional permission_map_icon; + Optional permission_online_icon; + Optional info_btn; + Optional profile_btn; + Optional output_monitor; }; LLPersonView(const LLPersonView::Params& p); @@ -89,18 +100,34 @@ private: LLPointer mImageSelected; LLAvatarIconCtrl* mAvatarIcon; + LLTextBox * mLastInteractionTimeTextbox; + LLIconCtrl * mPermissionEditTheirsIcon; + LLIconCtrl * mPermissionEditMineIcon; + LLIconCtrl * mPermissionMapIcon; + LLIconCtrl * mPermissionOnlineIcon; LLButton * mInfoBtn; + LLButton * mProfileBtn; + LLOutputMonitorCtrl * mOutputMonitorCtrl; + + typedef enum e_avatar_item_child { ALIC_SPEAKER_INDICATOR, + ALIC_PROFILE_BUTTON, ALIC_INFO_BUTTON, + ALIC_PERMISSION_ONLINE, + ALIC_PERMISSION_MAP, + ALIC_PERMISSION_EDIT_MINE, + ALIC_PERMISSION_EDIT_THEIRS, + ALIC_INTERACTION_TIME, ALIC_COUNT, } EAvatarListItemChildIndex; - static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sChildrenWidths[ALIC_COUNT]; - //static void initChildrenWidths(LLConversationViewParticipant* self); - //void updateChildren(); + static bool sStaticInitialized; + static S32 sMouseOverChildrenWidths[ALIC_COUNT]; + static S32 sMouseOverChildren[ALIC_COUNT]; + static void initChildrenWidths(LLPersonView* self); + void updateChildren(); //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); }; diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 84ad807b83..d257a5114f 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -21,5 +21,86 @@ left="5" top="2" width="20" /> + + + + + + + + -- cgit v1.2.3 From 548b75f3fdec08227c5d41424e3af90fbe455208 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 30 Apr 2013 01:40:46 +0100 Subject: updated to grab FB URLs from server --- indra/newview/llpanelpeople.cpp | 35 ++++++++++++++++++++--------------- indra/newview/llpanelpeople.h | 3 +-- 2 files changed, 21 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ef45cc44f7..712a116873 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -91,9 +91,6 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com/fbc"; -static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/redirect"; - class LLFacebookConnectHandler : public LLCommandHandler { public: @@ -1729,6 +1726,14 @@ public: llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; } } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + mPanelPeople->openFacebookWeb(content["location"]); + } + } }; class FacebookDisconnectResponder : public LLHTTPClient::Responder @@ -1782,7 +1787,7 @@ public: // show the facebook login page if not connected yet if (status == 404 && mShowLoginIfNotConnected) { - mPanelPeople->openFacebookWeb("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + mPanelPeople->getFacebookRedirectURL()); + mPanelPeople->connectToFacebook(); } } } @@ -1810,6 +1815,14 @@ public: llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; } } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + mPanelPeople->openFacebookWeb(content["location"]); + } + } }; void LLPanelPeople::loadFacebookFriends() @@ -1828,8 +1841,9 @@ void LLPanelPeople::tryToReconnectToFacebook() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; - body["code"] = auth_code; - body["redirect_uri"] = getFacebookRedirectURL(); + if (!auth_code.empty()) + body["code"] = auth_code; + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); } @@ -1846,13 +1860,6 @@ std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) return url; } -std::string LLPanelPeople::getFacebookRedirectURL() -{ - static std::string sFacebookRedirectUrl = gAgent.getRegion()->getCapability("FacebookRedirect"); - llinfos << sFacebookRedirectUrl << llendl; - return sFacebookRedirectUrl; -} - void LLPanelPeople::onLoginFbcButtonClicked() { if (mConnectedToFbc) @@ -1867,12 +1874,10 @@ void LLPanelPeople::onLoginFbcButtonClicked() void LLPanelPeople::onFacebookAppRequestClicked() { - openFacebookWeb("http://www.facebook.com/dialog/apprequests?app_id=565771023434202&message=Test&redirect_uri=" + getFacebookRedirectURL()); } void LLPanelPeople::onFacebookAppSendClicked() { - openFacebookWeb("https://www.facebook.com/dialog/send?app_id=565771023434202&name=Join Second Life!&link=https://join.secondlife.com&redirect_uri=" + getFacebookRedirectURL()); } static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 95105309d2..943d84ac1d 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -69,11 +69,10 @@ public: void hideFacebookFriends(); void loadFacebookFriends(); void tryToReconnectToFacebook(); - void connectToFacebook(const std::string& auth_code); + void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); std::string getFacebookConnectURL(const std::string& route = ""); - std::string getFacebookRedirectURL(); bool mConnectedToFbc; bool mTryToConnectToFbc; -- cgit v1.2.3 From a3a0d665022e9b0a9ab99f41d4a989af3fafb122 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 29 Apr 2013 18:55:23 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now mouse over of peopleview items show the info button and profile button. --- indra/newview/llpersontabview.cpp | 77 +++++++++++++++++++++- indra/newview/llpersontabview.h | 16 +++-- .../skins/default/xui/en/widgets/person_view.xml | 9 +++ 3 files changed, 95 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index eaa112e051..fa7bc09e10 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -142,7 +142,6 @@ mInfoBtn(NULL), mProfileBtn(NULL), mOutputMonitorCtrl(NULL) { - initChildrenWidths(this); } S32 LLPersonView::getLabelXPos() @@ -162,6 +161,29 @@ LLPersonView::~LLPersonView() } +BOOL LLPersonView::postBuild() +{ + initChildrenWidths(this); + updateChildren(); + return LLFolderViewItem::postBuild(); +} + +void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) +{ + mInfoBtn->setVisible(TRUE); + mProfileBtn->setVisible(TRUE); + updateChildren(); + LLFolderViewItem::onMouseEnter(x, y, mask); +} + +void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) +{ + mInfoBtn->setVisible(FALSE); + mProfileBtn->setVisible(FALSE); + updateChildren(); + LLFolderViewItem::onMouseLeave(x, y, mask); +} + void LLPersonView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); @@ -222,6 +244,11 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) mPermissionEditTheirsIcon = LLUICtrlFactory::create(permission_edit_theirs_icon); addChild(mPermissionEditTheirsIcon); + LLIconCtrl::Params permission_edit_mine_icon(params.permission_edit_mine_icon()); + applyXUILayout(permission_edit_mine_icon, this); + mPermissionEditMineIcon = LLUICtrlFactory::create(permission_edit_mine_icon); + addChild(mPermissionEditMineIcon); + LLIconCtrl::Params permission_map_icon(params.permission_map_icon()); applyXUILayout(permission_map_icon, this); mPermissionMapIcon = LLUICtrlFactory::create(permission_map_icon); @@ -250,5 +277,53 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) void LLPersonView::initChildrenWidths(LLPersonView* self) { + S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft; + S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft; + S32 info_btn_width = self->mProfileBtn->getRect().mLeft - self->mInfoBtn->getRect().mLeft; + S32 permission_online_icon_width = self->mInfoBtn->getRect().mLeft - self->mPermissionOnlineIcon->getRect().mLeft; + S32 permissions_map_icon_width = self->mPermissionOnlineIcon->getRect().mLeft - self->mPermissionMapIcon->getRect().mLeft; + S32 permission_edit_mine_icon_width = self->mPermissionMapIcon->getRect().mLeft - self->mPermissionEditMineIcon->getRect().mLeft; + S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft; + S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft; + + self->mChildAndWidthVec.push_back(std::pair(self->mOutputMonitorCtrl, output_monitor_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mProfileBtn, profile_btn_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mInfoBtn, info_btn_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionOnlineIcon, permission_online_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionMapIcon, permissions_map_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditMineIcon, permission_edit_mine_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width)); + self->mChildAndWidthVec.push_back(std::pair(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width)); } + +void LLPersonView::updateChildren() +{ + mLabelPaddingRight = 0; + LLView * control; + S32 control_width; + LLRect control_rect; + + for(S32 i = 0; i < mChildAndWidthVec.size(); ++i) + { + control = mChildAndWidthVec[i].first; + + if(!control->getVisible()) + { + continue; + } + + control_width = mChildAndWidthVec[i].second; + mLabelPaddingRight += control_width; + + control_rect = control->getRect(); + control_rect.setLeftTopAndSize( + getLocalRect().getWidth() - mLabelPaddingRight, + control_rect.mTop, + control_rect.getWidth(), + control_rect.getHeight()); + + control->setShape(control_rect); + + } +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index d8d1a65df6..56d7f4eade 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -86,11 +86,15 @@ public: LLPersonView(const LLPersonView::Params& p); virtual ~LLPersonView(); - S32 getLabelXPos(); - void addToFolder(LLFolderViewFolder * person_folder_view); - void initFromParams(const LLPersonView::Params & params); + S32 getLabelXPos(); + void addToFolder(LLFolderViewFolder * person_folder_view); + void initFromParams(const LLPersonView::Params & params); + BOOL postBuild(); + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); protected: + void draw(); void drawHighlight(); @@ -123,12 +127,12 @@ private: ALIC_COUNT, } EAvatarListItemChildIndex; + typedef std::vector> ChildAndWidthVec; + ChildAndWidthVec mChildAndWidthVec; + static bool sStaticInitialized; - static S32 sMouseOverChildrenWidths[ALIC_COUNT]; - static S32 sMouseOverChildren[ALIC_COUNT]; static void initChildrenWidths(LLPersonView* self); void updateChildren(); - //LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); }; #endif // LL_LLPERSONTABVIEW_H diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index d257a5114f..d0d87c02c2 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -31,6 +31,7 @@ name="last_interaction_time_textbox" text_color="LtGray_50" value="0s" + visible="false" width="35" /> -- cgit v1.2.3 From 343ad70696349f4b30b7f2f9a6242cdd1035cd21 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 29 Apr 2013 18:57:26 -0700 Subject: ACME-275 : WIP : Starting to write the LLPersonViewerFilter code --- indra/newview/llpanelpeople.cpp | 24 ++++++++------ indra/newview/llpersonmodelcommon.cpp | 62 +++++++++++++++++++++++++++++++++++ indra/newview/llpersonmodelcommon.h | 26 +++++++++------ 3 files changed, 92 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ef45cc44f7..ce31c735e3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1200,23 +1200,23 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) { // store accordion tabs opened/closed state before any manipulation with accordion tabs if (!saved_filter.empty()) - { - notifyChildren(LLSD().with("action","store_state")); - } + { + notifyChildren(LLSD().with("action","store_state")); + } mOnlineFriendList->setNameFilter(filter); mAllFriendList->setNameFilter(filter); - setAccordionCollapsedByUser("tab_online", false); - setAccordionCollapsedByUser("tab_all", false); - showFriendsAccordionsIfNeeded(); + setAccordionCollapsedByUser("tab_online", false); + setAccordionCollapsedByUser("tab_all", false); + showFriendsAccordionsIfNeeded(); // restore accordion tabs state _after_ all manipulations if(saved_filter.empty()) - { - notifyChildren(LLSD().with("action","restore_state")); - } -} + { + notifyChildren(LLSD().with("action","restore_state")); + } + } else if (cur_tab == GROUP_TAB_NAME) { mGroupList->setNameFilter(filter); @@ -1225,6 +1225,10 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) { mRecentList->setNameFilter(filter); } + else if (cur_tab == FBCTESTTWO_TAB_NAME) + { + mPersonFolderViewModel.getFilter().setFilterSubString(filter); + } } void LLPanelPeople::onTabSelected(const LLSD& param) diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index bea7f3d45e..4e54562f18 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -157,3 +157,65 @@ LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : LLPersonModelCommon(root_view_model) { } + +// +// LLPersonViewFilter +// + +LLPersonViewFilter::LLPersonViewFilter() : + mEmpty(""), + mFilterSubString(""), + mFilterModified(FILTER_NONE) +{ +} + +void LLPersonViewFilter::setFilterSubString(const std::string& string) +{ + std::string filter_sub_string_new = string; + LLStringUtil::trimHead(filter_sub_string_new); + LLStringUtil::toUpper(filter_sub_string_new); + + if (mFilterSubString != filter_sub_string_new) + { + mFilterSubString = filter_sub_string_new; + } +} + +std::string::size_type LLPersonViewFilter::getFilterStringSize() const +{ + return mFilterSubString.size(); +} + +bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) +{ + //const LLPersonModelCommon* person = dynamic_cast(item); + std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + + return (mFilterSubString.size() == 0 || string_offset != std::string::npos); +} + +bool LLPersonViewFilter::showAllResults() const +{ + return mFilterSubString.size() > 0; +} + +std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const +{ + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; +} + +bool LLPersonViewFilter::isActive() const +{ + return mFilterSubString.size(); +} + +bool LLPersonViewFilter::isModified() const +{ + return isActive(); +} + +void LLPersonViewFilter::clearModified() +{ + mFilterModified = FILTER_NONE; + setFilterSubString(""); +} diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f3454df53f..bdbee002e6 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -127,7 +127,7 @@ private: }; -//Below code is just copied and adjusted from llconversationmodel.h, will need to investigate further +// Filtering functional object class LLPersonViewFilter : public LLFolderViewFilter { @@ -143,20 +143,23 @@ public: // Default sort order is by type for sessions and by date for participants static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); - LLPersonViewFilter() { mEmpty = ""; } + LLPersonViewFilter(); ~LLPersonViewFilter() {} - bool check(const LLFolderViewModelItem* item) { return true; } + void setFilterSubString(const std::string& string); + std::string::size_type getFilterStringSize() const; + bool check(const LLFolderViewModelItem* item); + bool showAllResults() const; + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; + bool isActive() const; + bool isModified() const; + void clearModified(); + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + void setEmptyLookupMessage(const std::string& message) { } std::string getEmptyLookupMessage() const { return mEmpty; } - bool showAllResults() const { return true; } - std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const { return std::string::npos; } - std::string::size_type getFilterStringSize() const { return 0; } - bool isActive() const { return false; } - bool isModified() const { return false; } - void clearModified() { } const std::string& getName() const { return mEmpty; } const std::string& getFilterText() { return mEmpty; } void setModified(EFilterModified behavior = FILTER_RESTART) { } @@ -173,8 +176,11 @@ public: S32 getCurrentGeneration() const { return 0; } S32 getFirstSuccessGeneration() const { return 0; } S32 getFirstRequiredGeneration() const { return 0; } + private: - std::string mEmpty; + std::string mEmpty; + std::string mFilterSubString; + EFilterModified mFilterModified; }; class LLPersonViewSort -- cgit v1.2.3 From 8189c27cfad6f498966dc99dd483df8466330ccd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 11:37:16 -0700 Subject: ACME-252 Create AvatarFolderItemView: Optimization. Now the widths for the personview are computed once and stored staticically since they don't change per control. --- indra/newview/llpersontabview.cpp | 48 ++++++++++++++++++++++++++++----------- indra/newview/llpersontabview.h | 14 ++++++++---- 2 files changed, 45 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fa7bc09e10..2bc436226d 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -116,6 +116,9 @@ void LLPersonTabView::drawHighlight() static LLDefaultChildRegistry::Register r_person_view("person_view"); +bool LLPersonView::sChildrenWidthsInitialized = false; +ChildWidthVec LLPersonView::mChildWidthVec; + LLPersonView::Params::Params() : avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), @@ -163,7 +166,13 @@ LLPersonView::~LLPersonView() BOOL LLPersonView::postBuild() { - initChildrenWidths(this); + if(!sChildrenWidthsInitialized) + { + initChildrenWidthVec(this); + sChildrenWidthsInitialized = true; + } + + initChildVec(); updateChildren(); return LLFolderViewItem::postBuild(); } @@ -275,7 +284,7 @@ void LLPersonView::initFromParams(const LLPersonView::Params & params) addChild(mOutputMonitorCtrl); } -void LLPersonView::initChildrenWidths(LLPersonView* self) +void LLPersonView::initChildrenWidthVec(LLPersonView* self) { S32 output_monitor_width = self->getRect().getWidth() - self->mOutputMonitorCtrl->getRect().mLeft; S32 profile_btn_width = self->mOutputMonitorCtrl->getRect().mLeft - self->mProfileBtn->getRect().mLeft; @@ -286,15 +295,26 @@ void LLPersonView::initChildrenWidths(LLPersonView* self) S32 permission_edit_theirs_icon_width = self->mPermissionEditMineIcon->getRect().mLeft - self->mPermissionEditTheirsIcon->getRect().mLeft; S32 last_interaction_time_textbox_width = self->mPermissionEditTheirsIcon->getRect().mLeft - self->mLastInteractionTimeTextbox->getRect().mLeft; - self->mChildAndWidthVec.push_back(std::pair(self->mOutputMonitorCtrl, output_monitor_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mProfileBtn, profile_btn_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mInfoBtn, info_btn_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionOnlineIcon, permission_online_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionMapIcon, permissions_map_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditMineIcon, permission_edit_mine_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mPermissionEditTheirsIcon, permission_edit_theirs_icon_width)); - self->mChildAndWidthVec.push_back(std::pair(self->mLastInteractionTimeTextbox, last_interaction_time_textbox_width)); + self->mChildWidthVec.push_back(output_monitor_width); + self->mChildWidthVec.push_back(profile_btn_width); + self->mChildWidthVec.push_back(info_btn_width); + self->mChildWidthVec.push_back(permission_online_icon_width); + self->mChildWidthVec.push_back(permissions_map_icon_width); + self->mChildWidthVec.push_back(permission_edit_mine_icon_width); + self->mChildWidthVec.push_back(permission_edit_theirs_icon_width); + self->mChildWidthVec.push_back(last_interaction_time_textbox_width); +} +void LLPersonView::initChildVec() +{ + mChildVec.push_back(mOutputMonitorCtrl); + mChildVec.push_back(mProfileBtn); + mChildVec.push_back(mInfoBtn); + mChildVec.push_back(mPermissionOnlineIcon); + mChildVec.push_back(mPermissionMapIcon); + mChildVec.push_back(mPermissionEditMineIcon); + mChildVec.push_back(mPermissionEditTheirsIcon); + mChildVec.push_back(mLastInteractionTimeTextbox); } void LLPersonView::updateChildren() @@ -304,16 +324,18 @@ void LLPersonView::updateChildren() S32 control_width; LLRect control_rect; - for(S32 i = 0; i < mChildAndWidthVec.size(); ++i) + llassert(mChildWidthVec.size() == mChildVec.size()); + + for(S32 i = 0; i < mChildWidthVec.size(); ++i) { - control = mChildAndWidthVec[i].first; + control = mChildVec[i]; if(!control->getVisible()) { continue; } - control_width = mChildAndWidthVec[i].second; + control_width = mChildWidthVec[i]; mLabelPaddingRight += control_width; control_rect = control->getRect(); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 56d7f4eade..80020073d7 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -64,6 +64,9 @@ private: }; +typedef std::vector ChildWidthVec; +typedef std::vector ChildVec; + class LLPersonView : public LLFolderViewItem { @@ -127,11 +130,14 @@ private: ALIC_COUNT, } EAvatarListItemChildIndex; - typedef std::vector> ChildAndWidthVec; - ChildAndWidthVec mChildAndWidthVec; + //Widths of controls are same for every instance so can be static + static ChildWidthVec mChildWidthVec; + //Control pointers are different for each instance so non-static + ChildVec mChildVec; - static bool sStaticInitialized; - static void initChildrenWidths(LLPersonView* self); + static bool sChildrenWidthsInitialized; + static void initChildrenWidthVec(LLPersonView* self); + void initChildVec(); void updateChildren(); }; -- cgit v1.2.3 From 03239c14e82f4d400cefa8c4b418a6192cc08654 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 14:03:04 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now clicking the profile button and info button will show a facebook user's SL profile or info respectively. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonmodelcommon.cpp | 13 ++++++++++--- indra/newview/llpersonmodelcommon.h | 6 ++++-- indra/newview/llpersontabview.cpp | 10 ++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 609284cdd5..4c044c2471 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1698,7 +1698,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(name, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 4e54562f18..91c3f6a92a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -148,14 +148,21 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) // LLPersonModel // -LLPersonModel::LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model) +LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model), +mAgentID(agent_id) { } LLPersonModel::LLPersonModel(LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(root_view_model) +LLPersonModelCommon(root_view_model), +mAgentID(LLUUID(NULL)) +{ +} + +LLUUID LLPersonModel::getAgentID() { + return mAgentID; } // diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index bdbee002e6..4030cd11df 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -120,11 +120,13 @@ private: class LLPersonModel : public LLPersonModelCommon { public: - LLPersonModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model); LLPersonModel(LLFolderViewModelInterface& root_view_model); -private: + LLUUID getAgentID(); +private: + LLUUID mAgentID; }; // Filtering functional object diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 2bc436226d..a0d6b40d08 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -29,6 +29,10 @@ #include "llpersontabview.h" +#include "llavataractions.h" +#include "llfloaterreg.h" +#include "llpersonmodelcommon.h" + static LLDefaultChildRegistry::Register r_person_tab_view("person_tab_view"); const LLColor4U DEFAULT_WHITE(255, 255, 255); @@ -174,6 +178,12 @@ BOOL LLPersonView::postBuild() initChildVec(); updateChildren(); + + LLPersonModel * person_model = static_cast(getViewModelItem()); + + mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE)); + mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID())); + return LLFolderViewItem::postBuild(); } -- cgit v1.2.3 From f18c5ad3c6cb95ad329ad7147631edd6855f3ac5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 15:33:40 -0700 Subject: ACME-252 Create AvatarFolderItemView: Now the people view shows both the facebook name and the SL name (assuming this connection exists). --- indra/newview/llpanelpeople.cpp | 7 ++++++- indra/newview/llpersontabview.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4c044c2471..a9a024c9ed 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1698,7 +1698,12 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model { LLPersonModel* person_model = NULL; - person_model = new LLPersonModel(agent_id, name, mPersonFolderViewModel); + LLAvatarName avatar_name; + bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name); + + std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name; + + person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index a0d6b40d08..76f3151777 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -181,6 +181,7 @@ BOOL LLPersonView::postBuild() LLPersonModel * person_model = static_cast(getViewModelItem()); + mAvatarIcon->setValue(person_model->getAgentID()); mInfoBtn->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", person_model->getAgentID()), FALSE)); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarActions::showProfile, person_model->getAgentID())); -- cgit v1.2.3 From 9fdfc8dd5c52e515990f3ef4e552b9084fa66373 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 16:01:31 -0700 Subject: ACME-252 Create AvatarFolderItemView: Slight xml change for person view to make the profile button display lower. --- indra/newview/skins/default/xui/en/widgets/person_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index d0d87c02c2..4a39109f36 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -90,6 +90,7 @@ visible="false" width="16" /> Date: Tue, 30 Apr 2013 17:18:29 -0700 Subject: ACME-275 : WIP : Write all LLPersonViewerFilter methods and clean up interface --- indra/newview/llpersonmodelcommon.cpp | 32 ++++++++++++------ indra/newview/llpersonmodelcommon.h | 64 +++++++++++++++++++++++------------ 2 files changed, 64 insertions(+), 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 4e54562f18..32ceef096d 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -163,8 +163,9 @@ LLPersonModelCommon(root_view_model) // LLPersonViewFilter::LLPersonViewFilter() : - mEmpty(""), + mEmptyLookupMessage(""), mFilterSubString(""), + mName(""), mFilterModified(FILTER_NONE) { } @@ -177,31 +178,32 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string) if (mFilterSubString != filter_sub_string_new) { + // *TODO : Add logic to support more and less restrictive filtering + mFilterModified = FILTER_RESTART; mFilterSubString = filter_sub_string_new; } } -std::string::size_type LLPersonViewFilter::getFilterStringSize() const +bool LLPersonViewFilter::showAllResults() const { - return mFilterSubString.size(); + return mFilterSubString.size() > 0; } bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) { - //const LLPersonModelCommon* person = dynamic_cast(item); std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; return (mFilterSubString.size() == 0 || string_offset != std::string::npos); } -bool LLPersonViewFilter::showAllResults() const +std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() > 0; + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; } -std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const +std::string::size_type LLPersonViewFilter::getFilterStringSize() const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + return mFilterSubString.size(); } bool LLPersonViewFilter::isActive() const @@ -211,11 +213,21 @@ bool LLPersonViewFilter::isActive() const bool LLPersonViewFilter::isModified() const { - return isActive(); + return mFilterModified != FILTER_NONE; } void LLPersonViewFilter::clearModified() { mFilterModified = FILTER_NONE; - setFilterSubString(""); } + +void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message) +{ + mEmptyLookupMessage = message; +} + +std::string LLPersonViewFilter::getEmptyLookupMessage() const +{ + return mEmptyLookupMessage; +} + diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index bdbee002e6..2ddec3d05e 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -136,49 +136,69 @@ public: enum ESortOrderType { SO_NAME = 0, // Sort by name - SO_DATE = 0x1, // Sort by date (most recent) - SO_SESSION_TYPE = 0x2, // Sort by type (valid only for sessions) - SO_DISTANCE = 0x3, // Sort by distance (valid only for participants in nearby chat) + SO_ONLINE_STATUS = 0x1 // Sort by online status (i.e. online or not) }; - // Default sort order is by type for sessions and by date for participants - static const U32 SO_DEFAULT = (SO_SESSION_TYPE << 16) | (SO_DATE); + // Default sort order is by name + static const U32 SO_DEFAULT = SO_NAME; LLPersonViewFilter(); ~LLPersonViewFilter() {} - void setFilterSubString(const std::string& string); - std::string::size_type getFilterStringSize() const; + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ bool check(const LLFolderViewModelItem* item); + bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + + void setEmptyLookupMessage(const std::string& message); + std::string getEmptyLookupMessage() const; + bool showAllResults() const; + std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; + std::string::size_type getFilterStringSize() const; + + // +-------------------------------------------------------------------+ + // + Status + // +-------------------------------------------------------------------+ bool isActive() const; bool isModified() const; void clearModified(); - - bool checkFolder(const LLFolderViewModelItem* folder) const { return true; } + const std::string& getName() const { return mName; } + const std::string& getFilterText() { return mName; } + void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } - void setEmptyLookupMessage(const std::string& message) { } - std::string getEmptyLookupMessage() const { return mEmpty; } - - const std::string& getName() const { return mEmpty; } - const std::string& getFilterText() { return mEmpty; } - void setModified(EFilterModified behavior = FILTER_RESTART) { } - + // +-------------------------------------------------------------------+ + // + Count + // +-------------------------------------------------------------------+ + // Note : we currently filter the whole person list at once, no need to count then. void setFilterCount(S32 count) { } S32 getFilterCount() const { return 0; } void decrementFilterCount() { } - bool isDefault() const { return true; } - bool isNotDefault() const { return false; } + // +-------------------------------------------------------------------+ + // + Default + // +-------------------------------------------------------------------+ + // Note : we don't support runtime default setting for person filter + bool isDefault() const { return !isActive(); } + bool isNotDefault() const { return isActive(); } void markDefault() { } - void resetDefault() { } - + void resetDefault() { setModified(); } + + // +-------------------------------------------------------------------+ + // + Generation + // +-------------------------------------------------------------------+ + // Note : unclear if we have to take tab on generation at that point S32 getCurrentGeneration() const { return 0; } S32 getFirstSuccessGeneration() const { return 0; } S32 getFirstRequiredGeneration() const { return 0; } - + + // Non Virtual Methods (i.e. specific to this class) + void setFilterSubString(const std::string& string); + private: - std::string mEmpty; + std::string mName; + std::string mEmptyLookupMessage; std::string mFilterSubString; EFilterModified mFilterModified; }; -- cgit v1.2.3 From 4d72a6ea92d87822350be63e235b90daa4727d55 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 30 Apr 2013 18:17:20 -0700 Subject: ACME-252 Create AvatarFolderItemView: Fixed focusing issue when hovering over a people view and then selected an icon. Now when selecting the icon upon hover the corresponding people view will be selected as well. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpersonfolderview.cpp | 7 ++++++- indra/newview/llpersontabview.cpp | 36 ++++++++++++++++++++++++++++++++++++ indra/newview/llpersontabview.h | 1 + 4 files changed, 44 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..77c3430c01 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1690,7 +1690,7 @@ void LLPanelPeople::addTestParticipant() for(int i = 0; i < 300; ++i) { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); + addParticipantToModel(person_folder_model, gAgent.getID(), "Test Name"); } } diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 636d093e0e..ba1e9d20eb 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -64,7 +64,12 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) } } - return LLFolderView::handleMouseDown(x, y, mask); + mKeyboardSelection = FALSE; + mSearchString.clear(); + + LLEditMenuHandler::gEditMenuHandler = this; + + return LLView::handleMouseDown( x, y, mask ); } bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 76f3151777..fdc024beb8 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -65,6 +65,7 @@ BOOL LLPersonTabView::handleMouseDown( S32 x, S32 y, MASK mask ) if(selected_item) { + gFocusMgr.setKeyboardFocus( this ); highlight = true; } @@ -204,6 +205,41 @@ void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) LLFolderViewItem::onMouseLeave(x, y, mask); } +BOOL LLPersonView::handleMouseDown( S32 x, S32 y, MASK mask) +{ + if(!LLView::childrenHandleMouseDown(x, y, mask)) + { + gFocusMgr.setMouseCapture( this ); + } + + if (!mIsSelected) + { + if(mask & MASK_CONTROL) + { + getRoot()->changeSelection(this, !mIsSelected); + } + else if (mask & MASK_SHIFT) + { + getParentFolder()->extendSelectionTo(this); + } + else + { + getRoot()->setSelection(this, FALSE); + } + make_ui_sound("UISndClick"); + } + else + { + // If selected, we reserve the decision of deselecting/reselecting to the mouse up moment. + // This is necessary so we maintain selection consistent when starting a drag. + mSelectPending = TRUE; + } + + mDragStartX = x; + mDragStartY = y; + return TRUE; +} + void LLPersonView::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 80020073d7..9cce615167 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -95,6 +95,7 @@ public: BOOL postBuild(); void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); + BOOL handleMouseDown( S32 x, S32 y, MASK mask); protected: -- cgit v1.2.3 From 145bbacc6c167351357572a5d635f790e6715b86 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 1 May 2013 20:43:49 +0100 Subject: made secondlife:///app/fbc/connect avoid 'the slurl you click on is not supported' messages --- indra/newview/llpanelpeople.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..640c5e4e4e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -111,12 +111,11 @@ public: { mPanelPeople->connectToFacebook(query_map["code"]); mPanelPeople = NULL; - return true; } } + return true; } } - return false; } }; -- cgit v1.2.3 From 88ae31a3adcdc9fabf45b4a7cf1e53bd08615875 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 2 May 2013 13:31:21 -0700 Subject: Fix line endings --- indra/newview/llviewerwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 136e61389a..c65caea3ec 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2036,8 +2036,8 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; - LLNotificationsUI::LLToast::cleanupToasts(); - llinfos << "Leftover toast cleaned up." << llendl; + LLNotificationsUI::LLToast::cleanupToasts(); + llinfos << "Leftover toast cleaned up." << llendl; // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. -- cgit v1.2.3 From a73305c41d058fc755b824e5a9243afe43b424e1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 May 2013 16:24:09 -0700 Subject: ACME-275 : WIP : Implemented filter(), still arrange() not done timely, tweaked test values to allow test of sort and filter --- indra/newview/llpanelpeople.cpp | 14 ++++++++- indra/newview/llpersonmodelcommon.cpp | 55 ++++++++++++++++++++++++++++++----- indra/newview/llpersonmodelcommon.h | 18 +++++++----- 3 files changed, 72 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a9a024c9ed..9daf441ab3 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1687,10 +1687,22 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { + std::string suffix("Aa"); + std::string prefix("EastBayGuy"); for(int i = 0; i < 300; ++i) { LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - addParticipantToModel(person_folder_model, LLUUID().generateNewID(), "EastBayGuy"); + std::string name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, LLUUID().generateNewID(), name); + // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... + suffix[1]+=1; + if (suffix[1]=='{') + { + suffix[1]='a'; + suffix[0]+=1; + if (suffix[0]=='[') + suffix[0]='A'; + } } } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 3e9ca9c3b9..9660432b80 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -31,21 +31,23 @@ #include "llevents.h" #include "llsdutil.h" +#include "llstring.h" // // LLPersonModelCommon // LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLFolderViewModelItemCommon(root_view_model), - mName(display_name), + LLFolderViewModelItemCommon(root_view_model), mID(LLUUID().generateNewID()) { + renameItem(display_name); } LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : -LLFolderViewModelItemCommon(root_view_model), + LLFolderViewModelItemCommon(root_view_model), mName(""), + mSearchableName(""), mID(LLUUID().generateNewID()) { } @@ -55,6 +57,14 @@ LLPersonModelCommon::~LLPersonModelCommon() } +BOOL LLPersonModelCommon::renameItem(const std::string& new_name) +{ + mName = new_name; + mSearchableName = new_name; + LLStringUtil::toUpper(mSearchableName); + return TRUE; +} + void LLPersonModelCommon::postEvent(const std::string& event_type, LLPersonTabModel* folder, LLPersonModel* person) { LLUUID folder_id = folder->getID(); @@ -84,6 +94,39 @@ void LLPersonModelCommon::showProperties(void) { } +bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) +{ + // See LLFolderViewModelItemInventory::filter() +/* + if (!filter.isModified()) + { + llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; + return true; + } +*/ + if (!mChildren.empty()) + { + //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl; + setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); + iter != end_iter; + ++iter) + { + // LLFolderViewModelItem + LLPersonModelCommon* item = dynamic_cast(*iter); + item->filter(filter); + } + } + else + { + const bool passed_filter = filter.check(this); + setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + } + + filter.clearModified(); + return true; +} + // // LLPersonTabModel // @@ -186,7 +229,7 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string) if (mFilterSubString != filter_sub_string_new) { // *TODO : Add logic to support more and less restrictive filtering - mFilterModified = FILTER_RESTART; + setModified(FILTER_RESTART); mFilterSubString = filter_sub_string_new; } } @@ -198,9 +241,7 @@ bool LLPersonViewFilter::showAllResults() const bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) { - std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; - - return (mFilterSubString.size() == 0 || string_offset != std::string::npos); + return (mFilterSubString.size() ? (item->getSearchableName().find(mFilterSubString) != std::string::npos) : true); } std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 9e13a7d7d9..1e9117c2df 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -46,13 +46,14 @@ public: // Stub those things we won't really be using in this conversation context virtual const std::string& getName() const { return mName; } virtual const std::string& getDisplayName() const { return mName; } - virtual const std::string& getSearchableName() const { return mName; } + virtual const std::string& getSearchableName() const { return mSearchableName; } + virtual LLPointer getIcon() const { return NULL; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual BOOL isItemRenameable() const { return TRUE; } - virtual BOOL renameItem(const std::string& new_name) { mName = new_name; return TRUE; } + virtual BOOL renameItem(const std::string& new_name); virtual BOOL isItemMovable( void ) const { return FALSE; } virtual BOOL isItemRemovable( void ) const { return FALSE; } virtual BOOL isItemInTrash( void) const { return FALSE; } @@ -70,10 +71,12 @@ public: virtual bool hasChildren() const { return FALSE; } virtual bool potentiallyVisible() { return true; } - virtual bool filter( LLFolderViewFilter& filter) { return false; } + + virtual bool filter( LLFolderViewFilter& filter); + virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } - virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } - virtual bool passedFilter(S32 filter_generation = -1) { return true; } +// virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; } // The action callbacks virtual void performAction(LLInventoryModel* model, std::string action); @@ -97,7 +100,8 @@ public: protected: - std::string mName; // Name of the session or the participant + std::string mName; // Name of the person + std::string mSearchableName; // Name used in string matching for this person LLUUID mID; }; @@ -175,7 +179,7 @@ public: // +-------------------------------------------------------------------+ // Note : we currently filter the whole person list at once, no need to count then. void setFilterCount(S32 count) { } - S32 getFilterCount() const { return 0; } + S32 getFilterCount() const { return 1; } void decrementFilterCount() { } // +-------------------------------------------------------------------+ -- cgit v1.2.3 From 6cce8629b962cd73515e2d0a85620b602e57a0fe Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 May 2013 18:47:56 -0700 Subject: CHUI-275 : WIP : Cleaned up comments --- indra/newview/llpersonmodelcommon.cpp | 9 +++++---- indra/newview/llpersonmodelcommon.h | 8 -------- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 9660432b80..6b4c71faa2 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -96,8 +96,8 @@ void LLPersonModelCommon::showProperties(void) bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) { - // See LLFolderViewModelItemInventory::filter() /* + Hack: for the moment, we always apply the filter if we're called if (!filter.isModified()) { llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; @@ -106,19 +106,20 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) */ if (!mChildren.empty()) { - //llinfos << "Merov : LLPersonModelCommon::filter, filtering folder = " << getDisplayName() << llendl; - setPassedFilter(1, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders) + setPassedFilter(1, -1); + // Call filter recursively on all children for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; ++iter) { - // LLFolderViewModelItem LLPersonModelCommon* item = dynamic_cast(*iter); item->filter(filter); } } else { + // If there's no children, the current instance is a person and we check and set the passed filter flag on it const bool passed_filter = filter.check(this); setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index ffd145b549..f44f619d18 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -174,14 +174,6 @@ public: const std::string& getFilterText() { return mName; } void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } - // +-------------------------------------------------------------------+ - // + Count - // +-------------------------------------------------------------------+ - // Note : we currently filter the whole person list at once, no need to count then. - //void setFilterCount(S32 count) { } - //S32 getFilterCount() const { return 1; } - //void decrementFilterCount() { } - // +-------------------------------------------------------------------+ // + Time // +-------------------------------------------------------------------+ -- cgit v1.2.3 From 1b6d6b7e794ad4401faa91a79774922a5baec968 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 11:57:59 -0700 Subject: ACME-323 Create a tab for 'Invite people you know to SL': FBC Test Two tabs are now named to match UX spec. Also created a function called createPersonTabs() which simplifies tab creation. The LLPersonFolderView is being turned into the tab manager. --- indra/newview/llpanelpeople.cpp | 25 ------------------------- indra/newview/llpersonfolderview.cpp | 24 ++++++++++++++++++++++++ indra/newview/llpersonfolderview.h | 4 ++++ 3 files changed, 28 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03135ce580..22b79a9380 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -750,31 +750,6 @@ BOOL LLPanelPeople::postBuild() scroller->setFollowsAll(); mPersonFolderView->setScrollContainer(scroller); mPersonFolderView->setFollowsAll(); - - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; - - //Create a person tab - item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel); - params.name = item->getDisplayName(); - params.root = mPersonFolderView; - params.listener = item; - params.tool_tip = params.name; - widget = LLUICtrlFactory::create(params); - widget->addToFolder(mPersonFolderView); - - mPersonFolderView->mPersonFolderModelMap[item->getID()] = item; - mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget; gIdleCallbacks.addFunction(idle, this); diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index ba1e9d20eb..21578e986b 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -38,6 +38,8 @@ LLFolderView(p), mConversationsEventStream("ConversationsEventsTwo") { mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); + + createPersonTabs(); } LLPersonFolderView::~LLPersonFolderView() @@ -45,6 +47,28 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 74e9142a7c..1cf597b8c9 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,6 +50,10 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + + void createPersonTabs(); + void createPersonTab(const std::string& tab_name); + bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); -- cgit v1.2.3 From 0408a984d3efb55cdf88c314e333be3b29c291ea Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 13:55:12 -0700 Subject: ACME-324 Populate list with FB only friends: When clicking the '+' button FB only friends will appear in the second tab titled 'Invite people you know to SL'. --- indra/newview/llpanelpeople.cpp | 38 ++++++++++++++++++++++++++++++++---- indra/newview/llpersonfolderview.cpp | 1 + indra/newview/llpersonfolderview.h | 1 + 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22b79a9380..e1933c041c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,17 +1641,29 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); + S32 model_index; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //FB+SL but not SL friend + if(agent_id.notNull()) + { + model_index = 0; + } + //FB only friend + else + { + model_index = 1; + } + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) { addParticipantToModel(session_model, agent_id, name); @@ -1663,11 +1675,29 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); + LLPersonTabModel * person_folder_model; + LLUUID agentID; + std::string name; + S32 model_index; + for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap.begin()->second); - std::string name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, gAgent.getID(), name); + //Adds FB+SL people that aren't yet SL friends + if(i < 10) + { + model_index = 0; + agentID = gAgent.getID(); + } + //Adds FB only friends + else + { + model_index = 1; + agentID = LLUUID(NULL); + } + + person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 21578e986b..8f468e6814 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -65,6 +65,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); + mPersonTabIDs.push_back(item->getID()); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 1cf597b8c9..3f5f874e0f 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -61,6 +61,7 @@ public: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; + std::vector mPersonTabIDs; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From cca67a38d89da30d2b36690d91eb00cac04384bd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 3 May 2013 16:18:47 -0700 Subject: =?UTF-8?q?ACME-326=20Add=20=E2=80=98connect=20to=20facebook?= =?UTF-8?q?=E2=80=99=20on=20menu=20bar=20with=20functionality:=20Now=20the?= =?UTF-8?q?=20'SL=20residents=20you=20may=20want=20to=20friend'=20folder?= =?UTF-8?q?=20is=20populated=20only=20with=20FB+SL=20users=20who=20are=20n?= =?UTF-8?q?ot=20yet=20friends.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelpeople.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e1933c041c..f9f4d6d1b6 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1642,14 +1642,18 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); S32 model_index; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + //FB+SL but not SL friend - if(agent_id.notNull()) + if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { model_index = 0; } @@ -1659,9 +1663,6 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); - //Add to folder view LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) -- cgit v1.2.3 From ad12517329e73abf64ccc926aa49453cb4b73bfc Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 3 May 2013 17:03:37 -0700 Subject: ACME-275 : WIP : Filtering --- indra/newview/llpanelpeople.cpp | 1 + indra/newview/llpersonfolderview.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 03135ce580..66a183d5e5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1224,6 +1224,7 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) else if (cur_tab == FBCTESTTWO_TAB_NAME) { mPersonFolderViewModel.getFilter().setFilterSubString(filter); + mPersonFolderView->requestArrange(); } } diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index ba1e9d20eb..8d2191aebb 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -37,6 +37,7 @@ LLPersonFolderView::LLPersonFolderView(const Params &p) : LLFolderView(p), mConversationsEventStream("ConversationsEventsTwo") { + rename("Persons"); // For tracking! mConversationsEventStream.listen("ConversationsRefresh", boost::bind(&LLPersonFolderView::onConversationModelEvent, this, _1)); } -- cgit v1.2.3 From e30c0925f517b18830b7a4d520246acd98981ab3 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:31:22 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 12 +++---- indra/newview/llpersonfolderview.cpp | 68 +++++++++++++++++++++--------------- indra/newview/llpersonfolderview.h | 7 ++-- 3 files changed, 49 insertions(+), 38 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f9f4d6d1b6..56523773b8 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1664,10 +1664,10 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) } //Add to folder view - LLPersonTabModel * session_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); - if(session_model) + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + if(person_tab_model) { - addParticipantToModel(session_model, agent_id, name); + addParticipantToModel(person_tab_model, agent_id, name); } } } @@ -1676,7 +1676,7 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); - LLPersonTabModel * person_folder_model; + LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; S32 model_index; @@ -1696,9 +1696,9 @@ void LLPanelPeople::addTestParticipant() agentID = LLUUID(NULL); } - person_folder_model = dynamic_cast(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, agentID, name); + addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 8f468e6814..191c7d5bcd 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,29 +47,6 @@ LLPersonFolderView::~LLPersonFolderView() mConversationsEventStream.stopListening("ConversationsRefresh"); } -void LLPersonFolderView::createPersonTabs() -{ - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); -} - -void LLPersonFolderView::createPersonTab(const std::string& tab_name) -{ - //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); - LLPersonTabView::Params params; - params.name = item->getDisplayName(); - params.root = this; - params.listener = item; - params.tool_tip = params.name; - LLPersonTabView * widget = LLUICtrlFactory::create(params); - widget->addToFolder(this); - - mPersonTabIDs.push_back(item->getID()); - mPersonFolderModelMap[item->getID()] = item; - mPersonFolderViewMap[item->getID()] = widget; -} - BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { LLFolderViewItem * item = getCurSelectedItem(); @@ -97,6 +74,29 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) return LLView::handleMouseDown( x, y, mask ); } +void LLPersonFolderView::createPersonTabs() +{ + createPersonTab("SL residents you may want to friend"); + createPersonTab("Invite people you know to SL"); +} + +void LLPersonFolderView::createPersonTab(const std::string& tab_name) +{ + //Create a person tab + LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabView::Params params; + params.name = item->getDisplayName(); + params.root = this; + params.listener = item; + params.tool_tip = params.name; + LLPersonTabView * widget = LLUICtrlFactory::create(params); + widget->addToFolder(this); + + mIndexToFolderVec.push_back(item->getID()); + mPersonFolderModelMap[item->getID()] = item; + mPersonFolderViewMap[item->getID()] = widget; +} + bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) { std::string type = event.get("type").asString(); @@ -105,17 +105,17 @@ bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) if(type == "add_participant") { - LLPersonTabModel * person_folder_model = dynamic_cast(mPersonFolderModelMap[folder_id]); - LLPersonTabView * person_folder_view = dynamic_cast(mPersonFolderViewMap[folder_id]); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderModelMap[folder_id]); + LLPersonTabView * person_tab_view = dynamic_cast(mPersonFolderViewMap[folder_id]); - if(person_folder_model) + if(person_tab_model) { - LLPersonModel * person_model = person_folder_model->findParticipant(person_id); + LLPersonModel * person_model = person_tab_model->findParticipant(person_id); if(person_model) { - LLPersonView * participant_view = createConversationViewParticipant(person_model); - participant_view->addToFolder(person_folder_view); + LLPersonView * person_view = createConversationViewParticipant(person_model); + person_view->addToFolder(person_tab_view); } } } @@ -137,3 +137,13 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } + +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +{ + return mPersonFolderModelMap[mIndexToFolderVec[index]]; +} + +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +{ + return mPersonFolderViewMap[mIndexToFolderVec[index]]; +} diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3f5f874e0f..3a15f59164 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -50,18 +50,19 @@ public: LLPersonFolderView(const Params &p); ~LLPersonFolderView(); + BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); void createPersonTab(const std::string& tab_name); - bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + LLPersonTabModel * getPersonTabModelByIndex(const S32 index); + LLPersonTabView * getPersonTabViewByIndex(const S32 index); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mPersonTabIDs; + std::vector mIndexToFolderVec; LLEventStream mConversationsEventStream; }; -- cgit v1.2.3 From f6ad5819c15b1acca1a8b6498bc56adf1c0c3ac9 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 11:46:16 -0700 Subject: ACME-326 Populate the list with FB users who use SL but are not yet SL friends: Code cleanup --- indra/newview/llpanelpeople.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 56523773b8..b9afe10d84 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1663,7 +1663,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) model_index = 1; } - //Add to folder view + //Add to person tab model LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); if(person_tab_model) { -- cgit v1.2.3 From c451672ee7e3bc8229a3e5cba544c93495147024 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 14:22:46 -0700 Subject: ACME-338 Hide info button for FB only friends: Upon hover of FB only friends the info button and profile button are hidden. --- indra/newview/llpanelpeople.cpp | 16 ++++++++-------- indra/newview/llpersonfolderview.cpp | 19 +++++++++---------- indra/newview/llpersonfolderview.h | 16 ++++++++-------- indra/newview/llpersonmodelcommon.cpp | 5 +++-- indra/newview/llpersonmodelcommon.h | 10 +++++++++- indra/newview/llpersontabview.cpp | 20 +++++++++++++++----- indra/newview/llpersontabview.h | 8 +++++--- 7 files changed, 57 insertions(+), 37 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b9afe10d84..f7492a51e1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,7 +1641,7 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); - S32 model_index; + LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) @@ -1655,16 +1655,16 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) //FB+SL but not SL friend if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; } //FB only friend else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; } //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); if(person_tab_model) { addParticipantToModel(person_tab_model, agent_id, name); @@ -1679,24 +1679,24 @@ void LLPanelPeople::addTestParticipant() LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; - S32 model_index; + LLPersonTabModel::tab_type tab_type; for(int i = 0; i < 300; ++i) { //Adds FB+SL people that aren't yet SL friends if(i < 10) { - model_index = 0; + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; agentID = gAgent.getID(); } //Adds FB only friends else { - model_index = 1; + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; agentID = LLUUID(NULL); } - person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(model_index)); + person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); name = prefix + " " + suffix; addParticipantToModel(person_tab_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 191c7d5bcd..c22e4f3e58 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -30,7 +30,6 @@ #include "llpersonfolderview.h" #include "llpersontabview.h" -#include "llpersonmodelcommon.h" LLPersonFolderView::LLPersonFolderView(const Params &p) : @@ -76,14 +75,14 @@ BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) void LLPersonFolderView::createPersonTabs() { - createPersonTab("SL residents you may want to friend"); - createPersonTab("Invite people you know to SL"); + createPersonTab(LLPersonTabModel::FB_SL_NON_SL_FRIEND, "SL residents you may want to friend"); + createPersonTab(LLPersonTabModel::FB_ONLY_FRIEND, "Invite people you know to SL"); } -void LLPersonFolderView::createPersonTab(const std::string& tab_name) +void LLPersonFolderView::createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name) { //Create a person tab - LLPersonTabModel* item = new LLPersonTabModel(tab_name, *mViewModel); + LLPersonTabModel* item = new LLPersonTabModel(tab_type, tab_name, *mViewModel); LLPersonTabView::Params params; params.name = item->getDisplayName(); params.root = this; @@ -92,7 +91,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create(params); widget->addToFolder(this); - mIndexToFolderVec.push_back(item->getID()); + mIndexToFolderMap[tab_type] = item->getID(); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } @@ -138,12 +137,12 @@ LLPersonView * LLPersonFolderView::createConversationViewParticipant(LLPersonMod return LLUICtrlFactory::create(params); } -LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(const S32 index) +LLPersonTabModel * LLPersonFolderView::getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderModelMap[mIndexToFolderVec[index]]; + return mPersonFolderModelMap[mIndexToFolderMap[tab_type]]; } -LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(const S32 index) +LLPersonTabView * LLPersonFolderView::getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type) { - return mPersonFolderViewMap[mIndexToFolderVec[index]]; + return mPersonFolderViewMap[mIndexToFolderMap[tab_type]]; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 3a15f59164..85dec6515d 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -27,7 +27,10 @@ #ifndef LL_LLPERSONFOLDERVIEW_H #define LL_LLPERSONFOLDERVIEW_H -class LLPersonTabModel; +#include "llevents.h" +#include "llfolderview.h" +#include "llpersonmodelcommon.h" + class LLPersonTabView; class LLPersonView; class LLPersonModel; @@ -35,9 +38,6 @@ class LLPersonModel; typedef std::map person_folder_model_map; typedef std::map person_folder_view_map; -#include "llevents.h" -#include "llfolderview.h" - class LLPersonFolderView : public LLFolderView { public: @@ -53,16 +53,16 @@ public: BOOL handleMouseDown( S32 x, S32 y, MASK mask ); void createPersonTabs(); - void createPersonTab(const std::string& tab_name); + void createPersonTab(LLPersonTabModel::tab_type tab_type, const std::string& tab_name); bool onConversationModelEvent(const LLSD &event); LLPersonView * createConversationViewParticipant(LLPersonModel * item); - LLPersonTabModel * getPersonTabModelByIndex(const S32 index); - LLPersonTabView * getPersonTabViewByIndex(const S32 index); + LLPersonTabModel * getPersonTabModelByIndex(LLPersonTabModel::tab_type tab_type); + LLPersonTabView * getPersonTabViewByIndex(LLPersonTabModel::tab_type tab_type); person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; - std::vector mIndexToFolderVec; + std::map mIndexToFolderMap; LLEventStream mConversationsEventStream; }; diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 6b4c71faa2..70a24ac77a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -132,8 +132,9 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) // LLPersonTabModel // -LLPersonTabModel::LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model) +LLPersonTabModel::LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name,root_view_model), +mTabType(tab_type) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f44f619d18..7be3387564 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -108,7 +108,13 @@ protected: class LLPersonTabModel : public LLPersonModelCommon { public: - LLPersonTabModel(std::string display_name, LLFolderViewModelInterface& root_view_model); + enum tab_type + { + FB_SL_NON_SL_FRIEND, + FB_ONLY_FRIEND, + }; + + LLPersonTabModel(tab_type tab_type, std::string display_name, LLFolderViewModelInterface& root_view_model); LLPersonTabModel(LLFolderViewModelInterface& root_view_model); LLPointer getIcon() const { return NULL; } @@ -118,6 +124,8 @@ public: void clearParticipants(); LLPersonModel* findParticipant(const LLUUID& person_id); + tab_type mTabType; + private: }; diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index fdc024beb8..0dfd53705b 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -160,8 +160,10 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { LLFolderViewItem::addToFolder(person_folder_view); - //Added item to folder, could change folder's mHasVisibleChildren flag so call arrange + //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); + + mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); } LLPersonView::~LLPersonView() @@ -191,16 +193,24 @@ BOOL LLPersonView::postBuild() void LLPersonView::onMouseEnter(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(TRUE); - mProfileBtn->setVisible(TRUE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(TRUE); + mProfileBtn->setVisible(TRUE); + } + updateChildren(); LLFolderViewItem::onMouseEnter(x, y, mask); } void LLPersonView::onMouseLeave(S32 x, S32 y, MASK mask) { - mInfoBtn->setVisible(FALSE); - mProfileBtn->setVisible(FALSE); + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mInfoBtn->setVisible(FALSE); + mProfileBtn->setVisible(FALSE); + } + updateChildren(); LLFolderViewItem::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9cce615167..9e5fdc3057 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -33,6 +33,8 @@ #include "lloutputmonitorctrl.h" #include "lltextbox.h" +class LLPersonTabModel; + class LLPersonTabView : public LLFolderViewFolder { @@ -104,9 +106,11 @@ protected: private: + //Short-cut to tab model + LLPersonTabModel * mPersonTabModel; + LLPointer mImageOver; LLPointer mImageSelected; - LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; @@ -117,8 +121,6 @@ private: LLButton * mProfileBtn; LLOutputMonitorCtrl * mOutputMonitorCtrl; - - typedef enum e_avatar_item_child { ALIC_SPEAKER_INDICATOR, ALIC_PROFILE_BUTTON, -- cgit v1.2.3 From 04587bdb9d5e1653d5b19a6ca51e547180994958 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 6 May 2013 17:53:18 -0700 Subject: ACME-340 Get facebook icon from spec and add to viewer: Added a facebook icon and the icon appears only for the 'Invite people you know to SL' tab. --- indra/newview/llpersontabview.cpp | 33 +++++++++++++++++++-- indra/newview/llpersontabview.h | 2 ++ .../skins/default/textures/icons/Facebook.png | Bin 0 -> 365 bytes indra/newview/skins/default/textures/textures.xml | 2 ++ .../skins/default/xui/en/widgets/person_view.xml | 12 ++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Facebook.png (limited to 'indra/newview') diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 0dfd53705b..6aa51febcb 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -125,6 +125,7 @@ bool LLPersonView::sChildrenWidthsInitialized = false; ChildWidthVec LLPersonView::mChildWidthVec; LLPersonView::Params::Params() : +facebook_icon("facebook_icon"), avatar_icon("avatar_icon"), last_interaction_time_textbox("last_interaction_time_textbox"), permission_edit_theirs_icon("permission_edit_theirs_icon"), @@ -140,6 +141,7 @@ LLPersonView::LLPersonView(const LLPersonView::Params& p) : LLFolderViewItem(p), mImageOver(LLUI::getUIImage("ListItem_Over")), mImageSelected(LLUI::getUIImage("ListItem_Select")), +mFacebookIcon(NULL), mAvatarIcon(NULL), mLastInteractionTimeTextbox(NULL), mPermissionEditTheirsIcon(NULL), @@ -154,7 +156,19 @@ mOutputMonitorCtrl(NULL) S32 LLPersonView::getLabelXPos() { - return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + S32 label_x_pos; + + if(mAvatarIcon->getVisible()) + { + label_x_pos = getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad; + } + else + { + label_x_pos = getIndentation() + mFacebookIcon->getRect().getWidth() + mIconPad; + } + + + return label_x_pos; } void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) @@ -164,6 +178,16 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) person_folder_view->requestArrange(); mPersonTabModel = static_cast(getParentFolder()->getViewModelItem()); + + if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) + { + mAvatarIcon->setVisible(TRUE); + } + else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) + { + mFacebookIcon->setVisible(TRUE); + } + } LLPersonView::~LLPersonView() @@ -295,11 +319,16 @@ void LLPersonView::drawHighlight() void LLPersonView::initFromParams(const LLPersonView::Params & params) { + LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); + applyXUILayout(facebook_icon_params, this); + mFacebookIcon = LLUICtrlFactory::create(facebook_icon_params); + addChild(mFacebookIcon); + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); applyXUILayout(avatar_icon_params, this); mAvatarIcon = LLUICtrlFactory::create(avatar_icon_params); addChild(mAvatarIcon); - + LLTextBox::Params last_interaction_time_textbox(params.last_interaction_time_textbox()); applyXUILayout(last_interaction_time_textbox, this); mLastInteractionTimeTextbox = LLUICtrlFactory::create(last_interaction_time_textbox); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9e5fdc3057..9839a1eaaf 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -77,6 +77,7 @@ public: struct Params : public LLInitParam::Block { Params(); + Optional facebook_icon; Optional avatar_icon; Optional last_interaction_time_textbox; Optional permission_edit_theirs_icon; @@ -111,6 +112,7 @@ private: LLPointer mImageOver; LLPointer mImageSelected; + LLIconCtrl * mFacebookIcon; LLAvatarIconCtrl* mAvatarIcon; LLTextBox * mLastInteractionTimeTextbox; LLIconCtrl * mPermissionEditTheirsIcon; diff --git a/indra/newview/skins/default/textures/icons/Facebook.png b/indra/newview/skins/default/textures/icons/Facebook.png new file mode 100644 index 0000000000..8287d56f88 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Facebook.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 5b17ef94db..18146943a5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -199,6 +199,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 4a39109f36..006437401c 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -13,6 +13,17 @@ text_pad_right="4" arrow_size="10" max_folder_item_overlap="2"> + Date: Mon, 6 May 2013 18:19:08 -0700 Subject: ACME-341 Hide the avatar icon and use the FB icon instead: Adjusted positioning of facebook icon to better match spec. --- indra/newview/skins/default/xui/en/widgets/person_view.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml index 006437401c..46c1b7ff75 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -14,16 +14,15 @@ arrow_size="10" max_folder_item_overlap="2"> + width="14" /> Date: Mon, 6 May 2013 18:31:27 -0700 Subject: ACME-275 : Fixed! Filtering on FB list works (tested with simulated data only so far) --- indra/newview/llpersonmodelcommon.cpp | 28 ++++++++++++++++++++++++---- indra/newview/llpersonmodelcommon.h | 14 ++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 6b4c71faa2..9fefc17345 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -48,6 +48,7 @@ LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_m LLFolderViewModelItemCommon(root_view_model), mName(""), mSearchableName(""), + mPrevPassedAllFilters(false), mID(LLUUID().generateNewID()) { } @@ -103,11 +104,11 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) llinfos << "Merov : LLPersonModelCommon::filter, exit, no modif" << llendl; return true; } -*/ + */ if (!mChildren.empty()) { // If the current instance has children, it's a "person folder" and always passes filters (we do not filter out empty folders) - setPassedFilter(1, -1); + setPassedFilter(1, filter.getCurrentGeneration()); // Call filter recursively on all children for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; @@ -121,13 +122,31 @@ bool LLPersonModelCommon::filter( LLFolderViewFilter& filter) { // If there's no children, the current instance is a person and we check and set the passed filter flag on it const bool passed_filter = filter.check(this); - setPassedFilter(passed_filter, -1, filter.getStringMatchOffset(this), filter.getFilterStringSize()); + setPassedFilter(passed_filter, filter.getCurrentGeneration(), filter.getStringMatchOffset(this), filter.getFilterStringSize()); } filter.clearModified(); return true; } +void LLPersonModelCommon::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) +{ + LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); + bool before = mPrevPassedAllFilters; + mPrevPassedAllFilters = passedFilter(filter_generation); + + if (before != mPrevPassedAllFilters) + { + // Need to rearrange the folder if the filtered state of the item changed + LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder(); + if (parent_folder) + { + parent_folder->requestArrange(); + } + } +} + + // // LLPersonTabModel // @@ -217,7 +236,8 @@ LLPersonViewFilter::LLPersonViewFilter() : mEmptyLookupMessage(""), mFilterSubString(""), mName(""), - mFilterModified(FILTER_NONE) + mFilterModified(FILTER_NONE), + mCurrentGeneration(0) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index f44f619d18..1b8197cf6a 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -75,7 +75,7 @@ public: virtual bool filter( LLFolderViewFilter& filter); virtual bool descendantsPassedFilter(S32 filter_generation = -1) { return true; } -// virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) { } + virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); virtual bool passedFilter(S32 filter_generation = -1) { return mPassedFilter; } // The action callbacks @@ -102,6 +102,7 @@ protected: std::string mName; // Name of the person std::string mSearchableName; // Name used in string matching for this person + bool mPrevPassedAllFilters; LLUUID mID; }; @@ -172,7 +173,7 @@ public: void clearModified(); const std::string& getName() const { return mName; } const std::string& getFilterText() { return mName; } - void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; } + void setModified(EFilterModified behavior = FILTER_RESTART) { mFilterModified = behavior; mCurrentGeneration++; } // +-------------------------------------------------------------------+ // + Time @@ -193,10 +194,10 @@ public: // +-------------------------------------------------------------------+ // + Generation // +-------------------------------------------------------------------+ - // Note : unclear if we have to take tab on generation at that point - S32 getCurrentGeneration() const { return 0; } - S32 getFirstSuccessGeneration() const { return 0; } - S32 getFirstRequiredGeneration() const { return 0; } + // Note : For the moment, we do not support restrictive filtering so all generation indexes are pointing to the current generation + S32 getCurrentGeneration() const { return mCurrentGeneration; } + S32 getFirstSuccessGeneration() const { return mCurrentGeneration; } + S32 getFirstRequiredGeneration() const { return mCurrentGeneration; } // Non Virtual Methods (i.e. specific to this class) void setFilterSubString(const std::string& string); @@ -206,6 +207,7 @@ private: std::string mEmptyLookupMessage; std::string mFilterSubString; EFilterModified mFilterModified; + S32 mCurrentGeneration; }; class LLPersonViewSort -- cgit v1.2.3 From 54de882b81083298009e3b4a3d74fa1c7255068d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 7 May 2013 13:47:18 -0700 Subject: ACME-343 : Add Connect to Facebook menu item --- indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 39e777b246..9ce360415c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -15,6 +15,13 @@ function="ShowAgentProfile" parameter="agent" /> + + + + -- cgit v1.2.3 From dbfcd6c9c5709b74365c2538ba312685b09d22bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 7 May 2013 17:20:33 -0500 Subject: Optimization -- don't draw glow in alpha pool unless needed --- indra/newview/lldrawpoolalpha.cpp | 3 +- indra/newview/llspatialpartition.cpp | 3 +- indra/newview/llspatialpartition.h | 5 +-- indra/newview/llviewerpartsim.cpp | 2 +- indra/newview/llviewerpartsource.cpp | 2 +- indra/newview/llvopartgroup.cpp | 70 ++++++++++++++++++++++++------------ 6 files changed, 56 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 6fa16825df..331744acb7 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -515,7 +515,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && draw_glow_for_this_partition && - params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE)) + params.mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_EMISSIVE) && + (!params.mParticle || params.mHasGlow)) { static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GLOW("Alpha Glow"); LLFastTimer t(FTM_RENDER_ALPHA_GLOW); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 1ec56eb5f8..2a1d0d223c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4656,7 +4656,8 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mDistance(0.f), mDrawMode(LLRender::TRIANGLES), mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), - mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA) + mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA), + mHasGlow(FALSE) { mVertexBuffer->validateRange(mStart, mEnd, mCount, mOffset); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 08e77855c4..e9be93ce98 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -70,12 +70,12 @@ protected: public: void* operator new(size_t size) { - return ll_aligned_malloc_16(size); + return ll_aligned_malloc(size,64); } void operator delete(void* ptr) { - ll_aligned_free_16(ptr); + ll_aligned_free(ptr); } @@ -121,6 +121,7 @@ public: U32 mDrawMode; U32 mBlendFuncSrc; U32 mBlendFuncDst; + BOOL mHasGlow; struct CompareTexture { diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 21f1d2619c..96cd43a8ab 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -387,7 +387,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } // Do glow interpolation - part->mGlow.mV[3] = (U8) (lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); // Set the last update time to now. part->mLastUpdateTime = cur_time; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 8c49ce646d..b6bbd6140d 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mStartGlow = mPartSysData.mPartData.mStartGlow; part->mEndGlow = mPartSysData.mPartData.mEndGlow; - part->mGlow = LLColor4U(0, 0, 0, (U8) (part->mStartGlow*255.f)); + part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 53d67347d1..e5e627c1ea 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -273,6 +273,10 @@ void LLVOPartGroup::getBlendFunc(S32 idx, U32& src, U32& dst) src = part->mBlendFuncSource; dst = part->mBlendFuncDest; } + else + { + llerrs << "WTF?" << llendl; + } } LLVector3 LLVOPartGroup::getCameraPosition() const @@ -670,7 +674,7 @@ void LLVOPartGroup::getGeometry(S32 idx, } else { - pglow = LLColor4U(0, 0, 0, (U8) (255.f*part.mStartGlow)); + pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); pcolor = part.mStartColor; } } @@ -685,10 +689,13 @@ void LLVOPartGroup::getGeometry(S32 idx, *colorsp++ = color; *colorsp++ = color; - *emissivep++ = pglow; - *emissivep++ = pglow; - *emissivep++ = part.mGlow; - *emissivep++ = part.mGlow; + //if (pglow.mV[3] || part.mGlow.mV[3]) + { //only write glow if it is not zero + *emissivep++ = pglow; + *emissivep++ = pglow; + *emissivep++ = part.mGlow; + *emissivep++ = part.mGlow; + } if (!(part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)) @@ -873,8 +880,17 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider cur_col = colorsp + geom_idx; LLStrider cur_glow = emissivep + geom_idx; + LLColor4U* start_glow = cur_glow.get(); + object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx); + BOOL has_glow = FALSE; + + if (cur_glow.get() != start_glow) + { + has_glow = TRUE; + } + llassert(facep->getGeomCount() == 4); llassert(facep->getIndicesCount() == 6); @@ -894,26 +910,32 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst); - if (idx >= 0 && - draw_vec[idx]->mTexture == facep->getTexture() && - draw_vec[idx]->mFullbright == fullbright && - draw_vec[idx]->mBlendFuncDst == bf_dst && - draw_vec[idx]->mBlendFuncSrc == bf_src) + + if (idx >= 0) { - if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) - { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mEnd += facep->getGeomCount(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); - } - else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + LLDrawInfo* info = draw_vec[idx]; + + if (info->mTexture == facep->getTexture() && + info->mHasGlow == has_glow && + info->mFullbright == fullbright && + info->mBlendFuncDst == bf_dst && + info->mBlendFuncSrc == bf_src) { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mStart -= facep->getGeomCount(); - draw_vec[idx]->mOffset = facep->getIndicesStart(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mEnd += facep->getGeomCount(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } + else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mStart -= facep->getGeomCount(); + info->mOffset = facep->getIndicesStart(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } } } @@ -932,6 +954,8 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) info->mVSize = vsize; info->mBlendFuncDst = bf_dst; info->mBlendFuncSrc = bf_src; + info->mHasGlow = has_glow; + info->mParticle = TRUE; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); -- cgit v1.2.3 From 3a351c4ee548e2bce8ad0d5935377a090591621f Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 8 May 2013 05:51:28 +0000 Subject: Adding follow_redirects parameter to LLHTTPClient get/head variants. Not following redirects for facebook connect requests. --- indra/newview/llpanelpeople.cpp | 15 ++++++++++++--- indra/newview/tests/lltranslate_test.cpp | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index af9ecd743c..479e503ef0 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1854,14 +1854,20 @@ public: void LLPanelPeople::loadFacebookFriends() { - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLSD(), timeout, follow_redirects); } void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) { - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false), + LLSD(), timeout, follow_redirects); } } @@ -1895,7 +1901,10 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true)); + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true), + LLSD(), timeout, follow_redirects); } } diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp index fd9527d631..8ce56326d8 100644 --- a/indra/newview/tests/lltranslate_test.cpp +++ b/indra/newview/tests/lltranslate_test.cpp @@ -308,8 +308,8 @@ void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) { void LLCurl::Responder::result(LLSD const&) {} LLCurl::Responder::~Responder() {} -void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32) {} -void LLHTTPClient::get(const std::string&, LLPointer, const LLSD&, const F32) {} +void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {} +void LLHTTPClient::get(const std::string&, LLPointer, const LLSD&, const F32, bool) {} LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer) : std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {} -- cgit v1.2.3 From 7d6e3945204c05efe85eadf8a6635d0ca30e9186 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 8 May 2013 19:17:47 +0100 Subject: temporary hack for fb demo to use https://pdp15.lindenlab.com instead of going through cap server --- indra/newview/llpanelpeople.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 479e503ef0..9956888134 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1887,7 +1887,8 @@ void LLPanelPeople::disconnectFromFacebook() std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) { - static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; llinfos << url << llendl; return url; -- cgit v1.2.3 From 2d65482d7152b613409a071e0a117d38f350932a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 8 May 2013 15:26:45 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Adjusted personview/personmodel contain a suffix which is the FB username for SL+FB users --- indra/newview/llpanelpeople.cpp | 15 ++++++++++----- indra/newview/llpersonmodelcommon.cpp | 14 ++++++++++++-- indra/newview/llpersonmodelcommon.h | 6 ++++-- indra/newview/llpersontabview.cpp | 23 ++++++++++++++++++++++- indra/newview/llpersontabview.h | 1 + 5 files changed, 49 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9956888134..07a1c46256 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -732,6 +732,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; folder_view_params.use_ellipses = false; + folder_view_params.use_label_suffix = true; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; mPersonFolderView = LLUICtrlFactory::create(folder_view_params); @@ -1676,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Test Name"); + std::string prefix("Second Life User Name Goes Here"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1717,11 +1718,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model LLPersonModel* person_model = NULL; LLAvatarName avatar_name; - bool avatar_name_exists = LLAvatarNameCache::get(agent_id, &avatar_name); - - std::string aggregated_name = avatar_name_exists ? name + " (" + avatar_name.getDisplayName() + ") " : name; + bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + std::string avatar_name_string; + + if(has_name) + { + avatar_name_string = avatar_name.getDisplayName(); + } - person_model = new LLPersonModel(agent_id, aggregated_name, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index b3424cc451..e48eddf05a 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -39,14 +39,24 @@ LLPersonModelCommon::LLPersonModelCommon(std::string display_name, LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), + mLabelSuffix(""), mID(LLUUID().generateNewID()) { renameItem(display_name); } +LLPersonModelCommon::LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model) : +LLFolderViewModelItemCommon(root_view_model), + mID(LLUUID().generateNewID()) +{ + mLabelSuffix = suffix; + renameItem(display_name); +} + LLPersonModelCommon::LLPersonModelCommon(LLFolderViewModelInterface& root_view_model) : LLFolderViewModelItemCommon(root_view_model), mName(""), + mLabelSuffix(""), mSearchableName(""), mPrevPassedAllFilters(false), mID(LLUUID().generateNewID()) @@ -212,8 +222,8 @@ LLPersonModel* LLPersonTabModel::findParticipant(const LLUUID& person_id) // LLPersonModel // -LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model) : -LLPersonModelCommon(display_name,root_view_model), +LLPersonModel::LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model) : +LLPersonModelCommon(display_name, suffix, root_view_model), mAgentID(agent_id) { } diff --git a/indra/newview/llpersonmodelcommon.h b/indra/newview/llpersonmodelcommon.h index 5f3801874d..74598eaee0 100644 --- a/indra/newview/llpersonmodelcommon.h +++ b/indra/newview/llpersonmodelcommon.h @@ -40,6 +40,7 @@ class LLPersonModelCommon : public LLFolderViewModelItemCommon public: LLPersonModelCommon(std::string name, LLFolderViewModelInterface& root_view_model); + LLPersonModelCommon(std::string display_name, std::string suffix, LLFolderViewModelInterface& root_view_model); LLPersonModelCommon(LLFolderViewModelInterface& root_view_model); virtual ~LLPersonModelCommon(); @@ -51,7 +52,7 @@ public: virtual LLPointer getIcon() const { return NULL; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } - virtual std::string getLabelSuffix() const { return LLStringUtil::null; } + virtual std::string getLabelSuffix() const { return mLabelSuffix; } virtual BOOL isItemRenameable() const { return TRUE; } virtual BOOL renameItem(const std::string& new_name); virtual BOOL isItemMovable( void ) const { return FALSE; } @@ -101,6 +102,7 @@ public: protected: std::string mName; // Name of the person + std::string mLabelSuffix; std::string mSearchableName; // Name used in string matching for this person bool mPrevPassedAllFilters; LLUUID mID; @@ -133,7 +135,7 @@ private: class LLPersonModel : public LLPersonModelCommon { public: - LLPersonModel(const LLUUID& agent_id, const std::string display_name, LLFolderViewModelInterface& root_view_model); + LLPersonModel(const LLUUID& agent_id, const std::string display_name, const std::string suffix, LLFolderViewModelInterface& root_view_model); LLPersonModel(LLFolderViewModelInterface& root_view_model); LLUUID getAgentID(); diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 6aa51febcb..16ebb6af90 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -182,6 +182,7 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) if(mPersonTabModel->mTabType == LLPersonTabModel::FB_SL_NON_SL_FRIEND) { mAvatarIcon->setVisible(TRUE); + mFacebookIcon->setVisible(TRUE); } else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) { @@ -286,7 +287,20 @@ void LLPersonView::draw() F32 right_x = 0; drawHighlight(); - drawLabel(font, text_left, y, color, right_x); + drawLabel(mLabel, font, text_left, y, color, right_x); + + if(mLabelSuffix.length()) + { + LLRect mFacebookIconRect = mFacebookIcon->getRect(); + S32 new_left = right_x + 7; + mFacebookIconRect.set(new_left, + mFacebookIconRect.mTop, + new_left + mFacebookIconRect.getWidth(), + mFacebookIconRect.mBottom); + mFacebookIcon->setRect(mFacebookIconRect); + } + + drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); LLView::draw(); } @@ -317,6 +331,13 @@ void LLPersonView::drawHighlight() } } +void LLPersonView::drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x) +{ + font->renderUTF8(text, 0, x, y, color, + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); +} + void LLPersonView::initFromParams(const LLPersonView::Params & params) { LLIconCtrl::Params facebook_icon_params(params.facebook_icon()); diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 9839a1eaaf..6f244c2794 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -104,6 +104,7 @@ protected: void draw(); void drawHighlight(); + void drawLabel(const std::string text, const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x); private: -- cgit v1.2.3 From 14be8efcc6a9797d2041e56addd0897f0b4234ea Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 May 2013 16:53:52 -0700 Subject: ACME-348 : WIP : LLFacebookConnect refactoring --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfacebookconnect.cpp | 215 ++++++++++++++++++++++++++++++++++++ indra/newview/llfacebookconnect.h | 66 +++++++++++ indra/newview/llpanelpeople.cpp | 178 ----------------------------- indra/newview/llpanelpeople.h | 4 - 5 files changed, 283 insertions(+), 182 deletions(-) create mode 100644 indra/newview/llfacebookconnect.cpp create mode 100644 indra/newview/llfacebookconnect.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6b7fa7d842..44b1604b15 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES llexpandabletextbox.cpp llexternaleditor.cpp llface.cpp + llfacebookconnect.cpp llfasttimerview.cpp llfavoritesbar.cpp llfeaturemanager.cpp @@ -769,6 +770,7 @@ set(viewer_HEADER_FILES llexpandabletextbox.h llexternaleditor.h llface.h + llfacebookconnect.h llfasttimerview.h llfavoritesbar.h llfeaturemanager.h diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp new file mode 100644 index 0000000000..1962f6fd97 --- /dev/null +++ b/indra/newview/llfacebookconnect.cpp @@ -0,0 +1,215 @@ +/** + * @file llfacebookconnect.h + * @author Merov, Cho, Gil + * @brief Connection to Facebook Service + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfacebookconnect.h" + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookConnectResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookConnectResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; + + // Grab some graph data now that we are connected + LLFacebookConnect::instance().setConnected(true); + LLFacebookConnect::instance().loadFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookDisconnectResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookDisconnectResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; + + // Hide all the facebook stuff + LLFacebookConnect::instance().setConnected(false); + LLFacebookConnect::instance().hideFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookConnectedResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookDisconnectResponder); +public: + + LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {} + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; + + // Grab some graph data if already connected + LLFacebookConnect::instance().setConnected(true); + LLFacebookConnect::instance().loadFacebookFriends(); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + + // show the facebook login page if not connected yet + if ((status == 404) && mShowLoginIfNotConnected) + { + LLFacebookConnect::instance().connectToFacebook(); + } + } + } + +private: + bool mShowLoginIfNotConnected; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookFriendsResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookFriendsResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL; + + // Display the list of friends + LLFacebookConnect::instance().showFacebookFriends(content); + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + } + } +}; + + +/////////////////////////////////////////////////////////////////////////////// +// +LLFacebookConnect::LLFacebookConnect() +: mConnectedToFbc(false) +{ +} + +void LLFacebookConnect::init() +{ +} + +void LLFacebookConnect::loadFacebookFriends() +{ + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLSD(), timeout, follow_redirects); +} + +void LLFacebookConnect::hideFacebookFriends() +{ + // That needs to be done in llpanelpeople... + //mFacebookFriends->clear(); +} + +void LLFacebookConnect::connectToFacebook(const std::string& auth_code) +{ + LLSD body; + if (!auth_code.empty()) + body["code"] = auth_code; + + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); +} + +void LLFacebookConnect::showFacebookFriends(const LLSD& friends) +{ + /* All that needs to be rewritten to + mFacebookFriends->clear(); + LLPersonTabModel::tab_type tab_type; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + + //FB+SL but not SL friend + if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if(person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } + */ +} + + + + + + + + diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h new file mode 100644 index 0000000000..d60fdacd90 --- /dev/null +++ b/indra/newview/llfacebookconnect.h @@ -0,0 +1,66 @@ +/** + * @file llfacebookconnect.h + * @author Merov, Cho, Gil + * @brief Connection to Facebook Service + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFACEBOOKCONNECT_H +#define LL_LLFACEBOOKCONNECT_H + +#include "llsingleton.h" + +/** + * @class LLFacebookConnect + * + * Manages authentication to, and interaction with, a web service allowing the + * the viewer to get Facebook OpenGraph data. + */ +class LLFacebookConnect : public LLSingleton +{ + LOG_CLASS(LLFacebookConnect); +public: + /* + * Performs initial setup, by requesting config data from the web service if + * it has not already been received. + */ + void init(); + + void loadFacebookFriends(); + void hideFacebookFriends(); + void connectToFacebook(const std::string& auth_code = ""); + void showFacebookFriends(const LLSD& friends); + + void setConnected(bool connected) { mConnectedToFbc = connected; } + +private: + + friend class LLSingleton; + + LLFacebookConnect(); + ~LLFacebookConnect() {}; + + bool mConnectedToFbc; +}; + +#endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9956888134..ce3ae48aca 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1639,40 +1639,6 @@ void LLPanelPeople::openFacebookWeb(std::string url) LLUrlAction::openURLExternal(url); } -void LLPanelPeople::showFacebookFriends(const LLSD& friends) -{ - mFacebookFriends->clear(); - LLPersonTabModel::tab_type tab_type; - LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - - for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) - { - std::string name = i->second["name"].asString(); - LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - - //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); - - //FB+SL but not SL friend - if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - } - //FB only friend - else - { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - } - - //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if(person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } - } -} - void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); @@ -1725,141 +1691,6 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model person_folder_model->addParticipant(person_model); } -void LLPanelPeople::hideFacebookFriends() -{ - mFacebookFriends->clear(); -} - -class FacebookConnectResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookConnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // grab some graph data now that we are connected - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } - - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - if (status == 302) - { - mPanelPeople->openFacebookWeb(content["location"]); - } - } -}; - -class FacebookDisconnectResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookDisconnectResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // hide all the facebook stuff - mPanelPeople->mConnectedToFbc = false; - mPanelPeople->hideFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } -}; - -class FacebookConnectedResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - bool mShowLoginIfNotConnected; - - FacebookConnectedResponder(LLPanelPeople * panel_people, bool show_login_if_not_connected) : mPanelPeople(panel_people), mShowLoginIfNotConnected(show_login_if_not_connected) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // grab some graph data if already connected - mPanelPeople->mConnectedToFbc = true; - mPanelPeople->loadFacebookFriends(); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - - // show the facebook login page if not connected yet - if (status == 404 && mShowLoginIfNotConnected) - { - mPanelPeople->connectToFacebook(); - } - } - } -}; - -class FacebookFriendsResponder : public LLHTTPClient::Responder -{ -public: - - LLPanelPeople * mPanelPeople; - - FacebookFriendsResponder(LLPanelPeople * panel_people) : mPanelPeople(panel_people) {} - - /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - llinfos << content << llendl; - - // display the list of friends - mPanelPeople->showFacebookFriends(content); - } - else - { - llinfos << "failed to get response. reason: " << reason << " status: " << status << llendl; - } - } - - /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) - { - if (status == 302) - { - mPanelPeople->openFacebookWeb(content["location"]); - } - } -}; - -void LLPanelPeople::loadFacebookFriends() -{ - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), - LLSD(), timeout, follow_redirects); -} - void LLPanelPeople::tryToReconnectToFacebook() { if (!mConnectedToFbc) @@ -1871,15 +1702,6 @@ void LLPanelPeople::tryToReconnectToFacebook() } } -void LLPanelPeople::connectToFacebook(const std::string& auth_code) -{ - LLSD body; - if (!auth_code.empty()) - body["code"] = auth_code; - - LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); -} - void LLPanelPeople::disconnectFromFacebook() { LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 943d84ac1d..fa354f7ecb 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -63,13 +63,9 @@ public: static void idle(void * user_data); void openFacebookWeb(std::string url); - void showFacebookFriends(const LLSD& friends); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); - void hideFacebookFriends(); - void loadFacebookFriends(); void tryToReconnectToFacebook(); - void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); std::string getFacebookConnectURL(const std::string& route = ""); -- cgit v1.2.3 From 62eda57ea1f4d3e39aa34010f7709908f24fb6e2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 May 2013 10:25:21 -0700 Subject: ACME-348 : WIP : LLFacebookConnect refactorin completed. Not functional yet though. --- indra/newview/llfacebookconnect.cpp | 92 +++++++++++++++++++++++++++++++++---- indra/newview/llfacebookconnect.h | 8 +++- indra/newview/llpanelpeople.cpp | 72 +++-------------------------- indra/newview/llpanelpeople.h | 9 +--- 4 files changed, 98 insertions(+), 83 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 1962f6fd97..ec2085c2ac 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -29,6 +29,38 @@ #include "llfacebookconnect.h" +#include "llagent.h" +#include "llcallingcard.h" // for LLAvatarTracker +//#include "llcommandhandler.h" +#include "llhttpclient.h" + +/////////////////////////////////////////////////////////////////////////////// +// +/* +class LLFacebookConnectHandler : public LLCommandHandler +{ +public: + LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + if (tokens.size() > 0) + { + if (tokens[0].asString() == "connect") + { + if (query_map.has("code")) + { + LLFacebookConnect::instance().connectToFacebook(query_map["code"]); + } + return true; + } + } + return false; + } +}; +LLFacebookConnectHandler gFacebookConnectHandler; +*/ + /////////////////////////////////////////////////////////////////////////////// // class LLFacebookConnectResponder : public LLHTTPClient::Responder @@ -81,7 +113,7 @@ public: // class LLFacebookConnectedResponder : public LLHTTPClient::Responder { - LOG_CLASS(LLFacebookDisconnectResponder); + LOG_CLASS(LLFacebookConnectedResponder); public: LLFacebookConnectedResponder(bool show_login_if_not_connected) : mShowLoginIfNotConnected(show_login_if_not_connected) {} @@ -147,11 +179,20 @@ void LLFacebookConnect::init() { } +std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) +{ + //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); + static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho + std::string url = sFacebookConnectUrl + route; + llinfos << url << llendl; + return url; +} + void LLFacebookConnect::loadFacebookFriends() { const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new FacebookFriendsResponder(this), + LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), LLSD(), timeout, follow_redirects); } @@ -167,15 +208,41 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) if (!auth_code.empty()) body["code"] = auth_code; - LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new FacebookConnectResponder(this)); + LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder()); +} + +void LLFacebookConnect::disconnectFromFacebook() +{ + LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); +} + +void LLFacebookConnect::tryToReconnectToFacebook() +{ + if (!mConnectedToFbc) + { + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(false), + LLSD(), timeout, follow_redirects); + } +} + +void LLFacebookConnect::getConnectionToFacebook() +{ + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), + LLSD(), timeout, follow_redirects); } void LLFacebookConnect::showFacebookFriends(const LLSD& friends) { - /* All that needs to be rewritten to - mFacebookFriends->clear(); - LLPersonTabModel::tab_type tab_type; + /* All that needs to be rewritten a different way */ + // FOR TESTING ONLY!! Print out the data in the log + //mFacebookFriends->clear(); + //LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + llinfos << "LLFacebookConnect::showFacebookFriends" << llendl; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { @@ -183,27 +250,32 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); //add to avatar list - mFacebookFriends->addNewItem(agent_id, name, false); + //mFacebookFriends->addNewItem(agent_id, name, false); //FB+SL but not SL friend + bool is_SL_friend = false; if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + is_SL_friend = false; } //FB only friend else { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + is_SL_friend = true; } + llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; //Add to person tab model + /* LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); if(person_tab_model) { addParticipantToModel(person_tab_model, agent_id, name); } + */ } - */ } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index d60fdacd90..c42d8c8edc 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -49,9 +49,14 @@ public: void loadFacebookFriends(); void hideFacebookFriends(); void connectToFacebook(const std::string& auth_code = ""); + void disconnectFromFacebook(); + void tryToReconnectToFacebook(); + void getConnectionToFacebook(); + void showFacebookFriends(const LLSD& friends); void setConnected(bool connected) { mConnectedToFbc = connected; } + bool getConnected() { return mConnectedToFbc; } private: @@ -59,7 +64,8 @@ private: LLFacebookConnect(); ~LLFacebookConnect() {}; - + std::string getFacebookConnectURL(const std::string& route = ""); + bool mConnectedToFbc; }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ce3ae48aca..02a254b76c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -54,8 +54,8 @@ #include "llcallingcard.h" // for LLAvatarTracker #include "llcallbacklist.h" #include "llerror.h" +#include "llfacebookconnect.h" #include "llfloateravatarpicker.h" -//#include "llfloaterminiinspector.h" #include "llfriendcard.h" #include "llgroupactions.h" #include "llgrouplist.h" @@ -76,7 +76,6 @@ #include "llspeakers.h" #include "llfloaterwebcontent.h" #include "llurlaction.h" -#include "llcommandhandler.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -91,35 +90,6 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; -class LLFacebookConnectHandler : public LLCommandHandler -{ -public: - LLFacebookConnectHandler() : LLCommandHandler("fbc", UNTRUSTED_THROTTLE), mPanelPeople(NULL) { } - - LLPanelPeople* mPanelPeople; - - bool handle(const LLSD& tokens, const LLSD& query_map, - LLMediaCtrl* web) - { - if (tokens.size() > 0) - { - if (tokens[0].asString() == "connect") - { - if (query_map.has("code")) - { - if (mPanelPeople) - { - mPanelPeople->connectToFacebook(query_map["code"]); - mPanelPeople = NULL; - } - } - return true; - } - } - return false; - } -}; -LLFacebookConnectHandler gFacebookConnectHandler; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -577,7 +547,6 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), - mConnectedToFbc(false), mPersonFolderView(NULL), mTryToConnectToFbc(true), mTabContainer(NULL), @@ -947,7 +916,7 @@ void LLPanelPeople::updateFbcTestList() if (mTryToConnectToFbc) { // try to reconnect to facebook! - tryToReconnectToFacebook(); + LLFacebookConnect::instance().tryToReconnectToFacebook(); // don't try again mTryToConnectToFbc = false; @@ -1633,11 +1602,12 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } +/* void LLPanelPeople::openFacebookWeb(std::string url) { - gFacebookConnectHandler.mPanelPeople = this; LLUrlAction::openURLExternal(url); } +*/ void LLPanelPeople::addTestParticipant() { @@ -1691,43 +1661,15 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model person_folder_model->addParticipant(person_model); } -void LLPanelPeople::tryToReconnectToFacebook() -{ - if (!mConnectedToFbc) - { - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, false), - LLSD(), timeout, follow_redirects); - } -} - -void LLPanelPeople::disconnectFromFacebook() -{ - LLHTTPClient::del(getFacebookConnectURL("/connection"), new FacebookDisconnectResponder(this)); -} - -std::string LLPanelPeople::getFacebookConnectURL(const std::string& route) -{ - //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho - std::string url = sFacebookConnectUrl + route; - llinfos << url << llendl; - return url; -} - void LLPanelPeople::onLoginFbcButtonClicked() { - if (mConnectedToFbc) + if (LLFacebookConnect::instance().getConnected()) { - disconnectFromFacebook(); + LLFacebookConnect::instance().disconnectFromFacebook(); } else { - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new FacebookConnectedResponder(this, true), - LLSD(), timeout, follow_redirects); + LLFacebookConnect::instance().getConnectionToFacebook(); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index fa354f7ecb..2f74064327 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,16 +62,11 @@ public: static void idle(void * user_data); - void openFacebookWeb(std::string url); +// void openFacebookWeb(std::string url); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); - void tryToReconnectToFacebook(); - void disconnectFromFacebook(); - std::string getFacebookConnectURL(const std::string& route = ""); - - bool mConnectedToFbc; - bool mTryToConnectToFbc; + bool mTryToConnectToFbc; // internals class Updater; -- cgit v1.2.3 From cd8e0b92e1c8f9f8544b1011e61c21c7789b93b7 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 9 May 2013 11:10:13 -0700 Subject: Tweak to ensure more avatar rendering info is sent to the simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 54144677f4..da4b6cf806 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -249,7 +249,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio { LLVOAvatar* avatar = dynamic_cast(*iter); if (avatar && - avatar->getRezzedStatus() == 2 && // Fully rezzed + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) !avatar->isDead() && // Not dead yet avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region { -- cgit v1.2.3 From be9f71d16660e37fb058ddf05f20e6a80a272862 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 9 May 2013 15:40:02 -0500 Subject: MAINT-2647 Fix for some objects not rendering until first LoD switch/selection. --- indra/newview/lldrawable.cpp | 2 +- indra/newview/lldrawable.h | 1 - indra/newview/llviewerobject.cpp | 3 ++- indra/newview/llviewerobjectlist.cpp | 3 ++- indra/newview/pipeline.cpp | 5 ----- 5 files changed, 5 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 2e3a9119b8..31ab37f970 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -441,7 +441,7 @@ void LLDrawable::makeActive() } llassert(isAvatar() || isRoot() || mParent->isActive()); - } +} void LLDrawable::makeStatic(BOOL warning_enabled) diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 4608d16fec..4420a34fae 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -284,7 +284,6 @@ public: NEARBY_LIGHT = 0x00200000, // In gPipeline.mNearbyLightSet BUILT = 0x00400000, FORCE_INVISIBLE = 0x00800000, // stay invis until CLEAR_INVISIBLE is set (set of orphaned) - CLEAR_INVISIBLE = 0x01000000, // clear FORCE_INVISIBLE next draw frame REBUILD_SHADOW = 0x02000000, HAS_ALPHA = 0x04000000, RIGGED = 0x08000000, diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9dc9932c86..e17b085eab 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2137,7 +2137,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned) { // lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl; - mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); + gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index fa79ac07e6..66615657d8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2064,8 +2064,9 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) if (childp->mDrawable.notNull()) { // Make the drawable visible again and set the drawable parent - childp->mDrawable->setState(LLDrawable::CLEAR_INVISIBLE); + childp->mDrawable->clearState(LLDrawable::FORCE_INVISIBLE); childp->setDrawableParent(objectp->mDrawable); // LLViewerObjectList::findOrphans() + gPipeline.markRebuild( childp->mDrawable, LLDrawable::REBUILD_ALL, TRUE ); } // Make certain particles, icon and HUD aren't hidden diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 442c3ef124..16596f2574 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3320,11 +3320,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) { drawablep->setVisible(camera, NULL, FALSE); } - else if (drawablep->isState(LLDrawable::CLEAR_INVISIBLE)) - { - // clear invisible flag here to avoid single frame glitch - drawablep->clearState(LLDrawable::FORCE_INVISIBLE|LLDrawable::CLEAR_INVISIBLE); - } } if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) -- cgit v1.2.3 From 359c3d520eaf8de818081db32812387416add26a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 9 May 2013 16:02:03 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Rendering now matches the UX spec. --- indra/newview/llpanelpeople.cpp | 6 +++--- indra/newview/llpersontabview.cpp | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 07a1c46256..420225f260 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -731,7 +731,7 @@ BOOL LLPanelPeople::postBuild() folder_view_params.listener = base_item; folder_view_params.view_model = &mPersonFolderViewModel; folder_view_params.root = NULL; - folder_view_params.use_ellipses = false; + folder_view_params.use_ellipses = true; folder_view_params.use_label_suffix = true; folder_view_params.options_menu = "menu_conversation.xml"; folder_view_params.name = "fbcfolderview"; @@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Second Life User Name Goes Here"); + std::string prefix("Facebook User Name"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1726,7 +1726,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model avatar_name_string = avatar_name.getDisplayName(); } - person_model = new LLPersonModel(agent_id, name, avatar_name_string, mPersonFolderViewModel); + person_model = new LLPersonModel(agent_id, avatar_name_string, name, mPersonFolderViewModel); person_folder_model->addParticipant(person_model); } diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 16ebb6af90..d4c73cd53f 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -173,6 +173,8 @@ S32 LLPersonView::getLabelXPos() void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { + const LLFontGL * font = LLFontGL::getFontSansSerifSmall(); + LLFolderViewItem::addToFolder(person_folder_view); //Added item to folder could change folder's mHasVisibleChildren flag so call arrange person_folder_view->requestArrange(); @@ -183,6 +185,17 @@ void LLPersonView::addToFolder(LLFolderViewFolder * person_folder_view) { mAvatarIcon->setVisible(TRUE); mFacebookIcon->setVisible(TRUE); + + S32 label_width = font->getWidth(mLabel); + F32 text_left = (F32)getLabelXPos(); + + LLRect mFacebookIconRect = mFacebookIcon->getRect(); + S32 new_left = text_left + label_width + 7; + mFacebookIconRect.set(new_left, + mFacebookIconRect.mTop, + new_left + mFacebookIconRect.getWidth(), + mFacebookIconRect.mBottom); + mFacebookIcon->setRect(mFacebookIconRect); } else if(mPersonTabModel->mTabType == LLPersonTabModel::FB_ONLY_FRIEND) { @@ -288,18 +301,6 @@ void LLPersonView::draw() drawHighlight(); drawLabel(mLabel, font, text_left, y, color, right_x); - - if(mLabelSuffix.length()) - { - LLRect mFacebookIconRect = mFacebookIcon->getRect(); - S32 new_left = right_x + 7; - mFacebookIconRect.set(new_left, - mFacebookIconRect.mTop, - new_left + mFacebookIconRect.getWidth(), - mFacebookIconRect.mBottom); - mFacebookIcon->setRect(mFacebookIconRect); - } - drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); LLView::draw(); -- cgit v1.2.3 From fb27eae15502cbd2a13cde018ae67f961320d0ba Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 9 May 2013 17:36:04 -0700 Subject: ACME-342 Format the PersonView so that it shows the avatar icon, SL name, FB icon, and FB name: Found a couple bugs that were causing the positioning of text to be incorrect in the 'Peope you may want to friend' tab. --- indra/newview/llpanelpeople.cpp | 4 ++-- indra/newview/llpersontabview.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 420225f260..2bdfdf6687 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1677,7 +1677,7 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends) void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); - std::string prefix("Facebook User Name"); + std::string prefix("FB Name"); LLPersonTabModel * person_tab_model; LLUUID agentID; std::string name; @@ -1718,7 +1718,7 @@ void LLPanelPeople::addParticipantToModel(LLPersonTabModel * person_folder_model LLPersonModel* person_model = NULL; LLAvatarName avatar_name; - bool has_name = LLAvatarNameCache::get(agent_id, &avatar_name); + bool has_name = agent_id.notNull() ? LLAvatarNameCache::get(agent_id, &avatar_name) : false; std::string avatar_name_string; if(has_name) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index d4c73cd53f..34ffc6ffce 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -300,8 +300,14 @@ void LLPersonView::draw() F32 right_x = 0; drawHighlight(); - drawLabel(mLabel, font, text_left, y, color, right_x); - drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); + if(mLabel.length()) + { + drawLabel(mLabel, font, text_left, y, color, right_x); + } + if(mLabelSuffix.length()) + { + drawLabel(mLabelSuffix, font, mFacebookIcon->getRect().mRight + 7, y, color, right_x); + } LLView::draw(); } -- cgit v1.2.3 From f90d93f75da6481dc1b308dfb76dd767e7623ea5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 May 2013 15:10:53 -0700 Subject: ACME-348 : WIP : Add some traces to work out the protocol (temporary) --- indra/newview/llfacebookconnect.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ec2085c2ac..e7f039aff1 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -173,6 +173,7 @@ public: LLFacebookConnect::LLFacebookConnect() : mConnectedToFbc(false) { + llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl; } void LLFacebookConnect::init() @@ -181,6 +182,7 @@ void LLFacebookConnect::init() std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { + llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl; //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; @@ -190,6 +192,7 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) void LLFacebookConnect::loadFacebookFriends() { + llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), @@ -198,12 +201,14 @@ void LLFacebookConnect::loadFacebookFriends() void LLFacebookConnect::hideFacebookFriends() { + llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl; // That needs to be done in llpanelpeople... //mFacebookFriends->clear(); } void LLFacebookConnect::connectToFacebook(const std::string& auth_code) { + llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl; LLSD body; if (!auth_code.empty()) body["code"] = auth_code; @@ -213,11 +218,13 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) void LLFacebookConnect::disconnectFromFacebook() { + llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl; LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } void LLFacebookConnect::tryToReconnectToFacebook() { + llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl; if (!mConnectedToFbc) { const bool follow_redirects=false; @@ -229,6 +236,7 @@ void LLFacebookConnect::tryToReconnectToFacebook() void LLFacebookConnect::getConnectionToFacebook() { + llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), @@ -242,7 +250,7 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) //mFacebookFriends->clear(); //LLPersonTabModel::tab_type tab_type; LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - llinfos << "LLFacebookConnect::showFacebookFriends" << llendl; + llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl; for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) { @@ -257,15 +265,15 @@ void LLFacebookConnect::showFacebookFriends(const LLSD& friends) if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) { //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - is_SL_friend = false; + is_SL_friend = true; } //FB only friend else { //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - is_SL_friend = true; + is_SL_friend = false; } - llinfos << "LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; + llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; //Add to person tab model /* -- cgit v1.2.3 From 7c4bfc8f55ebc581ddac0c2394b07b24d240d1a6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 May 2013 18:25:45 -0700 Subject: ACME-348 : Completed : Facebook Connect refactored, LLPeoplePanel test list hooked correctly. --- indra/newview/llfacebookconnect.cpp | 100 ++++++++++-------------------------- indra/newview/llfacebookconnect.h | 19 ++++--- indra/newview/llpanelpeople.cpp | 54 ++++++++++++++++--- indra/newview/llpanelpeople.h | 5 +- 4 files changed, 88 insertions(+), 90 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e7f039aff1..7f8e3afe89 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -98,9 +98,9 @@ public: { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - // Hide all the facebook stuff + // Clear all facebook stuff LLFacebookConnect::instance().setConnected(false); - LLFacebookConnect::instance().hideFacebookFriends(); + LLFacebookConnect::instance().clearContent(); } else { @@ -156,9 +156,7 @@ public: if (isGoodStatus(status)) { LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL; - - // Display the list of friends - LLFacebookConnect::instance().showFacebookFriends(content); + LLFacebookConnect::instance().storeContent(content); } else { @@ -171,18 +169,14 @@ public: /////////////////////////////////////////////////////////////////////////////// // LLFacebookConnect::LLFacebookConnect() -: mConnectedToFbc(false) -{ - llinfos << "Merov : LLFacebookConnect::LLFacebookConnect" << llendl; -} - -void LLFacebookConnect::init() +: mConnectedToFbc(false), + mContent(), + mGeneration(0) { } std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { - llinfos << "Merov : LLFacebookConnect::getFacebookConnectURL. route = " << route << llendl; //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); static std::string sFacebookConnectUrl = "https://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho std::string url = sFacebookConnectUrl + route; @@ -190,25 +184,8 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) return url; } -void LLFacebookConnect::loadFacebookFriends() -{ - llinfos << "Merov : LLFacebookConnect::loadFacebookFriends" << llendl; - const bool follow_redirects=false; - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), - LLSD(), timeout, follow_redirects); -} - -void LLFacebookConnect::hideFacebookFriends() -{ - llinfos << "Merov : LLFacebookConnect::hideFacebookFriends" << llendl; - // That needs to be done in llpanelpeople... - //mFacebookFriends->clear(); -} - void LLFacebookConnect::connectToFacebook(const std::string& auth_code) { - llinfos << "Merov : LLFacebookConnect::connectToFacebook" << llendl; LLSD body; if (!auth_code.empty()) body["code"] = auth_code; @@ -218,13 +195,11 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code) void LLFacebookConnect::disconnectFromFacebook() { - llinfos << "Merov : LLFacebookConnect::disconnectFromFacebook" << llendl; LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } void LLFacebookConnect::tryToReconnectToFacebook() { - llinfos << "Merov : LLFacebookConnect::tryToReconnectToFacebook" << llendl; if (!mConnectedToFbc) { const bool follow_redirects=false; @@ -236,54 +211,35 @@ void LLFacebookConnect::tryToReconnectToFacebook() void LLFacebookConnect::getConnectionToFacebook() { - llinfos << "Merov : LLFacebookConnect::getConnectionToFacebook" << llendl; const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(true), LLSD(), timeout, follow_redirects); } -void LLFacebookConnect::showFacebookFriends(const LLSD& friends) +void LLFacebookConnect::loadFacebookFriends() { - /* All that needs to be rewritten a different way */ - // FOR TESTING ONLY!! Print out the data in the log - //mFacebookFriends->clear(); - //LLPersonTabModel::tab_type tab_type; - LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); - llinfos << "Merov : LLFacebookConnect::showFacebookFriends" << llendl; - - for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) - { - std::string name = i->second["name"].asString(); - LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - - //add to avatar list - //mFacebookFriends->addNewItem(agent_id, name, false); - - //FB+SL but not SL friend - bool is_SL_friend = false; - if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - //tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - is_SL_friend = true; - } - //FB only friend - else - { - //tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - is_SL_friend = false; - } - llinfos << "Merov : LLFacebookConnect : agent_id = " << agent_id << ", name = " << name << ", SL friend = " << is_SL_friend << llendl; - - //Add to person tab model - /* - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if(person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } - */ - } + const bool follow_redirects=false; + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friend"), new LLFacebookFriendsResponder(), + LLSD(), timeout, follow_redirects); +} + +void LLFacebookConnect::storeContent(const LLSD& content) +{ + mGeneration++; + mContent = content; +} + +const LLSD& LLFacebookConnect::getContent() const +{ + return mContent; +} + +void LLFacebookConnect::clearContent() +{ + mGeneration++; + mContent = LLSD(); } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index c42d8c8edc..691aaa9131 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -40,24 +40,21 @@ class LLFacebookConnect : public LLSingleton { LOG_CLASS(LLFacebookConnect); public: - /* - * Performs initial setup, by requesting config data from the web service if - * it has not already been received. - */ - void init(); - - void loadFacebookFriends(); - void hideFacebookFriends(); void connectToFacebook(const std::string& auth_code = ""); void disconnectFromFacebook(); void tryToReconnectToFacebook(); void getConnectionToFacebook(); - void showFacebookFriends(const LLSD& friends); + void loadFacebookFriends(); + + void clearContent(); + void storeContent(const LLSD& content); + const LLSD& getContent() const; void setConnected(bool connected) { mConnectedToFbc = connected; } bool getConnected() { return mConnectedToFbc; } - + S32 generation() { return mGeneration; } + private: friend class LLSingleton; @@ -67,6 +64,8 @@ private: std::string getFacebookConnectURL(const std::string& route = ""); bool mConnectedToFbc; + LLSD mContent; + S32 mGeneration; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 02a254b76c..8648a44c55 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -555,12 +555,13 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mMiniMap(NULL) + mMiniMap(NULL), + mFacebookListGeneration(0) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this)); - mFbcTestListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFbcTestList, this)); + mFacebookListUpdater = new LLFbcTestListUpdater(boost::bind(&LLPanelPeople::updateFacebookList, this)); mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this)); mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); @@ -595,7 +596,7 @@ LLPanelPeople::~LLPanelPeople() delete mNearbyListUpdater; delete mFriendListUpdater; delete mRecentListUpdater; - delete mFbcTestListUpdater; + delete mFacebookListUpdater; if(LLVoiceClient::instanceExists()) { @@ -683,13 +684,17 @@ BOOL LLPanelPeople::postBuild() mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + //===Temporary ======================================================================== + LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); mFacebookFriends = social_tab->getChild("facebook_friends"); - social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); + // Note: we use the same updater for both test lists (brute force but OK since it's temporary) + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); //===Test START======================================================================== LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); + socialtwo_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); //Create folder view LLPersonModelCommon* base_item = new LLPersonModelCommon(mPersonFolderViewModel); @@ -911,7 +916,7 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } -void LLPanelPeople::updateFbcTestList() +void LLPanelPeople::updateFacebookList() { if (mTryToConnectToFbc) { @@ -922,8 +927,45 @@ void LLPanelPeople::updateFbcTestList() mTryToConnectToFbc = false; // stop updating - mFbcTestListUpdater->setActive(false); + mFacebookListUpdater->setActive(false); } + + if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) + { + mFacebookListGeneration = LLFacebookConnect::instance().generation(); + LLSD friends = LLFacebookConnect::instance().getContent(); + + mFacebookFriends->clear(); + LLPersonTabModel::tab_type tab_type; + LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance(); + + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + + //add to avatar list + mFacebookFriends->addNewItem(agent_id, name, false); + + //FB+SL but not SL friend + if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if (person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } + } } void LLPanelPeople::updateButtons() diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 2f74064327..6b5514deaf 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -88,7 +88,7 @@ private: void updateFriendList(); void updateNearbyList(); void updateRecentList(); - void updateFbcTestList(); + void updateFacebookList(); bool isItemsFreeOfFriends(const uuid_vec_t& uuids); @@ -152,6 +152,7 @@ private: LLAvatarList* mRecentList; LLGroupList* mGroupList; LLSocialList* mFacebookFriends; + S32 mFacebookListGeneration; LLNetMap* mMiniMap; std::vector mSavedOriginalFilters; @@ -162,7 +163,7 @@ private: Updater* mFriendListUpdater; Updater* mNearbyListUpdater; Updater* mRecentListUpdater; - Updater* mFbcTestListUpdater; + Updater* mFacebookListUpdater; Updater* mButtonsUpdater; LLMenuButton* mFBCGearButton; LLHandle< LLFloater > mPicker; -- cgit v1.2.3 From dbef09a2bb629cf6001a3963f6899bcac53b7774 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 May 2013 18:29:28 -0700 Subject: ACME-344 : Menu hooked up. Readded the missing completedHeader() methods in responder that I mistakenly took out during the refactor. --- indra/newview/llfacebookconnect.cpp | 28 +++++++++++++++++++--- indra/newview/llfacebookconnect.h | 1 + indra/newview/llpanelpeople.cpp | 8 ------- indra/newview/llpanelpeople.h | 1 - indra/newview/llviewermenu.cpp | 19 +++++++++++++++ indra/newview/llviewermenu.h | 4 ++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 7 files changed, 50 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 7f8e3afe89..39aa82dc7a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -31,12 +31,13 @@ #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker -//#include "llcommandhandler.h" +#include "llcommandhandler.h" #include "llhttpclient.h" +#include "llurlaction.h" /////////////////////////////////////////////////////////////////////////////// // -/* + class LLFacebookConnectHandler : public LLCommandHandler { public: @@ -59,7 +60,6 @@ public: } }; LLFacebookConnectHandler gFacebookConnectHandler; -*/ /////////////////////////////////////////////////////////////////////////////// // @@ -83,6 +83,15 @@ public: LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; } } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } + }; /////////////////////////////////////////////////////////////////////////////// @@ -163,6 +172,14 @@ public: LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; } } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } }; @@ -175,6 +192,11 @@ LLFacebookConnect::LLFacebookConnect() { } +void LLFacebookConnect::openFacebookWeb(std::string url) +{ + LLUrlAction::openURLExternal(url); +} + std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) { //static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 691aaa9131..8036c9ce3e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -55,6 +55,7 @@ public: bool getConnected() { return mConnectedToFbc; } S32 generation() { return mGeneration; } + void openFacebookWeb(std::string url); private: friend class LLSingleton; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 542597f98b..ba7015faf5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -75,7 +75,6 @@ #include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" -#include "llurlaction.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -1645,13 +1644,6 @@ bool LLPanelPeople::isAccordionCollapsedByUser(const std::string& name) return isAccordionCollapsedByUser(getChild(name)); } -/* -void LLPanelPeople::openFacebookWeb(std::string url) -{ - LLUrlAction::openURLExternal(url); -} -*/ - void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 6b5514deaf..be780bec5e 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,7 +62,6 @@ public: static void idle(void * user_data); -// void openFacebookWeb(std::string url); void addTestParticipant(); void addParticipantToModel(LLPersonTabModel * session_model, const LLUUID& agent_id, const std::string& name); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index beca08203f..bb9ad8c606 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -52,6 +52,7 @@ #include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" +#include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -5970,6 +5971,21 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } +void handle_facebook_connect() +{ + if (LLFacebookConnect::instance().getConnected()) + { + LLFacebookConnect::instance().disconnectFromFacebook(); + } + else + { + LLFacebookConnect::instance().getConnectionToFacebook(); + } +} + +//bool is_facebook_connected(); + + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8719,4 +8735,7 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + + // Facebook Connect + commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 143420e227..b916d95b7a 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -135,6 +135,10 @@ bool enable_pay_object(); bool enable_buy_object(); bool handle_go_to(); +// Facebook Connect +void handle_facebook_connect(); +//bool is_facebook_connected(); + // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 9ce360415c..b34816fb14 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -19,7 +19,7 @@ label="Connect to Facebook..." name="ConnectToFacebook"> + function="Facebook.Connect" /> Date: Tue, 14 May 2013 13:58:41 -0700 Subject: ACME-324 Populate list with FB only friends: Fixed a bug that was causing FB+SL friends to appear within the 'Invite people you know to Second Life' tab. --- indra/newview/llpanelpeople.cpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index ba7015faf5..0847878fb4 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -943,27 +943,31 @@ void LLPanelPeople::updateFacebookList() { std::string name = i->second["name"].asString(); LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); - + bool second_life_buddy = agent_id.notNull() ? avatar_tracker.isBuddy(agent_id) : false; + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); - //FB+SL but not SL friend - if (agent_id.notNull() && !avatar_tracker.isBuddy(agent_id)) - { - tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; - } - //FB only friend - else - { - tab_type = LLPersonTabModel::FB_ONLY_FRIEND; - } - - //Add to person tab model - LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); - if (person_tab_model) - { - addParticipantToModel(person_tab_model, agent_id, name); - } + if(!second_life_buddy) + { + //FB+SL but not SL friend + if (agent_id.notNull()) + { + tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND; + } + //FB only friend + else + { + tab_type = LLPersonTabModel::FB_ONLY_FRIEND; + } + + //Add to person tab model + LLPersonTabModel * person_tab_model = dynamic_cast(mPersonFolderView->getPersonTabModelByIndex(tab_type)); + if (person_tab_model) + { + addParticipantToModel(person_tab_model, agent_id, name); + } + } } } } -- cgit v1.2.3 From 0cb2b30bfb239f05e1780cae5e3a7328a1474416 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 17 May 2013 11:45:06 -0700 Subject: Simple imposter AV rendering cleanup --- indra/newview/app_settings/settings.xml | 28 ++++------- indra/newview/llvoavatar.cpp | 55 +++------------------- indra/newview/llvoavatar.h | 1 - indra/newview/skins/default/xui/en/menu_viewer.xml | 9 ---- .../newview/skins/default/xui/en/notifications.xml | 39 --------------- 5 files changed, 15 insertions(+), 117 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 676ba57726..7cb45559fa 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9480,7 +9480,7 @@ RenderAutoMuteByteLimit Comment - Maximum bytes of attachments before an avatar is automatically visually muted (0 for no limit). + Maximum bytes of attachments before an avatar is rendered as a simple imposter (0 for no limit). Persist 1 Type @@ -9491,7 +9491,7 @@ RenderAutoMuteRenderCostLimit Comment - Maximum render weight before an avatar is automatically visually muted (0 to not use this limit). + Maximum render weight before an avatar is rendered as a simple imposter (0 to not use this limit). Persist 1 Type @@ -9502,7 +9502,7 @@ RenderAutoMuteSurfaceAreaLimit Comment - Maximum surface area of attachments before an avatar is automatically visually muted (0 to not use this limit). + Maximum surface area of attachments before an avatar is rendered as a simple imposter (0 to not use this limit). Persist 1 Type @@ -9510,16 +9510,16 @@ Value 0 - RenderAutoMuteEnabled + RenderAutoMuteThreshold Comment - Apply visual muting to high cost, non-friends, not in IM, or somewhat distant avatars + Threshold on the Avatar Detail slider where simple imposter mode is enabled. (less than 0 is always on, greather than 1 always off) Persist 1 Type - Boolean + F32 Value - 0 + 0.25 RenderAutoMuteLogging @@ -9531,19 +9531,7 @@ Boolean Value 0 - - RenderAutoMuteVisibilityRank - - Comment - Number of avatars to show normally for visual muting mode. - Persist - 1 - Type - U32 - Value - 0 - - + RenderAutoHideSurfaceAreaLimit Comment diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3c25339037..4de2f4684e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2999,11 +2999,10 @@ bool LLVOAvatar::isVisuallyMuted() if (!isSelf()) { - static LLCachedControl render_mute_enabled(gSavedSettings, "RenderAutoMuteEnabled"); + static LLCachedControl render_mute_threshold(gSavedSettings, "RenderAutoMuteThreshold"); static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderCostLimit"); - static LLCachedControl visibility_rank(gSavedSettings, "RenderAutoMuteVisibilityRank"); if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) { // Always want to see this AV as an imposter @@ -3013,7 +3012,7 @@ bool LLVOAvatar::isVisuallyMuted() { // Never show as imposter muted = false; } - else if (render_mute_enabled) + else if (LLVOAvatar::sLODFactor <= render_mute_threshold) { F64 now = LLFrameTimer::getTotalSeconds(); @@ -3034,13 +3033,14 @@ bool LLVOAvatar::isVisuallyMuted() // Could be part of the grand || collection above, but yanked out to make the logic visible if (!muted) { - if (visibility_rank > 0) + if (sMaxVisible > 0) { // They are above the visibilty rank - mute them - muted = (mVisibilityRank > visibility_rank); + muted = (mVisibilityRank > sMaxVisible); } + /* Not used - always draw friends or those in IMs. Works nicely, needs UI? if (muted || // Don't mute friends or IMs - visibility_rank == 0) + sMaxVisible == 0) { muted = !(LLAvatarTracker::instance().isBuddy(getID())); if (muted) @@ -3049,6 +3049,7 @@ bool LLVOAvatar::isVisuallyMuted() muted = !gIMMgr->hasSession(session_id); } } + */ } // Save visual mute state and set interval for updating @@ -7879,8 +7880,6 @@ void LLVOAvatar::idleUpdateRenderCost() calculateUpdateRenderCost(); // Update mVisualComplexity if needed - doRenderCostNagging(max_render_cost); // Remind the user their AV is too complex - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) { std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); @@ -7892,46 +7891,6 @@ void LLVOAvatar::idleUpdateRenderCost() } -// Remind the user about their expensive avatar -void LLVOAvatar::doRenderCostNagging(U32 max_render_cost) -{ - if (isSelf()) - { - static S32 sOldComplexity = 0; - static F64 sLastRenderCostNagTime = 0.0; - - const F64 RENDER_NAG_INTERVAL = 60.0; - - F64 now = LLFrameTimer::getTotalSeconds(); - if (sLastRenderCostNagTime > 0.0 && - (now - sLastRenderCostNagTime) > RENDER_NAG_INTERVAL && - sOldComplexity != mVisualComplexity) - { - sOldComplexity = mVisualComplexity; - - if (max_render_cost > 0) - { //pop up notification that you have exceeded a render cost limit - if (mVisualComplexity > max_render_cost+max_render_cost/2) - { - LLNotificationsUtil::add("ExceededHighDetailRenderCost"); - sLastRenderCostNagTime = now; - } - else if (mVisualComplexity > max_render_cost) - { - LLNotificationsUtil::add("ExceededMidDetailRenderCost"); - sLastRenderCostNagTime = now; - } - else if (mVisualComplexity > max_render_cost/2) - { - LLNotificationsUtil::add("ExceededLowDetailRenderCost"); - sLastRenderCostNagTime = now; - } - } - } - } -} - - // Calculations for mVisualComplexity value void LLVOAvatar::calculateUpdateRenderCost() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8862056066..afe1d56059 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -250,7 +250,6 @@ public: static void invalidateNameTags(); void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); - void doRenderCostNagging(U32 max_render_cost); void calculateUpdateRenderCost(); void updateVisualComplexity() { mVisualComplexityStale = TRUE; } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index f66272aa2e..9c8313f46c 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -547,15 +547,6 @@ - - - - - - Your avatar has become too complex to be rendered by even high performance computers. Almost all Residents will see a low detail stand in instead of your actual avatar. - - - - - - Your avatar has become too complex to be rendered by most computers. Many Residents will see a low detail stand in instead of your actual avatar. - - - - - - Your avatar has become too complex to be rendered by some computers. Some Residents will see a low detail stand in instead of your actual avatar. - - - - Date: Fri, 17 May 2013 13:38:52 -0700 Subject: ACME-275 : Fixed! Use Name and Suffix for person name for filtering and search --- indra/newview/llpersonmodelcommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index e48eddf05a..73239dcb8d 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -71,7 +71,7 @@ LLPersonModelCommon::~LLPersonModelCommon() BOOL LLPersonModelCommon::renameItem(const std::string& new_name) { mName = new_name; - mSearchableName = new_name; + mSearchableName = new_name + " " + mLabelSuffix; LLStringUtil::toUpper(mSearchableName); return TRUE; } -- cgit v1.2.3 From abdbf45aaa05f201afd9e2f6c6be87150be2c890 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 20 May 2013 11:18:12 -0700 Subject: MAINT-2616 : Updated my Intel driver and now have orange in buttons and Inventory pull down bar causing blinks to screen. Pulled in FS code, Reviewed by Kelly --- .../shaders/class1/interface/solidcolorIntelV.glsl | 44 ++++++++++++++++++++++ indra/newview/llselectmgr.cpp | 10 ++++- indra/newview/llviewershadermgr.cpp | 19 ++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl new file mode 100644 index 0000000000..dcf38c27ce --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl @@ -0,0 +1,44 @@ +/** + * @file solidcolorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +uniform vec4 color; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +// vertex_color = diffuse_color; + vertex_color = color; + vary_texcoord0 = texcoord0; +} + diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 4681efd3e5..02ace86b95 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6051,7 +6051,15 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (shader) { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes - gSolidColorProgram.bind(); + if(gGLManager.mIsIntel) + { + gSolidColorProgramIntel.bind(); + gGL.diffuseColor4fv(color.mV); + } + else + { + gSolidColorProgram.bind(); + } } gGL.matrixMode(LLRender::MM_MODELVIEW); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7d7889845d..ef5ccb5120 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -640,6 +640,7 @@ void LLViewerShaderMgr::unloadShaders() gTwoTextureAddProgram.unload(); gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); + gSolidColorProgramIntel.unload(); gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); @@ -2703,6 +2704,24 @@ BOOL LLViewerShaderMgr::loadShadersInterface() } } + // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one + // for those cards. Passing color as a uniform and not a shader attribute + if (success) + { + gSolidColorProgramIntel.mName = "Solid Color Shader for Intel"; + gSolidColorProgramIntel.mShaderFiles.clear(); + gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorIntelV.glsl", GL_VERTEX_SHADER_ARB)); + gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); // The standard fragment shader is just fine. So keep it. + gSolidColorProgramIntel.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gSolidColorProgramIntel.createShader(NULL, NULL); + if (success) + { + gSolidColorProgramIntel.bind(); + gSolidColorProgramIntel.uniform1i(sTex0, 0); + gSolidColorProgramIntel.unbind(); + } + } + if (success) { gOcclusionProgram.mName = "Occlusion Shader"; -- cgit v1.2.3 From 53ed2e4ac67088dce27f4c391d3e980e2d63154b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 20 May 2013 19:32:55 -0700 Subject: ACME-381 : Implement experimental checkin feature (used to test publish_actions permissions workflow) --- indra/newview/llfacebookconnect.cpp | 43 ++++++++++++++++++++++ indra/newview/llfacebookconnect.h | 1 + indra/newview/llpanelpeople.cpp | 13 +++++++ indra/newview/llpanelpeople.h | 1 + .../newview/skins/default/xui/en/menu_gear_fbc.xml | 7 ++++ 5 files changed, 65 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 39aa82dc7a..eb70cf4d10 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -94,6 +94,35 @@ public: }; +/////////////////////////////////////////////////////////////////////////////// +// +class LLFacebookPostResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLFacebookPostResponder); +public: + + virtual void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; + } + else + { + LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL; + } + } + + void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 302) + { + LLFacebookConnect::instance().openFacebookWeb(content["location"]); + } + } + +}; + /////////////////////////////////////////////////////////////////////////////// // class LLFacebookDisconnectResponder : public LLHTTPClient::Responder @@ -247,6 +276,20 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } +void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url) +{ + // Note: We need to improve the API support to provide all the relevant data if possible + // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html + LLSD body; + if (!message.empty()) + body["message"] = message; + if (!url.empty()) + body["link"] = url; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 8036c9ce3e..f151dd95c1 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,6 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); + void postCheckinMessage(const std::string& message, const std::string& url); void clearContent(); void storeContent(const LLSD& content); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 0847878fb4..e0b1c3abba 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -76,6 +76,9 @@ #include "llspeakers.h" #include "llfloaterwebcontent.h" +#include "llagentui.h" +#include "llslurl.h" + #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 #define FBCTEST_LIST_UPDATE_INTERVAL 0.25 @@ -568,6 +571,7 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); + mCommitCallbackRegistrar.add("People.testFBCCheckin", boost::bind(&LLPanelPeople::onFacebookCheckinClicked, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this)); @@ -1716,6 +1720,15 @@ void LLPanelPeople::onLoginFbcButtonClicked() } } +void LLPanelPeople::onFacebookCheckinClicked() +{ + // Get the local SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + + LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString()); +} + void LLPanelPeople::onFacebookAppRequestClicked() { } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index be780bec5e..f617517392 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -123,6 +123,7 @@ private: void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); void onFacebookTestAddClicked(); + void onFacebookCheckinClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml index d73cee344b..2c341b6ecc 100644 --- a/indra/newview/skins/default/xui/en/menu_gear_fbc.xml +++ b/indra/newview/skins/default/xui/en/menu_gear_fbc.xml @@ -41,4 +41,11 @@ + + + \ No newline at end of file -- cgit v1.2.3 From 8a16b55bf8a87d29c116d9061d9701e8b844cc7b Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 21 May 2013 09:11:50 -0700 Subject: MAINT-2711 : Add missing LSL constants for llGetObjectDetails() to the viewer. Reviewed by Kelly --- indra/newview/app_settings/keywords.ini | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 02adbc7af4..766c9a4604 100755 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -177,6 +177,25 @@ OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key +OBJECT_RUNNING_SCRIPT_COUNT Used with llGetObjectDetails to get the number of running scripts in an object +OBJECT_TOTAL_SCRIPT_COUNT Used with llGetObjectDetails to get the total number of scripts in an object +OBJECT_SCRIPT_MEMORY Used with llGetObjectDetails to get the total amount of script memory in an object +OBJECT_SCRIPT_TIME Used with llGetObjectDetails to get the average script time used by an object +OBJECT_PRIM_EQUIVALENCE Used with llGetObjectDetails to get the prim equivalence of an object +OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost of an object +OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost of an object +OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost of an object +OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get the pathfinding time (seconds) for an object +OBJECT_ROOT Used with llGetObjectDetails to get root ID of an object +OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get attachent point where an object is attached +OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get the pathfinding setting of an object +OBJECT_PHYSICS Used with llGetObjectDetails to determine if the object is physical or not +OBJECT_PHANTOM Used with llGetObjectDetails to determine if the object is phantom or not +OBJECT_TEMP_ON_REZ Used with llGetObjectDetails to determine if the object is temporary or not +OBJECT_RENDER_WEIGHT Used with llGetObjectDetails to return an avatar's rendering weight +OBJECT_ATTACHMENT_GEOMETRY_BYTES Used with llGetObjectDetails to return an avatar's attachment rendering geometry bytes +OBJECT_ATTACHMENT_SURFACE_AREA Used with llGetObjectDetails to return an avatar's attachment surface area + # some vehicle params VEHICLE_TYPE_NONE -- cgit v1.2.3 From e5bdb0f0e1b3c48173e36b54da0f25c7d535df49 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 21 May 2013 13:50:49 -0700 Subject: MAINT-2676 - Set home to here - screen_home.bmp not saved. Reviewed by Kelly. --- indra/newview/llviewermessage.cpp | 52 ++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9894ec7c07..d6ba803c46 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5938,19 +5938,42 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } +static void process_special_alert_messages(const std::string & message) +{ + // Do special handling for alert messages. This is a legacy hack, and any actual displayed + // text should be altered in the notifications.xml files. + if ( message == "You died and have been teleported to your home location") + { + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); + } + else if( message == "Home position set." ) + { + // save the home location image to disk + std::string snap_filename = gDirUtilp->getLindenUserDir(); + snap_filename += gDirUtilp->getDirDelimiter(); + snap_filename += SCREEN_HOME_FILENAME; + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + } +} + + + void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) { // make sure the cursor is back to the usual default since the // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; msgsystem->getBOOL("AlertData", "Modal", modal); - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -5965,12 +5988,15 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -6000,20 +6026,6 @@ bool handle_special_alerts(const std::string &pAlertName) void process_alert_core(const std::string& message, BOOL modal) { - // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml - if ( message == "You died and have been teleported to your home location") - { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); - } - else if( message == "Home position set." ) - { - // save the home location image to disk - std::string snap_filename = gDirUtilp->getLindenUserDir(); - snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); - } - const std::string ALERT_PREFIX("ALERT: "); const std::string NOTIFY_PREFIX("NOTIFY: "); if (message.find(ALERT_PREFIX) == 0) -- cgit v1.2.3 From 473474b94969799d2835191072c5bca1b7d431d8 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 22 May 2013 16:51:42 -0700 Subject: Revert changes for MAINT-2616 due to licensing issues, need a full patch submitted to be acceptable --- .../shaders/class1/interface/solidcolorIntelV.glsl | 44 ---------------------- indra/newview/llselectmgr.cpp | 10 +---- indra/newview/llviewershadermgr.cpp | 19 ---------- 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl deleted file mode 100644 index dcf38c27ce..0000000000 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorIntelV.glsl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file solidcolorV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -uniform vec4 color; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void main() -{ - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); -// vertex_color = diffuse_color; - vertex_color = color; - vary_texcoord0 = texcoord0; -} - diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 02ace86b95..4681efd3e5 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6051,15 +6051,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (shader) { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes - if(gGLManager.mIsIntel) - { - gSolidColorProgramIntel.bind(); - gGL.diffuseColor4fv(color.mV); - } - else - { - gSolidColorProgram.bind(); - } + gSolidColorProgram.bind(); } gGL.matrixMode(LLRender::MM_MODELVIEW); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ef5ccb5120..7d7889845d 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -640,7 +640,6 @@ void LLViewerShaderMgr::unloadShaders() gTwoTextureAddProgram.unload(); gOneTextureNoColorProgram.unload(); gSolidColorProgram.unload(); - gSolidColorProgramIntel.unload(); gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); @@ -2704,24 +2703,6 @@ BOOL LLViewerShaderMgr::loadShadersInterface() } } - // When running with a intel gfx card, do not use the solidcolor?.glsl files. Instead use a custom one - // for those cards. Passing color as a uniform and not a shader attribute - if (success) - { - gSolidColorProgramIntel.mName = "Solid Color Shader for Intel"; - gSolidColorProgramIntel.mShaderFiles.clear(); - gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorIntelV.glsl", GL_VERTEX_SHADER_ARB)); - gSolidColorProgramIntel.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); // The standard fragment shader is just fine. So keep it. - gSolidColorProgramIntel.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; - success = gSolidColorProgramIntel.createShader(NULL, NULL); - if (success) - { - gSolidColorProgramIntel.bind(); - gSolidColorProgramIntel.uniform1i(sTex0, 0); - gSolidColorProgramIntel.unbind(); - } - } - if (success) { gOcclusionProgram.mName = "Occlusion Shader"; -- cgit v1.2.3 From 4cf16ffdfbb166fbb3fcf1d7950ca1a240c94ca1 Mon Sep 17 00:00:00 2001 From: Cinders Date: Wed, 22 May 2013 21:43:32 -0600 Subject: STORM-1888: Hide Spellchecker Settings floater when Preferences floater is closed Bonus: Correct the immediately preceding auto replace comment --- indra/newview/llfloaterpreference.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index bbf88060c1..fde98aae9a 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -617,9 +617,12 @@ void LLFloaterPreference::cancel() // hide translation settings floater LLFloaterReg::hideInstance("prefs_translation"); - // hide translation settings floater + // hide autoreplace settings floater LLFloaterReg::hideInstance("prefs_autoreplace"); + // hide spellchecker settings folder + LLFloaterReg::hideInstance("prefs_spellchecker"); + // cancel hardware menu LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); if (hardware_settings) -- cgit v1.2.3 From ff291257886badc495d04d59f78cfc9858964702 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 29 May 2013 01:31:48 +0100 Subject: updated postCheckinMessage to use new parameters and new route path --- indra/newview/llfacebookconnect.cpp | 20 +++++++++++++------- indra/newview/llfacebookconnect.h | 2 +- indra/newview/llpanelpeople.cpp | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index eb70cf4d10..86da748f0f 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -276,18 +276,24 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } -void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& url) +void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture) { - // Note: We need to improve the API support to provide all the relevant data if possible - // Full set described : http://facebook-python-library.docs-library.appspot.com/facebook-python/library-manual.html - LLSD body; + LLSD body; if (!message.empty()) body["message"] = message; - if (!url.empty()) - body["link"] = url; + if (!link.empty()) + body["link"] = link; + if (!name.empty()) + body["name"] = name; + if (!caption.empty()) + body["caption"] = caption; + if (!description.empty()) + body["description"] = description; + if (!picture.empty()) + body["picture"] = picture; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share"), body, new LLFacebookPostResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); } void LLFacebookConnect::storeContent(const LLSD& content) diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index f151dd95c1..8886630222 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,7 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); - void postCheckinMessage(const std::string& message, const std::string& url); + void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void clearContent(); void storeContent(const LLSD& content); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e0b1c3abba..69b6bdf737 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1726,7 +1726,7 @@ void LLPanelPeople::onFacebookCheckinClicked() LLSLURL slurl; LLAgentUI::buildSLURL(slurl); - LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString()); + LLFacebookConnect::instance().postCheckinMessage("Here I am in SL!", slurl.getSLURLString(), slurl.getRegion(), "", "", ""); } void LLPanelPeople::onFacebookAppRequestClicked() -- cgit v1.2.3 From e72a9ebf638db2197920115be57493a40d54d2b6 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 29 May 2013 17:04:42 -0700 Subject: ACME-433 Add a new tab to the bottom of the friends list --- indra/newview/skins/default/xui/en/panel_people.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 9bab2ccb0b..bc6b82e328 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -365,6 +365,23 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M top="0" width="307" /> + + + Date: Thu, 30 May 2013 17:03:54 -0700 Subject: ACME-434 When tab becomes visible, pull suggested friends data. --- indra/newview/llpanelpeople.cpp | 34 ++++++++++++++++++++++++++++++++++ indra/newview/llpanelpeople.h | 2 ++ 2 files changed, 36 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 69b6bdf737..785de6e9c9 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -652,8 +652,11 @@ BOOL LLPanelPeople::postBuild() // updater is active only if panel is visible to user. friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this)); + friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); + mOnlineFriendList = friends_tab->getChild("avatars_online"); mAllFriendList = friends_tab->getChild("avatars_all"); + mSuggestedFriends = friends_tab->getChild("suggested_friends"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mOnlineFriendList->showPermissions("FriendsListShowPermissions"); @@ -895,6 +898,35 @@ void LLPanelPeople::updateFriendList() //update trash and other buttons according to a selected item updateButtons(); showFriendsAccordionsIfNeeded(); + + updateSuggestedFriendList(); +} + +void LLPanelPeople::updateSuggestedFriendList() +{ + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); + + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; + + if(!second_life_buddy) + { + //FB+SL but not SL friend + if (agent_id.notNull()) + { + suggested_friends.push_back(agent_id); + } + } + } + + mSuggestedFriends->setDirty(true, true); } void LLPanelPeople::updateNearbyList() @@ -973,6 +1005,8 @@ void LLPanelPeople::updateFacebookList() } } } + + updateSuggestedFriendList(); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f617517392..9cfa6b7cd2 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -85,6 +85,7 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); + void updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); void updateFacebookList(); @@ -148,6 +149,7 @@ private: LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; + LLAvatarList* mSuggestedFriends; LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; -- cgit v1.2.3 From 7e2a20308ec3a1d3306a5260461b4c1b5a5314a5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 14:55:38 -0700 Subject: ACME-435 Only show the 'People you may want to friend' tab when it is populated. --- indra/newview/llpanelpeople.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 785de6e9c9..22fbbf0c0e 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -830,7 +830,7 @@ void LLPanelPeople::updateFriendListHelpText() // Seems sometimes all_friends can be empty because of issue with Inventory loading (clear cache, slow connection...) // So, lets check all lists to avoid overlapping the text with online list. See EXT-6448. - bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches(); + bool any_friend_exists = mAllFriendList->filterHasMatches() || mOnlineFriendList->filterHasMatches() || mSuggestedFriends->filterHasMatches(); no_friends_text->setVisible(!any_friend_exists); if (no_friends_text->getVisible()) { @@ -897,9 +897,8 @@ void LLPanelPeople::updateFriendList() mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches()); //update trash and other buttons according to a selected item updateButtons(); - showFriendsAccordionsIfNeeded(); - updateSuggestedFriendList(); + showFriendsAccordionsIfNeeded(); } void LLPanelPeople::updateSuggestedFriendList() @@ -926,7 +925,9 @@ void LLPanelPeople::updateSuggestedFriendList() } } - mSuggestedFriends->setDirty(true, true); + //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); + showFriendsAccordionsIfNeeded(); } void LLPanelPeople::updateNearbyList() @@ -1007,6 +1008,7 @@ void LLPanelPeople::updateFacebookList() } updateSuggestedFriendList(); + showFriendsAccordionsIfNeeded(); } } @@ -1230,9 +1232,11 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) mOnlineFriendList->setNameFilter(filter); mAllFriendList->setNameFilter(filter); + mSuggestedFriends->setNameFilter(filter); setAccordionCollapsedByUser("tab_online", false); setAccordionCollapsedByUser("tab_all", false); + setAccordionCollapsedByUser("tab_suggested_friends", false); showFriendsAccordionsIfNeeded(); // restore accordion tabs state _after_ all manipulations @@ -1623,6 +1627,7 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded() // Expand and show accordions if needed, else - hide them showAccordion("tab_online", mOnlineFriendList->filterHasMatches()); showAccordion("tab_all", mAllFriendList->filterHasMatches()); + showAccordion("tab_suggested_friends", mSuggestedFriends->filterHasMatches()); // Rearrange accordions LLAccordionCtrl* accordion = getChild("friends_accordion"); -- cgit v1.2.3 From 9497a70eb2b3d47d1bfd83ff34bb60d8f490644d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 17:53:36 -0700 Subject: ACME-436 Update the list of Suggested Friends when new data arrives --- indra/newview/skins/default/xui/en/panel_people.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index bc6b82e328..c21d2abdd7 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -371,6 +371,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="tab_suggested_friends" title="People you may want to friend"> Date: Sat, 1 Jun 2013 01:55:40 +0100 Subject: added LLFacebookConnect::sharePhoto() for ACME-467 --- indra/newview/llfacebookconnect.cpp | 11 ++++++++++- indra/newview/llfacebookconnect.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 86da748f0f..5013a5cb40 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -211,7 +211,6 @@ public: } }; - /////////////////////////////////////////////////////////////////////////////// // LLFacebookConnect::LLFacebookConnect() @@ -296,6 +295,16 @@ void LLFacebookConnect::postCheckinMessage(const std::string& message, const std LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); } +void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) +{ + LLSD body; + body["image"] = image_url; + body["caption"] = caption; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 8886630222..faa60b0f34 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -47,6 +47,7 @@ public: void loadFacebookFriends(); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); + void sharePhoto(const std::string& image_url, const std::string& caption); void clearContent(); void storeContent(const LLSD& content); -- cgit v1.2.3 From 0c0f4edb0026b1695655512ebed3a5508919a9b7 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 31 May 2013 18:13:01 -0700 Subject: ACME-484 Add a right click menu to the 'Suggested Friends' tab --- indra/newview/llpanelpeople.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22fbbf0c0e..2a14978a95 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -689,6 +689,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); //===Temporary ======================================================================== -- cgit v1.2.3 From e17b9de293084da0de0ce12290c9ae1939184337 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 31 May 2013 19:07:09 -0700 Subject: ACME-453, ACME-455, ACME-456, ACME-465 : Duplicate and tweak the Snapshot Profile UI to create the Snapshot Facebook UI --- indra/newview/CMakeLists.txt | 1 + indra/newview/llpanelsnapshotfacebook.cpp | 101 +++++++++++ indra/newview/llpanelsnapshotoptions.cpp | 7 + indra/newview/skins/default/textures/textures.xml | 1 + .../default/textures/toolbar_icons/facebook.png | Bin 0 -> 1180 bytes .../skins/default/xui/en/floater_snapshot.xml | 24 ++- .../default/xui/en/panel_snapshot_facebook.xml | 199 +++++++++++++++++++++ .../default/xui/en/panel_snapshot_options.xml | 23 ++- 8 files changed, 351 insertions(+), 5 deletions(-) create mode 100755 indra/newview/llpanelsnapshotfacebook.cpp create mode 100755 indra/newview/skins/default/textures/toolbar_icons/facebook.png create mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 477600ca01..f01c2f714d 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -434,6 +434,7 @@ set(viewer_SOURCE_FILES llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelsnapshot.cpp + llpanelsnapshotfacebook.cpp llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp new file mode 100755 index 0000000000..50c5b62fe7 --- /dev/null +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -0,0 +1,101 @@ +/** + * @file llpanelsnapshotfacebook.cpp + * @brief Posts a snapshot to the resident Facebook account. + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +// libs +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "llpanel.h" +#include "llspinctrl.h" + +// newview +#include "llfloatersnapshot.h" +#include "llpanelsnapshot.h" +#include "llsidetraypanelcontainer.h" +#include "llwebprofile.h" + +/** + * Posts a snapshot to the resident Facebook account. + */ +class LLPanelSnapshotFacebook +: public LLPanelSnapshot +{ + LOG_CLASS(LLPanelSnapshotFacebook); + +public: + LLPanelSnapshotFacebook(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + /*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"; } + /*virtual*/ std::string getImageSizeComboName() const { return "facebook_size_combo"; } + /*virtual*/ std::string getImageSizePanelName() const { return "facebook_image_size_lp"; } + /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } + /*virtual*/ void updateControls(const LLSD& info); + + void onSend(); +}; + +static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); + +LLPanelSnapshotFacebook::LLPanelSnapshotFacebook() +{ + mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLPanelSnapshotFacebook::onSend, this)); + mCommitCallbackRegistrar.add("PostToFacebook.Cancel", boost::bind(&LLPanelSnapshotFacebook::cancel, this)); +} + +// virtual +BOOL LLPanelSnapshotFacebook::postBuild() +{ + return LLPanelSnapshot::postBuild(); +} + +// virtual +void LLPanelSnapshotFacebook::onOpen(const LLSD& key) +{ + LLPanelSnapshot::onOpen(key); +} + +// virtual +void LLPanelSnapshotFacebook::updateControls(const LLSD& info) +{ + const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; + getChild("post_btn")->setEnabled(have_snapshot); +} + +void LLPanelSnapshotFacebook::onSend() +{ + std::string caption = getChild("caption")->getValue().asString(); + bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLFloaterSnapshot::postSave(); +} diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 554fabe5b3..14953f3cf9 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -51,6 +51,7 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); + void onSaveToFacebook(); void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); @@ -60,6 +61,7 @@ static LLRegisterPanelClassWrapper panel_class("llpanels LLPanelSnapshotOptions::LLPanelSnapshotOptions() { + mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook", boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); @@ -99,6 +101,11 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) LLFloaterSnapshot::postPanelSwitch(); } +void LLPanelSnapshotOptions::onSaveToFacebook() +{ + openPanel("panel_snapshot_facebook"); +} + void LLPanelSnapshotOptions::onSaveToProfile() { openPanel("panel_snapshot_profile"); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 18146943a5..a0b46bab0b 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -567,6 +567,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png new file mode 100755 index 0000000000..32fe2bf8ac Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 49d64767cc..e8e7fb77c1 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -21,7 +21,11 @@ Sending Email + name="facebook_progress_str"> + Posting to Facebook + + Posting + name="facebook_succeeded_str"> + Image uploaded + + Image uploaded + name="facebook_failed_str"> + Failed to upload image to your Facebook timeline. + + Failed to upload image to your Profile Feed. + + + + + Post to my Facebook timeline + + + + + + + + + + + + + + + + + + Caption: + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index d2f29ade44..8cf5bfb426 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -5,6 +5,25 @@ layout="topleft" name="panel_snapshot_options" width="490"> + -- cgit v1.2.3 From 8420e8d5db1b9987f57fa542d81e450f54aec16f Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 3 Jun 2013 15:53:34 -0700 Subject: Fix build --- indra/newview/llmeshrepository.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b30576171e..83b7cae347 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1237,7 +1237,6 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat } mPendingLOD.erase(iter); } - } } return true; -- cgit v1.2.3 From 6bf2dad1cc8df2769a0833786bc16eea96649d6d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 4 Jun 2013 14:05:13 -0700 Subject: ACME-484: Right-click menu only has 'Add Friend' and 'View Profile' options. Also multi-select is disabled. --- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelpeoplemenus.cpp | 33 ++++++++++++++++++++++ indra/newview/llpanelpeoplemenus.h | 13 +++++++++ .../newview/skins/default/xui/en/panel_people.xml | 1 - 4 files changed, 47 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2a14978a95..5bc645bcfd 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -689,7 +689,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); - mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); //===Temporary ======================================================================== diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 49f7361c4a..313056f06a 100755 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -47,6 +47,7 @@ namespace LLPanelPeopleMenus PeopleContextMenu gPeopleContextMenu; NearbyPeopleContextMenu gNearbyPeopleContextMenu; +SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; //== PeopleContextMenu =============================================================== @@ -301,4 +302,36 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +//== SuggestedFriendsContextMenu =============================================================== + +LLContextMenu* SuggestedFriendsContextMenu::createMenu() +{ + // set up the callbacks for all of the avatar menu items + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + LLContextMenu* menu; + + // Set up for one person selected menu + const LLUUID& id = mUUIDs.front(); + registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id)); + registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id)); + + // create the context menu from the XUI + menu = createFromFile("menu_people_nearby.xml"); + buildContextMenu(*menu, 0x0); + + return menu; +} + +void SuggestedFriendsContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) +{ + menuentry_vec_t items; + menuentry_vec_t disabled_items; + + items.push_back(std::string("view_profile")); + items.push_back(std::string("add_friend")); + + hide_context_entries(menu, items, disabled_items); +} + } // namespace LLPanelPeopleMenus diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 0a1dcef303..5367eca0d3 100755 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -58,8 +58,21 @@ protected: /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); }; +/** + * Menu used in the suggested friends list. + */ +class SuggestedFriendsContextMenu : public PeopleContextMenu +{ +public: + /*virtual*/ LLContextMenu * createMenu(); + +protected: + /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); +}; + extern PeopleContextMenu gPeopleContextMenu; extern NearbyPeopleContextMenu gNearbyPeopleContextMenu; +extern SuggestedFriendsContextMenu gSuggestedFriendsContextMenu; } // namespace LLPanelPeopleMenus diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c21d2abdd7..451095c7d8 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -377,7 +377,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M height="173" layout="topleft" left="0" - multi_select="true" name="suggested_friends" show_permissions_granted="true" top="0" -- cgit v1.2.3 From f3a72799b01ad2449ae24e86169b994c696c1b4a Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 5 Jun 2013 01:03:33 +0100 Subject: added call to sharePhoto() with placeholder image for ACME-467 --- indra/newview/llpanelsnapshotfacebook.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 50c5b62fe7..200c64f16b 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -38,6 +38,8 @@ #include "llsidetraypanelcontainer.h" #include "llwebprofile.h" +#include "llfacebookconnect.h" + /** * Posts a snapshot to the resident Facebook account. */ @@ -98,4 +100,7 @@ void LLPanelSnapshotFacebook::onSend() LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); LLFloaterSnapshot::postSave(); + + // test with a placeholder image, until we can figure out a way to grab the uploaded image url + LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } -- cgit v1.2.3 From abcb3e85628712da4d61fda6e68bb86a29e1f965 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 4 Jun 2013 18:39:41 -0700 Subject: ACME-471: Once connected to facebook, a user can use the 'Check in to Facebook' button under the 'Me' menu to make a check in post to Facebook --- indra/newview/llfacebookconnect.cpp | 18 +++++++++++++++++ indra/newview/llfacebookconnect.h | 1 + indra/newview/llviewermenu.cpp | 23 ++++++++++++++++++++++ indra/newview/llviewermenu.h | 4 +++- indra/newview/skins/default/xui/en/menu_viewer.xml | 6 ++++++ 5 files changed, 51 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 5013a5cb40..668ba04406 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -275,6 +275,24 @@ void LLFacebookConnect::loadFacebookFriends() LLSD(), timeout, follow_redirects); } +void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message) +{ + LLSD body; + if (!location.empty()) + body["location"] = location; + if (!name.empty()) + body["name"] = name; + if (!description.empty()) + body["description"] = description; + if (!image.empty()) + body["image"] = image; + if (!message.empty()) + body["message"] = message; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture) { LLSD body; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index faa60b0f34..2dba182267 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -46,6 +46,7 @@ public: void getConnectionToFacebook(); void loadFacebookFriends(); + void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void sharePhoto(const std::string& image_url, const std::string& caption); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bb9ad8c606..eb100a3f9b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -45,6 +45,7 @@ #include "llagent.h" #include "llagentaccess.h" #include "llagentcamera.h" +#include "llagentui.h" #include "llagentwearables.h" #include "llagentpilot.h" #include "llcompilequeue.h" @@ -5983,6 +5984,26 @@ void handle_facebook_connect() } } +void handle_facebook_checkin() +{ + + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + //Get the location name + LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); + std::string parcel_string = parcel->getAgentParcelName(); + + //Get the location description + LLVector3 agent_pos = gAgent.getPositionAgent(); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + + LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); +} + //bool is_facebook_connected(); @@ -8738,4 +8759,6 @@ void initialize_menus() // Facebook Connect commit.add("Facebook.Connect", boost::bind(&handle_facebook_connect)); + // Facebook Checkin + commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index b916d95b7a..9c3f13f843 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -137,7 +137,9 @@ bool handle_go_to(); // Facebook Connect void handle_facebook_connect(); -//bool is_facebook_connected(); + +//Facebook Checkin +void handle_facebook_checkin(); // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b34816fb14..5061842c7f 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -21,6 +21,12 @@ + + + Date: Wed, 5 Jun 2013 00:32:15 -0700 Subject: ACME-471: In last commit was not using the correct name and location. Now using the proper name and location. --- indra/newview/llviewermenu.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index eb100a3f9b..bd5a37876f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5992,16 +5992,40 @@ void handle_facebook_checkin() LLAgentUI::buildSLURL(slurl); std::string slurl_string = slurl.getSLURLString(); - //Get the location name + std::string region_name = gAgent.getRegion()->getName(); + + //Get the parcel name LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_string = parcel->getAgentParcelName(); + std::string parcel_title = parcel->getAgentParcelName(); + + //Create the location + LLVector3 agent_pos_region = gAgent.getPositionAgent(); + S32 pos_x = S32(agent_pos_region.mV[VX]); + S32 pos_y = S32(agent_pos_region.mV[VY]); + S32 pos_z = S32(agent_pos_region.mV[VZ]); + + // Round the numbers based on the velocity + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + + const F32 FLY_CUTOFF = 6.f; // meters/sec + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; // meters/sec + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } - //Get the location description - LLVector3 agent_pos = gAgent.getPositionAgent(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); + std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); - LLFacebookConnect::instance().postCheckin(slurl_string, parcel_string, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From ec52db8d0c4099dd5e3b476f7b44a4ebda7cb676 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 5 Jun 2013 17:32:10 -0400 Subject: STORM-1838 Slowly reappling changes to work with CHUI --- indra/newview/llavataractions.cpp | 1 + indra/newview/llconversationloglist.cpp | 1 + indra/newview/llconversationmodel.cpp | 1 + indra/newview/llfloaterimcontainer.cpp | 4 ++++ indra/newview/llpanelpeoplemenus.cpp | 13 ++++++++++++- indra/newview/llpanelpeoplemenus.h | 1 + indra/newview/skins/default/xui/en/menu_conversation.xml | 9 +++++++++ indra/newview/skins/default/xui/en/menu_people_nearby.xml | 9 +++++++++ 8 files changed, 38 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 45992b8c83..285e70c8ea 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,6 +443,7 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { +llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 5ab108b39f..cf9c9b3415 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -311,6 +311,7 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) } else if ("offer_teleport" == command_name) { +llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(selected_conversation_participant_id); } else if("add_friend" == command_name) diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..b0aaa21ec9 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -132,6 +132,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32 items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 5e0cd8ef78..65155041f0 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1007,6 +1007,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec { LLAvatarActions::offerTeleport(selectedIDS); } + else if ("request_teleport" == command) + { + LLAvatarActions::teleportRequest(selectedIDS.front()); + } else if ("voice_call" == command) { LLAvatarActions::startCall(userID); diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index a68772a35d..ddc92f439b 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -74,7 +74,7 @@ LLContextMenu* PeopleContextMenu::createMenu() registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id)); - registrar.add("Avatar.TeleportRequest", boost::bind(&LLAvatarActions::teleportRequest, id)); + registrar.add("Avatar.TeleportRequest", boost::bind(&PeopleContextMenu::requestTeleport, this)); registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id)); enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2)); @@ -126,6 +126,7 @@ void PeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); @@ -256,10 +257,19 @@ bool PeopleContextMenu::checkContextMenuItem(const LLSD& userdata) return false; } +void PeopleContextMenu::requestTeleport() +{ + // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), + // so we have to use a wrapper. +llwarns << "DBG " << llendl; + LLAvatarActions::teleportRequest(mUUIDs.front()); +} + void PeopleContextMenu::offerTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(), // so we have to use a wrapper. +llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(mUUIDs); } @@ -285,6 +295,7 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) items.push_back(std::string("view_profile")); items.push_back(std::string("im")); items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); items.push_back(std::string("voice_call")); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 0a1dcef303..abf5fa05e4 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -47,6 +47,7 @@ private: bool enableContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); void offerTeleport(); + void requestTeleport(); }; /** diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 5a13ef0a59..c2c15023c5 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -46,6 +46,15 @@ + + + + + + + + + + Date: Wed, 5 Jun 2013 14:45:11 -0700 Subject: ACME-471: Code cleanup, instead of duplicating code from LLAgentUI::buildLocationString, now calling LLAgentUI::buildLocationString with a flag to perform a similar operation. --- indra/newview/llagentui.cpp | 10 ++++++++++ indra/newview/llagentui.h | 1 + indra/newview/llviewermenu.cpp | 33 ++------------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index b9ec304b7e..125f911e0d 100755 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -130,6 +130,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), + pos_x, pos_y, pos_z); + break; } } else @@ -164,6 +169,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + parcel_name.c_str(), + pos_x, pos_y, pos_z); + break; } } str = buffer; diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index dda5dc1fd1..bb48dad14c 100755 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -35,6 +35,7 @@ public: enum ELocationFormat { LOCATION_FORMAT_NORMAL, // Parcel + LOCATION_FORMAT_NORMAL_COORDS, // Parcel (x, y, z) LOCATION_FORMAT_LANDMARK, // Parcel, Region LOCATION_FORMAT_NO_MATURITY, // Parcel, Region (x, y, z) LOCATION_FORMAT_NO_COORDS, // Parcel, Region - Maturity diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bd5a37876f..471db8d8fc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5993,37 +5993,8 @@ void handle_facebook_checkin() std::string slurl_string = slurl.getSLURLString(); std::string region_name = gAgent.getRegion()->getName(); - - //Get the parcel name - LLViewerParcelMgr * parcel = LLViewerParcelMgr::getInstance(); - std::string parcel_title = parcel->getAgentParcelName(); - - //Create the location - LLVector3 agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX]); - S32 pos_y = S32(agent_pos_region.mV[VY]); - S32 pos_z = S32(agent_pos_region.mV[VZ]); - - // Round the numbers based on the velocity - F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); - - const F32 FLY_CUTOFF = 6.f; // meters/sec - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; // meters/sec - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - - std::string description = llformat("%s (%d, %d, %d)", parcel_title.c_str(), pos_x, pos_y, pos_z); + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -- cgit v1.2.3 From 64f4246f17b8270870fae84eca26e18a567a2174 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 14:54:10 -0700 Subject: ACME-471: Code cleanup, just moving some code. --- indra/newview/llagentui.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 125f911e0d..3410a37890 100755 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -112,6 +112,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const case LOCATION_FORMAT_NORMAL: buffer = llformat("%s", region_name.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + region_name.c_str(), + pos_x, pos_y, pos_z); + break; case LOCATION_FORMAT_NO_COORDS: buffer = llformat("%s%s%s", region_name.c_str(), @@ -130,11 +135,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; - case LOCATION_FORMAT_NORMAL_COORDS: - buffer = llformat("%s (%d, %d, %d)", - region_name.c_str(), - pos_x, pos_y, pos_z); - break; } } else @@ -148,6 +148,11 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const case LOCATION_FORMAT_NORMAL: buffer = llformat("%s, %s", parcel_name.c_str(), region_name.c_str()); break; + case LOCATION_FORMAT_NORMAL_COORDS: + buffer = llformat("%s (%d, %d, %d)", + parcel_name.c_str(), + pos_x, pos_y, pos_z); + break; case LOCATION_FORMAT_NO_MATURITY: buffer = llformat("%s, %s (%d, %d, %d)", parcel_name.c_str(), @@ -169,11 +174,6 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); break; - case LOCATION_FORMAT_NORMAL_COORDS: - buffer = llformat("%s (%d, %d, %d)", - parcel_name.c_str(), - pos_x, pos_y, pos_z); - break; } } str = buffer; -- cgit v1.2.3 From faf99f2e1c88f281836c555d9fa6886d45f13751 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Jun 2013 15:43:31 -0700 Subject: ACME-485 : Temporary facebook.png icon for the snapshot panel --- .../skins/default/textures/toolbar_icons/facebook.png | Bin 1180 -> 2974 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 indra/newview/skins/default/textures/toolbar_icons/facebook.png (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png old mode 100755 new mode 100644 index 32fe2bf8ac..b960b834dc Binary files a/indra/newview/skins/default/textures/toolbar_icons/facebook.png and b/indra/newview/skins/default/textures/toolbar_icons/facebook.png differ -- cgit v1.2.3 From 4d162e1ec2cd716f40666056bb9e2710958e3360 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 5 Jun 2013 23:52:34 +0100 Subject: added callback to post photo with actual image url --- indra/newview/llpanelsnapshotfacebook.cpp | 13 +++++++-- indra/newview/llwebprofile.cpp | 48 ++++++++++++++++++++++++------- indra/newview/llwebprofile.h | 5 ++-- 3 files changed, 52 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 200c64f16b..954941274a 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,6 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); + void onImageUploaded(const std::string& image_url, const std::string& caption); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -98,9 +99,17 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location); + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url - LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); + //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); +} + +void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption) +{ + if (!image_url.empty()) + { + LLFacebookConnect::instance().sharePhoto(image_url, caption); + } } diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 641f338f2c..4bc4724753 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder LOG_CLASS(LLWebProfileResponders::ConfigResponder); public: - ConfigResponder(LLPointer imagep) - : mImagep(imagep) + ConfigResponder(LLPointer imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImagep(imagep), mImageCaption(caption), mImageCallback(cb) { } @@ -113,11 +113,13 @@ public: // Do the actual image upload using the configuration. LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl; - LLWebProfile::post(mImagep, config, upload_url); + LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback); } private: LLPointer mImagep; + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -127,6 +129,22 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient:: LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder); public: + PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImageCaption(caption), mImageCallback(cb) + { + } + + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) + { + if (status == 200) + { + std::string image_url = content.get("Location"); + llinfos << "Image uploaded to " << image_url << llendl; + if (!mImageCallback.empty() && !image_url.empty()) + mImageCallback(image_url, mImageCaption); + } + } + /*virtual*/ void completedRaw( U32 status, const std::string& reason, @@ -148,9 +166,10 @@ public: LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl; LLWebProfile::reportImageUploadStatus(true); } - + private: - LLPointer mImagep; + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; @@ -161,6 +180,11 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde LOG_CLASS(LLWebProfileResponders::PostImageResponder); public: + PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) + : mImageCaption(caption), mImageCallback(cb) + { + } + /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content) { // Viewer seems to fail to follow a 303 redirect on POST request @@ -172,7 +196,7 @@ public: headers["Cookie"] = LLWebProfile::getAuthCookie(); const std::string& redir_url = content["location"]; LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; - LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers); } else { @@ -188,6 +212,10 @@ public: const LLIOPipe::buffer_ptr_t& buffer) { } + +private: + std::string mImageCaption; + LLWebProfile::image_url_callback_t mImageCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -197,7 +225,7 @@ std::string LLWebProfile::sAuthCookie; LLWebProfile::status_callback_t LLWebProfile::mStatusCallback; // static -void LLWebProfile::uploadImage(LLPointer image, const std::string& caption, bool add_location) +void LLWebProfile::uploadImage(LLPointer image, const std::string& caption, bool add_location, LLWebProfile::image_url_callback_t cb) { // Get upload configuration data. std::string config_url(getProfileURL(LLStringUtil::null) + "snapshots/s3_upload_config"); @@ -207,7 +235,7 @@ void LLWebProfile::uploadImage(LLPointer image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); headers["Cookie"] = getAuthCookie(); - LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers); + LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers); } // static @@ -218,7 +246,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) } // static -void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url) +void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb) { if (dynamic_cast(image.get()) == 0) { @@ -284,7 +312,7 @@ void LLWebProfile::post(LLPointer image, const LLSD& config, c memcpy(data, body.str().data(), size); // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(), headers); + LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers); } // static diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h index 10279bffac..c1c0c23540 100755 --- a/indra/newview/llwebprofile.h +++ b/indra/newview/llwebprofile.h @@ -48,8 +48,9 @@ class LLWebProfile public: typedef boost::function status_callback_t; + typedef boost::function image_url_callback_t; - static void uploadImage(LLPointer image, const std::string& caption, bool add_location); + static void uploadImage(LLPointer image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t()); static void setAuthCookie(const std::string& cookie); static void setImageUploadResultCallback(status_callback_t cb) { mStatusCallback = cb; } @@ -58,7 +59,7 @@ private: friend class LLWebProfileResponders::PostImageResponder; friend class LLWebProfileResponders::PostImageRedirectResponder; - static void post(LLPointer image, const LLSD& config, const std::string& url); + static void post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb); static void reportImageUploadStatus(bool ok); static std::string getAuthCookie(); -- cgit v1.2.3 From 9232d919c8571743d9f5c899b80e2807f131f4d3 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:09:59 +0100 Subject: removed unnecessary passing of image caption --- indra/newview/llpanelsnapshotfacebook.cpp | 6 +++--- indra/newview/llwebprofile.cpp | 27 ++++++++++++--------------- indra/newview/llwebprofile.h | 4 ++-- 3 files changed, 17 insertions(+), 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 954941274a..9bea5aa796 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -64,7 +64,7 @@ private: /*virtual*/ void updateControls(const LLSD& info); void onSend(); - void onImageUploaded(const std::string& image_url, const std::string& caption); + void onImageUploaded(const std::string& caption, const std::string& image_url); }; static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); @@ -99,14 +99,14 @@ void LLPanelSnapshotFacebook::onSend() std::string caption = getChild("caption")->getValue().asString(); bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, _1, _2)); + LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } -void LLPanelSnapshotFacebook::onImageUploaded(const std::string& image_url, const std::string& caption) +void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) { if (!image_url.empty()) { diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 4bc4724753..6923724de2 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -62,8 +62,8 @@ class LLWebProfileResponders::ConfigResponder : public LLHTTPClient::Responder LOG_CLASS(LLWebProfileResponders::ConfigResponder); public: - ConfigResponder(LLPointer imagep, const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImagep(imagep), mImageCaption(caption), mImageCallback(cb) + ConfigResponder(LLPointer imagep, LLWebProfile::image_url_callback_t cb) + : mImagep(imagep), mImageCallback(cb) { } @@ -113,12 +113,11 @@ public: // Do the actual image upload using the configuration. LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl; - LLWebProfile::post(mImagep, config, upload_url, mImageCaption, mImageCallback); + LLWebProfile::post(mImagep, config, upload_url, mImageCallback); } private: LLPointer mImagep; - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -129,8 +128,8 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient:: LOG_CLASS(LLWebProfileResponders::PostImageRedirectResponder); public: - PostImageRedirectResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImageCaption(caption), mImageCallback(cb) + PostImageRedirectResponder(LLWebProfile::image_url_callback_t cb) + : mImageCallback(cb) { } @@ -141,7 +140,7 @@ public: std::string image_url = content.get("Location"); llinfos << "Image uploaded to " << image_url << llendl; if (!mImageCallback.empty() && !image_url.empty()) - mImageCallback(image_url, mImageCaption); + mImageCallback(image_url); } } @@ -168,7 +167,6 @@ public: } private: - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -180,8 +178,8 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde LOG_CLASS(LLWebProfileResponders::PostImageResponder); public: - PostImageResponder(const std::string& caption, LLWebProfile::image_url_callback_t cb) - : mImageCaption(caption), mImageCallback(cb) + PostImageResponder(LLWebProfile::image_url_callback_t cb) + : mImageCallback(cb) { } @@ -196,7 +194,7 @@ public: headers["Cookie"] = LLWebProfile::getAuthCookie(); const std::string& redir_url = content["location"]; LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; - LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCaption, mImageCallback), headers); + LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(mImageCallback), headers); } else { @@ -214,7 +212,6 @@ public: } private: - std::string mImageCaption; LLWebProfile::image_url_callback_t mImageCallback; }; @@ -235,7 +232,7 @@ void LLWebProfile::uploadImage(LLPointer image, const std::str LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl; LLSD headers = LLViewerMedia::getHeaders(); headers["Cookie"] = getAuthCookie(); - LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, caption, cb), headers); + LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image, cb), headers); } // static @@ -246,7 +243,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) } // static -void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, LLWebProfile::image_url_callback_t cb) +void LLWebProfile::post(LLPointer image, const LLSD& config, const std::string& url, LLWebProfile::image_url_callback_t cb) { if (dynamic_cast(image.get()) == 0) { @@ -312,7 +309,7 @@ void LLWebProfile::post(LLPointer image, const LLSD& config, c memcpy(data, body.str().data(), size); // Send request, successful upload will trigger posting metadata. - LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(caption, cb), headers); + LLHTTPClient::postRaw(url, data, size, new LLWebProfileResponders::PostImageResponder(cb), headers); } // static diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h index c1c0c23540..63dccf80af 100755 --- a/indra/newview/llwebprofile.h +++ b/indra/newview/llwebprofile.h @@ -48,7 +48,7 @@ class LLWebProfile public: typedef boost::function status_callback_t; - typedef boost::function image_url_callback_t; + typedef boost::function image_url_callback_t; static void uploadImage(LLPointer image, const std::string& caption, bool add_location, image_url_callback_t cb = image_url_callback_t()); static void setAuthCookie(const std::string& cookie); @@ -59,7 +59,7 @@ private: friend class LLWebProfileResponders::PostImageResponder; friend class LLWebProfileResponders::PostImageRedirectResponder; - static void post(LLPointer image, const LLSD& config, const std::string& url, const std::string& caption, image_url_callback_t cb); + static void post(LLPointer image, const LLSD& config, const std::string& url, image_url_callback_t cb); static void reportImageUploadStatus(bool ok); static std::string getAuthCookie(); -- cgit v1.2.3 From 58177c83b0a81aae363bccc0e5ac2312b083341d Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 6 Jun 2013 00:17:33 +0100 Subject: uncommented the placeholder image upload --- indra/newview/llpanelsnapshotfacebook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 9bea5aa796..56b1f921b9 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -103,7 +103,7 @@ void LLPanelSnapshotFacebook::onSend() LLFloaterSnapshot::postSave(); // test with a placeholder image, until we can figure out a way to grab the uploaded image url - //LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); + LLFacebookConnect::instance().sharePhoto("http://fc02.deviantart.net/fs43/i/2009/125/a/9/Future_of_Frog_by_axcho.jpg", caption); } void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) -- cgit v1.2.3 From cf5cf32ebf3a8eccbaa9e8c092fd23b357a68727 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 5 Jun 2013 16:31:32 -0700 Subject: ACME-471: Now using the actual map top-down image for the checked in location. --- indra/newview/llviewermenu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..e8c7e0cfdc 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5995,8 +5995,12 @@ void handle_facebook_checkin() std::string region_name = gAgent.getRegion()->getName(); std::string description; LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } //bool is_facebook_connected(); -- cgit v1.2.3 From ba90e388855f99ec5b3f1991f2437f616a5d9e62 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Jun 2013 19:40:33 -0700 Subject: ACME-464 : WIP : Make the menu Connect to FB only connect and be disabled if the user is already connected --- indra/newview/llpanelsnapshotfacebook.cpp | 3 ++- indra/newview/llviewermenu.cpp | 17 +++++++++-------- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 ++ 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 200c64f16b..27abbfa456 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -90,7 +90,8 @@ 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("post_btn")->setEnabled(have_snapshot); + const bool is_connected = LLFacebookConnect::instance().getConnected(); + getChild("post_btn")->setEnabled(have_snapshot && is_connected); } void LLPanelSnapshotFacebook::onSend() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 471db8d8fc..bc2e13d77e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -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() { @@ -5999,9 +6001,6 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDL4jdC_vCh0ow-QCXZjN-WNojEXWiz0APEa6Qhpl8cxawjkoC7w", ""); } -//bool is_facebook_connected(); - - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8754,6 +8753,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)); } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5061842c7f..e67350722d 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -20,6 +20,8 @@ name="ConnectToFacebook"> + Date: Thu, 6 Jun 2013 16:34:24 -0400 Subject: STORM-1838 Added teleport request to conversation log. Added xml to have message appear in IM window, if open. Code cleanup. --- indra/newview/llavataractions.cpp | 1 - indra/newview/llconversationloglist.cpp | 5 ++++- indra/newview/llpanelpeoplemenus.cpp | 2 -- indra/newview/skins/default/xui/en/menu_conversation.xml | 2 -- .../skins/default/xui/en/menu_conversation_log_gear.xml | 10 ++++++++++ indra/newview/skins/default/xui/en/notifications.xml | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 285e70c8ea..45992b8c83 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -443,7 +443,6 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const // static void LLAvatarActions::teleportRequest(const LLUUID& id) { -llwarns << "DBG " << llendl; std::string name; gCacheName->getFullName(id, name); gCacheName->cleanFullName(name); diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index cf9c9b3415..44212298cf 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -311,9 +311,12 @@ void LLConversationLogList::onCustomAction(const LLSD& userdata) } else if ("offer_teleport" == command_name) { -llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(selected_conversation_participant_id); } + else if ("request_teleport" == command_name) + { + LLAvatarActions::teleportRequest(selected_conversation_participant_id); + } else if("add_friend" == command_name) { if (!LLAvatarActions::isFriend(selected_conversation_participant_id)) diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index ddc92f439b..0b2bf1d2c8 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -261,7 +261,6 @@ void PeopleContextMenu::requestTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), // so we have to use a wrapper. -llwarns << "DBG " << llendl; LLAvatarActions::teleportRequest(mUUIDs.front()); } @@ -269,7 +268,6 @@ void PeopleContextMenu::offerTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(), // so we have to use a wrapper. -llwarns << "DBG " << llendl; LLAvatarActions::offerTeleport(mUUIDs); } diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index c2c15023c5..d8eb2f0ffd 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -46,7 +46,6 @@ - - + + + + [NAME_SLURL] is requesting to be teleported to your location. [MESSAGE] -- cgit v1.2.3 From d233d8836b610b5e5ca76a1e3bb4d63dc3592e66 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 6 Jun 2013 17:16:00 -0400 Subject: STORM-1838 Remove incorrect XML menu text --- indra/newview/skins/default/xui/en/menu_people_nearby.xml | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 80e8e59076..f12226ebeb 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -143,15 +143,4 @@ function="Avatar.EnableItem" parameter="can_block" /> - - - - - -- cgit v1.2.3 From 4163603a1118a9c1e220e56f22e757d162932ebe Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 6 Jun 2013 15:06:52 -0700 Subject: ACME-464 : WIP : Post in the snapshot Panel correctly disabled / enabled according to FB connection status --- indra/newview/llpanelsnapshotfacebook.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index b434741538..faeabf0a07 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -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,7 @@ BOOL LLPanelSnapshotFacebook::postBuild() // virtual void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { + updateControls(key); LLPanelSnapshot::onOpen(key); } @@ -95,6 +97,13 @@ void LLPanelSnapshotFacebook::updateControls(const LLSD& info) getChild("post_btn")->setEnabled(have_snapshot && is_connected); } +// virtual +void LLPanelSnapshotFacebook::updateCustomResControls() +{ + const bool is_connected = LLFacebookConnect::instance().getConnected(); + getChild("post_btn")->setEnabled(is_connected); +} + void LLPanelSnapshotFacebook::onSend() { std::string caption = getChild("caption")->getValue().asString(); -- cgit v1.2.3 From 8511385a5407181ced7bb226d4054185c597d05e Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Thu, 6 Jun 2013 18:16:44 -0700 Subject: MAINT-2764 : Planar texture mapping with bumpiness and path cut breaks under forward rendering. Will get Dave P to review --- indra/newview/llvovolume.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 00a109546e..98943b194e 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4268,8 +4268,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 bump_count = 0; U32 simple_count = 0; U32 alpha_count = 0; - - U32 useage = group->mSpatialPartition->mBufferUsage; @@ -4709,15 +4707,15 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bump_mask |= LLVertexBuffer::MAP_BINORMAL; genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, TRUE); genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, TRUE); - genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE); + genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, TRUE); genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, TRUE); } else { - genDrawInfo(group, simple_mask, simple_faces, simple_count); - genDrawInfo(group, fullbright_mask, fullbright_faces, fullbright_count); + genDrawInfo(group, simple_mask, simple_faces, simple_count, FALSE, FALSE); + genDrawInfo(group, fullbright_mask, fullbright_faces, fullbright_count, FALSE, FALSE); genDrawInfo(group, bump_mask, bump_faces, bump_count, FALSE, FALSE); - genDrawInfo(group, alpha_mask, alpha_faces, alpha_count, TRUE); + genDrawInfo(group, alpha_mask, alpha_faces, alpha_count, TRUE, FALSE); } -- cgit v1.2.3 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(-) (limited to 'indra/newview') 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 From 5020579a07eca7a719f70b2ae7fde40a2522f124 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 7 Jun 2013 12:34:57 -0700 Subject: ACME-470: Adjusting 'Check in to Facebook' text to 'Check in to Facebook...' --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5061842c7f..97cd01123f 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -22,7 +22,7 @@ function="Facebook.Connect" /> -- cgit v1.2.3 From 54e879cc22ec342f57cec23d38ba269b83489111 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 8 Jun 2013 00:48:46 +0100 Subject: added Facebook status update feature for ACME-502, ACME-503, and ACME-504 --- indra/newview/llfacebookconnect.cpp | 9 +++++++++ indra/newview/llfacebookconnect.h | 3 ++- indra/newview/llnotificationscripthandler.cpp | 3 +++ indra/newview/llviewermenu.cpp | 20 ++++++++++++++++++++ indra/newview/llviewermenu.h | 5 ++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 8 +++++++- .../newview/skins/default/xui/en/notifications.xml | 21 +++++++++++++++++++++ 7 files changed, 66 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 668ba04406..79e8d98668 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -323,6 +323,15 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookPostResponder()); } +void LLFacebookConnect::updateStatus(const std::string& message) +{ + LLSD body; + body["message"] = message; + + // Note: we can use that route for different publish action. We should be able to use the same responder. + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookPostResponder()); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mGeneration++; diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 2dba182267..58e2707ba3 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -49,6 +49,7 @@ public: void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); void postCheckinMessage(const std::string& message, const std::string& link, const std::string& name, const std::string& caption, const std::string& description, const std::string& picture); void sharePhoto(const std::string& image_url, const std::string& caption); + void updateStatus(const std::string& message); void clearContent(); void storeContent(const LLSD& content); @@ -69,7 +70,7 @@ private: bool mConnectedToFbc; LLSD mContent; - S32 mGeneration; + S32 mGeneration; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 08c98e4f28..2854962922 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -35,6 +35,9 @@ #include "llnotificationmanager.h" #include "llnotifications.h" #include "llscriptfloater.h" +#include "llfacebookconnect.h" +#include "llavatarname.h" +#include "llavatarnamecache.h" using namespace LLNotificationsUI; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bfa5ac2d1..67460c4bc6 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6005,6 +6005,23 @@ void handle_facebook_checkin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); } +bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + std::string message = response["message"].asString(); + if (!message.empty()) + LLFacebookConnect::instance().updateStatus(message); + } + return false; +} + +void handle_facebook_status() +{ + LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); +} + void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8761,4 +8778,7 @@ void initialize_menus() // Facebook Checkin commit.add("Facebook.Checkin", boost::bind(&handle_facebook_checkin)); + + // Facebook Status Update + commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 9c3f13f843..e71beef10d 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -138,9 +138,12 @@ bool handle_go_to(); // Facebook Connect void handle_facebook_connect(); -//Facebook Checkin +// Facebook Checkin void handle_facebook_checkin(); +// Facebook Status Update +void handle_facebook_status(); + // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e67350722d..2b2ac8c079 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -28,7 +28,13 @@ name="CheckinToFacebook"> - + + + + + + What's on your mind? (asks Facebook) + confirm +
+ + +
+ + + + - - - + name="place_panel"/> + -- cgit v1.2.3 From 824a5c65f57ae0fa2cce99ade156341fcf8daf5a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 20 Jun 2013 17:58:27 -0700 Subject: ACME-584: Adjusted name of a couple XUI elements. --- indra/newview/skins/default/xui/en/floater_social.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 2b382215d1..d446e0c0f6 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -47,7 +47,7 @@ name="stack1" top="8"> + label="button_container" + help_topic="button_container" + name="button_container"/> + + Date: Sat, 22 Jun 2013 01:32:15 +0100 Subject: tweaked numbers to look more like mockup for ACME-568 --- indra/newview/skins/default/xui/en/floater_social.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 378841b1a6..c49749840b 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -37,14 +37,14 @@ height="16" left="9" name="caption_label" - top_pad="12" + top_pad="18" type="string"> What's on your mind? -- cgit v1.2.3 From 9debe1787f966efd6c25ffc43a3a77553aca107a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 22 Jun 2013 11:49:36 -0700 Subject: ACME-497 : All xml work for the Checkin feature --- indra/newview/llfloatersocial.cpp | 5 + indra/newview/llfloatersocial.h | 1 + .../skins/default/xui/en/floater_social.xml | 112 ++++++++++++++++++++- 3 files changed, 115 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index fe9cfa592b..4a3efe4a2d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -31,5 +31,10 @@ LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key) { + mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this)); +} +void LLFloaterSocial::onCancel() +{ + closeFloater(); } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index b120fe5804..f65c0dcf5d 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -34,6 +34,7 @@ class LLFloaterSocial : public LLFloater { public: LLFloaterSocial(const LLSD& key); + void onCancel(); }; #endif // LL_LLFLOATERSOCIAL_H diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index d446e0c0f6..2909da295d 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -283,18 +283,124 @@ top_delta="0" width="100"> + function="SocialSharing.Cancel" /> + name="place_panel"> + + + + Say something about where you are: + + + + + + + + + + + Include overhead view of location + + + + + + + + -- cgit v1.2.3 From 27bd181a6d07b191d674870039b2801713c554f1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 23 Jun 2013 12:15:21 -0700 Subject: ACME-497 : Working implementation of Checkin though couple of bugs to fix and no visible map in the UI --- indra/newview/llfloatersocial.cpp | 65 +++++++++++++++++++++- indra/newview/llfloatersocial.h | 10 ++++ .../skins/default/xui/en/floater_social.xml | 5 +- 3 files changed, 77 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index f6fc55927e..cca966bb9a 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -29,11 +29,25 @@ #include "llfloatersocial.h" +#include "llagent.h" #include "llagentui.h" +#include "llfacebookconnect.h" #include "llfloaterreg.h" #include "llslurl.h" +#include "llviewerregion.h" +#include "llviewercontrol.h" -static LLRegisterPanelClassWrapper panel_class("llsocialphotopanel"); +static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); +static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); + +std::string get_map_url() +{ + LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos); + return map_url; +} LLSocialPhotoPanel::LLSocialPhotoPanel() { @@ -60,6 +74,55 @@ void LLSocialPhotoPanel::onSend() } +LLSocialCheckinPanel::LLSocialCheckinPanel() : + mMapUrl("") +{ + mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this)); +} + +/*virtual*/ +void LLSocialCheckinPanel::setVisible(BOOL visible) +{ + if (visible) + { + mMapUrl = get_map_url(); + } + LLPanel::setVisible(visible); +} + +void LLSocialCheckinPanel::onSend() +{ + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Get the region name + std::string region_name = gAgent.getRegion()->getName(); + + // Get the region description + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + + + // Optionally add the region map view + bool add_map_view = getChild("add_place_view_cb")->getValue().asBoolean(); + std::string map_url = (add_map_view ? mMapUrl : ""); + + // Get the caption + std::string caption = getChild("place_caption")->getValue().asString(); + + // Post all that to Facebook + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); + + // Close the floater once "Post" has been pushed + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key) { diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index a8c83fb364..aee7f2f060 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -36,6 +36,16 @@ class LLSocialPhotoPanel : public LLPanel void onSend(); }; +class LLSocialCheckinPanel : public LLPanel +{ +public: + LLSocialCheckinPanel(); + void onSend(); + /*virtual*/ void setVisible(BOOL visible); +private: + std::string mMapUrl; +}; + class LLFloaterSocial : public LLFloater { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index d57bc157cd..f99044b233 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -71,7 +71,7 @@ top_delta="0" width="100"> + function="SocialSharing.Cancel" /> + function="SocialSharing.SendCheckin" /> - - - + + + -- cgit v1.2.3 From 68fa34965daa5bd65aea5cb1f4dc4554e7d9f70f Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 25 Jun 2013 00:26:10 +0100 Subject: made status update actually post to Facebook, for ACME-569 and ACME-573 --- indra/newview/llfloatersocial.cpp | 18 ++++++++++++++++++ indra/newview/llfloatersocial.h | 7 +++++++ indra/newview/skins/default/xui/en/floater_social.xml | 5 +++-- 3 files changed, 28 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 361d54f696..dd4f4f03d9 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -37,6 +37,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" +static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); @@ -53,6 +54,23 @@ std::string get_map_url() return map_url; } +LLSocialStatusPanel::LLSocialStatusPanel() +{ + mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this)); +} + +void LLSocialStatusPanel::onSend() +{ + std::string message = getChild("message")->getValue().asString(); + LLFacebookConnect::instance().updateStatus(message); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + LLSocialPhotoPanel::LLSocialPhotoPanel() { mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index aee7f2f060..561aefa111 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -29,6 +29,13 @@ #include "llfloater.h" +class LLSocialStatusPanel : public LLPanel +{ +public: + LLSocialStatusPanel(); + void onSend(); +}; + class LLSocialPhotoPanel : public LLPanel { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index fc26ba5842..15e105f67d 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -23,6 +23,7 @@ height="430" halign="center"> @@ -60,7 +61,7 @@ top_pad="18" width="100"> + function="SocialSharing.SendStatus" /> - - + help_topic="panel_social_status" + name="panel_social_status"/> - - - - - - - - - - - [SIZE] KB - - - - - Succeeded - - - - - Failed - - - - - Working - - - - - - + help_topic="panel_social_photo" + name="panel_social_photo"/> - - - - Say something about where you are: - - - - - - - - - - - Include overhead view of location - - - - - - - - + help_topic="panel_social_place" + name="panel_social_place"/> -- cgit v1.2.3 From fc05dc5114785368e37e325fdb429fed7cd3c363 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 27 Jun 2013 16:52:53 -0700 Subject: ACME-630 Adding missing files --- .../skins/default/xui/en/panel_social_photo.xml | 254 +++++++++++++++++++++ .../skins/default/xui/en/panel_social_place.xml | 108 +++++++++ .../skins/default/xui/en/panel_social_status.xml | 50 ++++ 3 files changed, 412 insertions(+) create mode 100644 indra/newview/skins/default/xui/en/panel_social_photo.xml create mode 100644 indra/newview/skins/default/xui/en/panel_social_place.xml create mode 100644 indra/newview/skins/default/xui/en/panel_social_status.xml (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml new file mode 100644 index 0000000000..e6742b0ea7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + [SIZE] KB + + + + + Succeeded + + + + + Failed + + + + + Working + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml new file mode 100644 index 0000000000..30b48d9bb1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_place.xml @@ -0,0 +1,108 @@ + + + + + Say something about where you are: + + + + + + + + + + + Include overhead view of location + + + + + + + + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml new file mode 100644 index 0000000000..ae199e7e38 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_social_status.xml @@ -0,0 +1,50 @@ + + + What's on your mind? + + + + + + \ No newline at end of file -- cgit v1.2.3 From 0e50cbc2edacdecf32071c97c2ce5349db5ef5e9 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 01:21:14 +0100 Subject: made it optional to autoconnect in LLFacebookConnect::getConnectionToFacebook() for ACME-648 --- indra/newview/llfacebookconnect.cpp | 18 +++++++++++++----- indra/newview/llfacebookconnect.h | 2 +- indra/newview/llfloatersocial.cpp | 2 +- indra/newview/llpanelpeople.cpp | 2 +- indra/newview/llpanelsnapshotfacebook.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index cf0f554149..52268daa36 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -201,9 +201,9 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder LOG_CLASS(LLFacebookConnectedResponder); public: - LLFacebookConnectedResponder() + LLFacebookConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect) { - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); } virtual void completed(U32 status, const std::string& reason, const LLSD& content) @@ -223,7 +223,14 @@ public: // show the facebook login page if not connected yet if (status == 404) { - LLFacebookConnect::instance().connectToFacebook(); + if (mAutoConnect) + { + LLFacebookConnect::instance().connectToFacebook(); + } + else + { + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + } } else { @@ -234,6 +241,7 @@ public: } private: + bool mAutoConnect; }; /////////////////////////////////////////////////////////////////////////////// @@ -304,13 +312,13 @@ void LLFacebookConnect::disconnectFromFacebook() LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder()); } -void LLFacebookConnect::getConnectionToFacebook() +void LLFacebookConnect::getConnectionToFacebook(bool auto_connect) { if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED)) { const bool follow_redirects=false; const F32 timeout=HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(), + LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect), LLSD(), timeout, follow_redirects); } } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index a19b6fbb98..c54da8e3f3 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,7 +54,7 @@ public: void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use. void disconnectFromFacebook(); // Disconnect from the FBC service. - void getConnectionToFacebook(); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). + void getConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). void loadFacebookFriends(); void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 8d026471dc..35761d5cc8 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -516,7 +516,7 @@ void LLFloaterSocial::onCancel() BOOL LLFloaterSocial::postBuild() { // Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state) - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); // Keep tab of the Photo Panel mSocialPhotoPanel = static_cast(getChild("panel_social_photo")); return LLFloater::postBuild(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b6b72800f9..92391f0537 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1683,7 +1683,7 @@ void LLPanelPeople::onLoginFbcButtonClicked() } else { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } } diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp index 0a76bc3b9d..94fbb986c0 100755 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ b/indra/newview/llpanelsnapshotfacebook.cpp @@ -89,7 +89,7 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key) { if (!LLFacebookConnect::instance().isConnected()) { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } updateControls(key); LLPanelSnapshot::onOpen(key); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index df2da12045..47787e2687 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5957,7 +5957,7 @@ void handle_facebook_connect() { if (!LLFacebookConnect::instance().isConnected()) { - LLFacebookConnect::instance().getConnectionToFacebook(); + LLFacebookConnect::instance().getConnectionToFacebook(true); } } -- cgit v1.2.3 From 06f0e4161b3c735678f9ace02d659cc838afc1d8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 27 Jun 2013 18:30:27 -0700 Subject: ACME-629 Clean up names of variables and functions used in the Facebook photo panel --- indra/newview/llfloatersocial.cpp | 385 +++++++++++++++++++------------------- indra/newview/llfloatersocial.h | 39 ++-- 2 files changed, 214 insertions(+), 210 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 35761d5cc8..dfc9024d54 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -64,6 +64,10 @@ std::string get_map_url() return map_url; } +/////////////////////////// +//LLSocialStatusPanel////// +/////////////////////////// + LLSocialStatusPanel::LLSocialStatusPanel() : mMessageTextEditor(NULL), mPostStatusButton(NULL) @@ -108,12 +112,21 @@ void LLSocialStatusPanel::onSend() } } +/////////////////////////// +//LLSocialPhotoPanel/////// +/////////////////////////// + LLSocialPhotoPanel::LLSocialPhotoPanel() : +mSnapshotPanel(NULL), +mResolutionComboBox(NULL), mRefreshBtn(NULL), mRefreshLabel(NULL), mSucceessLblPanel(NULL), mFailureLblPanel(NULL), -mThumbnailPlaceholder(NULL) +mThumbnailPlaceholder(NULL), +mCaptionTextBox(NULL), +mLocationCheckbox(NULL), +mPostButton(NULL) { mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); } @@ -129,179 +142,21 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel() BOOL LLSocialPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2)); - - mPostButton = getChild("post_btn"); + + mSnapshotPanel = getChild("snapshot_panel"); mResolutionComboBox = getChild("resolution_combobox"); - mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this)); + mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE)); mRefreshBtn = getChild("new_snapshot_btn"); childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); mRefreshLabel = getChild("refresh_lbl"); mSucceessLblPanel = getChild("succeeded_panel"); mFailureLblPanel = getChild("failed_panel"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); - - return LLPanel::postBuild(); -} - -void LLSocialPhotoPanel::onResolutionComboCommit() -{ - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - updateResolution(mResolutionComboBox, instance); -} - -void LLSocialPhotoPanel::onClickNewSnapshot() -{ - LLSnapshotLivePreview* previewp = static_cast(mPreviewHandle.get()); - //LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - if (previewp /*&& view*/) - { - //view->impl.setStatus(Impl::STATUS_READY); - lldebugs << "updating snapshot" << llendl; - previewp->updateSnapshot(TRUE); - } -} - -void LLSocialPhotoPanel::updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update) -{ - LLComboBox* combobox = (LLComboBox*)ctrl; - LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; - - if (!view || !combobox) - { - llassert(view && combobox); - return; - } - - std::string sdstring = combobox->getSelectedValue(); - LLSD sdres; - std::stringstream sstream(sdstring); - LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); - - S32 width = sdres[0]; - S32 height = sdres[1]; - - LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - if (previewp && combobox->getCurrentIndex() >= 0) - { - S32 original_width = 0 , original_height = 0 ; - previewp->getSize(original_width, original_height) ; - - if (width == 0 || height == 0) - { - // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; - previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - } - else - { - // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; - previewp->setSize(width, height); - } - - checkAspectRatio(width); - - previewp->getSize(width, height); - - if(original_width != width || original_height != height) - { - previewp->setSize(width, height); - - // hide old preview as the aspect ratio could be wrong - lldebugs << "updating thumbnail" << llendl; - - previewp->updateSnapshot(FALSE, TRUE); - if(do_update) - { - lldebugs << "Will update controls" << llendl; - updateControls(); - setNeedRefresh(true); - } - } - - } -} - -void LLSocialPhotoPanel::setNeedRefresh(bool need) -{ - mRefreshLabel->setVisible(need); - mNeedRefresh = need; -} - -void LLSocialPhotoPanel::checkAspectRatio(S32 index) -{ - LLSnapshotLivePreview *previewp = getPreviewView() ; - - BOOL keep_aspect = FALSE; - - if (0 == index) // current window size - { - keep_aspect = TRUE; - } - else // predefined resolution - { - keep_aspect = FALSE; - } - - if (previewp) - { - previewp->mKeepAspectRatio = keep_aspect; - } -} - -LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() -{ - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); - return previewp; -} - -void LLSocialPhotoPanel::updateControls() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - BOOL got_bytes = previewp && previewp->getDataSize() > 0; - BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType(); - - // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; - - LLLocale locale(LLLocale::USER_LOCALE); - std::string bytes_string; - if (got_snap) - { - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); - } - - //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); - getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); - getChild("file_size_label")->setColor( - shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD - && got_bytes - && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); - - LLComboBox* combo = getChild("resolution_combobox"); - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - updateResolution(combo, instance, FALSE); -} - -void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) -{ - bool visible = new_visibility.asBoolean(); - if (visible && !mPreviewHandle.get()) - { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - - previewp->setSnapshotType(previewp->SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - //previewp->setSnapshotQuality(98); - previewp->setThumbnailPlaceholderRect(getThumbnailPlaceholderRect()); + mCaptionTextBox = getChild("caption"); + mLocationCheckbox = getChild("add_location_cb"); + mPostButton = getChild("post_btn"); - updateControls(); - } + return LLPanel::postBuild(); } void LLSocialPhotoPanel::draw() @@ -313,7 +168,7 @@ void LLSocialPhotoPanel::draw() if(previewp && previewp->getThumbnailImage()) { bool working = false; //impl.getStatus() == Impl::STATUS_WORKING; - const LLRect& thumbnail_rect = getThumbnailPlaceholderRect(); + const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); const S32 thumbnail_w = previewp->getThumbnailWidth(); const S32 thumbnail_h = previewp->getThumbnailHeight(); @@ -325,8 +180,7 @@ void LLSocialPhotoPanel::draw() S32 offset_x = thumbnail_rect.mLeft + local_offset_x; S32 offset_y = thumbnail_rect.mBottom + local_offset_y; - LLUICtrl * snapshot_panel = getChild("snapshot_panel"); - snapshot_panel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, gFloaterView->getParentFloater(this)); + mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. @@ -373,20 +227,57 @@ void LLSocialPhotoPanel::draw() gGL.pushUIMatrix(); S32 x_pos; S32 y_pos; - snapshot_panel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, gFloaterView->getParentFloater(this)); - + mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType()); + LLUI::translate((F32) x_pos, (F32) y_pos); mThumbnailPlaceholder->draw(); gGL.popUIMatrix(); } - mPostButton->setEnabled(LLFacebookConnect::instance().isConnected()); + mPostButton->setEnabled(LLFacebookConnect::instance().isConnected()); +} + +LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() +{ + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); + return previewp; +} + +void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + if (visible && !mPreviewHandle.get()) + { + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + mPreviewHandle = previewp->getHandle(); + + previewp->setSnapshotType(previewp->SNAPSHOT_WEB); + previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + //previewp->setSnapshotQuality(98); + previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); + + updateControls(); + } +} + +void LLSocialPhotoPanel::onClickNewSnapshot() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + if (previewp) + { + //setStatus(Impl::STATUS_READY); + lldebugs << "updating snapshot" << llendl; + previewp->updateSnapshot(TRUE); + } } void LLSocialPhotoPanel::onSend() { - std::string caption = getChild("caption")->getValue().asString(); - bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + std::string caption = mCaptionTextBox->getValue().asString(); + bool add_location = mLocationCheckbox->getValue().asBoolean(); if (add_location) { @@ -399,7 +290,6 @@ void LLSocialPhotoPanel::onSend() } LLSnapshotLivePreview* previewp = getPreviewView(); - LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption); updateControls(); @@ -411,6 +301,122 @@ void LLSocialPhotoPanel::onSend() } } +void LLSocialPhotoPanel::updateControls() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + BOOL got_bytes = previewp && previewp->getDataSize() > 0; + BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); + LLSnapshotLivePreview::ESnapshotType shot_type = previewp->getSnapshotType(); + + // *TODO: Separate maximum size for Web images from postcards + lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + + LLLocale locale(LLLocale::USER_LOCALE); + std::string bytes_string; + if (got_snap) + { + LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + } + + //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string + getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); + getChild("file_size_label")->setColor( + shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD + && got_bytes + && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); + + updateResolution(FALSE); +} + +void LLSocialPhotoPanel::updateResolution(BOOL do_update) +{ + LLComboBox* combobox = static_cast(mResolutionComboBox); + + std::string sdstring = combobox->getSelectedValue(); + LLSD sdres; + std::stringstream sstream(sdstring); + LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); + + S32 width = sdres[0]; + S32 height = sdres[1]; + + LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + if (previewp && combobox->getCurrentIndex() >= 0) + { + S32 original_width = 0 , original_height = 0 ; + previewp->getSize(original_width, original_height) ; + + if (width == 0 || height == 0) + { + // take resolution from current window size + lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); + } + else + { + // use the resolution from the selected pre-canned drop-down choice + lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + previewp->setSize(width, height); + } + + checkAspectRatio(width); + + previewp->getSize(width, height); + + if(original_width != width || original_height != height) + { + previewp->setSize(width, height); + + // hide old preview as the aspect ratio could be wrong + lldebugs << "updating thumbnail" << llendl; + + previewp->updateSnapshot(FALSE, TRUE); + if(do_update) + { + lldebugs << "Will update controls" << llendl; + updateControls(); + setNeedRefresh(true); + } + } + + } +} + +void LLSocialPhotoPanel::checkAspectRatio(S32 index) +{ + LLSnapshotLivePreview *previewp = getPreviewView() ; + + BOOL keep_aspect = FALSE; + + if (0 == index) // current window size + { + keep_aspect = TRUE; + } + else // predefined resolution + { + keep_aspect = FALSE; + } + + if (previewp) + { + previewp->mKeepAspectRatio = keep_aspect; + } +} + +void LLSocialPhotoPanel::setNeedRefresh(bool need) +{ + mRefreshLabel->setVisible(need); + mNeedRefresh = need; +} + +LLUICtrl* LLSocialPhotoPanel::getRefreshBtn() +{ + return mRefreshBtn; +} + +//////////////////////// +//LLSocialCheckinPanel// +//////////////////////// LLSocialCheckinPanel::LLSocialCheckinPanel() : mMapUrl(""), @@ -501,6 +507,9 @@ void LLSocialCheckinPanel::onSend() } } +//////////////////////// +//LLFloaterSocial/////// +//////////////////////// LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key), mSocialPhotoPanel(NULL) @@ -522,15 +531,9 @@ BOOL LLFloaterSocial::postBuild() return LLFloater::postBuild(); } -/*virtual*/ -void LLFloaterSocial::draw() -{ - LLFloater::draw(); -} - void LLFloaterSocial::onOpen(const LLSD& key) { - LLSnapshotLivePreview* preview = static_cast(mSocialPhotoPanel->mPreviewHandle.get()); + LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView(); if(preview) { lldebugs << "opened, updating snapshot" << llendl; @@ -541,14 +544,13 @@ void LLFloaterSocial::onOpen(const LLSD& key) // static void LLFloaterSocial::preUpdate() { - // FIXME: duplicated code LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); if (instance) { - // Disable the send/post/save buttons until snapshot is ready. + //Will set file size text to 'unknown' instance->mSocialPhotoPanel->updateControls(); - // Force hiding the "Refresh to save" hint because we know we've just started refresh. + //Hides the refresh text instance->mSocialPhotoPanel->setNeedRefresh(false); } } @@ -556,21 +558,22 @@ void LLFloaterSocial::preUpdate() // static void LLFloaterSocial::postUpdate() { - // FIXME: duplicated code LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); if (instance) { - // Enable the send/post/save buttons. + //Will set the file size text instance->mSocialPhotoPanel->updateControls(); - // We've just done refresh. + //Hides the refresh text instance->mSocialPhotoPanel->setNeedRefresh(false); // The refresh button is initially hidden. We show it after the first update, - // i.e. when preview appears. - if (!instance->mSocialPhotoPanel->mRefreshBtn->getVisible()) + // i.e. after snapshot is taken + LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn(); + + if (!refresh_button->getVisible()) { - instance->mSocialPhotoPanel->mRefreshBtn->setVisible(true); + refresh_button->setVisible(true); } } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 6675a990f4..95ba688430 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -50,37 +50,40 @@ private: class LLSocialPhotoPanel : public LLPanel { - public: +public: LLSocialPhotoPanel(); ~LLSocialPhotoPanel(); BOOL postBuild(); void draw(); - void onSend(); - const LLRect& getThumbnailPlaceholderRect() { return mThumbnailPlaceholder->getRect(); } - void onResolutionComboCommit(); + LLSnapshotLivePreview* getPreviewView(); + void onVisibilityChange(const LLSD& new_visibility); void onClickNewSnapshot(); + void onSend(); - LLHandle mPreviewHandle; - - void updateResolution(LLUICtrl* ctrl, void* data, BOOL do_update = TRUE); - void setNeedRefresh(bool need); + void updateControls(); + void updateResolution(BOOL do_update); void checkAspectRatio(S32 index); - LLSnapshotLivePreview* getPreviewView(); + void setNeedRefresh(bool need); + LLUICtrl* getRefreshBtn(); - void updateControls(); - void onVisibilityChange(const LLSD& new_visibility); +private: + + LLHandle mPreviewHandle; + LLUICtrl * mSnapshotPanel; LLUICtrl * mResolutionComboBox; - LLUICtrl *mRefreshBtn, *mRefreshLabel; - LLUICtrl *mSucceessLblPanel, *mFailureLblPanel; - LLUICtrl* mThumbnailPlaceholder; + LLUICtrl * mRefreshBtn; + LLUICtrl * mRefreshLabel; + LLUICtrl * mSucceessLblPanel; + LLUICtrl * mFailureLblPanel; + LLUICtrl * mThumbnailPlaceholder; + LLUICtrl * mCaptionTextBox; + LLUICtrl * mLocationCheckbox; + LLUICtrl * mPostButton; bool mNeedRefresh; - -private: - LLUICtrl* mPostButton; }; class LLSocialCheckinPanel : public LLPanel @@ -108,8 +111,6 @@ public: BOOL postBuild(); void onCancel(); void onOpen(const LLSD& key); - /*virtual*/ void draw(); - static void preUpdate(); static void postUpdate(); -- cgit v1.2.3 From 7d17bbe132cf0f799b703bba978d48d44a1377c4 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 19:26:07 +0100 Subject: removed unused Me menu items for ACME-637 --- indra/newview/llfloatersocial.cpp | 2 +- indra/newview/llviewermenu.cpp | 60 ---------------------- indra/newview/llviewermenu.h | 9 ---- indra/newview/skins/default/xui/en/menu_viewer.xml | 20 -------- .../newview/skins/default/xui/en/notifications.xml | 21 -------- .../default/xui/en/panel_snapshot_facebook.xml | 4 +- 6 files changed, 3 insertions(+), 113 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index dfc9024d54..d6c00b7c86 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -128,7 +128,7 @@ mCaptionTextBox(NULL), mLocationCheckbox(NULL), mPostButton(NULL) { - mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); + mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this)); } LLSocialPhotoPanel::~LLSocialPhotoPanel() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 47787e2687..137eeb6a99 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5953,56 +5953,6 @@ void handle_report_abuse() LLFloaterReporter::showFromMenu(COMPLAINT_REPORT); } -void handle_facebook_connect() -{ - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().getConnectionToFacebook(true); - } -} - -bool enable_facebook_connect() -{ - // The menu item will be disabled if we are already connected - return !LLFacebookConnect::instance().isConnected(); -} - -void handle_facebook_checkin() -{ - - // Get the location SLURL - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - std::string region_name = gAgent.getRegion()->getName(); - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); - LLVector3d center_agent = gAgent.getRegion()->getCenterGlobal(); - int x_pos = center_agent[0] / 256.0; - int y_pos = center_agent[1] / 256.0; - std::string locationMap = llformat("http://map.secondlife.com/map-1-%d-%d-objects.jpg", x_pos, y_pos); - - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, locationMap, ""); -} - -bool handle_facebook_status_callback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - std::string message = response["message"].asString(); - if (!message.empty()) - LLFacebookConnect::instance().updateStatus(message); - } - return false; -} - -void handle_facebook_status() -{ - LLNotificationsUtil::add("FacebookUpdateStatus", LLSD(), LLSD(), boost::bind(&handle_facebook_status_callback, _1, _2)); -} - void handle_buy_currency() { LLBuyCurrencyHTML::openCurrencyFloater(); @@ -8801,14 +8751,4 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); - - // 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)); - - // Facebook Status Update - commit.add("Facebook.UpdateStatus", boost::bind(&handle_facebook_status)); } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index e71beef10d..143420e227 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -135,15 +135,6 @@ bool enable_pay_object(); bool enable_buy_object(); bool handle_go_to(); -// Facebook Connect -void handle_facebook_connect(); - -// Facebook Checkin -void handle_facebook_checkin(); - -// Facebook Status Update -void handle_facebook_status(); - // Export to XML or Collada void handle_export_selected( void * ); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 733eb16c54..6da4b3d234 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -15,26 +15,6 @@ function="ShowAgentProfile" parameter="agent" />
- - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5f4869e110..c8911e47e8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10135,25 +10135,4 @@ Cannot create large prims that intersect other players. Please re-try when othe yestext="OK"/> - - What's on your mind? (asks Facebook) - confirm -
- - -
-- cgit v1.2.3 From 7df863265f6f536aeae84dceab9140fb4465213c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 28 Jun 2013 13:32:01 -0500 Subject: NORSPEC-290 Shader optimization WIP -- remove a couple normalizes, pows, and divides from various lighting functions. --- .../shaders/class1/deferred/alphaF.glsl | 51 +++-- .../shaders/class1/deferred/alphaNonIndexedF.glsl | 150 ------------- .../class1/deferred/alphaNonIndexedNoColorF.glsl | 92 -------- .../shaders/class1/deferred/alphaSkinnedV.glsl | 136 ------------ .../shaders/class1/deferred/alphaV.glsl | 37 +--- .../class1/deferred/avatarAlphaNoColorV.glsl | 10 +- .../shaders/class1/deferred/avatarAlphaV.glsl | 153 ------------- .../shaders/class1/deferred/materialF.glsl | 8 +- .../shaders/class1/lighting/lightFuncV.glsl | 2 +- .../shaders/class1/objects/previewV.glsl | 4 +- .../shaders/class2/deferred/alphaNonIndexedF.glsl | 235 -------------------- .../class2/deferred/alphaNonIndexedNoColorF.glsl | 242 --------------------- .../shaders/class2/deferred/alphaSkinnedV.glsl | 156 ------------- .../shaders/class2/deferred/alphaV.glsl | 224 ------------------- .../shaders/class2/deferred/avatarAlphaV.glsl | 153 ------------- indra/newview/pipeline.cpp | 4 +- 16 files changed, 45 insertions(+), 1612 deletions(-) delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl delete mode 100755 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl delete mode 100755 indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 143af0576c..af3f362208 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -61,6 +61,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -82,7 +83,7 @@ vec3 calcDirectionalLight(vec3 n, vec3 l) return vec3(a,a,a); } -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -92,14 +93,14 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float float da = 0.0; - if (d > 0.0 && la > 0.0 && fa > 0.0) +// if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist = d/la; - da = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + da = clamp(1.0-(dist+fa-1.0)/fa, 0.0, 1.0); da *= da; da *= 2.0; @@ -112,7 +113,7 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float da *= max(dot(n, lv), 0.0); } - return vec3(da,da,da); + return da; } #if HAS_SHADOW @@ -138,6 +139,25 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc) void main() { +#ifdef USE_INDEXED_TEX + vec4 diff = diffuseLookup(vary_texcoord0.xy); +#else + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); +#endif + +#ifdef USE_VERTEX_COLOR + float vertex_color_alpha = vertex_color.a; +#else + float vertex_color_alpha = 1.0; +#endif + + float alpha = vertex_color_alpha*diff.a; + + vec4 gamma_diff = diff; + + diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f)); + + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; frag *= screen_res; @@ -210,21 +230,6 @@ void main() } #endif -#ifdef USE_INDEXED_TEX - vec4 diff = diffuseLookup(vary_texcoord0.xy); -#else - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); -#endif - vec4 gamma_diff = diff; - - diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f)); - -#ifdef USE_VERTEX_COLOR - float vertex_color_alpha = vertex_color.a; -#else - float vertex_color_alpha = 1.0; -#endif - vec3 normal = vary_norm; vec3 l = light_position[0].xyz; @@ -243,6 +248,7 @@ void main() color.rgb = scaleSoftClip(color.rgb); + //convert to linear space color.rgb = pow(color.rgb, vec3(2.2)); col = vec4(0,0,0,0); @@ -257,8 +263,9 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) - color.rgb += diff.rgb * pow(vary_pointlight_col, vec3(2.2)) * col.rgb; + color.rgb += diff.rgb * vary_pointlight_col_linear * col.rgb; + //convert to gamma space color.rgb = pow(color.rgb, vec3(1.0/2.2)); frag_color = color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 2ce44d599f..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - color.rgb = pow(color.rgb, vec3(1.0/2.2)); - - frag_color = color; - //frag_color = vec4(1,0,1,1); - //frag_color = vec4(1,0,1,1)*shadow; - -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index 1113a9845b..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; - -uniform mat4 inv_proj; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0); - vec4 color = diff * col; - - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - color.rgb += diff.rgb * vary_pointlight_col.rgb; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 5f93986f1d..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,136 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -mat4 getObjectSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -VARYING vec3 vary_norm; - -uniform float near_clip; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz); - vary_norm = norm; - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - vary_pointlight_col = diffuse_color.rgb; - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = atmosAffectDirectionalLight(1); - - col.rgb = col.rgb*diffuse_color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 9d3ba564cd..cc63baa422 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -68,6 +68,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; #ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; @@ -79,43 +80,8 @@ VARYING vec3 vary_norm; uniform float near_clip; -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - uniform vec3 sun_dir; -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - void main() { vec4 pos; @@ -181,6 +147,7 @@ void main() vary_pointlight_col = diff; + vary_pointlight_col_linear = pow(diff, vec3(2.2)); col.rgb = vec3(0,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl index c8ddefac26..145cf524d4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaNoColorV.glsl @@ -71,18 +71,18 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa vec3 lv = lp.xyz-v; //get distance - float d = dot(lv,lv); + float d = length(lv); float da = 0.0; - if (d > 0.0 && la > 0.0 && fa > 0.0) + //if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + da = clamp(1.0-(dist-1.0+fa)/fa, 0.0, 1.0); // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl deleted file mode 100755 index d6149fcc32..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -uniform float near_clip; - -uniform vec4 color; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb * color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 53ade8ea64..27bb43110b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -133,14 +133,14 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe vec3 col = vec3(0,0,0); - if (d > 0.0 && la > 0.0 && fa > 0.0) + //if (d > 0.0 && la > 0.0 && fa > 0.0) { //normalize light vector - lv = normalize(lv); + lv /= d; //distance attenuation - float dist = d/la; - float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d*la; + float dist_atten = clamp(1.0-(dist-1.0+fa)/fa, 0.0, 1.0); dist_atten *= dist_atten; dist_atten *= 2.0; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl index a9288b3df6..dc0b989e34 100755 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl @@ -45,7 +45,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa lv *= 1.0/d; //distance attenuation - float da = clamp(1.0/(la * d), 0.0, 1.0); + float da = clamp(1.0/(1.f/la * d), 0.0, 1.0); // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 7f3f84398b..c325a236d7 100755 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -91,8 +91,8 @@ void main() // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], 1.f/light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], 1.f/light_attenuation[3].x, light_attenuation[3].z); vertex_color = col*color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 9670d59399..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,235 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - vec4 col = vec4(vary_ambient + dlight*shadow, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index fae279fba0..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; - -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a, a, a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - float cs = shadow2D(shadowMap, stc.xyz).x; - - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight*shadow, 1.0); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 7f4d82ecc6..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -mat4 getObjectSkinnedTransform(); -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ -//get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - - mat4 mat = getObjectSkinnedTransform(); - - mat = modelview_matrix * mat; - - vec3 pos = (mat*vec4(position, 1.0)).xyz; - - gl_Position = projection_matrix * vec4(pos, 1.0); - - vec4 n = vec4(position, 1.0); - n.xyz += normal.xyz; - n.xyz = (mat*n).xyz; - n.xyz = normalize(n.xyz-pos.xyz); - - vec3 norm = n.xyz; - vary_norm = norm; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*diffuse_color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - - col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - - vertex_color = col; - - - - pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); - -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl deleted file mode 100755 index 13c6ffc607..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file alphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; - -#ifdef USE_INDEXED_TEX -void passTextureIndex(); -#endif - -ATTRIBUTE vec3 normal; - -#ifdef USE_VERTEX_COLOR -ATTRIBUTE vec4 diffuse_color; -#endif - -ATTRIBUTE vec2 texcoord0; - -#ifdef HAS_SKIN -mat4 getObjectSkinnedTransform(); -#else -#ifdef IS_AVATAR_SKIN -mat4 getSkinnedTransform(); -#endif -#endif - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -vec3 calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -#ifdef USE_VERTEX_COLOR -VARYING vec4 vertex_color; -#endif - -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -uniform vec3 sun_dir; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - -void main() -{ - vec4 pos; - vec3 norm; - - //transform vertex -#ifdef HAS_SKIN - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize((trans * vec4(norm, 1.0)).xyz - pos.xyz); - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - -#ifdef IS_AVATAR_SKIN - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - norm = normalize(normal_matrix * normal); - vec4 vert = vec4(position.xyz, 1.0); - pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); -#endif - -#endif - -#ifdef USE_INDEXED_TEX - passTextureIndex(); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -#else - vary_texcoord0 = texcoord0; -#endif - - vary_norm = norm; - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - -#ifndef USE_VERTEX_COLOR - vec4 diffuse_color = vec4(1,1,1,1); -#endif - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - vec3 dff = pow(diffuse_color.rgb, vec3(2.2f,2.2f,2.2f)); - - vary_pointlight_col = dff; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(col.rgb); - - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0-ambient); - - col.rgb *= ambient; - - vary_directional.rgb = atmosAffectDirectionalLight(1.0f); - vary_ambient = col.rgb*dff; - - col.rgb = col.rgb*dff; - -#ifdef USE_VERTEX_COLOR - vertex_color = col; -#endif - -#ifdef HAS_SKIN - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -#else - -#ifdef IS_AVATAR_SKIN - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#else - pos = modelview_projection_matrix * vert; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#endif - -#endif - -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl deleted file mode 100755 index 44aaa98b97..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform vec4 color; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - gl_Position = projection_matrix * pos; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb*color.rgb; - - vertex_color = col; - - - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 231508e253..7072c95c3e 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2710,14 +2710,14 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d { shader = &gDownsampleDepthRectProgram; shader->bind(); - shader->uniform2f("delta", 1.f, 1.f); + shader->uniform2f(sDelta, 1.f, 1.f); shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, source.getWidth(), source.getHeight()); } else { shader = &gDownsampleDepthProgram; shader->bind(); - shader->uniform2f("delta", 1.f/source.getWidth(), 1.f/source.getHeight()); + shader->uniform2f(sDelta, 1.f/source.getWidth(), 1.f/source.getHeight()); shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, 1.f, 1.f); } -- cgit v1.2.3 From 89ae19e57edc9abfd300b17caf2719d7794dabf9 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 20:19:17 +0100 Subject: removed old error popups and added better logging for ACME-653 --- indra/newview/llfacebookconnect.cpp | 29 ++++++---------------- .../newview/skins/default/xui/en/notifications.xml | 11 -------- 2 files changed, 8 insertions(+), 32 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 52268daa36..dc450aab7a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -41,19 +41,12 @@ // Local functions -void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description) +void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) { - // Note: 302 (redirect) is *not* an error that warrants prompting the user + // Note: 302 (redirect) is *not* an error that warrants logging if (status != 302) { - LLSD args(LLSD::emptyMap()); - std::stringstream msg; - msg << status; - args["STATUS"] = msg.str(); - args["REASON"] = reason; - args["CODE"] = code; - args["DESCRIPTION"] = description; - LLNotificationsUtil::add("FacebookCannotConnect", args); + LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL; } } @@ -113,8 +106,7 @@ public: else { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description")); } } @@ -147,8 +139,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description")); } if (mShareCallback) @@ -188,8 +179,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description")); } } }; @@ -218,8 +208,6 @@ public: } else { - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; - // show the facebook login page if not connected yet if (status == 404) { @@ -235,7 +223,7 @@ public: else { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); + log_facebook_connect_error("Connected", status, reason, content.get("error_code"), content.get("error_description")); } } } @@ -261,8 +249,7 @@ public: } else { - prompt_user_for_error(status, reason, content.get("error_code"), content.get("error_description")); - LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL; + log_facebook_connect_error("Friends", status, reason, content.get("error_code"), content.get("error_description")); } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index c8911e47e8..1f20d3ab58 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5439,17 +5439,6 @@ This day cycle file references a missing sky file: [SKY]. Sorry, the settings couldn't be applied to the region. Leaving the region and then returning may help rectify the problem. The reason given was: [FAIL_REASON]
- -Connection to Facebook failed. Reason: [STATUS] [REASON] ([CODE] - [DESCRIPTION]) - - - Date: Fri, 28 Jun 2013 13:48:44 -0700 Subject: ACME-638: Removed LLSocialList class and FBC Test tab in the People panel. --- indra/newview/CMakeLists.txt | 2 - indra/newview/llpanelpeople.cpp | 32 ----- indra/newview/llpanelpeople.h | 2 - indra/newview/llsociallist.cpp | 154 --------------------- indra/newview/llsociallist.h | 102 -------------- .../newview/skins/default/xui/en/panel_people.xml | 95 ------------- 6 files changed, 387 deletions(-) delete mode 100644 indra/newview/llsociallist.cpp delete mode 100644 indra/newview/llsociallist.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a5ad2e4d4e..f593375aed 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -513,7 +513,6 @@ set(viewer_SOURCE_FILES llsky.cpp llslurl.cpp llsnapshotlivepreview.cpp - llsociallist.cpp llspatialpartition.cpp llspeakers.cpp llspeakingindicatormanager.cpp @@ -1092,7 +1091,6 @@ set(viewer_HEADER_FILES llsky.h llslurl.h llsnapshotlivepreview.h - llsociallist.h llspatialpartition.h llspeakers.h llspeakingindicatormanager.h diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 92391f0537..d3493373f6 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -72,7 +72,6 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" -#include "llsociallist.h" #include "llspeakers.h" #include "llfloaterwebcontent.h" @@ -87,7 +86,6 @@ static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; static const std::string RECENT_TAB_NAME = "recent_panel"; static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars -static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string FBCTESTTWO_TAB_NAME = "fbctesttwo_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; @@ -528,7 +526,6 @@ LLPanelPeople::LLPanelPeople() mCommitCallbackRegistrar.add("People.loginFBC", boost::bind(&LLPanelPeople::onLoginFbcButtonClicked, this)); mCommitCallbackRegistrar.add("People.requestFBC", boost::bind(&LLPanelPeople::onFacebookAppRequestClicked, this)); mCommitCallbackRegistrar.add("People.sendFBC", boost::bind(&LLPanelPeople::onFacebookAppSendClicked, this)); - mCommitCallbackRegistrar.add("People.testaddFBC", boost::bind(&LLPanelPeople::onFacebookTestAddClicked, this)); mCommitCallbackRegistrar.add("People.testaddFBCFolderView", boost::bind(&LLPanelPeople::addTestParticipant, this)); mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this)); @@ -648,13 +645,6 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); - //===Temporary ======================================================================== - - LLPanel * social_tab = getChild(FBCTEST_TAB_NAME); - mFacebookFriends = social_tab->getChild("facebook_friends"); - // Note: we use the same updater for both test lists (brute force but OK since it's temporary) - social_tab->setVisibleCallback(boost::bind(&LLPanelPeople::updateFacebookList, this, _2)); - //===Test START======================================================================== LLPanel * socialtwo_tab = getChild(FBCTESTTWO_TAB_NAME); @@ -1025,8 +1015,6 @@ LLUUID LLPanelPeople::getCurrentItemID() const if (cur_tab == BLOCKED_TAB_NAME) return LLUUID::null; // FIXME? - if (cur_tab == FBCTEST_TAB_NAME) - return LLUUID::null; if (cur_tab == FBCTESTTWO_TAB_NAME) return LLUUID::null; @@ -1054,8 +1042,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const mGroupList->getSelectedUUIDs(selected_uuids); else if (cur_tab == BLOCKED_TAB_NAME) selected_uuids.clear(); // FIXME? - else if (cur_tab == FBCTEST_TAB_NAME) - return; else if (cur_tab == FBCTESTTWO_TAB_NAME) return; else @@ -1695,22 +1681,4 @@ void LLPanelPeople::onFacebookAppSendClicked() { } -static LLFastTimer::DeclareTimer FTM_AVATAR_LIST_TEST("avatar list test"); - -void LLPanelPeople::onFacebookTestAddClicked() -{ - LLFastTimer _(FTM_AVATAR_LIST_TEST); - - mFacebookFriends->clear(); - - LL_INFOS("LLPanelPeople") << "start adding 300 users" << LL_ENDL; - - for(int i = 0; i < 300; ++i) - { - mFacebookFriends->addNewItem(LLUUID(), "Test", false); - } - - LL_INFOS("LLPanelPeople") << "finished adding 300 users" << LL_ENDL; -} - // EOF diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 1cd2a05e91..cbfd74a2a0 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -35,7 +35,6 @@ #include "llvoiceclient.h" class LLAvatarList; -class LLAvatarListSocial; class LLAvatarName; class LLFilterEditor; class LLGroupList; @@ -123,7 +122,6 @@ private: void onLoginFbcButtonClicked(); void onFacebookAppRequestClicked(); void onFacebookAppSendClicked(); - void onFacebookTestAddClicked(); bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp deleted file mode 100644 index 9f827cf04f..0000000000 --- a/indra/newview/llsociallist.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** -* @file llsociallist.cpp -* @brief Implementation of llsociallist -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - - -#include "llviewerprecompiledheaders.h" - -#include "llsociallist.h" - -#include "llavataractions.h" -#include "llfloaterreg.h" -#include "llavatariconctrl.h" -#include "llavatarnamecache.h" -#include "lloutputmonitorctrl.h" -#include "lltextutil.h" - -static LLDefaultChildRegistry::Register r("social_list"); - -LLSocialList::LLSocialList(const Params&p) : LLFlatListViewEx(p) -{ - -} - -LLSocialList::~LLSocialList() -{ - -} - -void LLSocialList::draw() -{ - LLFlatListView::draw(); -} - -void LLSocialList::refresh() -{ - -} - -void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) -{ - LLSocialListItem * item = new LLSocialListItem(); - LLAvatarName avatar_name; - bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name); - - item->mAvatarId = id; - if(id.notNull()) - { - item->mIcon->setValue(id); - } - - item->setName(has_avatar_name ? name + " (" + avatar_name.getDisplayName() + ")" : name, mNameFilter); - addItem(item, id, pos); -} - -LLSocialListItem::LLSocialListItem() -{ - buildFromFile("panel_avatar_list_item.xml"); -} - -LLSocialListItem::~LLSocialListItem() -{ - -} - -BOOL LLSocialListItem::postBuild() -{ - mIcon = getChild("avatar_icon"); - mLabelTextBox = getChild("avatar_name"); - - mLastInteractionTime = getChild("last_interaction"); - mIconPermissionOnline = getChild("permission_online_icon"); - mIconPermissionMap = getChild("permission_map_icon"); - mIconPermissionEditMine = getChild("permission_edit_mine_icon"); - mIconPermissionEditTheirs = getChild("permission_edit_theirs_icon"); - mSpeakingIndicator = getChild("speaking_indicator"); - mInfoBtn = getChild("info_btn"); - mProfileBtn = getChild("profile_btn"); - - mLastInteractionTime->setVisible(false); - mIconPermissionOnline->setVisible(false); - mIconPermissionMap->setVisible(false); - mIconPermissionEditMine->setVisible(false); - mIconPermissionEditTheirs->setVisible(false); - mSpeakingIndicator->setVisible(false); - mInfoBtn->setVisible(false); - mProfileBtn->setVisible(false); - - mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this)); - mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this)); - - return TRUE; -} - -void LLSocialListItem::setName(const std::string& name, const std::string& highlight) -{ - mLabel = name; - LLTextUtil::textboxSetHighlightedVal(mLabelTextBox, mLabelTextBoxStyle, name, highlight); -} - -void LLSocialListItem::setValue(const LLSD& value) -{ - getChildView("selected_icon")->setVisible( value["selected"]); -} - -void LLSocialListItem::onMouseEnter(S32 x, S32 y, MASK mask) -{ - getChildView("hovered_icon")->setVisible( true); - mInfoBtn->setVisible(true); - mProfileBtn->setVisible(true); - - LLPanel::onMouseEnter(x, y, mask); -} - -void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask) -{ - getChildView("hovered_icon")->setVisible( false); - mInfoBtn->setVisible(false); - mProfileBtn->setVisible(false); - - LLPanel::onMouseLeave(x, y, mask); -} - -void LLSocialListItem::onInfoBtnClick() -{ - LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); -} - -void LLSocialListItem::onProfileBtnClick() -{ - LLAvatarActions::showProfile(mAvatarId); -} diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h deleted file mode 100644 index bc667fc400..0000000000 --- a/indra/newview/llsociallist.h +++ /dev/null @@ -1,102 +0,0 @@ -/** -* @file llsociallist.h -* @brief Header file for llsociallist -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLSOCIALLIST_H -#define LL_LLSOCIALLIST_H - -#include "llflatlistview.h" -#include "llstyle.h" - - -/** - * Generic list of avatars. - * - * Updates itself when it's dirty, using optional name filter. - * To initiate update, modify the UUID list and call setDirty(). - * - * @see getIDs() - * @see setDirty() - * @see setNameFilter() - */ - -class LLAvatarIconCtrl; -class LLIconCtrl; -class LLOutputMonitorCtrl; - -class LLSocialList : public LLFlatListViewEx -{ -public: - - struct Params : public LLInitParam::Block - { - }; - - LLSocialList(const Params&p); - virtual ~LLSocialList(); - - virtual void draw(); - void refresh(); - void addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos = ADD_BOTTOM); - - - - std::string mNameFilter; -}; - -class LLSocialListItem : public LLPanel -{ - public: - LLSocialListItem(); - ~LLSocialListItem(); - - BOOL postBuild(); - void setName(const std::string& name, const std::string& highlight = LLStringUtil::null); - void setValue(const LLSD& value); - void onMouseEnter(S32 x, S32 y, MASK mask); - void onMouseLeave(S32 x, S32 y, MASK mask); - void onInfoBtnClick(); - void onProfileBtnClick(); - - LLUUID mAvatarId; - - LLTextBox * mLabelTextBox; - std::string mLabel; - LLStyle::Params mLabelTextBoxStyle; - - - LLAvatarIconCtrl * mIcon; - LLTextBox * mLastInteractionTime; - LLIconCtrl * mIconPermissionOnline; - LLIconCtrl * mIconPermissionMap; - LLIconCtrl * mIconPermissionEditMine; - LLIconCtrl * mIconPermissionEditTheirs; - LLOutputMonitorCtrl * mSpeakingIndicator; - LLButton * mInfoBtn; - LLButton * mProfileBtn; -}; - - -#endif // LL_LLSOCIALLIST_H diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 451095c7d8..76124148a0 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -651,101 +651,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M right="-1" /> - - - - - - - - - - - - - - - Date: Fri, 28 Jun 2013 14:06:29 -0700 Subject: ACME-638: Removing non-used variable --- indra/newview/llpanelpeople.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index cbfd74a2a0..55c2c3cdae 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -150,7 +150,6 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - LLSocialList* mFacebookFriends; S32 mFacebookListGeneration; LLNetMap* mMiniMap; -- cgit v1.2.3 From db8422f7841ab875c9dc636e10ae5993216d4a5b Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 22:31:18 +0100 Subject: made sure photo preview is only generated when photo tab is visible for ACME-649 --- indra/newview/llfloatersocial.cpp | 48 ++++++++++++++++++++------------------- indra/newview/llfloatersocial.h | 1 - 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index d6c00b7c86..4660644969 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -246,20 +246,32 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) { bool visible = new_visibility.asBoolean(); - if (visible && !mPreviewHandle.get()) + if (visible) { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - - previewp->setSnapshotType(previewp->SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - //previewp->setSnapshotQuality(98); - previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); - - updateControls(); + if (mPreviewHandle.get()) + { + LLSnapshotLivePreview* preview = getPreviewView(); + if(preview) + { + lldebugs << "opened, updating snapshot" << llendl; + preview->updateSnapshot(TRUE); + } + } + else + { + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + mPreviewHandle = previewp->getHandle(); + + previewp->setSnapshotType(previewp->SNAPSHOT_WEB); + previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + //previewp->setSnapshotQuality(98); + previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); + + updateControls(); + } } } @@ -531,16 +543,6 @@ BOOL LLFloaterSocial::postBuild() return LLFloater::postBuild(); } -void LLFloaterSocial::onOpen(const LLSD& key) -{ - LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView(); - if(preview) - { - lldebugs << "opened, updating snapshot" << llendl; - preview->updateSnapshot(TRUE); - } -} - // static void LLFloaterSocial::preUpdate() { diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 95ba688430..89b9e2016a 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -110,7 +110,6 @@ public: LLFloaterSocial(const LLSD& key); BOOL postBuild(); void onCancel(); - void onOpen(const LLSD& key); static void preUpdate(); static void postUpdate(); -- cgit v1.2.3 From 1c7a7fe2d1c3f9399a6248551b7b2a8a7e68afdd Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Jun 2013 23:08:03 +0100 Subject: removed FB photo sharing from snapshot floater for ACME-639 --- indra/newview/CMakeLists.txt | 1 - indra/newview/llpanelsnapshotfacebook.cpp | 139 -------------- indra/newview/llpanelsnapshotoptions.cpp | 7 - .../skins/default/xui/en/floater_snapshot.xml | 6 - .../default/xui/en/panel_snapshot_facebook.xml | 199 --------------------- .../default/xui/en/panel_snapshot_options.xml | 19 -- 6 files changed, 371 deletions(-) delete mode 100755 indra/newview/llpanelsnapshotfacebook.cpp delete mode 100755 indra/newview/skins/default/xui/en/panel_snapshot_facebook.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f593375aed..3d6d315454 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -438,7 +438,6 @@ set(viewer_SOURCE_FILES llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelsnapshot.cpp - llpanelsnapshotfacebook.cpp llpanelsnapshotinventory.cpp llpanelsnapshotlocal.cpp llpanelsnapshotoptions.cpp diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp deleted file mode 100755 index 94fbb986c0..0000000000 --- a/indra/newview/llpanelsnapshotfacebook.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file llpanelsnapshotfacebook.cpp - * @brief Posts a snapshot to the resident Facebook account. - * - * $LicenseInfo:firstyear=2013&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2013, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -// libs -#include "llcombobox.h" -#include "llfloaterreg.h" -#include "llpanel.h" -#include "llspinctrl.h" - -// newview -#include "llfloatersnapshot.h" -#include "llpanelsnapshot.h" -#include "llsidetraypanelcontainer.h" -#include "llwebprofile.h" - -#include "llfacebookconnect.h" -#include "llslurl.h" -#include "llagentui.h" - -/** - * Posts a snapshot to the resident Facebook account. - */ -class LLPanelSnapshotFacebook -: public LLPanelSnapshot -{ - LOG_CLASS(LLPanelSnapshotFacebook); - -public: - LLPanelSnapshotFacebook(); - - /*virtual*/ BOOL postBuild(); - /*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"; } - /*virtual*/ std::string getImageSizeComboName() const { return "facebook_size_combo"; } - /*virtual*/ std::string getImageSizePanelName() const { return "facebook_image_size_lp"; } - /*virtual*/ LLFloaterSnapshot::ESnapshotFormat getImageFormat() const { return LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG; } - /*virtual*/ void updateControls(const LLSD& info); - - void onSend(); - void onImageUploaded(const std::string& caption, const std::string& image_url); -}; - -static LLRegisterPanelClassWrapper panel_class("llpanelsnapshotfacebook"); - -LLPanelSnapshotFacebook::LLPanelSnapshotFacebook() -{ - mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLPanelSnapshotFacebook::onSend, this)); - mCommitCallbackRegistrar.add("PostToFacebook.Cancel", boost::bind(&LLPanelSnapshotFacebook::cancel, this)); -} - -// virtual -BOOL LLPanelSnapshotFacebook::postBuild() -{ - return LLPanelSnapshot::postBuild(); -} - -// virtual -void LLPanelSnapshotFacebook::onOpen(const LLSD& key) -{ - if (!LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().getConnectionToFacebook(true); - } - updateControls(key); - LLPanelSnapshot::onOpen(key); -} - -// virtual -void LLPanelSnapshotFacebook::updateControls(const LLSD& info) -{ - const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true; - const bool is_connected = LLFacebookConnect::instance().isConnected(); - getChild("post_btn")->setEnabled(have_snapshot && is_connected); -} - -// virtual -void LLPanelSnapshotFacebook::updateCustomResControls() -{ - LLPanelSnapshot::updateCustomResControls(); - const bool is_connected = LLFacebookConnect::instance().isConnected(); - getChild("post_btn")->setEnabled(is_connected); -} - -void LLPanelSnapshotFacebook::onSend() -{ - std::string caption = getChild("caption")->getValue().asString(); - bool add_location = getChild("add_location_cb")->getValue().asBoolean(); - - if (add_location) - { - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - if (caption.empty()) - caption = slurl.getSLURLString(); - else - caption = caption + " " + slurl.getSLURLString(); - } - LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption); - //LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); - LLFloaterSnapshot::postSave(); -} - -void LLPanelSnapshotFacebook::onImageUploaded(const std::string& caption, const std::string& image_url) -{ - if (!image_url.empty()) - { - LLFacebookConnect::instance().sharePhoto(image_url, caption); - } -} diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 14953f3cf9..554fabe5b3 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -51,7 +51,6 @@ private: void updateUploadCost(); void openPanel(const std::string& panel_name); void onSaveToProfile(); - void onSaveToFacebook(); void onSaveToEmail(); void onSaveToInventory(); void onSaveToComputer(); @@ -61,7 +60,6 @@ static LLRegisterPanelClassWrapper panel_class("llpanels LLPanelSnapshotOptions::LLPanelSnapshotOptions() { - mCommitCallbackRegistrar.add("Snapshot.SaveToFacebook", boost::bind(&LLPanelSnapshotOptions::onSaveToFacebook, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this)); mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this)); @@ -101,11 +99,6 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name) LLFloaterSnapshot::postPanelSwitch(); } -void LLPanelSnapshotOptions::onSaveToFacebook() -{ - openPanel("panel_snapshot_facebook"); -} - void LLPanelSnapshotOptions::onSaveToProfile() { openPanel("panel_snapshot_profile"); diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index e8e7fb77c1..853c209bca 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -268,12 +268,6 @@ left="0" name="panel_snapshot_options" top="0" /> - - - - - Post to my Facebook timeline - - - - - - - - - - - - - - - - - - Caption: - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml index 8cf5bfb426..61c8c971c2 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml @@ -5,25 +5,6 @@ layout="topleft" name="panel_snapshot_options" width="490"> - - - - - - -- cgit v1.2.3 From 3325c8ecb3eec0a126ef4b7be338ed5a2f8a8ee8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 28 Jun 2013 17:15:55 -0700 Subject: ACME-629: Posting a photo to facebook works again. The post button callback was not being called due to a name change. --- indra/newview/skins/default/xui/en/panel_social_photo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml index e6742b0ea7..fc86349235 100644 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -236,7 +236,7 @@ name="post_btn" width="100"> + function="SocialSharing.SendPhoto" /> - + + + \ No newline at end of file -- cgit v1.2.3 From 1dbabed6b5bac8a0fcc1d9a70522eb726e01bae7 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Jul 2013 23:42:02 +0100 Subject: made listeners more robust in llfloatersocial.cpp for ACME-665 --- indra/newview/llfloatersocial.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 57b6cccd32..67a9f0c742 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -103,6 +103,7 @@ void LLSocialStatusPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } @@ -310,6 +311,7 @@ void LLSocialPhotoPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } @@ -535,6 +537,7 @@ void LLSocialCheckinPanel::onSend() } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } -- cgit v1.2.3 From ad8aeecb8331ca68eef9a12536c80a4658885ccb Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 01:29:54 +0100 Subject: Added auto-connect upon 404 from a POST in LLFacebookConnect, and added FB_POSTED state, for ACME-667 --- indra/newview/llfacebookconnect.cpp | 6 ++++- indra/newview/llfacebookconnect.h | 5 ++-- indra/newview/llfloatersocial.cpp | 51 ++++++++++++++++++++++++------------- 3 files changed, 41 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 30fb63084b..07204531de 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -145,7 +145,11 @@ public: toast_user_for_success(); LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTED); + } + else if (status == 404) + { + LLFacebookConnect::instance().connectToFacebook(); } else { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index ddff87385e..b37c713ae5 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -50,7 +50,8 @@ public: FB_CONNECTED = 2, FB_CONNECTION_FAILED = 3, FB_POSTING = 4, - FB_POST_FAILED = 5 + FB_POSTED = 5, + FB_POST_FAILED = 6 }; typedef boost::function share_callback_t; @@ -76,7 +77,7 @@ public: const LLSD& getContent() const; void setConnectionState(EConnectionState connection_state); - bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING)); } + bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); } EConnectionState getConnectionState() { return mConnectionState; } S32 generation() { return mGeneration; } diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 67a9f0c742..eb3ceaf96e 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -96,6 +96,9 @@ void LLSocialStatusPanel::draw() void LLSocialStatusPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -103,19 +106,21 @@ void LLSocialStatusPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); - - sendStatus(); + case LLFacebookConnect::FB_CONNECTED: + sendStatus(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); + break; } return false; @@ -304,6 +309,9 @@ void LLSocialPhotoPanel::onClickNewSnapshot() void LLSocialPhotoPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -311,19 +319,21 @@ void LLSocialPhotoPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); - - sendPhoto(); + case LLFacebookConnect::FB_CONNECTED: + sendPhoto(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); + break; } return false; @@ -530,6 +540,9 @@ void LLSocialCheckinPanel::draw() void LLSocialCheckinPanel::onSend() { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); + // Connect to Facebook if necessary and then post if (LLFacebookConnect::instance().isConnected()) { @@ -537,19 +550,21 @@ void LLSocialCheckinPanel::onSend() } else { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(true); } } bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + switch (data.get("enum").asInteger()) { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); - - sendCheckin(); + case LLFacebookConnect::FB_CONNECTED: + sendCheckin(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); + break; } return false; -- cgit v1.2.3 From fd4262541946770515ce8a486dd3a69245365def Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:01:51 +0100 Subject: Close floater and clear text upon FB_POSTED for ACME-668 --- indra/newview/llfloatersocial.cpp | 38 ++++++++++++++++++++++++++++++++++++++ indra/newview/llfloatersocial.h | 3 +++ 2 files changed, 41 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index eb3ceaf96e..2ecadcfaf6 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -120,6 +120,7 @@ bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); + clearAndClose(); break; } @@ -135,6 +136,17 @@ void LLSocialStatusPanel::sendStatus() } } +void LLSocialStatusPanel::clearAndClose() +{ + mMessageTextEditor->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + /////////////////////////// //LLSocialPhotoPanel/////// /////////////////////////// @@ -333,6 +345,7 @@ bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); + clearAndClose(); break; } @@ -365,6 +378,17 @@ void LLSocialPhotoPanel::sendPhoto() updateControls(); } +void LLSocialPhotoPanel::clearAndClose() +{ + mCaptionTextBox->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + void LLSocialPhotoPanel::updateControls() { LLSnapshotLivePreview* previewp = getPreviewView(); @@ -564,6 +588,7 @@ bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTED: LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); + clearAndClose(); break; } @@ -595,6 +620,17 @@ void LLSocialCheckinPanel::sendCheckin() LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); } +void LLSocialCheckinPanel::clearAndClose() +{ + getChild("place_caption")->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + //////////////////////// //LLFloaterSocial/////// //////////////////////// @@ -680,6 +716,8 @@ void LLFloaterSocial::draw() mStatusLoadingIndicator->setVisible(true); break; case LLFacebookConnect::FB_CONNECTED: + break; + case LLFacebookConnect::FB_POSTED: break; case LLFacebookConnect::FB_CONNECTION_FAILED: case LLFacebookConnect::FB_POST_FAILED: diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index e37facbbce..5e1ee6be0e 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -45,6 +45,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendStatus(); + void clearAndClose(); private: LLUICtrl* mMessageTextEditor; @@ -67,6 +68,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendPhoto(); + void clearAndClose(); void updateControls(); void updateResolution(BOOL do_update); @@ -101,6 +103,7 @@ public: bool onFacebookConnectStateChange(const LLSD& data); void sendCheckin(); + void clearAndClose(); private: std::string mMapUrl; -- cgit v1.2.3 From 85824ebc0931d4ac89e375b35dbccd1295746e31 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:13:47 +0100 Subject: Removed share callbacks from LLFacebookConnect --- indra/newview/llfacebookconnect.cpp | 19 +++---------------- indra/newview/llfacebookconnect.h | 7 ------- 2 files changed, 3 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 07204531de..816947827c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -133,11 +133,6 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING); } - LLFacebookShareResponder(LLFacebookConnect::share_callback_t cb) : mShareCallback(cb) - { - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING); - } - virtual void completed(U32 status, const std::string& reason, const LLSD& content) { if (isGoodStatus(status)) @@ -156,11 +151,6 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED); log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description")); } - - if (mShareCallback) - { - mShareCallback(isGoodStatus(status)); - } } void completedHeader(U32 status, const std::string& reason, const LLSD& content) @@ -170,9 +160,6 @@ public: LLFacebookConnect::instance().openFacebookWeb(content["location"]); } } - -private: - LLFacebookConnect::share_callback_t mShareCallback; }; /////////////////////////////////////////////////////////////////////////////// @@ -346,7 +333,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder(mPostCheckinCallback)); + LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) @@ -409,7 +396,7 @@ void LLFacebookConnect::sharePhoto(LLPointer image, const std: memcpy(data, body.str().data(), size); // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(mSharePhotoCallback), headers); + LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers); } void LLFacebookConnect::updateStatus(const std::string& message) @@ -418,7 +405,7 @@ void LLFacebookConnect::updateStatus(const std::string& message) body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder(mUpdateStatusCallback)); + LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder()); } void LLFacebookConnect::storeContent(const LLSD& content) diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index b37c713ae5..a06e53b90e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,7 +54,6 @@ public: FB_POST_FAILED = 6 }; - typedef boost::function share_callback_t; typedef boost::function content_updated_callback_t; void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use. @@ -67,9 +66,6 @@ public: void sharePhoto(LLPointer image, const std::string& caption); void updateStatus(const std::string& message); - void setPostCheckinCallback(share_callback_t cb) { mPostCheckinCallback = cb; } - void setSharePhotoCallback(share_callback_t cb) { mSharePhotoCallback = cb; } - void setUpdateStatusCallback(share_callback_t cb) { mUpdateStatusCallback = cb; } void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;} void clearContent(); @@ -94,9 +90,6 @@ private: LLSD mContent; S32 mGeneration; - share_callback_t mPostCheckinCallback; - share_callback_t mSharePhotoCallback; - share_callback_t mUpdateStatusCallback; content_updated_callback_t mContentUpdatedCallback; static boost::scoped_ptr sStateWatcher; -- cgit v1.2.3 From f7a1f7b784fff0579e4d1fecd8265d0f960bd7f4 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 4 Jul 2013 02:43:09 +0100 Subject: Replaced content change callback with an event in LLFacebookConnect for ACME-648 (more or less) --- indra/newview/llfacebookconnect.cpp | 15 ++------------- indra/newview/llfacebookconnect.h | 7 +------ indra/newview/llpanelpeople.cpp | 10 +++++++--- indra/newview/llpanelpeople.h | 2 +- 4 files changed, 11 insertions(+), 23 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 816947827c..30ebedca25 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -41,6 +41,7 @@ #include "llevents.h" boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState")); +boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); // Local functions void log_facebook_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description) @@ -413,10 +414,7 @@ void LLFacebookConnect::storeContent(const LLSD& content) mGeneration++; mContent = content; - if(mContentUpdatedCallback) - { - mContentUpdatedCallback(); - } + sContentWatcher->post(content); } const LLSD& LLFacebookConnect::getContent() const @@ -441,12 +439,3 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c mConnectionState = connection_state; } - - - - - - - - - diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index a06e53b90e..7b6eb3644f 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -54,8 +54,6 @@ public: FB_POST_FAILED = 6 }; - typedef boost::function content_updated_callback_t; - void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use. void disconnectFromFacebook(); // Disconnect from the FBC service. void checkConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook(). @@ -66,8 +64,6 @@ public: void sharePhoto(LLPointer image, const std::string& caption); void updateStatus(const std::string& message); - void setContentUpdatedCallback(content_updated_callback_t cb) { mContentUpdatedCallback = cb;} - void clearContent(); void storeContent(const LLSD& content); const LLSD& getContent() const; @@ -90,9 +86,8 @@ private: LLSD mContent; S32 mGeneration; - content_updated_callback_t mContentUpdatedCallback; - static boost::scoped_ptr sStateWatcher; + static boost::scoped_ptr sContentWatcher; }; #endif // LL_LLFACEBOOKCONNECT_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8c8cad0743..766335c982 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -781,7 +781,7 @@ void LLPanelPeople::updateFriendList() showFriendsAccordionsIfNeeded(); } -void LLPanelPeople::updateSuggestedFriendList() +bool LLPanelPeople::updateSuggestedFriendList() { if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) { @@ -814,6 +814,8 @@ void LLPanelPeople::updateSuggestedFriendList() mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); showFriendsAccordionsIfNeeded(); } + + return false; } void LLPanelPeople::updateNearbyList() @@ -855,7 +857,8 @@ void LLPanelPeople::updateFacebookList(bool visible) { if (visible) { - LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); + LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); if (mTryToConnectToFbc) { @@ -866,6 +869,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); LLFacebookConnect::instance().checkConnectionToFacebook(); } @@ -878,7 +882,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { - LLFacebookConnect::instance().setContentUpdatedCallback(NULL); + LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index c6ee7b8165..b746835dfb 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -76,7 +76,7 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); - void updateSuggestedFriendList(); + bool updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); void updateFacebookList(bool visible); -- cgit v1.2.3 From 6e8b353575f670e50267cb172860a3f8da1dbbd0 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 3 Jul 2013 19:29:42 -0700 Subject: ACME-626 : Simplify the preview drawing code and positioning --- indra/newview/llfloatersocial.cpp | 53 ++-------------------- .../skins/default/xui/en/floater_social.xml | 3 -- .../skins/default/xui/en/panel_social_photo.xml | 53 +++++++++------------- 3 files changed, 27 insertions(+), 82 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index a0dbb7ea95..fce9d1b28f 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -178,76 +178,33 @@ void LLSocialPhotoPanel::draw() { LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - LLPanel::draw(); - - if(previewp && previewp->getThumbnailImage()) + if (previewp && previewp->getThumbnailImage()) { - bool working = false; //impl.getStatus() == Impl::STATUS_WORKING; const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); + const LLRect& snapshot_rect = mSnapshotPanel->getRect(); const S32 thumbnail_w = previewp->getThumbnailWidth(); const S32 thumbnail_h = previewp->getThumbnailHeight(); // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; - const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; // preview y pos within the preview rect // calc preview offset within the floater rect S32 offset_x = thumbnail_rect.mLeft + local_offset_x; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y; + S32 offset_y = thumbnail_rect.mBottom - (snapshot_rect.mTop - thumbnail_rect.mTop); mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - LLColor4 color = working ? LLColor4::grey4 : LLColor4::white; + LLColor4 color = LLColor4::white; gl_draw_scaled_image(offset_x, offset_y, thumbnail_w, thumbnail_h, previewp->getThumbnailImage(), color % alpha); previewp->drawPreviewRect(offset_x, offset_y) ; - - // Draw some controls on top of the preview thumbnail. - static const S32 PADDING = 5; - static const S32 REFRESH_LBL_BG_HEIGHT = 32; - - // Reshape and position the posting result message panels at the top of the thumbnail. - // Do this regardless of current posting status (finished or not) to avoid flicker - // when the result message is displayed for the first time. - // if (impl.getStatus() == Impl::STATUS_FINISHED) - { - LLRect result_lbl_rect = mSucceessLblPanel->getRect(); - const S32 result_lbl_h = result_lbl_rect.getHeight(); - result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h); - mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mSucceessLblPanel->setRect(result_lbl_rect); - mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h); - mFailureLblPanel->setRect(result_lbl_rect); - } - - // Position the refresh button in the bottom left corner of the thumbnail. - mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING); - - if (mNeedRefresh) - { - // Place the refresh hint text to the right of the refresh button. - const LLRect& refresh_btn_rect = mRefreshBtn->getRect(); - mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom); - - // Draw the refresh hint background. - LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y); - gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE); - } - - gGL.pushUIMatrix(); - S32 x_pos; - S32 y_pos; - mSnapshotPanel->localPointToOtherView(thumbnail_rect.mLeft, thumbnail_rect.mBottom, &x_pos, &y_pos, getParentByType()); - - LLUI::translate((F32) x_pos, (F32) y_pos); - mThumbnailPlaceholder->draw(); - gGL.popUIMatrix(); } + LLPanel::draw(); } LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 3ce6841a3a..40800c87e6 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -36,9 +36,6 @@ filename="panel_social_photo.xml" class="llsocialphotopanel" follows="all" - background_visible="true" - bg_alpha_color="DkGray" - bg_opaque_color="DkGray" label="PHOTO" help_topic="panel_social_photo" name="panel_social_photo"/> diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml index c15b2f02d4..72e5286fe6 100644 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -1,15 +1,15 @@ [SIZE] KB - + width="24" /> + visible="false"> Working + + Refreshing... + Comment (optional): @@ -114,9 +118,9 @@ initial_value="true" label="Include location in posting" name="add_location_cb" - left="6" + left="9" height="16" - top_pad="5"/> + top_pad="8"/> + height="181"> Say something about where you are: + height="186"> + + + height="367"> What's on your mind? Date: Mon, 15 Jul 2013 14:24:29 -0600 Subject: STORM-1951: Only toast when we should, honor show_toast notification param --- indra/newview/llnotificationscripthandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 08c98e4f28..56ed1044e9 100755 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -87,7 +87,7 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) { LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); } - else + else if (notification->canShowToast()) { LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); -- cgit v1.2.3 From e12b6caaa0596eae2fad43636663dd4e14a1949c Mon Sep 17 00:00:00 2001 From: Cinders Date: Mon, 15 Jul 2013 14:24:59 -0600 Subject: Remove trivial duplicate ; at the end of a line --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ace16396db..a71ccce89b 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6895,7 +6895,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) std::string target_name; gCacheName->getFullName(target_id, target_name); // for im log filenames LLSD args; - args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; + args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString(); LLSD payload; -- cgit v1.2.3 From 61e5164a41faf5d56919377ea00a6166b772a5a1 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Jul 2013 16:06:34 -0700 Subject: ACME-680 Create the Account tab --- indra/newview/skins/default/xui/en/floater_social.xml | 6 ++++++ indra/newview/skins/default/xui/en/panel_social_account.xml | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 indra/newview/skins/default/xui/en/panel_social_account.xml (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 65f738de1f..7f52a8c0da 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -57,6 +57,12 @@ label="PLACE" help_topic="panel_social_place" name="panel_social_place"/> + + + + + + \ No newline at end of file -- cgit v1.2.3 From 9988e4739f2af029732c66d0bc5f03e6f43c5685 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 15 Jul 2013 17:16:09 -0700 Subject: ACME-725 Add the connected text, 'Connect...' button, 'User another account...' button and 'Disconnect' button --- .../skins/default/xui/en/panel_social_account.xml | 61 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index d1f188fbc8..639e601f9d 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -4,7 +4,64 @@ layout="topleft" name="panel_social_account"> - + + You are connected to Facebook as: + + + [secondlife:/// Philippe Bossut] + + - \ No newline at end of file + + + + -- cgit v1.2.3 From 1bdf5ae8719e16e36a59b90db00b1fb349b5b279 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Tue, 16 Jul 2013 21:09:53 +0300 Subject: MAINT-2386 Update group information before sending invite --- indra/newview/llfloatergroupinvite.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 49da4e64b3..0c735dec1f 100755 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -30,6 +30,7 @@ #include "llpanelgroupinvite.h" #include "lltrans.h" #include "lldraghandle.h" +#include "llgroupmgr.h" class LLFloaterGroupInvite::impl { @@ -123,6 +124,11 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen LLFloaterGroupInvite *fgi = get_if_there(impl::sInstances, group_id, (LLFloaterGroupInvite*)NULL); + + // refresh group information + LLGroupMgr::getInstance()->clearGroupData(group_id); + + if (!fgi) { fgi = new LLFloaterGroupInvite(group_id); -- cgit v1.2.3 From fdea8c66de408a2054bbe86b1967cea11409c313 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 16 Jul 2013 22:15:14 +0100 Subject: switched FB auth to in-viewer browser for ACME-733 --- indra/newview/llfacebookconnect.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 0d11658d07..cf77dd365b 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -40,6 +40,9 @@ #include "lltrans.h" #include "llevents.h" +#include "llfloaterwebcontent.h" +#include "llfloaterreg.h" + boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStream("FacebookConnectState")); boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); @@ -274,7 +277,12 @@ LLFacebookConnect::LLFacebookConnect() void LLFacebookConnect::openFacebookWeb(std::string url) { - LLUrlAction::openURLExternal(url); + // Open the URL in an internal browser window without navigation UI + LLFloaterWebContent::Params p; + p.url(url).show_chrome(false); + LLFloaterReg::showInstance("web_content", p); + + //LLUrlAction::openURLExternal(url); } std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) -- cgit v1.2.3 From 3d6a98d845c871377a52fc924ce06329db34a776 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 17 Jul 2013 02:59:40 +0100 Subject: created floater_fbc_web for ACME-734 and ACME-735 --- indra/newview/llfacebookconnect.cpp | 12 ++++++++++-- indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/skins/default/xui/en/floater_fbc_web.xml | 9 +++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_fbc_web.xml (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index cf77dd365b..ac92fc6ed5 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -52,7 +52,7 @@ void log_facebook_connect_error(const std::string& request, U32 status, const st // Note: 302 (redirect) is *not* an error that warrants logging if (status != 302) { - LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << "(" << description << ")" << LL_ENDL; + LL_WARNS("FacebookConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL; } } @@ -76,10 +76,18 @@ public: { if (tokens[0].asString() == "connect") { + // connect to facebook if (query_map.has("code")) { LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); } + + // this command probably came from the fbc_web browser, so close it + LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + if (fbc_web) + { + fbc_web->closeFloater(); + } return true; } } @@ -280,7 +288,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url) // Open the URL in an internal browser window without navigation UI LLFloaterWebContent::Params p; p.url(url).show_chrome(false); - LLFloaterReg::showInstance("web_content", p); + LLFloaterReg::showInstance("fbc_web", p); //LLUrlAction::openURLExternal(url); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 69bda2c11c..4ce049df03 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -313,7 +313,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); - + LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); diff --git a/indra/newview/skins/default/xui/en/floater_fbc_web.xml b/indra/newview/skins/default/xui/en/floater_fbc_web.xml new file mode 100644 index 0000000000..0d35e22a19 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_fbc_web.xml @@ -0,0 +1,9 @@ + + -- cgit v1.2.3 From 095c53fa060b3d336b408e8b87f30518c8db36cd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 17 Jul 2013 17:50:54 -0700 Subject: ACME-731 Create the llsocialaccountpanel class to handle input/feedback. --- indra/newview/llfloatersocial.cpp | 77 ++++++++++++++++++++++ indra/newview/llfloatersocial.h | 23 +++++++ .../skins/default/xui/en/floater_social.xml | 1 + .../skins/default/xui/en/panel_social_account.xml | 20 +++--- 4 files changed, 113 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index c8c203fc25..66624f6355 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -48,6 +48,7 @@ static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); +static LLRegisterPanelClassWrapper t_panel_account("llsocialaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; @@ -609,6 +610,82 @@ void LLSocialCheckinPanel::clearAndClose() } } +/////////////////////////// +//LLSocialAccountPanel////// +/////////////////////////// + +LLSocialAccountPanel::LLSocialAccountPanel() : +mAccountCaptionLabel(NULL), +mAccountNameLabel(NULL), +mPanelButtons(NULL), +mConnectButton(NULL), +mUseAnotherAccountButton(NULL), +mDisconnectButton(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this)); +} + +BOOL LLSocialAccountPanel::postBuild() +{ + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); + mUseAnotherAccountButton = getChild("use_another_account_btn"); + mDisconnectButton = getChild("disconnect_btn"); + + hideConnectButton(); + + return LLPanel::postBuild(); +} + +void LLSocialAccountPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + LLRect mLayoutStackRect = mPanelButtons->getRect(); + F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop; + mLayoutStackRect.translate(0, -(mConnectButton->getRect().getHeight() + deltaTopPadding)); + mPanelButtons->setRect(mLayoutStackRect); + + mUseAnotherAccountButton->setVisible(FALSE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLSocialAccountPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + LLRect mLayoutStackRect = mPanelButtons->getRect(); + F32 deltaTopPadding = mConnectButton->getRect().mBottom - mUseAnotherAccountButton->getRect().mTop; + mLayoutStackRect.translate(0, mConnectButton->getRect().getHeight() + deltaTopPadding); + mPanelButtons->setRect(mLayoutStackRect); + + mUseAnotherAccountButton->setVisible(TRUE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLSocialAccountPanel::onConnect() +{ + hideConnectButton(); +} + +void LLSocialAccountPanel::onUseAnotherAccount() +{ + +} + +void LLSocialAccountPanel::onDisconnect() +{ + showConnectButton(); +} + //////////////////////// //LLFloaterSocial/////// //////////////////////// diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index f1deeb423d..cdd8a71b79 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -115,6 +115,29 @@ private: bool mMapCheckBoxValue; }; +class LLSocialAccountPanel : public LLPanel +{ +public: + LLSocialAccountPanel(); + BOOL postBuild(); + +private: + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; + LLUICtrl * mUseAnotherAccountButton; + LLUICtrl * mDisconnectButton; +}; + + class LLFloaterSocial : public LLFloater { public: diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 7f52a8c0da..eb209eb314 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -59,6 +59,7 @@ name="panel_social_place"/> [secondlife:/// Philippe Bossut] + + + -- cgit v1.2.3 From b2e2282e988ab8c7d989d8554a41fda8b8c6e691 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 18 Jul 2013 16:13:14 -0700 Subject: ACME-727 Display 'Not connected to Facebook' when the user does not have a FB token --- indra/newview/llfloatersocial.cpp | 60 ++++++++++++++++++++-- indra/newview/llfloatersocial.h | 2 + .../skins/default/xui/en/panel_social_account.xml | 15 ++++-- 3 files changed, 70 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 66624f6355..d64e4273f4 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -625,6 +625,8 @@ mDisconnectButton(NULL) mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this)); mCommitCallbackRegistrar.add("SocialSharing.UseAnotherAccount", boost::bind(&LLSocialAccountPanel::onUseAnotherAccount, this)); mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2)); } BOOL LLSocialAccountPanel::postBuild() @@ -636,9 +638,61 @@ BOOL LLSocialAccountPanel::postBuild() mUseAnotherAccountButton = getChild("use_another_account_btn"); mDisconnectButton = getChild("disconnect_btn"); + return LLPanel::postBuild(); +} + +void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1)); + + if(LLFacebookConnect::instance().isConnected()) + { hideConnectButton(); + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - return LLPanel::postBuild(); + } + else + { + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + } +} + +bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) +{ + + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + case LLFacebookConnect::FB_POSTING: + case LLFacebookConnect::FB_POSTED: + case LLFacebookConnect::FB_POST_FAILED: + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); + hideConnectButton(); + break; + case LLFacebookConnect::FB_NOT_CONNECTED: + case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: + case LLFacebookConnect::FB_CONNECTION_FAILED: + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); + break; + } + + return false; } void LLSocialAccountPanel::showConnectButton() @@ -673,7 +727,7 @@ void LLSocialAccountPanel::hideConnectButton() void LLSocialAccountPanel::onConnect() { - hideConnectButton(); + LLFacebookConnect::instance().checkConnectionToFacebook(true); } void LLSocialAccountPanel::onUseAnotherAccount() @@ -683,7 +737,7 @@ void LLSocialAccountPanel::onUseAnotherAccount() void LLSocialAccountPanel::onDisconnect() { - showConnectButton(); + LLFacebookConnect::instance().disconnectFromFacebook(); } //////////////////////// diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index cdd8a71b79..48245e34ea 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -122,6 +122,8 @@ public: BOOL postBuild(); private: + void onVisibilityChange(const LLSD& new_visibility); + bool onFacebookConnectStateChange(const LLSD& data); void onConnect(); void onUseAnotherAccount(); void onDisconnect(); diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index 838a9ba064..470e0848d2 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -3,7 +3,12 @@ width="304" layout="topleft" name="panel_social_account"> - + + - You are connected to Facebook as: + Not connected to Facebook. + width="210" + visible="false"> @@ -64,7 +70,8 @@ height="23" label="Disconnect" name="disconnect_btn" - width="210"> + width="210" + visible="false"> -- cgit v1.2.3 From 03563fcaa17c0af776c49baaa59421921603cddd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 18 Jul 2013 16:23:11 -0700 Subject: ACME-728: When the 'Disconnect' button is clicked the fbc-service disconnect route should be called --- indra/newview/llfloatersocial.cpp | 30 ++++++++++++++++++------------ indra/newview/llfloatersocial.h | 2 ++ 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index d64e4273f4..e61d86c474 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -652,15 +652,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) if(LLFacebookConnect::instance().isConnected()) { - hideConnectButton(); - mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - + showConnectedLayout(); } else { - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); + showDisconnectedLayout(); LLFacebookConnect::instance().checkConnectionToFacebook(); } } @@ -679,16 +675,12 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) case LLFacebookConnect::FB_POSTING: case LLFacebookConnect::FB_POSTED: case LLFacebookConnect::FB_POST_FAILED: - mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); - hideConnectButton(); + showConnectedLayout(); break; case LLFacebookConnect::FB_NOT_CONNECTED: case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: case LLFacebookConnect::FB_CONNECTION_FAILED: - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); + showDisconnectedLayout(); break; } @@ -725,6 +717,20 @@ void LLSocialAccountPanel::hideConnectButton() } } +void LLSocialAccountPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLSocialAccountPanel::showConnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_connected")); + mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); + hideConnectButton(); +} + void LLSocialAccountPanel::onConnect() { LLFacebookConnect::instance().checkConnectionToFacebook(true); diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 48245e34ea..e49445a39f 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -130,6 +130,8 @@ private: void showConnectButton(); void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; -- cgit v1.2.3 From 519cc4f93daed93f15bfa762ba09a9ba664dbdd6 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 18 Jul 2013 18:10:13 -0700 Subject: Slight adjustment to RegionRestartSeconds and RegionRestartMinutes messages to show region names. --- indra/newview/skins/default/xui/en/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index dc54e5e924..340d5f896a 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6805,7 +6805,7 @@ This will add a bookmark in your inventory so you can quickly IM this Resident. priority="high" sound="UISndAlert" type="notify"> -This region will restart in [MINUTES] minutes. +The region "[NAME]" will restart in [MINUTES] minutes. If you stay in this region you will be logged out. @@ -6815,7 +6815,7 @@ If you stay in this region you will be logged out. priority="high" sound="UISndAlert" type="notify"> -This region will restart in [SECONDS] seconds. +The region "[NAME]" will restart in [SECONDS] seconds. If you stay in this region you will be logged out. -- cgit v1.2.3 From 16709a9bef3ebf24c60eac29f7c5cb743e855da1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Jul 2013 21:05:41 -0700 Subject: ACME-734 : WIP : Implemented changes for https URL in the address bar and added options to web floater to hide history and disable buttons --- indra/newview/llfacebookconnect.cpp | 6 ++- indra/newview/llfloaterwebcontent.cpp | 43 +++++++++++++++++----- indra/newview/llfloaterwebcontent.h | 5 +++ .../skins/default/xui/en/floater_web_content.xml | 20 +++++++++- 4 files changed, 61 insertions(+), 13 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ac92fc6ed5..eb9b93161c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -287,7 +287,11 @@ void LLFacebookConnect::openFacebookWeb(std::string url) { // Open the URL in an internal browser window without navigation UI LLFloaterWebContent::Params p; - p.url(url).show_chrome(false); + p.url(url).show_chrome(true); + p.url(url).allow_address_entry(false); + p.url(url).allow_back_forward_navigation(false); + p.url(url).save_url_history(false); + p.url(url).trusted_content(true); LLFloaterReg::showInstance("fbc_web", p); //LLUrlAction::openURLExternal(url); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 3fe2518de6..92dbbb402d 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -46,7 +46,9 @@ LLFloaterWebContent::_Params::_Params() id("id"), window_class("window_class", "web_content"), show_chrome("show_chrome", true), - allow_address_entry("allow_address_entry", true), + allow_address_entry("allow_address_entry", true), + allow_back_forward_navigation("allow_back_forward_navigation", true), + save_url_history("save_url_history", true), preferred_media_size("preferred_media_size"), trusted_content("trusted_content", false), show_page_title("show_page_title", true) @@ -58,6 +60,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mWebBrowser(NULL), mAddressCombo(NULL), mSecureLockIcon(NULL), + mSecurePrefix(NULL), mStatusBarText(NULL), mStatusBarProgress(NULL), mBtnBack(NULL), @@ -65,7 +68,9 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mBtnReload(NULL), mBtnStop(NULL), mUUID(params.id()), - mShowPageTitle(params.show_page_title) + mShowPageTitle(params.show_page_title), + mAllowNavigation(true), + mSaveURLHistory(true) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -97,7 +102,8 @@ BOOL LLFloaterWebContent::postBuild() // cache image for secure browsing mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag"); - + mSecurePrefix = getChild< LLTextBox >( "secured_prefix" ); + // initialize the URL history using the system URL History manager initializeURLHistory(); @@ -243,6 +249,8 @@ void LLFloaterWebContent::open_media(const Params& p) getChild("status_bar")->setVisible(p.show_chrome); getChild("nav_controls")->setVisible(p.show_chrome); bool address_entry_enabled = p.allow_address_entry && !p.trusted_content; + mAllowNavigation = p.allow_back_forward_navigation; + mSaveURLHistory = p.save_url_history; getChildView("address")->setEnabled(address_entry_enabled); getChildView("popexternal")->setEnabled(address_entry_enabled); @@ -295,8 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting) void LLFloaterWebContent::draw() { // this is asynchronous so we need to keep checking - mBtnBack->setEnabled( mWebBrowser->canNavigateBack() ); - mBtnForward->setEnabled( mWebBrowser->canNavigateForward() ); + mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation); + mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation); LLFloater::draw(); } @@ -344,16 +352,28 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent mStatusBarText->setText( end_str ); // decide if secure browsing icon should be displayed - std::string prefix = std::string("https://"); + std::string prefix = std::string("https://"); std::string test_prefix = mCurrentURL.substr(0, prefix.length()); LLStringUtil::toLower(test_prefix); - if(test_prefix == prefix) + if (test_prefix == prefix) { mSecureLockIcon->setVisible(true); + mSecurePrefix->setVisible(true); + // Hack : we suppress the "https" prefix and move the text a bit + // to make space for the lock icon and the green "https" text. + // However, so not to confuse the list management, we're not adding + // that hacked url to the history. The full url is already in there. + std::string url = mCurrentURL; + url.replace(0,5,""); + url = " " + url; + mAddressCombo->remove( url ); + mAddressCombo->add( url ); + mAddressCombo->selectByValue( url ); } else { mSecureLockIcon->setVisible(false); + mSecurePrefix->setVisible(false); } } else if(event == MEDIA_EVENT_CLOSE_REQUEST) @@ -399,9 +419,12 @@ void LLFloaterWebContent::set_current_url(const std::string& url) { mCurrentURL = url; - // serialize url history into the system URL History manager - LLURLHistory::removeURL("browser", mCurrentURL); - LLURLHistory::addURL("browser", mCurrentURL); + LLURLHistory::removeURL("browser", mCurrentURL); + if (mSaveURLHistory) + { + // serialize url history into the system URL History manager + LLURLHistory::addURL("browser", mCurrentURL); + } mAddressCombo->remove( mCurrentURL ); mAddressCombo->add( mCurrentURL ); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index cfc87e9015..b416328e93 100755 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -54,6 +54,8 @@ public: id; Optional show_chrome, allow_address_entry, + allow_back_forward_navigation, + save_url_history, trusted_content, show_page_title; Optional preferred_media_size; @@ -97,6 +99,7 @@ protected: LLMediaCtrl* mWebBrowser; LLComboBox* mAddressCombo; LLIconCtrl* mSecureLockIcon; + LLTextBox* mSecurePrefix; LLTextBox* mStatusBarText; LLProgressBar* mStatusBarProgress; @@ -108,6 +111,8 @@ protected: std::string mCurrentURL; std::string mUUID; bool mShowPageTitle; + bool mAllowNavigation; + bool mSaveURLHistory; }; #endif // LL_LLFLOATERWEBCONTENT_H diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index cea10adca8..a1563dc9ae 100755 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -125,14 +125,30 @@ + + https + - - + - + + + [https://support.secondlife.com/ Learn more.] + -- cgit v1.2.3 From 1abafdc8b5bf0197b2a3586737d461140e07e994 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 2 Aug 2013 14:42:03 -0700 Subject: Switching SLShareHost to pdp location --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 832610c72c..20919adc76 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3465,7 +3465,7 @@ Type String Value - http://int.fbc.aditi.lindenlab.com + http://pdp15.lindenlab.com FastCacheFetchEnabled -- cgit v1.2.3 From 56b54aaf2954765f68c4fbe843495fdcdb918744 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 3 Aug 2013 01:42:31 +0100 Subject: made checkin use a placeholder location URL when the given SLURL is not valid --- indra/newview/llfloatersocial.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4cbc9c0218..eb9a7d2400 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -53,6 +53,7 @@ static LLRegisterPanelClassWrapper t_panel_checkin("llsoci static LLRegisterPanelClassWrapper t_panel_account("llsocialaccountpanel"); const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte +const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; std::string get_map_url() @@ -582,6 +583,13 @@ void LLSocialCheckinPanel::sendCheckin() LLSLURL slurl; LLAgentUI::buildSLURL(slurl); std::string slurl_string = slurl.getSLURLString(); + + // Use a valid http:// URL if the scheme is secondlife:// + LLURI slurl_uri(slurl_string); + if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) + { + slurl_string = DEFAULT_CHECKIN_LOCATION_URL; + } // Get the region name std::string region_name = gAgent.getRegion()->getName(); -- cgit v1.2.3 From a4bad4ba21787c6895368f5eb5cda7c3881d57da Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 2 Aug 2013 18:58:37 -0700 Subject: ACME-744: Temporary solution. The internal browser was not setting keyboard focus properly...as to why an investigation is needed. For now explicly setting keyboard focus to the internal browser after it is displayed. --- indra/newview/llfacebookconnect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e4ac2a4960..560208c31e 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -333,7 +333,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url) p.url(url).allow_address_entry(false); p.url(url).allow_back_forward_navigation(false); p.url(url).trusted_content(true); - LLFloaterReg::showInstance("fbc_web", p); + LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p); + //TODO Gil: Hack to give the focus to the web browser to show cursor, will fix + gFocusMgr.setKeyboardFocus( floater ); //LLUrlAction::openURLExternal(url); } -- cgit v1.2.3 From 35278461964653fc032995afdc366f096c937a14 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 2 Aug 2013 19:25:10 -0700 Subject: ACME-796 : Do not flip the fbc state to failure while connecting through web browser. Handle the dismiss case as best as possible. --- indra/newview/llfacebookconnect.cpp | 2 +- indra/newview/llfloatersocial.cpp | 6 +++++- indra/newview/llfloaterwebcontent.cpp | 11 +++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index e4ac2a4960..98fd8b1d7b 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -122,7 +122,7 @@ public: // Grab some graph data now that we are connected LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); } - else + else if (status != 302) { LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description")); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index eb9a7d2400..59db93f4b2 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -684,8 +684,12 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) else { showDisconnectedLayout(); - LLFacebookConnect::instance().checkConnectionToFacebook(); } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } } else { diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index e81055f7b1..9d703d2752 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -29,6 +29,7 @@ #include "llcombobox.h" #include "lliconctrl.h" #include "llfloaterreg.h" +#include "llfacebookconnect.h" #include "lllayoutstack.h" #include "llpluginclassmedia.h" #include "llprogressbar.h" @@ -293,6 +294,16 @@ void LLFloaterWebContent::onOpen(const LLSD& key) //virtual void LLFloaterWebContent::onClose(bool app_quitting) { + // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen + LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + if (fbc_web == this) + { + if (!LLFacebookConnect::instance().isConnected()) + { + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED); + } + } + LLViewerMedia::proxyWindowClosed(mUUID); destroy(); } -- cgit v1.2.3 From 106f161a6e33cef2ef1651dff829aca0193e04ee Mon Sep 17 00:00:00 2001 From: dmitry Date: Mon, 5 Aug 2013 15:09:01 +0300 Subject: MAINT-822 FIXED [PUBLIC]Inventory window should focus on search field --- indra/newview/llpanelmaininventory.cpp | 7 +++++++ indra/newview/llpanelmaininventory.h | 3 +++ indra/newview/llsidepanelinventory.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d6535c88e9..c38a78365a 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -540,6 +540,13 @@ void LLPanelMainInventory::changed(U32) updateItemcountText(); } +void LLPanelMainInventory::setFocusFilterEditor() +{ + if(mFilterEditor) + { + mFilterEditor->setFocus(true); + } +} // virtual void LLPanelMainInventory::draw() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 899931aa89..4fd93b24a4 100755 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -82,6 +82,9 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); void onFilterEdit(const std::string& search_string ); + + void setFocusFilterEditor(); + protected: // // Misc functions diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 8915bb2fef..cbf43dbb93 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -397,7 +397,7 @@ void LLSidepanelInventory::onToggleInboxBtn() void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); - + mPanelMainInventory->setFocusFilterEditor(); #if AUTO_EXPAND_INBOX // Expand the inbox if we have fresh items LLPanelMarketplaceInbox * inbox = findChild(MARKETPLACE_INBOX_PANEL); -- cgit v1.2.3 From d9d1d2722737069618e15eac2f33ac4600c357ba Mon Sep 17 00:00:00 2001 From: Cho Date: Mon, 5 Aug 2013 19:04:08 +0100 Subject: changed wording of learn more link for ACME-797 --- indra/newview/skins/default/xui/en/panel_social_account.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml index 957d117d9d..882e410bdb 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -65,11 +65,11 @@ length="1" follows="top|left" height="16" - left="3" + left="0" name="account_learn_more_label" - top_pad="5" + top_pad="20" type="string"> - [https://support.secondlife.com/ Learn more.] + [https://support.secondlife.com/ Learn about posting to Facebook] -- cgit v1.2.3 From e238ddf54bbf6b6adfc115e32bff03de75a8f4ac Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 5 Aug 2013 14:53:07 -0700 Subject: MAINT-2966 : Add viewer alert info for "NoEnterRegionMaybeFull" --- indra/newview/skins/default/xui/en/notifications.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 99824862e2..d14aed273d 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8707,11 +8707,11 @@ You are no longer allowed here and have [EJECT_TIME] seconds to leave. fail -You can't enter this region because -the server is full. +You can't enter region "[NAME]". +It may be full or restarting soon. Date: Tue, 6 Aug 2013 10:27:18 -0700 Subject: ACME-744: Adjusted comment to be more clear --- indra/newview/llfacebookconnect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 645f62579d..ad776b2d1a 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -334,7 +334,10 @@ void LLFacebookConnect::openFacebookWeb(std::string url) p.url(url).allow_back_forward_navigation(false); p.url(url).trusted_content(true); LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p); - //TODO Gil: Hack to give the focus to the web browser to show cursor, will fix + //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems). + //So when showing the internal web browser, set focus to it's containing floater "fbc_web". When a mouse event + //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus. + //fbc_web floater contains the "webbrowser" panel. JIRA: ACME-744 gFocusMgr.setKeyboardFocus( floater ); //LLUrlAction::openURLExternal(url); -- cgit v1.2.3 From 3e08ccf6abb6f6ca7f1fa2fc6e80fd6589203f28 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 6 Aug 2013 17:12:32 -0700 Subject: ACME-801: Adding a suggested friend as a friend does not remove them from the suggested friend list --- indra/newview/llfacebookconnect.cpp | 5 +---- indra/newview/llfacebookconnect.h | 2 -- indra/newview/llpanelpeople.cpp | 42 ++++++++++++++++--------------------- indra/newview/llpanelpeople.h | 1 - 4 files changed, 19 insertions(+), 31 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ad776b2d1a..bdc17773d7 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -320,8 +320,7 @@ LLFacebookConnect::LLFacebookConnect() : mConnectionState(FB_NOT_CONNECTED), mConnected(false), mInfo(), - mContent(), - mGeneration(0) + mContent() { } @@ -506,7 +505,6 @@ const LLSD& LLFacebookConnect::getInfo() const void LLFacebookConnect::storeContent(const LLSD& content) { - mGeneration++; mContent = content; sContentWatcher->post(content); @@ -519,7 +517,6 @@ const LLSD& LLFacebookConnect::getContent() const void LLFacebookConnect::clearContent() { - mGeneration++; mContent = LLSD(); } diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index b9afd181e9..0f005cbe24 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -78,7 +78,6 @@ public: bool isConnected() { return mConnected; } bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_DISCONNECTING)); } EConnectionState getConnectionState() { return mConnectionState; } - S32 generation() { return mGeneration; } void openFacebookWeb(std::string url); @@ -93,7 +92,6 @@ private: BOOL mConnected; LLSD mInfo; LLSD mContent; - S32 mGeneration; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index f1ee76f733..1786f73a8b 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -510,8 +510,7 @@ LLPanelPeople::LLPanelPeople() mNearbyList(NULL), mRecentList(NULL), mGroupList(NULL), - mMiniMap(NULL), - mFacebookListGeneration(0) + mMiniMap(NULL) { mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this)); mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this)); @@ -783,36 +782,31 @@ void LLPanelPeople::updateFriendList() bool LLPanelPeople::updateSuggestedFriendList() { - if (LLFacebookConnect::instance().generation() != mFacebookListGeneration) - { - mFacebookListGeneration = LLFacebookConnect::instance().generation(); + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); - const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); - suggested_friends.clear(); + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + { + LLUUID agent_id = (*i).asUUID(); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - //Add suggested friends - LLSD friends = LLFacebookConnect::instance().getContent(); - for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) + if(!second_life_buddy) { - LLUUID agent_id = (*i).asUUID(); - bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - - if(!second_life_buddy) + //FB+SL but not SL friend + if (agent_id.notNull()) { - //FB+SL but not SL friend - if (agent_id.notNull()) - { - suggested_friends.push_back(agent_id); - } + suggested_friends.push_back(agent_id); } } - - //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) - mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); - showFriendsAccordionsIfNeeded(); } + //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); + showFriendsAccordionsIfNeeded(); + return false; } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index b746835dfb..c7141f36ee 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -140,7 +140,6 @@ private: LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; - S32 mFacebookListGeneration; LLNetMap* mMiniMap; std::vector mSavedOriginalFilters; -- cgit v1.2.3 From d27fc4ad338cb2839363ce2cca70359c82da5b98 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 7 Aug 2013 15:56:29 -0700 Subject: MAINT-2257 : Create ability to limit region/estate and parcel access by either Piof or Group membership (viewer changes). Using Mnikolenko's patch --- indra/newview/llfloaterland.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 6ef4d8717d..22f42875fb 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2377,7 +2377,7 @@ void LLPanelLandAccess::refresh() { BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); - BOOL public_access = !use_access_list && !use_group; + BOOL public_access = !use_access_list; getChild("public_access")->setValue(public_access ); getChild("GroupCheck")->setValue(use_group ); @@ -2582,7 +2582,6 @@ void LLPanelLandAccess::refresh_ui() { getChildView("Only Allow")->setToolTip(std::string()); } - getChildView("GroupCheck")->setEnabled(FALSE); getChildView("PassCheck")->setEnabled(FALSE); getChildView("pass_combo")->setEnabled(FALSE); getChildView("AccessList")->setEnabled(FALSE); @@ -2592,11 +2591,7 @@ void LLPanelLandAccess::refresh_ui() getChildView("limit_payment")->setEnabled(FALSE); getChildView("limit_age_verified")->setEnabled(FALSE); - std::string group_name; - if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) - { - getChildView("GroupCheck")->setEnabled(can_manage_allowed); - } + BOOL group_access = getChild("GroupCheck")->getValue().asBoolean(); BOOL sell_passes = getChild("PassCheck")->getValue().asBoolean(); getChildView("PassCheck")->setEnabled(can_manage_allowed); @@ -2607,6 +2602,11 @@ void LLPanelLandAccess::refresh_ui() getChildView("HoursSpin")->setEnabled(can_manage_allowed); } } + std::string group_name; + if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) + { + getChildView("GroupCheck")->setEnabled(can_manage_allowed); + } getChildView("AccessList")->setEnabled(can_manage_allowed); S32 allowed_list_count = parcel->mAccessList.size(); getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); @@ -2652,17 +2652,6 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) { return; } - - // If we disabled public access, enable group access by default (if applicable) - BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); - if (public_access == FALSE) - { - std::string group_name; - if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) - { - self->getChild("GroupCheck")->setValue(public_access ? FALSE : TRUE); - } - } onCommitAny(ctrl, userdata); } @@ -2697,7 +2686,6 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) if (public_access) { use_access_list = FALSE; - use_access_group = FALSE; limit_payment = self->getChild("limit_payment")->getValue().asBoolean(); limit_age_verified = self->getChild("limit_age_verified")->getValue().asBoolean(); } -- cgit v1.2.3 From 9167198312ac98f02640ecc3c445fa721413febd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 7 Aug 2013 16:12:29 -0700 Subject: ACME-814 : Disable Post in Photo panel while the preview is processing --- indra/newview/llfloatersocial.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 59db93f4b2..937f76648d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -205,8 +205,8 @@ void LLSocialPhotoPanel::draw() { LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mPostButton->setEnabled(no_ongoing_connection); mCancelButton->setEnabled(no_ongoing_connection); mCaptionTextBox->setEnabled(no_ongoing_connection); mResolutionComboBox->setEnabled(no_ongoing_connection); @@ -247,6 +247,9 @@ void LLSocialPhotoPanel::draw() // Update the visibility of the working (computing preview) label mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate())); + // Enable Post if we have a preview to send and no on going connection being processed + mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate())); + // Draw the rest of the panel on top of it LLPanel::draw(); } -- cgit v1.2.3 From 77baf98d12c75621f8b1d69824abf01b9aa260f7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 7 Aug 2013 18:45:50 -0700 Subject: ACME-820 : Let checkin checkbox be available and swap tile map / default tile when toggling --- indra/newview/llfloatersocial.cpp | 11 +++++------ indra/newview/llfloatersocial.h | 2 +- .../default/textures/icons/map_placeholder.jpg | Bin 25641 -> 12931 bytes .../skins/default/xui/en/panel_social_place.xml | 13 ++++++++++++- 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 937f76648d..66a586b16b 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -499,8 +499,8 @@ BOOL LLSocialCheckinPanel::postBuild() mMessageTextEditor = getChild("place_caption"); mMapLoadingIndicator = getChild("map_loading_indicator"); mMapPlaceholder = getChild("map_placeholder"); + mMapDefault = getChild("map_default"); mMapCheckBox = getChild("add_place_view_cb"); - mMapCheckBoxValue = mMapCheckBox->get(); return LLPanel::postBuild(); } @@ -511,6 +511,7 @@ void LLSocialCheckinPanel::draw() mPostButton->setEnabled(no_ongoing_connection); mCancelButton->setEnabled(no_ongoing_connection); mMessageTextEditor->setEnabled(no_ongoing_connection); + mMapCheckBox->setEnabled(no_ongoing_connection); std::string map_url = get_map_url(); // Did we change location? @@ -524,9 +525,6 @@ void LLSocialCheckinPanel::draw() // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox mMapLoadingIndicator->setVisible(true); mMapPlaceholder->setVisible(false); - mMapCheckBoxValue = mMapCheckBox->get(); - mMapCheckBox->set(false); - mMapCheckBox->setEnabled(false); } // Are we done loading the map tile? if (mReloadingMapTexture && mMapTexture->isFullyLoaded()) @@ -540,9 +538,10 @@ void LLSocialCheckinPanel::draw() // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value mMapLoadingIndicator->setVisible(false); mMapPlaceholder->setVisible(true); - mMapCheckBox->setEnabled(no_ongoing_connection); - mMapCheckBox->set(mMapCheckBoxValue); } + // Show the default icon if that's the checkbox value (the real one...) + // This will hide/show the loading indicator and/or tile underneath + mMapDefault->setVisible(!(mMapCheckBox->get())); LLPanel::draw(); } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index e7ad9ac12e..bbe07c9704 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -110,9 +110,9 @@ private: LLUICtrl* mMessageTextEditor; LLUICtrl* mMapLoadingIndicator; LLIconCtrl* mMapPlaceholder; + LLIconCtrl* mMapDefault; LLCheckBoxCtrl* mMapCheckBox; bool mReloadingMapTexture; - bool mMapCheckBoxValue; }; class LLSocialAccountPanel : public LLPanel diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg index 0cb86c58d3..57204e2261 100644 Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and b/indra/newview/skins/default/textures/icons/map_placeholder.jpg differ diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml index b53a41487a..13e94f6998 100644 --- a/indra/newview/skins/default/xui/en/panel_social_place.xml +++ b/indra/newview/skins/default/xui/en/panel_social_place.xml @@ -71,9 +71,20 @@ visible="true" name="map_placeholder"> + + Date: Thu, 8 Aug 2013 05:24:26 +0300 Subject: MAINT-2847 (Updater notification - message shows as "[[RELEASE_NOTES_FULL_URL] information about this update]") --- indra/newview/skins/default/xui/en/notifications.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index d14aed273d..b0c4ea8407 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3454,7 +3454,7 @@ or you can install it now. name="DownloadBackgroundTip" type="notify"> We have downloaded an update to your [APP_NAME] installation. -Version [VERSION] [[RELEASE_NOTES_FULL_URL] Information about this update] +Version [VERSION] [[INFO_URL] Information about this update] confirm -We have downloaded an update to your [APP_NAME] installation. -Version [VERSION] [[RELEASE_NOTES_FULL_URL] Information about this update] + We have downloaded an update to your [APP_NAME] installation. + Version [VERSION] [[INFO_URL] Information about this update] confirm Date: Thu, 8 Aug 2013 18:57:27 -0700 Subject: ACME-821 : Use 128x128 png for the default tile icon instead of 300x300 jpg --- .../skins/default/textures/icons/map_placeholder.jpg | Bin 12931 -> 0 bytes .../skins/default/textures/icons/map_placeholder.png | Bin 0 -> 7694 bytes indra/newview/skins/default/textures/textures.xml | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.jpg create mode 100644 indra/newview/skins/default/textures/icons/map_placeholder.png (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.jpg b/indra/newview/skins/default/textures/icons/map_placeholder.jpg deleted file mode 100644 index 57204e2261..0000000000 Binary files a/indra/newview/skins/default/textures/icons/map_placeholder.jpg and /dev/null differ diff --git a/indra/newview/skins/default/textures/icons/map_placeholder.png b/indra/newview/skins/default/textures/icons/map_placeholder.png new file mode 100644 index 0000000000..31e457aa75 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/map_placeholder.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4100849f6f..94c187e21a 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -326,7 +326,7 @@ with the same filename but different name - + -- cgit v1.2.3 From fff55ee5d057aeb50b0c7f096ede659ee71bb25e Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 9 Aug 2013 13:21:25 -0700 Subject: ACME-800: Posted to Facebook notifications persist in the open_notifications.xml file per user --- indra/newview/skins/default/xui/en/notifications.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a3592bce4a..46ebdcff54 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5995,7 +5995,6 @@ Please select at least one type of content to search (General, Moderate, or Adul [MESSAGE] -- cgit v1.2.3 From bc1606111478d53456601d8be239b0411f62ae37 Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Fri, 9 Aug 2013 17:11:38 -0700 Subject: Removing rogue debug --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvoicevivox.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3964ea5fac..a4a79d4d97 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13028,7 +13028,7 @@ Type String Value - -1 + 0 VivoxDebugSIPURIHostName diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ff73aa5354..9497041482 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -786,7 +786,6 @@ void LLVivoxVoiceClient::stateMachine() { loglevel = "0"; // turn logging off completely } - loglevel = "0"; // turn logging off completely params.args.add("-ll"); params.args.add(loglevel); params.cwd = gDirUtilp->getAppRODataDir(); -- cgit v1.2.3 From 481abb13812214d7d5f1124f8eb80f1cc1b08c19 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 9 Aug 2013 18:31:10 -0700 Subject: ACME 824: Suggested Friends do not repopulate if you disconnect and reconnect to Facebook API in same viewer session --- indra/newview/llfacebookconnect.cpp | 47 ++++++++++++++++++++++++++++--------- indra/newview/llfacebookconnect.h | 6 ++++- indra/newview/llpanelpeople.cpp | 34 +++++++++++++-------------- 3 files changed, 58 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index bdc17773d7..5551acff0d 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -197,9 +197,11 @@ public: { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - // Clear all facebook stuff - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + // Clear data + LLFacebookConnect::instance().clearInfo(); LLFacebookConnect::instance().clearContent(); + //Notify state change + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); } else { @@ -320,7 +322,9 @@ LLFacebookConnect::LLFacebookConnect() : mConnectionState(FB_NOT_CONNECTED), mConnected(false), mInfo(), - mContent() + mContent(), + mRefreshInfo(false), + mRefreshContent(false) { } @@ -388,18 +392,24 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) void LLFacebookConnect::loadFacebookInfo() { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), - LLSD(), timeout, follow_redirects); + if(mRefreshInfo) + { + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), + LLSD(), timeout, follow_redirects); + } } void LLFacebookConnect::loadFacebookFriends() { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), - LLSD(), timeout, follow_redirects); + if(mRefreshContent) + { + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), + LLSD(), timeout, follow_redirects); + } } void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message) @@ -495,6 +505,8 @@ void LLFacebookConnect::updateStatus(const std::string& message) void LLFacebookConnect::storeInfo(const LLSD& info) { mInfo = info; + mRefreshInfo = false; + sInfoWatcher->post(info); } @@ -503,9 +515,15 @@ const LLSD& LLFacebookConnect::getInfo() const return mInfo; } +void LLFacebookConnect::clearInfo() +{ + mInfo = LLSD(); +} + void LLFacebookConnect::storeContent(const LLSD& content) { mContent = content; + mRefreshContent = false; sContentWatcher->post(content); } @@ -520,11 +538,18 @@ void LLFacebookConnect::clearContent() mContent = LLSD(); } +void LLFacebookConnect::setDataDirty() +{ + mRefreshInfo = true; + mRefreshContent = true; +} + void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState connection_state) { if(connection_state == FB_CONNECTED) { setConnected(true); + setDataDirty(); } else if(connection_state == FB_NOT_CONNECTED) { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 0f005cbe24..77c26842de 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -69,9 +69,11 @@ public: void storeInfo(const LLSD& info); const LLSD& getInfo() const; - void clearContent(); + void clearInfo(); void storeContent(const LLSD& content); const LLSD& getContent() const; + void clearContent(); + void setDataDirty(); void setConnectionState(EConnectionState connection_state); void setConnected(bool connected); @@ -92,6 +94,8 @@ private: BOOL mConnected; LLSD mInfo; LLSD mContent; + bool mRefreshInfo; + bool mRefreshContent; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 1786f73a8b..72953ec6d3 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -835,12 +835,16 @@ void LLPanelPeople::updateRecentList() bool LLPanelPeople::onConnectedToFacebook(const LLSD& data) { - if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); + LLSD::Integer connection_state = data.get("enum").asInteger(); + if (connection_state == LLFacebookConnect::FB_CONNECTED) + { LLFacebookConnect::instance().loadFacebookFriends(); } + else if(connection_state == LLFacebookConnect::FB_NOT_CONNECTED) + { + updateSuggestedFriendList(); + }; return false; } @@ -852,21 +856,16 @@ void LLPanelPeople::updateFacebookList(bool visible) LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); // just in case it is already listening LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLPanelPeople", boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); - if (mTryToConnectToFbc) - { - // try to reconnect to facebook! - if (LLFacebookConnect::instance().isConnected()) - { - LLFacebookConnect::instance().loadFacebookFriends(); - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); - LLFacebookConnect::instance().checkConnectionToFacebook(); - } + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); - // don't try again + if (LLFacebookConnect::instance().isConnected()) + { + LLFacebookConnect::instance().loadFacebookFriends(); + } + else if(mTryToConnectToFbc) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); mTryToConnectToFbc = false; } @@ -874,6 +873,7 @@ void LLPanelPeople::updateFacebookList(bool visible) } else { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLPanelPeople"); } } -- cgit v1.2.3 From 5eba8063a7dfdde77b4e3c8054c51ab91b96dd70 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Mon, 12 Aug 2013 21:42:52 +0300 Subject: MAINT-2175 FIXED 'Pay Resident' floater is not opened after clicking on 'Pay' button in Object profile --- indra/newview/llsidepaneltaskinfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index ad7c939728..9be6d0c5f1 100755 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -1170,6 +1170,10 @@ void LLSidepanelTaskInfo::doClickAction(U8 click_action) // Warn, but do it anyway. LLNotificationsUtil::add("ClickActionNotPayable"); } + else + { + handle_give_money_dialog(); + } } LLSelectMgr::getInstance()->selectionSetClickAction(click_action); } -- cgit v1.2.3 From 457e06e9e764b27ce6f4f8bd97882a5b32f45dc7 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Mon, 12 Aug 2013 19:35:20 +0300 Subject: MAINT-2883 FIXED World Map - Land For Sale is missing L$ / sqm --- indra/newview/llworldmap.cpp | 7 +++++++ indra/newview/skins/default/xui/en/strings.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 5fa380e0e3..fd9cdd95a3 100755 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -518,10 +518,17 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& case MAP_ITEM_LAND_FOR_SALE: // land for sale case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale { + F32 cost_per_sqm = 0.0f; + if ((F32)extra > 0) + { + cost_per_sqm = (F32)extra2 / (F32)extra; + } + static LLUIString tooltip_fmt = LLTrans::getString("worldmap_item_tooltip_format"); tooltip_fmt.setArg("[AREA]", llformat("%d", extra)); tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2)); + tooltip_fmt.setArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); new_item.setTooltip(tooltip_fmt.getString()); if (type == MAP_ITEM_LAND_FOR_SALE) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index fb1846860c..d4a37a9813 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -378,7 +378,7 @@ Please try logging in again in a minute. Loading... Offline - [AREA] m² L$[PRICE] + [AREA] m² L$[PRICE] (L$[PRICE_PER_SQM]/m²) None found. -- cgit v1.2.3 From 91c9cc4c33f68f4f39e23763317a76ccb573c38b Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 12 Aug 2013 11:09:05 -0700 Subject: Save SL NVAPI profile only when changes have been made. --- indra/newview/llappviewerwin32.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 3cf3c739d9..80a80f4298 100755 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -172,21 +172,20 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) nvapi_error(status); return; } + + // (5) Now we apply (or save) our changes to the system + status = NvAPI_DRS_SaveSettings(hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } } else if (status != NVAPI_OK) { nvapi_error(status); return; } - - - - // (5) Now we apply (or save) our changes to the system - status = NvAPI_DRS_SaveSettings(hSession); - if (status != NVAPI_OK) - { - nvapi_error(status); - } } //#define DEBUGGING_SEH_FILTER 1 -- cgit v1.2.3 From d0e964289ec9888686619c4edd756edd622ca214 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 13 Aug 2013 01:47:20 +0100 Subject: added read_from_master parameter for ACME-829 --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfacebookconnect.cpp | 35 +++++++++++++++++++++------------ indra/newview/llfacebookconnect.h | 3 ++- 3 files changed, 25 insertions(+), 15 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 20919adc76..bebd1fd9e8 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3465,7 +3465,7 @@ Type String Value - http://pdp15.lindenlab.com + FastCacheFetchEnabled diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 5551acff0d..0a4fefbd24 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -119,7 +119,6 @@ public: { LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL; - // Grab some graph data now that we are connected LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED); } else if (status != 302) @@ -324,7 +323,8 @@ LLFacebookConnect::LLFacebookConnect() mInfo(), mContent(), mRefreshInfo(false), - mRefreshContent(false) + mRefreshContent(false), + mReadFromMaster(false) { } @@ -346,7 +346,7 @@ void LLFacebookConnect::openFacebookWeb(std::string url) //LLUrlAction::openURLExternal(url); } -std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) +std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); @@ -363,6 +363,10 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route) //End removable part std::string url = sFacebookConnectUrl + route; + if (include_read_from_master && mReadFromMaster) + { + url += "?read_from_master=true"; + } return url; } @@ -384,10 +388,10 @@ void LLFacebookConnect::disconnectFromFacebook() void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) { - const bool follow_redirects = false; - const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect), - LLSD(), timeout, follow_redirects); + const bool follow_redirects = false; + const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + LLHTTPClient::get(getFacebookConnectURL("/connection", true), new LLFacebookConnectedResponder(auto_connect), + LLSD(), timeout, follow_redirects); } void LLFacebookConnect::loadFacebookInfo() @@ -396,7 +400,7 @@ void LLFacebookConnect::loadFacebookInfo() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/info"), new LLFacebookInfoResponder(), + LLHTTPClient::get(getFacebookConnectURL("/info", true), new LLFacebookInfoResponder(), LLSD(), timeout, follow_redirects); } } @@ -407,7 +411,7 @@ void LLFacebookConnect::loadFacebookFriends() { const bool follow_redirects = false; const F32 timeout = HTTP_REQUEST_EXPIRY_SECS; - LLHTTPClient::get(getFacebookConnectURL("/friends"), new LLFacebookFriendsResponder(), + LLHTTPClient::get(getFacebookConnectURL("/friends", true), new LLFacebookFriendsResponder(), LLSD(), timeout, follow_redirects); } } @@ -427,7 +431,7 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/checkin"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/checkin", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) @@ -437,7 +441,7 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri body["caption"] = caption; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/photo"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/photo", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::sharePhoto(LLPointer image, const std::string& caption) @@ -490,7 +494,7 @@ void LLFacebookConnect::sharePhoto(LLPointer image, const std: memcpy(data, body.str().data(), size); // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo"), data, size, new LLFacebookShareResponder(), headers); + LLHTTPClient::postRaw(getFacebookConnectURL("/share/photo", true), data, size, new LLFacebookShareResponder(), headers); } void LLFacebookConnect::updateStatus(const std::string& message) @@ -499,7 +503,7 @@ void LLFacebookConnect::updateStatus(const std::string& message) body["message"] = message; // Note: we can use that route for different publish action. We should be able to use the same responder. - LLHTTPClient::post(getFacebookConnectURL("/share/wall"), body, new LLFacebookShareResponder()); + LLHTTPClient::post(getFacebookConnectURL("/share/wall", true), body, new LLFacebookShareResponder()); } void LLFacebookConnect::storeInfo(const LLSD& info) @@ -548,6 +552,7 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { if(connection_state == FB_CONNECTED) { + mReadFromMaster = true; setConnected(true); setDataDirty(); } @@ -555,6 +560,10 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c { setConnected(false); } + else if(connection_state == FB_POSTED) + { + mReadFromMaster = false; + } if (mConnectionState != connection_state) { diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 77c26842de..a77ac24167 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -88,7 +88,7 @@ private: LLFacebookConnect(); ~LLFacebookConnect() {}; - std::string getFacebookConnectURL(const std::string& route = ""); + std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false); EConnectionState mConnectionState; BOOL mConnected; @@ -96,6 +96,7 @@ private: LLSD mContent; bool mRefreshInfo; bool mRefreshContent; + bool mReadFromMaster; static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sInfoWatcher; -- cgit v1.2.3 From abc2abf45dbe69daa0130ad823ca7184acc9d8df Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 12 Aug 2013 20:26:33 -0700 Subject: ACME-820 : Use the LL hosted default image for the default map tile in checkin --- indra/newview/llfloatersocial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 66a586b16b..4c17d9e40d 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -54,7 +54,7 @@ static LLRegisterPanelClassWrapper t_panel_account("llsoci const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; -const std::string DEFAULT_CHECKIN_ICON_URL = "http://logok.org/wp-content/uploads/2010/07/podcastlogo1.jpg"; +const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; std::string get_map_url() { -- cgit v1.2.3 From 926d0ad81e85852872be63190e1553af084e4641 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 13 Aug 2013 19:22:35 +0300 Subject: MAINT-2861 FIXED llAdjustSoundVolume causes animated textures on same object to reset to first frame --- indra/newview/llvovolume.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index dd161f84c1..ed2b18b822 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -334,15 +334,9 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, if (!mTextureAnimp) { mTextureAnimp = new LLViewerTextureAnim(this); + mTexAnimMode = 0; } - else - { - if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH)) - { - mTextureAnimp->reset(); - } - } - mTexAnimMode = 0; + mTextureAnimp->unpackTAMessage(mesgsys, block_num); } else -- cgit v1.2.3 From c775ae7cbd92099ee7a71c219a1b4b9ff7e7d82f Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 26 Sep 2013 18:53:12 -0700 Subject: MAINT-3155 add cocoa equiv for former AppleEventManager shenanigans for SLURL handling --- indra/newview/llappdelegate-objc.mm | 13 +++++++++ indra/newview/llappviewermacosx.cpp | 53 +++++++++++++------------------------ 2 files changed, 31 insertions(+), 35 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 30476b3d22..91251ed7c0 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -54,6 +54,19 @@ } [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; + + [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; +} + +- (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + NSString *url= nil; + url = [[[[NSAppleEventManager sharedAppleEventManager]// 1 + currentAppleEvent]// 2 + paramDescriptorForKeyword:keyDirectObject]// 3 + stringValue];// 4 + + const char* url_utf8 = [url UTF8String]; + handleUrl(url_utf8); } - (void) applicationDidBecomeActive:(NSNotification *)notification diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 316c90d9d2..2723f0b90d 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -483,41 +483,24 @@ bool LLAppViewerMacOSX::getMasterSystemAudioMute() return (mute != 0); } -OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) +void handleUrl(const char* url_utf8) { - OSErr result = noErr; - DescType actualType; - char buffer[1024]; // Flawfinder: ignore - Size size; - - result = AEGetParamPtr ( - messagein, - keyDirectObject, - typeCString, - &actualType, - (Ptr)buffer, - sizeof(buffer), - &size); - - if(result == noErr) - { - std::string url = buffer; + if (url_utf8) + { + std::string url = url_utf8; + // Safari 3.2 silently mangles secondlife:///app/ URLs into + // secondlife:/app/ (only one leading slash). + // Fix them up to meet the URL specification. JC + const std::string prefix = "secondlife:/app/"; + std::string test_prefix = url.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + if (test_prefix == prefix) + { + url.replace(0, prefix.length(), "secondlife:///app/"); + } - // Safari 3.2 silently mangles secondlife:///app/ URLs into - // secondlife:/app/ (only one leading slash). - // Fix them up to meet the URL specification. JC - const std::string prefix = "secondlife:/app/"; - std::string test_prefix = url.substr(0, prefix.length()); - LLStringUtil::toLower(test_prefix); - if (test_prefix == prefix) - { - url.replace(0, prefix.length(), "secondlife:///app/"); - } - - LLMediaCtrl* web = NULL; - const bool trusted_browser = false; - LLURLDispatcher::dispatch(url, "", web, trusted_browser); - } - - return(result); + LLMediaCtrl* web = NULL; + const bool trusted_browser = false; + LLURLDispatcher::dispatch(url, "", web, trusted_browser); + } } -- cgit v1.2.3 From 942369270415fd1cdffb213e0c18038ba6e127c7 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 30 Sep 2013 11:41:16 +0300 Subject: MAINT-3193 FIXED crash with LLControlCache::LLControlCache: Control named RenderAutoMuteLoggingnot found. --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 5780268acb..9e3225a264 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -393,6 +393,6 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg // static bool LLAvatarRenderInfoAccountant::logRenderInfo() { - static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging"); + static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); return render_mute_logging_enabled; } -- cgit v1.2.3 From f0a80bb49b43e8e6e2a53194f558c3385ba3214e Mon Sep 17 00:00:00 2001 From: PavelK ProductEngine Date: Fri, 6 Sep 2013 17:48:48 +0300 Subject: MAINT-3030 [CHUIBUG]Conversations pane has alignment issues when collapsed --- indra/newview/llfloaterimcontainer.cpp | 4 ++-- indra/newview/skins/default/xui/en/floater_im_container.xml | 8 ++++---- .../newview/skins/default/xui/en/panel_conversation_list_item.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f26cb477ee..aa3bec878a 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -790,8 +790,8 @@ void LLFloaterIMContainer::collapseConversationsPane(bool collapse, bool save_is mConversationsPane->setTargetDim(gSavedPerAccountSettings.getS32("ConversationsListPaneWidth")); } - S32 delta_width = - gSavedPerAccountSettings.getS32("ConversationsListPaneWidth") - mConversationsPane->getMinDim(); + S32 delta_width = gSavedPerAccountSettings.getS32("ConversationsListPaneWidth") + - mConversationsPane->getMinDim() - mConversationsStack->getPanelSpacing() + 1; reshapeFloaterAndSetResizeLimits(collapse, delta_width); diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 1215efb7f9..b639d534c3 100755 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -41,7 +41,7 @@ auto_resize="false" user_resize="true" name="conversations_layout_panel" - min_dim="38" + min_dim="43" expanded_min_dim="136"> + width="36"> - \ No newline at end of file + -- cgit v1.2.3 From 0e116741a050ca1525a4faa2696b5c318d31bc06 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Oct 2013 18:00:11 -0500 Subject: MAINT-2968 Fix for crash on AMD hardware running current drivers. --- indra/newview/llspatialpartition.cpp | 31 +++++++++++++++---------------- indra/newview/llvoavatar.cpp | 6 +++--- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/pipeline.cpp | 12 ++++++------ 4 files changed, 25 insertions(+), 26 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d7ae897604..768c9d069f 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -89,28 +89,17 @@ class LLOcclusionQueryPool : public LLGLNamePool public: LLOcclusionQueryPool() { - mCurQuery = 1; + } protected: - std::list mAvailableName; - GLuint mCurQuery; - virtual GLuint allocateName() { GLuint ret = 0; - if (!mAvailableName.empty()) - { - ret = mAvailableName.front(); - mAvailableName.pop_front(); - } - else - { - ret = mCurQuery++; - } - + glGenQueriesARB(1, &ret); + return ret; } @@ -119,8 +108,7 @@ protected: #if LL_TRACK_PENDING_OCCLUSION_QUERIES LLSpatialGroup::sPendingQueries.erase(name); #endif - llassert(std::find(mAvailableName.begin(), mAvailableName.end(), name) == mAvailableName.end()); - mAvailableName.push_back(name); + glDeleteQueriesARB(1, &name); } }; @@ -4133,6 +4121,11 @@ void renderAvatarCollisionVolumes(LLVOAvatar* avatar) avatar->renderCollisionVolumes(); } +void renderAvatarJoints(LLVOAvatar* avatar) +{ + avatar->renderJoints(); +} + void renderAgentTarget(LLVOAvatar* avatar) { // render these for self only (why, i don't know) @@ -4290,6 +4283,11 @@ public: renderAvatarCollisionVolumes(avatar); } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_JOINTS)) + { + renderAvatarJoints(avatar); + } + if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) { renderAgentTarget(avatar); @@ -4573,6 +4571,7 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | + LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d449efb7e7..fe035a0a7f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -934,7 +934,7 @@ void LLVOAvatar::deleteLayerSetCaches(bool clearAll) } if (mBakedTextureDatas[i].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); + LLImageGL::deleteTextures(1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName)); mBakedTextureDatas[i].mMaskTexName = 0 ; } } @@ -7272,7 +7272,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture } U32 gl_name; - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &gl_name ); + LLImageGL::generateTextures(1, &gl_name ); stop_glerror(); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); @@ -7309,7 +7309,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture maskData->mLastDiscardLevel = discard_level; if (self->mBakedTextureDatas[baked_index].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); + LLImageGL::deleteTextures(1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); } self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name; found_texture_id = true; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 15628d5ab2..9ce99444d9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3066,7 +3066,7 @@ void LLVOAvatarSelf::deleteScratchTextures() namep; namep = sScratchTexNames.getNextData() ) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, (U32 *)namep ); + LLImageGL::deleteTextures(1, (U32 *)namep ); stop_glerror(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b0c73d0304..5da8a78b1b 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1198,13 +1198,13 @@ void LLPipeline::releaseGLBuffers() if (mNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 0, 1, &mNoiseMap); + LLImageGL::deleteTextures(1, &mNoiseMap); mNoiseMap = 0; } if (mTrueNoiseMap) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 0, 1, &mTrueNoiseMap); + LLImageGL::deleteTextures(1, &mTrueNoiseMap); mTrueNoiseMap = 0; } @@ -1229,7 +1229,7 @@ void LLPipeline::releaseLUTBuffers() { if (mLightFunc) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 0, 1, &mLightFunc); + LLImageGL::deleteTextures(1, &mLightFunc); mLightFunc = 0; } } @@ -1323,7 +1323,7 @@ void LLPipeline::createGLBuffers() noise[i].mV[2] = ll_frand()*scaler+1.f-scaler/2.f; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mNoiseMap); + LLImageGL::generateTextures(1, &mNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB, GL_FLOAT, noise, false); @@ -1339,7 +1339,7 @@ void LLPipeline::createGLBuffers() noise[i] = ll_frand()*2.0-1.0; } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_RGB16F_ARB, 1, &mTrueNoiseMap); + LLImageGL::generateTextures(1, &mTrueNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mTrueNoiseMap); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB,GL_FLOAT, noise, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); @@ -1452,7 +1452,7 @@ void LLPipeline::createLUTBuffers() // pix_format = GL_R32F; #endif - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); + LLImageGL::generateTextures(1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); //LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_UNSIGNED_BYTE, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls, false); -- cgit v1.2.3 From 929311869b028bcb34ad94a84f1c844fcd108f40 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 11 Oct 2013 17:10:26 -0500 Subject: MAINT-2968 Transplant cleanup. --- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llspatialpartition.cpp | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ba8c449c3d..f622d5a63a 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -697,7 +697,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - gPipeline.bindDeferredShader(*sVertexProgram); + sVertexProgram->bind(); sVertexProgram->setMinimumAlpha(0.01f); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 768c9d069f..00eb0c1ab1 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4121,11 +4121,6 @@ void renderAvatarCollisionVolumes(LLVOAvatar* avatar) avatar->renderCollisionVolumes(); } -void renderAvatarJoints(LLVOAvatar* avatar) -{ - avatar->renderJoints(); -} - void renderAgentTarget(LLVOAvatar* avatar) { // render these for self only (why, i don't know) @@ -4283,11 +4278,6 @@ public: renderAvatarCollisionVolumes(avatar); } - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_JOINTS)) - { - renderAvatarJoints(avatar); - } - if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET)) { renderAgentTarget(avatar); @@ -4571,7 +4561,6 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | - LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | -- cgit v1.2.3 From c7057c141c38492bfdc2bfe9d82de97a7364f01b Mon Sep 17 00:00:00 2001 From: "oz@lindenlab.com" Date: Wed, 16 Oct 2013 17:16:25 -0400 Subject: increment viewer version to 3.6.9 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 424e1794de..cff2619cfb 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.8 +3.6.9 -- cgit v1.2.3 From 2f0d9b78d28deba58988012a9940cb4f232ec2f9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 16 Oct 2013 15:49:14 -0700 Subject: Fix merge error in llvoavatar --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e343481b32..fe035a0a7f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7272,7 +7272,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture } U32 gl_name; - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &gl_name ); + LLImageGL::generateTextures(1, &gl_name ); stop_glerror(); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name); @@ -7309,7 +7309,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture maskData->mLastDiscardLevel = discard_level; if (self->mBakedTextureDatas[baked_index].mMaskTexName) { - LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); + LLImageGL::deleteTextures(1, &(self->mBakedTextureDatas[baked_index].mMaskTexName)); } self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name; found_texture_id = true; -- cgit v1.2.3 From ea1e1b0925b386cf83178539b8eae9e25c573548 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 23 Oct 2013 12:15:35 -0400 Subject: increment viewer version to 3.6.10 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index cff2619cfb..c47e8b5872 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.9 +3.6.10 -- cgit v1.2.3 From d4e622daf2775147c75a75389ffb9b55f8cef799 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 25 Oct 2013 11:16:44 -0700 Subject: MAINT-3356 GPU Table update to support Retina MBP 'Intel Iris OpenGL Engine' driver id on Mavericks. --- indra/newview/gpu_table.txt | 1 + indra/newview/tests/gpus_results.txt | 1 + indra/newview/tests/gpus_seen.txt | 1 + 3 files changed, 3 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 0acdf9661a..86969475c6 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -325,6 +325,7 @@ Intel HD Graphics 4600 .*Intel.*HD Graphics 46.* 3 1 0 4.2 Intel HD Graphics 4000 .*Intel.*HD Graphics 4.* 3 1 1 4.2 Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 4 1 0 4 Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 4 1 0 4 +Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 4 1 0 4 Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 4 1 0 4 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 1 4 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 1 2.1 diff --git a/indra/newview/tests/gpus_results.txt b/indra/newview/tests/gpus_results.txt index 5ffbc0a9e5..106593afd5 100755 --- a/indra/newview/tests/gpus_results.txt +++ b/indra/newview/tests/gpus_results.txt @@ -1444,6 +1444,7 @@ Intel Intel(R) HD Graphics Family Intel Intel(R) HD Graphics P3000 supported 2 1 4 Intel HD Graphics Intel Intel(R) HD Graphics P4000 supported 2 1 4 Intel HD Graphics Intel Intel(R) Q45/Q43 Express Chipset supported 1 1 2.1 Intel Q45/Q43 +Intel Iris OpenGL Graphics Engine supported 4 0 4 Intel Intel Iris OpenGL Engine Intel Mobile 4 Series supported 0 1 2.1 Intel Mobile 4 Series Intel Mobile Intel(R) 4 Series Express Chipset Family supported 0 1 2.1 Intel Mobile 4 Series Intel Mobile Intel(R) 4 Series Express Chipset Family v2 supported 0 1 2.1 Intel Mobile 4 Series diff --git a/indra/newview/tests/gpus_seen.txt b/indra/newview/tests/gpus_seen.txt index f44aa56cbd..a417cb3761 100755 --- a/indra/newview/tests/gpus_seen.txt +++ b/indra/newview/tests/gpus_seen.txt @@ -1908,6 +1908,7 @@ Intel Intel(R) HD Graphics P3000 Intel Intel(R) HD Graphics P4000 Intel Intel(R) Q45/Q43 Express Chipset Intel Intel(R) Q45/Q43 Express Chipset +Intel Iris OpenGL Graphics Engine Intel Mobile 4 Series Intel Mobile Intel(R) 4 Series Express Chipset Family Intel Mobile Intel(R) 4 Series Express Chipset Family -- cgit v1.2.3 From 970ee73e9a9cd1c94c295c9decb4d632886c19e6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 25 Oct 2013 11:48:43 -0700 Subject: Fix release merge issues (included upstream changes not yet in release from bear) --- indra/newview/app_settings/commands.xml | 7 - indra/newview/app_settings/settings.xml | 13 +- .../newview/app_settings/settings_per_account.xml | 11 -- .../shaders/class1/avatar/avatarSkinV.glsl | 6 +- .../shaders/class1/avatar/objectSkinV.glsl | 3 - indra/newview/llagent.cpp | 10 +- indra/newview/llblocklist.cpp | 110 +++------------ indra/newview/llblocklist.h | 21 +-- indra/newview/llchathistory.cpp | 156 +++------------------ indra/newview/llface.cpp | 1 + indra/newview/llface.h | 3 +- indra/newview/llfasttimerview.cpp | 2 +- indra/newview/llfasttimerview.h | 2 +- indra/newview/llfilepicker.cpp | 69 +-------- indra/newview/llfilepicker.h | 3 - indra/newview/llfloaterconversationpreview.cpp | 29 ++-- indra/newview/llfloaterconversationpreview.h | 2 +- indra/newview/llfloatergroupinvite.cpp | 6 - indra/newview/llfloaterimcontainer.cpp | 43 ++---- indra/newview/llfloaterimcontainer.h | 3 +- indra/newview/llfloaterimnearbychat.cpp | 7 +- indra/newview/llfloaterimnearbychat.h | 2 +- indra/newview/llfloaterimsession.cpp | 2 +- indra/newview/llfloaterimsession.h | 2 +- indra/newview/llfloaterland.cpp | 30 ++-- indra/newview/llfloatersidepanelcontainer.cpp | 2 +- indra/newview/llfloatersidepanelcontainer.h | 2 +- indra/newview/llmutelist.cpp | 17 --- indra/newview/llmutelist.h | 2 - indra/newview/llpanelmaininventory.cpp | 7 - indra/newview/llpanelmaininventory.h | 3 - indra/newview/llpersistentnotificationstorage.cpp | 25 +--- indra/newview/llpreviewtexture.cpp | 22 +-- indra/newview/llsceneview.cpp | 2 +- indra/newview/llsceneview.h | 2 +- indra/newview/llsidepanelinventory.cpp | 2 +- indra/newview/llsidepaneltaskinfo.cpp | 4 - indra/newview/lltoast.cpp | 2 +- indra/newview/lltoastnotifypanel.h | 2 - indra/newview/lltoastpanel.cpp | 6 - indra/newview/lltoastpanel.h | 1 - indra/newview/llviewermessage.cpp | 103 +++++++------- indra/newview/llviewerobjectlist.cpp | 34 +++-- indra/newview/llvoicevivox.cpp | 1 + indra/newview/llvovolume.cpp | 33 ++++- indra/newview/llworld.cpp | 9 -- indra/newview/skins/default/textures/textures.xml | 1 - .../skins/default/xui/en/menu_avatar_icon.xml | 70 +-------- .../skins/default/xui/en/panel_navigation_bar.xml | 3 - indra/newview/skins/default/xui/en/strings.xml | 2 - .../skins/default/xui/en/widgets/tab_container.xml | 12 +- 51 files changed, 235 insertions(+), 677 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 6a33ce105d..60c942094a 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -13,7 +13,6 @@ Value 1.6 - MaxPersistentNotifications - - Comment - Maximum amount of persistent notifications - Persist - 1 - Type - S32 - Value - 250 - MaxSelectDistance Comment @@ -13345,7 +13334,7 @@ Type String Value - 0 + -1 VivoxDebugSIPURIHostName diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 500151c935..636caf5ef3 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -77,17 +77,6 @@ Value 412 - ConversationsParticipantListCollapsed - - Comment - Stores the expanded/collapsed state of Nearby chat participant list - Persist - 1 - Type - Boolean - Value - true - InstantMessageLogPath Comment diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index 3df4d333ce..c98e7d1cd3 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -31,11 +31,9 @@ uniform vec4 matrixPalette[45]; mat4 getSkinnedTransform() { mat4 ret; - - float x = fract(weight.x); int i = int(floor(weight.x)); - i = min(i, 15); - i = max(i, 0); + float x = fract(weight.x); + ret[0] = mix(matrixPalette[i+0], matrixPalette[i+1], x); ret[1] = mix(matrixPalette[i+15],matrixPalette[i+16], x); ret[2] = mix(matrixPalette[i+30],matrixPalette[i+31], x); diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 12996cf0d6..271947b2dd 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -35,9 +35,6 @@ mat4 getObjectSkinnedTransform() vec4 w = fract(weight4); vec4 index = floor(weight4); - index = min(index, vec4(31.0)); - index = max(index, vec4( 0.0)); - float scale = 1.0/(w.x+w.y+w.z+w.w); w *= scale; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 325707bbf1..9cee0aa867 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1092,18 +1092,10 @@ const LLVector3d &LLAgent::getPositionGlobal() const //----------------------------------------------------------------------------- const LLVector3 &LLAgent::getPositionAgent() { - if (isAgentAvatarValid()) - { - if(gAgentAvatarp->mDrawable.isNull()) - { - mFrameAgent.setOrigin(gAgentAvatarp->getPositionAgent()); - } - else + if (isAgentAvatarValid() && !gAgentAvatarp->mDrawable.isNull()) { mFrameAgent.setOrigin(gAgentAvatarp->getRenderPosition()); } - } - return mFrameAgent.getOrigin(); } diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index ac41b26a34..066cb71677 100755 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -41,14 +41,10 @@ static const LLBlockListNameTypeComparator NAME_TYPE_COMPARATOR; LLBlockList::LLBlockList(const Params& p) : LLFlatListViewEx(p), mSelectedItem(NULL), - mDirty(true), - mShouldAddAll(true), - mActionType(NONE), - mMuteListSize(0) + mDirty(true) { LLMuteList::getInstance()->addObserver(this); - mMuteListSize = LLMuteList::getInstance()->getMutes().size(); // Set up context menu. LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -77,41 +73,6 @@ LLBlockList::~LLBlockList() LLMuteList::getInstance()->removeObserver(this); } -void LLBlockList::createList() -{ - std::vector mutes = LLMuteList::instance().getMutes(); - std::vector::const_iterator mute_it = mutes.begin(); - - for (; mute_it != mutes.end(); ++mute_it) - { - addNewItem(&*mute_it); - } -} - -BlockListActionType LLBlockList::getCurrentMuteListActionType() -{ - BlockListActionType type = NONE; - U32 curSize = LLMuteList::getInstance()->getMutes().size(); - if( curSize > mMuteListSize) - type = ADD; - else if(curSize < mMuteListSize) - type = REMOVE; - - return type; -} - -void LLBlockList::onChangeDetailed(const LLMute &mute) -{ - mActionType = getCurrentMuteListActionType(); - - mCurItemId = mute.mID; - mCurItemName = mute.mName; - mCurItemType = mute.mType; - mCurItemFlags = mute.mFlags; - - refresh(); -} - BOOL LLBlockList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); @@ -127,16 +88,6 @@ BOOL LLBlockList::handleRightMouseDown(S32 x, S32 y, MASK mask) return handled; } -void LLBlockList::removeListItem(const LLMute* mute) -{ - removeItemByUUID(mute->mID); -} - -void LLBlockList::hideListItem(LLBlockedListItem* item, bool show) -{ - item->setVisible(show); -} - void LLBlockList::setNameFilter(const std::string& filter) { std::string filter_upper = filter; @@ -185,56 +136,28 @@ void LLBlockList::refresh() bool have_filter = !mNameFilter.empty(); // save selection to restore it after list rebuilt - LLUUID selected = getSelectedUUID(), next_selected; + LLUUID selected = getSelectedUUID(); - if(mShouldAddAll) // creating list of blockers + // calling refresh may be initiated by removing currently selected item + // so select next item and save the selection to restore it after list rebuilt + if (!selectNextItemPair(false, true)) { - clear(); - createList(); - mShouldAddAll = false; - } - else - { - // handle remove/add functionality - LLMute mute(mCurItemId, mCurItemName, mCurItemType, mCurItemFlags); - if(mActionType == ADD) - { - addNewItem(&mute); - } - else if(mActionType == REMOVE) - { - if(selected == mute.mID) - { - // we are going to remove currently selected item, so select next item and save the selection to restore it - if (!selectNextItemPair(false, true)) - { - selectNextItemPair(true, true); - } - next_selected = getSelectedUUID(); - } - removeListItem(&mute); - } - mActionType = NONE; + selectNextItemPair(true, true); } + LLUUID next_selected = getSelectedUUID(); + + clear(); + + std::vector mutes = LLMuteList::instance().getMutes(); + std::vector::const_iterator mute_it = mutes.begin(); - // handle filter functionality - if(have_filter || (!have_filter && !mPrevNameFilter.empty())) + for (; mute_it != mutes.end(); ++mute_it) { - // we should update visibility of our items if previous filter was not empty - std::vector < LLPanel* > allItems; - getItems(allItems); - std::vector < LLPanel* >::iterator it = allItems.begin(); + if (have_filter && !findInsensitive(mute_it->mName, mNameFilter)) + continue; - for(; it != allItems.end() ; ++it) - { - LLBlockedListItem * curItem = dynamic_cast (*it); - if(curItem) - { - hideListItem(curItem, findInsensitive(curItem->getName(), mNameFilter)); - } - } + addNewItem(&*mute_it); } - mPrevNameFilter = mNameFilter; if (getItemPair(selected)) { @@ -246,7 +169,6 @@ void LLBlockList::refresh() // previously selected item was removed, so select next item selectItemPair(getItemPair(next_selected), true); } - mMuteListSize = LLMuteList::getInstance()->getMutes().size(); // Sort the list. sort(); diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index b1ea7e98e5..1a215710f4 100755 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -34,8 +34,6 @@ class LLBlockedListItem; class LLMute; -enum BlockListActionType {NONE, ADD, REMOVE}; - /** * List of blocked avatars and objects. * This list represents contents of the LLMuteList. @@ -58,8 +56,7 @@ public: LLToggleableMenu* getContextMenu() const { return mContextMenu.get(); } LLBlockedListItem* getBlockedItem() const; - virtual void onChange() { } - virtual void onChangeDetailed(const LLMute& ); + virtual void onChange() { refresh(); } virtual void draw(); void setNameFilter(const std::string& filter); @@ -70,32 +67,18 @@ public: private: void addNewItem(const LLMute* mute); - void removeListItem(const LLMute* mute); - void hideListItem(LLBlockedListItem* item, bool show); void setDirty(bool dirty = true) { mDirty = dirty; } bool findInsensitive(std::string haystack, const std::string& needle_upper); bool isActionEnabled(const LLSD& userdata); void onCustomAction (const LLSD& userdata); - void createList(); - BlockListActionType getCurrentMuteListActionType(); - + LLHandle mContextMenu; LLBlockedListItem* mSelectedItem; std::string mNameFilter; bool mDirty; - bool mShouldAddAll; - BlockListActionType mActionType; - U32 mMuteListSize; - - // This data is used to save information about item that currently changed(added or removed) - LLUUID mCurItemId; - std::string mCurItemName; - LLMute::EType mCurItemType; - U32 mCurItemFlags; - std::string mPrevNameFilter; }; diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ae0ac57e76..43a733f918 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -60,8 +60,6 @@ #include "llstring.h" #include "llurlaction.h" #include "llviewercontrol.h" -#include "llviewerobjectlist.h" -#include "llmutelist.h" static LLDefaultChildRegistry::Register r("chat_history"); @@ -183,18 +181,6 @@ public: { LLAvatarActions::startIM(getAvatarId()); } - else if (level == "teleport") - { - LLAvatarActions::offerTeleport(getAvatarId()); - } - else if (level == "voice_call") - { - LLAvatarActions::startCall(getAvatarId()); - } - else if (level == "chat_history") - { - LLAvatarActions::viewChatHistory(getAvatarId()); - } else if (level == "add") { LLAvatarActions::requestFriendshipDialog(getAvatarId(), mFrom); @@ -203,75 +189,13 @@ public: { LLAvatarActions::removeFriendDialog(getAvatarId()); } - else if (level == "invite_to_group") - { - LLAvatarActions::inviteToGroup(getAvatarId()); - } - else if (level == "zoom_in") - { - handle_zoom_to_object(getAvatarId()); - } - else if (level == "map") - { - LLAvatarActions::showOnMap(getAvatarId()); - } - else if (level == "share") - { - LLAvatarActions::share(getAvatarId()); - } - else if (level == "pay") - { - LLAvatarActions::pay(getAvatarId()); - } - else if(level == "block_unblock") - { - mute(getAvatarId(), LLMute::flagVoiceChat); - } - else if(level == "mute_unmute") - { - mute(getAvatarId(), LLMute::flagTextChat); - } - } - - bool onAvatarIconContextMenuItemChecked(const LLSD& userdata) - { - std::string level = userdata.asString(); - - if (level == "is_blocked") - { - return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagVoiceChat); - } - if (level == "is_muted") - { - return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagTextChat); - } - return false; - } - - void mute(const LLUUID& participant_id, U32 flags) - { - BOOL is_muted = LLMuteList::getInstance()->isMuted(participant_id, flags); - std::string name; - gCacheName->getFullName(participant_id, name); - LLMute mute(participant_id, name, LLMute::AGENT); - - if (!is_muted) - { - LLMuteList::getInstance()->add(mute, flags); - } - else - { - LLMuteList::getInstance()->remove(mute, flags); - } } BOOL postBuild() { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable; registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); - registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2)); registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -536,7 +460,7 @@ protected: if(menu) { - bool is_friend = LLAvatarActions::isFriend(mAvatarID); + bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL; menu->setItemEnabled("Add Friend", !is_friend); menu->setItemEnabled("Remove Friend", is_friend); @@ -546,34 +470,13 @@ protected: menu->setItemEnabled("Add Friend", false); menu->setItemEnabled("Send IM", false); menu->setItemEnabled("Remove Friend", false); - menu->setItemEnabled("Offer Teleport",false); - menu->setItemEnabled("Voice Call", false); - menu->setItemEnabled("Invite Group", false); - menu->setItemEnabled("Zoom In", false); - menu->setItemEnabled("Share", false); - menu->setItemEnabled("Pay", false); - menu->setItemEnabled("Block Unblock", false); - menu->setItemEnabled("Mute Text", false); } - else + + if (mSessionID == LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID)) { - LLUUID currentSessionID = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID); - if (mSessionID == currentSessionID) - { - menu->setItemVisible("Send IM", false); - } - menu->setItemEnabled("Offer Teleport", LLAvatarActions::canOfferTeleport(mAvatarID)); - menu->setItemEnabled("Voice Call", LLAvatarActions::canCall()); - - // We should only show 'Zoom in' item in a nearby chat - bool should_show_zoom = !LLIMModel::getInstance()->findIMSession(currentSessionID); - menu->setItemVisible("Zoom In", should_show_zoom && gObjectList.findObject(mAvatarID)); - menu->setItemEnabled("Block Unblock", LLAvatarActions::canBlock(mAvatarID)); - menu->setItemEnabled("Mute Text", LLAvatarActions::canBlock(mAvatarID)); + menu->setItemVisible("Send IM", false); } - menu->setItemEnabled("Chat History", LLLogChat::isTranscriptExist(mAvatarID)); - menu->setItemEnabled("Map", (LLAvatarTracker::instance().isBuddyOnline(mAvatarID) && is_agent_mappable(mAvatarID)) || gAgent.isGodlike() ); menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, menu, x, y); @@ -1065,42 +968,25 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // notify processing if (chat.mNotifId.notNull()) { - bool create_toast = true; - for (LLToastNotifyPanel::instance_iter ti(LLToastNotifyPanel::beginInstances()) - , tend(LLToastNotifyPanel::endInstances()); ti != tend; ++ti) + LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); + if (notification != NULL) { - LLToastNotifyPanel& panel = *ti; - LLIMToastNotifyPanel * imtoastp = dynamic_cast(&panel); - const std::string& notification_name = panel.getNotificationName(); - if (notification_name == "OfferFriendship" && panel.isControlPanelEnabled() && imtoastp) - { - create_toast = false; - break; - } - } - - if (create_toast) - { - LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); - if (notification != NULL) - { - LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( + LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( notification, chat.mSessionID, LLRect::null, !use_plain_text_chat_history, mEditor); - //Prepare the rect for the view - LLRect target_rect = mEditor->getDocumentView()->getRect(); - // squeeze down the widget by subtracting padding off left and right - target_rect.mLeft += mLeftWidgetPad + mEditor->getHPad(); - target_rect.mRight -= mRightWidgetPad; - notify_box->reshape(target_rect.getWidth(), notify_box->getRect().getHeight()); - notify_box->setOrigin(target_rect.mLeft, notify_box->getRect().mBottom); - - LLInlineViewSegment::Params params; - params.view = notify_box; - params.left_pad = mLeftWidgetPad; - params.right_pad = mRightWidgetPad; - mEditor->appendWidget(params, "\n", false); - } + //Prepare the rect for the view + LLRect target_rect = mEditor->getDocumentView()->getRect(); + // squeeze down the widget by subtracting padding off left and right + target_rect.mLeft += mLeftWidgetPad + mEditor->getHPad(); + target_rect.mRight -= mRightWidgetPad; + notify_box->reshape(target_rect.getWidth(), notify_box->getRect().getHeight()); + notify_box->setOrigin(target_rect.mLeft, notify_box->getRect().mBottom); + + LLInlineViewSegment::Params params; + params.view = notify_box; + params.left_pad = mLeftWidgetPad; + params.right_pad = mRightWidgetPad; + mEditor->appendWidget(params, "\n", false); } } @@ -1130,7 +1016,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (square_brackets) { message += "]"; - } + } mEditor->appendText(message, prependNewLineState, body_message_params); prependNewLineState = false; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index dbbfceb532..369273bca6 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1526,6 +1526,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } glBindBufferARB(GL_TRANSFORM_FEEDBACK_BUFFER, 0); + gGL.popMatrix(); if (cur_shader) diff --git a/indra/newview/llface.h b/indra/newview/llface.h index c9037ce1eb..66b5f13740 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -194,8 +194,7 @@ public: void setSize(S32 numVertices, S32 num_indices = 0, bool align = false); - BOOL genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat_vert_in, BOOL global_volume = FALSE); + BOOL genVolumeBBoxes(const LLVolume &volume, S32 f,const LLMatrix4& mat, BOOL global_volume = FALSE); void init(LLDrawable* drawablep, LLViewerObject* objp); void destroy(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 06119620de..8e1a1df211 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1545,7 +1545,7 @@ void LLFastTimerView::doAnalysis(std::string baseline, std::string target, std:: return ; } } -void LLFastTimerView::onClickCloseBtn(bool) +void LLFastTimerView::onClickCloseBtn() { setVisible(false); } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 1349b1e99c..5766cfa0b0 100755 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -63,7 +63,7 @@ public: F64 getTime(const std::string& name); protected: - virtual void onClickCloseBtn(bool app_quitting = false); + virtual void onClickCloseBtn(); private: typedef std::vector > bar_positions_t; bar_positions_t mBarStart; diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 9da8e82c49..c151b51c23 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -422,19 +422,6 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) L"PNG Images (*.png)\0*.png\0" \ L"\0"; break; - case FFSAVE_TGAPNG: - if (filename.empty()) - { - wcsncpy( mFilesW,L"untitled.png", FILENAME_BUFFER_SIZE); /*Flawfinder: ignore*/ - //PNG by default - } - mOFN.lpstrDefExt = L"png"; - mOFN.lpstrFilter = - L"PNG Images (*.png)\0*.png\0" \ - L"Targa Images (*.tga)\0*.tga\0" \ - L"\0"; - break; - case FFSAVE_JPEG: if (filename.empty()) { @@ -653,16 +640,13 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena creator = "TVOD"; extension = "wav"; break; + case FFSAVE_TGA: type = "TPIC"; creator = "prvw"; extension = "tga"; break; - case FFSAVE_TGAPNG: - type = "PNG"; - creator = "prvw"; - extension = "png"; - break; + case FFSAVE_BMP: type = "BMPf"; creator = "prvw"; @@ -937,20 +921,6 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer g_slist_free (file_list); } - // let's save the extension of the last added file(considering current filter) - GtkFileFilter *gfilter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(widget)); - std::string filter = gtk_file_filter_get_name(gfilter); - - if(filter == LLTrans::getString("png_image_files")) - { - picker->mCurrentExtension = ".png"; - } - else if(filter == LLTrans::getString("targa_image_files")) - { - picker->mCurrentExtension = ".tga"; - } - - // set the default path for this usage context. const char* cur_folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget)); if (cur_folder != NULL) @@ -1122,24 +1092,6 @@ static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker) LLTrans::getString("dictionary_files") + " (*.dic; *.xcu)"); } -static std::string add_save_texture_filter_to_gtkchooser(GtkWindow *picker) -{ - GtkFileFilter *gfilter_tga = gtk_file_filter_new(); - GtkFileFilter *gfilter_png = gtk_file_filter_new(); - - gtk_file_filter_add_pattern(gfilter_tga, "*.tga"); - gtk_file_filter_add_mime_type(gfilter_png, "image/png"); - std::string caption = LLTrans::getString("save_texture_image_files") + " (*.tga; *.png)"; - gtk_file_filter_set_name(gfilter_tga, LLTrans::getString("targa_image_files").c_str()); - gtk_file_filter_set_name(gfilter_png, LLTrans::getString("png_image_files").c_str()); - - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), - gfilter_png); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(picker), - gfilter_tga); - return caption; -} - BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) { BOOL rtn = FALSE; @@ -1177,15 +1129,6 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename (picker, "image/bmp", LLTrans::getString("bitmap_image_files") + " (*.bmp)"); suggest_ext = ".bmp"; break; - case FFSAVE_PNG: - caption += add_simple_mime_filter_to_gtkchooser - (picker, "image/png", LLTrans::getString("png_image_files") + " (*.png)"); - suggest_ext = ".png"; - break; - case FFSAVE_TGAPNG: - caption += add_save_texture_filter_to_gtkchooser(picker); - suggest_ext = ".png"; - break; case FFSAVE_AVI: caption += add_simple_mime_filter_to_gtkchooser (picker, "video/x-msvideo", @@ -1238,17 +1181,9 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename } gtk_widget_show_all(GTK_WIDGET(picker)); - gtk_main(); rtn = (getFileCount() == 1); - - if(rtn && filter == FFSAVE_TGAPNG) - { - std::string selected_file = mFiles.back(); - mFiles.pop_back(); - mFiles.push_back(selected_file + mCurrentExtension); - } } gViewerWindow->getWindow()->afterDialog(); diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index f0f82c51db..0d279f73f3 100755 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -107,7 +107,6 @@ public: FFSAVE_PNG = 13, FFSAVE_JPEG = 14, FFSAVE_SCRIPT = 15, - FFSAVE_TGAPNG = 16 }; // open the dialog. This is a modal operation @@ -176,8 +175,6 @@ private: // we remember the last path that was accessed for a particular usage std::map mContextToPathMap; std::string mCurContextName; - // we also remember the extension of the last added file. - std::string mCurrentExtension; #endif std::vector mFiles; diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 5041f4689d..4a85160f95 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -44,8 +44,7 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), - mMutex(NULL), - mShowHistory(false) + mMutex(NULL) { } @@ -92,11 +91,12 @@ BOOL LLFloaterConversationPreview::postBuild() mPageSpinner->setMinValue(1); mPageSpinner->set(1); mPageSpinner->setEnabled(false); + mChatHistoryLoaded = false; LLLogChat::startChatHistoryThread(file, load_params); return LLFloater::postBuild(); } -void LLFloaterConversationPreview::setPages(std::list& messages, const std::string& file_name) +void LLFloaterConversationPreview::setPages(std::list& messages,const std::string& file_name) { if(file_name == mChatHistoryFileName) { @@ -111,30 +111,34 @@ void LLFloaterConversationPreview::setPages(std::list& messages, const std std::string total_page_num = llformat("/ %d", mCurrentPage+1); getChild("page_num_label")->setValue(total_page_num); - mShowHistory = true; + mChatHistoryLoaded = true; } } void LLFloaterConversationPreview::draw() { - if(mShowHistory) + if(mChatHistoryLoaded) { showHistory(); - mShowHistory = false; + mChatHistoryLoaded = false; } LLFloater::draw(); } void LLFloaterConversationPreview::onOpen(const LLSD& key) { - mShowHistory = true; + if(mChatHistoryLoaded) + { + showHistory(); + } } void LLFloaterConversationPreview::showHistory() { - // additional protection to avoid changes of mMessages in setPages + // additional protection to avoid changes of mMessages in setPages() LLMutexLock lock(&mMutex); - if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) + + if (!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) { return; } @@ -143,7 +147,7 @@ void LLFloaterConversationPreview::showHistory() std::ostringstream message; std::list::const_iterator iter = mMessages.begin(); std::advance(iter, mCurrentPage * mPageSize); - + for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num) { LLSD msg = *iter; @@ -194,11 +198,10 @@ void LLFloaterConversationPreview::showHistory() void LLFloaterConversationPreview::onMoreHistoryBtnClick() { mCurrentPage = (int)(mPageSpinner->getValueF32()); - if (!mCurrentPage) + if (--mCurrentPage < 0) { return; } - mCurrentPage--; - mShowHistory = true; + showHistory(); } diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index b0488f4ff1..f8796127ba 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -62,7 +62,7 @@ private: std::string mAccountName; std::string mCompleteName; std::string mChatHistoryFileName; - bool mShowHistory; + bool mChatHistoryLoaded; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 0c735dec1f..49da4e64b3 100755 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -30,7 +30,6 @@ #include "llpanelgroupinvite.h" #include "lltrans.h" #include "lldraghandle.h" -#include "llgroupmgr.h" class LLFloaterGroupInvite::impl { @@ -124,11 +123,6 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen LLFloaterGroupInvite *fgi = get_if_there(impl::sInstances, group_id, (LLFloaterGroupInvite*)NULL); - - // refresh group information - LLGroupMgr::getInstance()->clearGroupData(group_id); - - if (!fgi) { fgi = new LLFloaterGroupInvite(group_id); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 9a27c8b7f8..90b4490e1d 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -101,7 +101,6 @@ LLFloaterIMContainer::~LLFloaterIMContainer() gSavedPerAccountSettings.setBOOL("ConversationsListPaneCollapsed", mConversationsPane->isCollapsed()); gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed()); - gSavedPerAccountSettings.setBOOL("ConversationsParticipantListCollapsed", !isParticipantListExpanded()); if (!LLSingleton::destroyed()) { @@ -251,11 +250,6 @@ BOOL LLFloaterIMContainer::postBuild() // Init the sort order now that the root had been created setSortOrder(LLConversationSort(gSavedSettings.getU32("ConversationSortOrder"))); - //We should expand nearby chat participants list for the new user - if(gAgent.isFirstLogin() || !gSavedPerAccountSettings.getBOOL("ConversationsParticipantListCollapsed")) - { - expandConversation(); - } // Keep the xml set title around for when we have to overwrite it mGeneralTitle = getTitle(); @@ -668,10 +662,10 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLFloater* session_floater = widget->getSessionFloater(); if (session_floater != nearby_chat) { - widget->setVisibleIfDetached(visible); - } + widget->setVisibleIfDetached(visible); } } + } // Now, do the normal multifloater show/hide LLMultiFloater::setVisible(visible); @@ -706,13 +700,13 @@ void LLFloaterIMContainer::setVisibleAndFrontmost(BOOL take_focus, const LLSD& k // Only select other sessions if (!getSelectedSession().isNull()) { - selectConversationPair(getSelectedSession(), false, take_focus); + selectConversationPair(getSelectedSession(), false, take_focus); } if (mInitialized && mIsFirstLaunch) { collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed")); mIsFirstLaunch = false; - } +} } void LLFloaterIMContainer::updateResizeLimits() @@ -840,7 +834,7 @@ void LLFloaterIMContainer::assignResizeLimits() S32 conv_pane_target_width = is_conv_pane_expanded ? ( is_msg_pane_expanded?mConversationsPane->getRect().getWidth():mConversationsPane->getExpandedMinDim() ) - : mConversationsPane->getMinDim(); + : mConversationsPane->getMinDim(); S32 msg_pane_min_width = is_msg_pane_expanded ? mMessagesPane->getExpandedMinDim() : 0; S32 new_min_width = conv_pane_target_width + msg_pane_min_width + summary_width_of_visible_borders; @@ -1001,7 +995,7 @@ void LLFloaterIMContainer::setSortOrder(const LLConversationSort& order) conversation_floater->setSortOrder(order); } } - + gSavedSettings.setU32("ConversationSortOrder", (U32)order); } @@ -1192,7 +1186,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, } else if("chat_history" == command) { - if (selectedIDS.size() > 0) + if (selectedIDS.size() > 0) { LLAvatarActions::viewChatHistory(selectedIDS.front()); } @@ -1214,7 +1208,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, { LLFloaterReg::showInstance("preview_conversation", LLSD(LLUUID::null), true); } - } +} } } @@ -1245,7 +1239,7 @@ void LLFloaterIMContainer::doToSelectedGroup(const LLSD& userdata) if (action == "group_profile") { - LLGroupActions::show(mSelectedSession); + LLGroupActions::show(mSelectedSession); } else if (action == "activate_group") { @@ -2092,19 +2086,6 @@ void LLFloaterIMContainer::expandConversation() } } } -bool LLFloaterIMContainer::isParticipantListExpanded() -{ - bool is_expanded = false; - if(!mConversationsPane->isCollapsed()) - { - LLConversationViewSession* widget = dynamic_cast(get_ptr_in_map(mConversationsWidgets,getSelectedSession())); - if (widget) - { - is_expanded = widget->isOpen(); - } - } - return is_expanded; -} // By default, if torn off session is currently frontmost, LLFloater::isFrontmost() will return FALSE, which can lead to some bugs // So LLFloater::isFrontmost() is overriden here to check both selected session and the IM floater itself @@ -2121,7 +2102,7 @@ BOOL LLFloaterIMContainer::isFrontmost() // For conversations, closeFloater() (linked to Ctrl-W) does not actually close the floater but the active conversation. // This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater. -void LLFloaterIMContainer::onClickCloseBtn(bool app_quitting/* = false*/) +void LLFloaterIMContainer::onClickCloseBtn() { // Always unminimize before trying to close. // Most of the time the user will never see this state. @@ -2130,7 +2111,7 @@ void LLFloaterIMContainer::onClickCloseBtn(bool app_quitting/* = false*/) LLMultiFloater::setMinimized(FALSE); } - LLFloater::closeFloater(app_quitting); + LLFloater::closeFloater(); } void LLFloaterIMContainer::closeHostedFloater() @@ -2177,7 +2158,7 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) if(app_quitting) { closeAllConversations(); - onClickCloseBtn(app_quitting); + onClickCloseBtn(); } else { diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 5d88b7881a..36da457cac 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -134,7 +134,7 @@ private: void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); void onSpeakButtonClicked(); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); + /*virtual*/ void onClickCloseBtn(); /*virtual*/ void closeHostedFloater(); void collapseConversationsPane(bool collapse, bool save_is_allowed=true); @@ -172,7 +172,6 @@ private: void toggleAllowTextChat(const LLUUID& participant_uuid); void toggleMute(const LLUUID& participant_id, U32 flags); void openNearbyChat(); - bool isParticipantListExpanded(); LLButton* mExpandCollapseBtn; LLButton* mStubCollapseBtn; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 323e84751f..3d77ea4f0b 100755 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -308,8 +308,7 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting) } // virtual -void LLFloaterIMNearbyChat::onClickCloseBtn(bool) - +void LLFloaterIMNearbyChat::onClickCloseBtn() { if (!isTornOff()) { @@ -494,11 +493,11 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke() if (!rest_of_match.empty()) { mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part + // Select to end of line, starting from the character // after the last one the user typed. - mInputEditor->selectByCursorPosition(utf8_out_str.size()-rest_of_match.size(),utf8_out_str.size()); + mInputEditor->selectNext(rest_of_match, false); } - } else if (matchChatTypeTrigger(utf8_trigger, &utf8_out_str)) { diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index f0daacd6a9..05b48cccb0 100755 --- a/indra/newview/llfloaterimnearbychat.h +++ b/indra/newview/llfloaterimnearbychat.h @@ -95,7 +95,7 @@ protected: void onChatFontChange(LLFontGL* fontp); /*virtual*/ void onTearOffClicked(); - /*virtual*/ void onClickCloseBtn(bool app_qutting = false); + /*virtual*/ void onClickCloseBtn(); static LLWString stripChannelNumber(const LLWString &mesg, S32* channel); EChatType processChatTypeTriggers(EChatType type, std::string &str); diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 14e1a486d3..5cb9df5625 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -112,7 +112,7 @@ void LLFloaterIMSession::onTearOffClicked() } // virtual -void LLFloaterIMSession::onClickCloseBtn(bool) +void LLFloaterIMSession::onClickCloseBtn() { LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index d6718843ca..a0e0171b34 100755 --- a/indra/newview/llfloaterimsession.h +++ b/indra/newview/llfloaterimsession.h @@ -141,7 +141,7 @@ private: /*virtual*/ void refresh(); /*virtual*/ void onTearOffClicked(); - /*virtual*/ void onClickCloseBtn(bool app_qutting); + /*virtual*/ void onClickCloseBtn(); // Update the window title and input field help text /*virtual*/ void updateSessionName(const std::string& name); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 6c8e81e563..8f20d4e082 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2374,7 +2374,7 @@ void LLPanelLandAccess::refresh() { BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); - BOOL public_access = !use_access_list; + BOOL public_access = !use_access_list && !use_group; getChild("public_access")->setValue(public_access ); getChild("GroupCheck")->setValue(use_group ); @@ -2541,10 +2541,6 @@ void LLPanelLandAccess::refresh_ui() getChildView("HoursSpin")->setEnabled(FALSE); getChildView("AccessList")->setEnabled(FALSE); getChildView("BannedList")->setEnabled(FALSE); - getChildView("add_allowed")->setEnabled(FALSE); - getChildView("remove_allowed")->setEnabled(FALSE); - getChildView("add_banned")->setEnabled(FALSE); - getChildView("remove_banned")->setEnabled(FALSE); LLParcel *parcel = mParcel->getParcel(); if (parcel) @@ -2583,6 +2579,7 @@ void LLPanelLandAccess::refresh_ui() { getChildView("Only Allow")->setToolTip(std::string()); } + getChildView("GroupCheck")->setEnabled(FALSE); getChildView("PassCheck")->setEnabled(FALSE); getChildView("pass_combo")->setEnabled(FALSE); getChildView("AccessList")->setEnabled(FALSE); @@ -2592,7 +2589,11 @@ void LLPanelLandAccess::refresh_ui() getChildView("limit_payment")->setEnabled(FALSE); getChildView("limit_age_verified")->setEnabled(FALSE); - + std::string group_name; + if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) + { + getChildView("GroupCheck")->setEnabled(can_manage_allowed); + } BOOL group_access = getChild("GroupCheck")->getValue().asBoolean(); BOOL sell_passes = getChild("PassCheck")->getValue().asBoolean(); getChildView("PassCheck")->setEnabled(can_manage_allowed); @@ -2603,11 +2604,6 @@ void LLPanelLandAccess::refresh_ui() getChildView("HoursSpin")->setEnabled(can_manage_allowed); } } - std::string group_name; - if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) - { - getChildView("GroupCheck")->setEnabled(can_manage_allowed); - } getChildView("AccessList")->setEnabled(can_manage_allowed); S32 allowed_list_count = parcel->mAccessList.size(); getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); @@ -2654,6 +2650,17 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) return; } + // If we disabled public access, enable group access by default (if applicable) + BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); + if (public_access == FALSE) + { + std::string group_name; + if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) + { + self->getChild("GroupCheck")->setValue(public_access ? FALSE : TRUE); + } + } + onCommitAny(ctrl, userdata); } @@ -2687,6 +2694,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) if (public_access) { use_access_list = FALSE; + use_access_group = FALSE; limit_payment = self->getChild("limit_payment")->getValue().asBoolean(); limit_age_verified = self->getChild("limit_age_verified")->getValue().asBoolean(); } diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index c5248719e9..5f9556a870 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -57,7 +57,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) getChild(sMainPanelName)->onOpen(key); } -void LLFloaterSidePanelContainer::onClickCloseBtn(bool) +void LLFloaterSidePanelContainer::onClickCloseBtn() { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 65ec8f604e..491723471f 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -51,7 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); + /*virtual*/ void onClickCloseBtn(); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 0720d443f8..54522bb7f6 100755 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -251,7 +251,6 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) llinfos << "Muting by name " << mute.mName << llendl; updateAdd(mute); notifyObservers(); - notifyObserversDetailed(mute); return TRUE; } else @@ -300,7 +299,6 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) llinfos << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl; updateAdd(localmute); notifyObservers(); - notifyObserversDetailed(localmute); if(!(localmute.mFlags & LLMute::flagParticles)) { //Kill all particle systems owned by muted task @@ -398,7 +396,6 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) } // Must be after erase. - notifyObserversDetailed(localmute); setLoaded(); // why is this here? -MG } else @@ -412,7 +409,6 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) updateRemove(mute); mLegacyMutes.erase(legacy_it); // Must be after erase. - notifyObserversDetailed(mute); setLoaded(); // why is this here? -MG } } @@ -766,16 +762,3 @@ void LLMuteList::notifyObservers() it = mObservers.upper_bound(observer); } } - -void LLMuteList::notifyObserversDetailed(const LLMute& mute) -{ - for (observer_set_t::iterator it = mObservers.begin(); - it != mObservers.end(); - ) - { - LLMuteListObserver* observer = *it; - observer->onChangeDetailed(mute); - // In case onChange() deleted an entry. - it = mObservers.upper_bound(observer); - } -} diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 3e998b4f0e..7a70370fe3 100755 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -123,7 +123,6 @@ private: void setLoaded(); void notifyObservers(); - void notifyObserversDetailed(const LLMute &mute); void updateAdd(const LLMute& mute); void updateRemove(const LLMute& mute); @@ -174,7 +173,6 @@ class LLMuteListObserver public: virtual ~LLMuteListObserver() { } virtual void onChange() = 0; - virtual void onChangeDetailed(const LLMute& ) { } }; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 1ff0bfd091..53deded2f2 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -542,13 +542,6 @@ void LLPanelMainInventory::changed(U32) updateItemcountText(); } -void LLPanelMainInventory::setFocusFilterEditor() -{ - if(mFilterEditor) - { - mFilterEditor->setFocus(true); - } -} // virtual void LLPanelMainInventory::draw() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index fc8cc67c33..394b004e20 100755 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -82,9 +82,6 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); void onFilterEdit(const std::string& search_string ); - - void setFocusFilterEditor(); - protected: // // Misc functions diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index d8fc2bee32..076c3e0235 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -77,14 +77,6 @@ void LLPersistentNotificationStorage::saveNotifications() } data.append(notification->asLLSD(true)); - if (data.size() >= gSavedSettings.getS32("MaxPersistentNotifications")) - { - llwarns << "Too many persistent notifications." - << " Saved " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << history_channel->size() - << " persistent notifications." << llendl; - break; - } - } writeNotifications(output); @@ -105,6 +97,7 @@ void LLPersistentNotificationStorage::loadNotifications() } mLoaded = true; + LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -122,9 +115,9 @@ void LLPersistentNotificationStorage::loadNotifications() findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLNotifications& instance = LLNotifications::instance(); - S32 processed_notifications = 0; - for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); - notification_it != data.rendArray(); + + for (LLSD::array_const_iterator notification_it = data.beginArray(); + notification_it != data.endArray(); ++notification_it) { LLSD notification_params = *notification_it; @@ -143,16 +136,8 @@ void LLPersistentNotificationStorage::loadNotifications() // hide saved toasts so they don't confuse the user notification_channel->hideToast(notification->getID()); } - ++processed_notifications; - if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) - { - llwarns << "Too many persistent notifications." - << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << llendl; - break; - } } - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); + LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL; } diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1ed48a978f..91a98792eb 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -36,7 +36,6 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llimagetga.h" -#include "llimagepng.h" #include "llinventory.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -262,7 +261,7 @@ void LLPreviewTexture::saveAs() LLFilePicker& file_picker = LLFilePicker::instance(); const LLInventoryItem* item = getItem() ; - if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGAPNG, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) + if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGA, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) { // User canceled or we failed to acquire save file. return; @@ -359,27 +358,14 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, if( self && final && success ) { - const U32 ext_length = 3; - std::string extension = self->mSaveFileName.substr( self->mSaveFileName.length() - ext_length); - - // We only support saving in PNG or TGA format - LLPointer image; - if(extension == "png") - { - image = new LLImagePNG; - } - else if(extension == "tga") - { - image = new LLImageTGA; - } - - if( image && !image->encode( src, 0 ) ) + LLPointer image_tga = new LLImageTGA; + if( !image_tga->encode( src ) ) { LLSD args; args["FILE"] = self->mSaveFileName; LLNotificationsUtil::add("CannotEncodeFile", args); } - else if( image && !image->save( self->mSaveFileName ) ) + else if( !image_tga->save( self->mSaveFileName ) ) { LLSD args; args["FILE"] = self->mSaveFileName; diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp index cbd8bee9d5..09e799e4f7 100755 --- a/indra/newview/llsceneview.cpp +++ b/indra/newview/llsceneview.cpp @@ -51,7 +51,7 @@ LLSceneView::LLSceneView(const LLRect& rect) setCanClose(true); } -void LLSceneView::onClickCloseBtn(bool) +void LLSceneView::onClickCloseBtn() { setVisible(false); } diff --git a/indra/newview/llsceneview.h b/indra/newview/llsceneview.h index 1fceecb9e1..2a3a14bbee 100755 --- a/indra/newview/llsceneview.h +++ b/indra/newview/llsceneview.h @@ -38,7 +38,7 @@ public: virtual void draw(); protected: - virtual void onClickCloseBtn(bool app_qutting = false); + virtual void onClickCloseBtn(); }; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index cbf43dbb93..8915bb2fef 100755 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -397,7 +397,7 @@ void LLSidepanelInventory::onToggleInboxBtn() void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); - mPanelMainInventory->setFocusFilterEditor(); + #if AUTO_EXPAND_INBOX // Expand the inbox if we have fresh items LLPanelMarketplaceInbox * inbox = findChild(MARKETPLACE_INBOX_PANEL); diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 9be6d0c5f1..ad7c939728 100755 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -1170,10 +1170,6 @@ void LLSidepanelTaskInfo::doClickAction(U8 click_action) // Warn, but do it anyway. LLNotificationsUtil::add("ClickActionNotPayable"); } - else - { - handle_give_money_dialog(); - } } LLSelectMgr::getInstance()->selectionSetClickAction(click_action); } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 448fae48de..d876c9a3f4 100755 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -555,7 +555,7 @@ BOOL LLToast::handleMouseDown(S32 x, S32 y, MASK mask) mHideBtnPressed = mHideBtn->getRect().pointInRect(x, y); } - return LLModalDialog::handleMouseDown(x, y, mask); + return LLFloater::handleMouseDown(x, y, mask); } //-------------------------------------------------------------------------- diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index fe7f1cf8f3..d02171b512 100755 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -69,8 +69,6 @@ public: virtual void updateNotification() {} - bool isControlPanelEnabled() const; - protected: LLButton* createButton(const LLSD& form_element, BOOL is_option); diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index e1b764a943..a30f841980 100755 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -52,12 +52,6 @@ std::string LLToastPanel::getTitle() return mNotification->getMessage(); } -//virtual -const std::string& LLToastPanel::getNotificationName() -{ - return mNotification->getName(); -} - //virtual const LLUUID& LLToastPanel::getID() { diff --git a/indra/newview/lltoastpanel.h b/indra/newview/lltoastpanel.h index 51630381f2..e4ab95007e 100755 --- a/indra/newview/lltoastpanel.h +++ b/indra/newview/lltoastpanel.h @@ -45,7 +45,6 @@ public: virtual ~LLToastPanel() = 0; virtual std::string getTitle(); - virtual const std::string& getNotificationName(); virtual const LLUUID& getID(); static const S32 MIN_PANEL_HEIGHT; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d77aaa27ac..ab9ea5618e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -45,7 +45,6 @@ #include "llsd.h" #include "llsdserialize.h" #include "llteleportflags.h" -#include "lltoastnotifypanel.h" #include "lltransactionflags.h" #include "llvfile.h" #include "llvfs.h" @@ -3229,20 +3228,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["online"] = (offline == IM_ONLINE); payload["sender"] = msg->getSender().getIPandPort(); - bool add_notification = true; - for (LLToastNotifyPanel::instance_iter ti(LLToastNotifyPanel::beginInstances()) - , tend(LLToastNotifyPanel::endInstances()); ti != tend; ++ti) - { - LLToastNotifyPanel& panel = *ti; - const std::string& notification_name = panel.getNotificationName(); - if (notification_name == "OfferFriendship" && panel.isControlPanelEnabled()) - { - add_notification = false; - break; - } - } - - if (is_muted && add_notification) + if (is_muted) { LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); } @@ -3253,9 +3239,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) send_do_not_disturb_message(msg, from_id); } args["NAME_SLURL"] = LLSLURL("agent", from_id, "about").getSLURLString(); - - if (add_notification) - { if(message.empty()) { //support for frienship offers from clients before July 2008 @@ -3271,7 +3254,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } } - } break; case IM_FRIENDSHIP_ACCEPTED: @@ -3834,6 +3816,19 @@ public: LLInventoryModel::EXCLUDE_TRASH, is_card); } + LLSD args; + if ( land_items.count() > 0 ) + { // Show notification that they can now teleport to landmarks. Use a random landmark from the inventory + S32 random_land = ll_rand( land_items.count() - 1 ); + args["NAME"] = land_items[random_land]->getName(); + LLNotificationsUtil::add("TeleportToLandmark",args); + } + if ( card_items.count() > 0 ) + { // Show notification that they can now contact people. Use a random calling card from the inventory + S32 random_card = ll_rand( card_items.count() - 1 ); + args["NAME"] = card_items[random_card]->getName(); + LLNotificationsUtil::add("TeleportToPerson",args); + } gInventory.removeObserver(this); delete this; @@ -4110,6 +4105,18 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) if (isAgentAvatarValid()) { + // Chat the "back" SLURL. (DEV-4907) + + LLSLURL slurl; + gAgent.getTeleportSourceSLURL(slurl); + LLSD substitution = LLSD().with("[T_SLURL]", slurl.getSLURLString()); + std::string completed_from = LLAgent::sTeleportProgressMessages["completed_from"]; + LLStringUtil::format(completed_from, substitution); + + LLSD args; + args["MESSAGE"] = completed_from; + LLNotificationsUtil::add("SystemMessageTip", args); + // Set the new position gAgentAvatarp->setPositionAgent(agent_pos); gAgentAvatarp->clearChat(); @@ -6885,43 +6892,43 @@ void send_lures(const LLSD& notification, const LLSD& response) LLAgentUI::buildSLURL(slurl); text.append("\r\n").append(slurl.getSLURLString()); - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_StartLure); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Info); - msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. - msg->addStringFast(_PREHASH_Message, text); - for(LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); - it != notification["payload"]["ids"].endArray(); - ++it) - { - LLUUID target_id = it->asUUID(); + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_StartLure); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_Info); + msg->addU8Fast(_PREHASH_LureType, (U8)0); // sim will fill this in. + msg->addStringFast(_PREHASH_Message, text); + for(LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); + it != notification["payload"]["ids"].endArray(); + ++it) + { + LLUUID target_id = it->asUUID(); - msg->nextBlockFast(_PREHASH_TargetData); - msg->addUUIDFast(_PREHASH_TargetID, target_id); + msg->nextBlockFast(_PREHASH_TargetData); + msg->addUUIDFast(_PREHASH_TargetID, target_id); - // Record the offer. - { - std::string target_name; - gCacheName->getFullName(target_id, target_name); // for im log filenames - LLSD args; - args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; + // Record the offer. + { + std::string target_name; + gCacheName->getFullName(target_id, target_name); // for im log filenames + LLSD args; + args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; - LLSD payload; + LLSD payload; - //*TODO please rewrite all keys to the same case, lower or upper - payload["from_id"] = target_id; + //*TODO please rewrite all keys to the same case, lower or upper + payload["from_id"] = target_id; payload["SUPPRESS_TOAST"] = true; - LLNotificationsUtil::add("TeleportOfferSent", args, payload); + LLNotificationsUtil::add("TeleportOfferSent", args, payload); - // Add the recepient to the recent people list. - LLRecentPeople::instance().add(target_id); - } + // Add the recepient to the recent people list. + LLRecentPeople::instance().add(target_id); } - gAgent.sendReliableMessage(); } + gAgent.sendReliableMessage(); +} bool handle_lure_callback(const LLSD& notification, const LLSD& response) { diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index f1b959a0b7..b4e287c446 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -954,7 +954,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) objectp = *idle_iter; llassert(objectp->isActive()); objectp->idleUpdate(agent, world, frame_time); - } + } //update flexible objects LLVolumeImplFlexible::updateClass(); @@ -962,8 +962,8 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) //update animated textures if (gAnimateTextures) { - LLViewerTextureAnim::updateClass(); - } + LLViewerTextureAnim::updateClass(); + } } @@ -1326,27 +1326,45 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) return; } - LLViewerObject *objectp = NULL; S32 num_removed = 0; + LLViewerObject *objectp; + + vobj_list_t::reverse_iterator target = mObjects.rbegin(); - vobj_list_t::iterator iter; - for (iter = mObjects.begin(); iter != mObjects.end();) + vobj_list_t::iterator iter = mObjects.begin(); + for ( ; iter != mObjects.end(); ) { // Scan for all of the dead objects and put them all on the end of the list with no ref count ops objectp = *iter; + if (objectp == NULL) + { //we caught up to the dead tail + break; + } - if (objectp && objectp->isDead()) + if (objectp->isDead()) { - iter = mObjects.erase(iter); + LLPointer::swap(*iter, *target); + *target = NULL; + ++target; num_removed++; + + if (num_removed == mNumDeadObjects || iter->isNull()) + { + // We've cleaned up all of the dead objects or caught up to the dead tail + break; + } } else { ++iter; } } + llassert(num_removed == mNumDeadObjects); + //erase as a block + mObjects.erase(mObjects.begin()+(mObjects.size()-mNumDeadObjects), mObjects.end()); + // We've cleaned the global object list, now let's do some paranoia testing on objects // before blowing away the dead list. mDeadObjects.clear(); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9497041482..ff73aa5354 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -786,6 +786,7 @@ void LLVivoxVoiceClient::stateMachine() { loglevel = "0"; // turn logging off completely } + loglevel = "0"; // turn logging off completely params.args.add("-ll"); params.args.add(loglevel); params.cwd = gDirUtilp->getAppRODataDir(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 436e226f3e..d9efd23b43 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1036,6 +1036,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); bool cache_in_vram = use_transform_feedback && gTransformPositionProgram.mProgramObject && @@ -2617,6 +2618,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) if (hasLightTexture()) { setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true); + parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true); mLightTexture = NULL; } } @@ -2634,7 +2636,8 @@ void LLVOVolume::setSpotLightParams(LLVector3 params) void LLVOVolume::setIsLight(BOOL is_light) { - if (is_light != getIsLight()) + BOOL was_light = getIsLight(); + if (is_light != was_light) { if (is_light) { @@ -2819,7 +2822,7 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params) + if (params && getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) { return params->isLightSpotlight(); } @@ -3749,8 +3752,30 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& { LLFace* face = mDrawable->getFace(face_hit); + bool ignore_alpha = false; + + const LLTextureEntry* te = face->getTextureEntry(); + if (te) + { + LLMaterial* mat = te->getMaterialParams(); + if (mat) + { + U8 mode = mat->getDiffuseAlphaMode(); + + if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE || + mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE) + { + ignore_alpha = true; + } + } + } + if (face && - (pick_transparent || !face->getTexture() || !face->getTexture()->hasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))) + (ignore_alpha || + pick_transparent || + !face->getTexture() || + !face->getTexture()->hasGLTexture() || + face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))) { local_end = p; if (face_hitp != NULL) @@ -4435,8 +4460,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bool emissive = false; - - { LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 103668d051..7996f8a640 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -140,7 +140,6 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) { llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl; LLViewerRegion *regionp = getRegionFromHandle(region_handle); - std::string seedUrl; if (regionp) { llinfos << "Region exists, removing it " << llendl; @@ -162,9 +161,6 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) llwarns << "LLWorld::addRegion exists, but isn't alive" << llendl; } - // Save capabilities seed URL - seedUrl = regionp->getCapability("Seed"); - // Kill the old host, and then we can continue on and add the new host. We have to kill even if the host // matches, because all the agent state for the new camera is completely different. removeRegion(old_host); @@ -192,11 +188,6 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) llerrs << "Unable to create new region!" << llendl; } - if ( !seedUrl.empty() ) - { - regionp->setCapability("Seed", seedUrl); - } - mRegionList.push_back(regionp); mActiveRegionList.push_back(regionp); mCulledRegionList.push_back(regionp); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index f4a7c437ea..94c187e21a 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -153,7 +153,6 @@ with the same filename but different name - diff --git a/indra/newview/skins/default/xui/en/menu_avatar_icon.xml b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml index 77b9095f7c..50910dff32 100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_icon.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_icon.xml @@ -17,7 +17,7 @@ parameter="profile" />
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index c7edba21f8..3edeb9aa36 100755 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -87,7 +87,6 @@ direction="down" height="23" image_overlay="Arrow_Left_Off" - image_hover_unselected="PushButton_Over" image_bottom_pad="1" layout="topleft" left="10" @@ -100,7 +99,6 @@ direction="down" height="23" image_overlay="Arrow_Right_Off" - image_hover_unselected="PushButton_Over" image_bottom_pad="1" layout="topleft" left_pad="0" @@ -113,7 +111,6 @@ height="23" image_bottom_pad="1" image_overlay="Home_Off" - image_hover_unselected="PushButton_Over" layout="topleft" left_pad="7" name="home_btn" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7e79d297ef..8ac95beddb 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -456,8 +456,6 @@ Please try logging in again in a minute. Load Targa Images Bitmap Images - PNG Images - Targa or PNG Images AVI Movie File XAF Anim File XML File diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml index 9559be214a..20acea57ea 100755 --- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -25,25 +25,19 @@ label_pad_left - padding to the left of tab button labels tab_bottom_image_selected="Toolbar_Left_Selected" tab_left_image_unselected="SegmentedBtn_Left_Disabled" tab_left_image_selected="SegmentedBtn_Left_Selected_Over" - tab_top_image_hovered="TabTop_Left_Selected" - tab_button_image_hovered="Toolbar_Left_Selected" - tab_left_image_hovered="SegmentedBtn_Left_Selected_Over"/> +/> +/> +/> -- cgit v1.2.3 From d5877bc365292358eb4c9b8d14d1c8a1237ca5bd Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 28 Oct 2013 14:37:06 +0200 Subject: MAINT-3343 FIXED Expand/Collapse message pan only on left click. --- indra/newview/llconversationview.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 4f875cca20..82d3fe74c0 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -267,6 +267,23 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) //This node (conversation) was selected and a child (participant) was not if(result && getRoot()) { + + if(getRoot()->getCurSelectedItem() == this) + { + LLConversationItem* item = dynamic_cast(getViewModelItem()); + LLUUID session_id = item? item->getUUID() : LLUUID(); + + LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance("im_container"); + if (im_container->isConversationsPaneCollapsed() && im_container->getSelectedSession() == session_id) + { + im_container->collapseMessagesPane(!im_container->isMessagesPaneCollapsed()); + } + else + { + im_container->collapseMessagesPane(false); + } + + } selectConversationItem(); } @@ -316,14 +333,6 @@ void LLConversationViewSession::selectConversationItem() LLUUID session_id = item? item->getUUID() : LLUUID(); LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance("im_container"); - if (im_container->isConversationsPaneCollapsed() && im_container->getSelectedSession() == session_id) - { - im_container->collapseMessagesPane(!im_container->isMessagesPaneCollapsed()); - } - else - { - im_container->collapseMessagesPane(false); - } im_container->flashConversationItemWidget(session_id,false); im_container->selectConversationPair(session_id, false); } -- cgit v1.2.3 From 3a57a67c5d386cfa6df004915ecb0104b3207e72 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 28 Oct 2013 17:15:57 -0700 Subject: ACME-1099 : Fix crash when getting the Facebook cap from a (potentially null) region --- indra/newview/llfacebookconnect.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 611d18d6d6..9a20ce8f1b 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -356,13 +356,18 @@ void LLFacebookConnect::openFacebookWeb(std::string url) std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { - std::string url = gAgent.getRegion()->getCapability("FacebookConnect"); - url += route; + std::string url(""); + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + url = regionp->getCapability("FacebookConnect"); + url += route; - if (include_read_from_master && mReadFromMaster) - { - url += "?read_from_master=true"; - } + if (include_read_from_master && mReadFromMaster) + { + url += "?read_from_master=true"; + } + } return url; } -- cgit v1.2.3 From 3a6228c44bb41f8d286f5ec7aa1c7c560e8ff604 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Nov 2013 09:42:08 -0700 Subject: BUG-4286 add AMD R7/R9 entried to GPU table --- indra/newview/gpu_table.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 86969475c6..e3dde3b092 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -212,6 +212,8 @@ ATI Radeon 9500 .*ATI.*Radeon 95.. 0 1 1 2.1 ATI Radeon 9600 .*ATI.*Radeon 96.. 0 1 1 2.1 ATI Radeon 9700 .*ATI.*Radeon 97.. 1 1 0 0 ATI Radeon 9800 .*ATI.*Radeon 98.. 1 1 1 2.1 +ATI Radeon R7 .*ATI.*(Radeon|ASUS).* R7.* 4 1 0 4.2 +ATI Radeon R9 .*ATI.*(Radeon|ASUS).* R9.* 5 1 0 4.2 ATI Radeon RV250 .*ATI.*RV250.* 0 1 0 0 ATI Radeon RV600 .*ATI.*RV6.* 1 1 0 0 ATI Radeon RX700 .*ATI.*RX70.* 1 1 0 0 -- cgit v1.2.3 From 71205580d956d06fbdababd83ffe52885742d304 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 5 Nov 2013 04:23:12 +0200 Subject: MAINT-3376 FIXED Successive llSetTextureAnim calls fail in 3.6.10 (283075) unless a different command (llSleep(0.01), llSay(0,"hello")) is placed between them.: - fix for MAINT-2861 was reverted to resolve this issue; --- indra/newview/llvovolume.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5205bc6987..8677c02829 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -334,8 +334,15 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, if (!mTextureAnimp) { mTextureAnimp = new LLViewerTextureAnim(this); - mTexAnimMode = 0; } + else + { + if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH)) + { + mTextureAnimp->reset(); + } + } + mTexAnimMode = 0; mTextureAnimp->unpackTAMessage(mesgsys, block_num); } -- cgit v1.2.3 From 9ad67587b776fc9e8727ad6b79ed328cccbfbf93 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 7 Nov 2013 16:18:17 -0600 Subject: DRTVWR-338 Make an inocuous change to get a new build number out of TeamCity --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1c532e957e..d9093c2a6d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9861,7 +9861,7 @@ RenderUseVAO Comment - [EXPERIMENTAL] Use GL Vertex Array Objects + [EXPERIMENTAL] Use GL Vertex Array Objects. Persist 1 Type -- cgit v1.2.3 From 66b6bffca92261d418f9888be4c3542554ddb4af Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 8 Nov 2013 09:39:24 -0800 Subject: MAINT-3412 Fix Intel Iris recognizer to include optional Pro as is reported with integrated-only graphics on new MBP --- indra/newview/gpu_table.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index e3dde3b092..8efc4ee87d 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -327,7 +327,7 @@ Intel HD Graphics 4600 .*Intel.*HD Graphics 46.* 3 1 0 4.2 Intel HD Graphics 4000 .*Intel.*HD Graphics 4.* 3 1 1 4.2 Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 4 1 0 4 Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 4 1 0 4 -Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 4 1 0 4 +Intel Intel Iris OpenGL Engine .*Intel.*Iris (Pro )*OpenGL.* 4 1 0 4 Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 4 1 0 4 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 1 4 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 1 2.1 -- cgit v1.2.3 From b8cafb8e850c9bc65f61202d6caba5725a33aef7 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 11 Nov 2013 15:26:19 -0500 Subject: increment viewer version to 3.6.11 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c47e8b5872..e8b6c77dc9 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.10 +3.6.11 -- cgit v1.2.3 From ebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 11 Nov 2013 15:26:55 -0500 Subject: convert dos line endings --- indra/newview/llvovolume.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8677c02829..dfac77857c 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -335,13 +335,13 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, { mTextureAnimp = new LLViewerTextureAnim(this); } - else - { - if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH)) - { - mTextureAnimp->reset(); - } - } + else + { + if (!(mTextureAnimp->mMode & LLTextureAnim::SMOOTH)) + { + mTextureAnimp->reset(); + } + } mTexAnimMode = 0; mTextureAnimp->unpackTAMessage(mesgsys, block_num); -- cgit v1.2.3 From 787ccaf297e81291469aaf269f563d862fb150a3 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 21 Nov 2013 14:05:30 -0500 Subject: increment viewer version to 3.6.12 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index e8b6c77dc9..8b7b0b52e5 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.11 +3.6.12 -- cgit v1.2.3 From 6d6b0edfe2aea7890cb33614723b9842e700cfa8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sun, 24 Nov 2013 13:16:36 -0500 Subject: normalize format of and add arch to all installer names --- indra/newview/CMakeLists.txt | 5 +- indra/newview/viewer_manifest.py | 221 ++++++++++++++++++--------------------- 2 files changed, 105 insertions(+), 121 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1fea6dea9f..c5e1cde4e6 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1748,6 +1748,7 @@ if (WINDOWS) ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --actions=copy + --arch=${ARCH} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} @@ -1815,6 +1816,7 @@ if (WINDOWS) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --arch=${ARCH} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} @@ -1939,7 +1941,6 @@ if (LINUX) --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} - --installer_name=${product} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS @@ -2017,6 +2018,7 @@ if (DARWIN) ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py --actions=copy + --arch=${ARCH} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} @@ -2049,6 +2051,7 @@ if (DARWIN) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --arch=${ARCH} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 894e368427..a657c4738c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors +from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL try: from llbase import llsd except ImportError: @@ -117,16 +117,16 @@ class ViewerManifest(LLManifest): Type='String', Value='')) settings_install = {} - for key, setting in (("sourceid", "sourceid"), - ("channel", "CmdLineChannel")): - if key in self.args: - # only set if value is non-empty - if self.args[key]: - # copy corresponding setting from settings_template - settings_install[setting] = settings_template[setting].copy() - # then fill in Value - settings_install[setting]["Value"] = self.args[key] - print "Put %s '%s' in settings_install.xml" % (setting, self.args[key]) + if 'sourceid' in self.args and self.args['sourceid']: + settings_install['sourceid'] = settings_template['sourceid'].copy() + settings_install['sourceid']['Value'] = self.args['sourceid'] + print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid'] + + if 'channel_suffix' in self.args and self.args['channel_suffix']: + print "DEBUG CmdLineChannel channel_suffix '%s'" % self.args['channel_suffix'] + settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy() + settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix() + print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix() # did we actually copy anything into settings_install dict? if settings_install: @@ -197,37 +197,72 @@ class ViewerManifest(LLManifest): def grid(self): return self.args['grid'] + def channel(self): return self.args['channel'] - def channel_unique(self): - return self.channel().replace("Second Life", "").strip() - def channel_oneword(self): - return "".join(self.channel_unique().split()) - def channel_lowerword(self): - return self.channel_oneword().lower() + + def channel_with_pkg_suffix(self): + fullchannel=self.channel() + if 'channel_suffix' in self.args and self.args['channel_suffix']: + fullchannel+=' '+self.args['channel_suffix'] + return fullchannel + + def channel_variant(self): + global CHANNEL_VENDOR_BASE + return self.channel().replace(CHANNEL_VENDOR_BASE, "").strip() + + def channel_type(self): # returns 'release', 'beta', 'project', or 'test' + global CHANNEL_VENDOR_BASE + channel_qualifier=self.channel().replace(CHANNEL_VENDOR_BASE, "").lower().strip() + if channel_qualifier.startswith('release'): + channel_type='release' + elif channel_qualifier.startswith('beta'): + channel_type='beta' + elif channel_qualifier.startswith('project'): + channel_type='project' + else: + channel_type='test' + return channel_type + + def channel_variant_app_suffix(self): + # get any part of the compiled channel name after the CHANNEL_VENDOR_BASE + suffix=self.channel_variant() + # by ancient convention, we don't use Release in the app name + if self.channel_type() == 'release': + suffix=suffix.replace('Release', '').strip() + # for the base release viewer, suffix will now be null - for any other, append what remains + if len(suffix) > 0: + suffix = "_"+ ("_".join(suffix.split())) + # the additional_packages mechanism adds more to the installer name (but not to the app name itself) + if 'channel_suffix' in self.args and self.args['channel_suffix']: + suffix+='_'+("_".join(self.args['channel_suffix'].split())) + return suffix + + def installer_base_name(self): + global CHANNEL_VENDOR_BASE + # a standard map of strings for replacing in the templates + substitution_strings = { + 'channel_vendor_base' : '_'.join(CHANNEL_VENDOR_BASE.split()), + 'channel_variant_underscores':self.channel_variant_app_suffix(), + 'version_underscores' : '_'.join(self.args['version']), + 'arch':self.args['arch'] + } + return "%(channel_vendor_base)s%(channel_variant_underscores)s_%(version_underscores)s_%(arch)s" % substitution_strings def app_name(self): - app_suffix='Test' - channel_type=self.channel_lowerword() - if channel_type.startswith('release') : + global CHANNEL_VENDOR_BASE + channel_type=self.channel_type() + if channel_type == 'release': app_suffix='Viewer' - elif re.match('^(beta|project).*',channel_type) : - app_suffix=self.channel_unique() - return "Second Life "+app_suffix - + else: + app_suffix=self.channel_variant() + return CHANNEL_VENDOR_BASE + ' ' + app_suffix + + def app_name_oneword(self): + return ''.join(self.app_name().split()) + def icon_path(self): - icon_path="icons/" - channel_type=self.channel_lowerword() - print "Icon channel type '%s'" % channel_type - if channel_type.startswith('release') : - icon_path += 'release' - elif re.match('^beta.*',channel_type) : - icon_path += 'beta' - elif re.match('^project.*',channel_type) : - icon_path += 'project' - else : - icon_path += 'test' - return icon_path + return "icons/" + self.channel_type() def flags_list(self): """ Convenience function that returns the command-line flags @@ -277,15 +312,9 @@ class ViewerManifest(LLManifest): random.shuffle(names) return ', '.join(names) -class WindowsManifest(ViewerManifest): +class Windows_i686_Manifest(ViewerManifest): def final_exe(self): - app_suffix="Test" - channel_type=self.channel_lowerword() - if channel_type.startswith('release') : - app_suffix='' - elif re.match('^(beta|project).*',channel_type) : - app_suffix=''.join(self.channel_unique().split()) - return "SecondLife"+app_suffix+".exe" + return self.app_name_oneword()+".exe" def test_msvcrt_and_copy_action(self, src, dst): # This is used to test a dll manifest. @@ -334,7 +363,7 @@ class WindowsManifest(ViewerManifest): print "Doesn't exist:", src def construct(self): - super(WindowsManifest, self).construct() + super(Windows_i686_Manifest, self).construct() if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. @@ -567,65 +596,34 @@ class WindowsManifest(ViewerManifest): 'version_short' : '.'.join(self.args['version'][:-1]), 'version_dashes' : '-'.join(self.args['version']), 'final_exe' : self.final_exe(), - 'grid':self.args['grid'], - 'grid_caps':self.args['grid'].upper(), 'flags':'', - 'channel':self.channel(), - 'channel_oneword':self.channel_oneword(), - 'channel_unique':self.channel_unique(), - 'subchannel_underscores':'_'.join(self.channel_unique().split()) + 'app_name':self.app_name(), + 'app_name_oneword':self.app_name_oneword() } + installer_file = self.installer_base_name() + '_Setup.exe' + substitution_strings['installer_file'] = installer_file + version_vars = """ !define INSTEXE "%(final_exe)s" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" """ % substitution_strings - if self.default_channel(): - if self.default_grid(): - # release viewer - installer_file = "Second_Life_%(version_dashes)s_Setup.exe" - grid_vars_template = """ - OutFile "%(installer_file)s" - !define INSTFLAGS "%(flags)s" - !define INSTNAME "SecondLifeViewer" - !define SHORTCUT "Second Life Viewer" - !define URLNAME "secondlife" - Caption "Second Life" - """ - else: - # alternate grid viewer - installer_file = "Second_Life_%(version_dashes)s_(%(grid_caps)s)_Setup.exe" - grid_vars_template = """ - OutFile "%(installer_file)s" - !define INSTFLAGS "%(flags)s" - !define INSTNAME "SecondLife%(grid_caps)s" - !define SHORTCUT "Second Life (%(grid_caps)s)" - !define URLNAME "secondlife%(grid)s" - !define UNINSTALL_SETTINGS 1 - Caption "Second Life %(grid)s ${VERSION}" - """ + + if self.channel_type() == 'release': + substitution_strings['caption'] = CHANNEL_VENDOR_BASE else: - # some other channel (grid name not used) - installer_file = "Second_Life_%(version_dashes)s_%(subchannel_underscores)s_Setup.exe" - grid_vars_template = """ + substitution_strings['caption'] = self.app_name() + ' ${VERSION}' + + grid_vars_template = """ OutFile "%(installer_file)s" !define INSTFLAGS "%(flags)s" - !define INSTNAME "SecondLife%(channel_oneword)s" - !define SHORTCUT "%(channel)s" + !define INSTNAME "%(app_name_oneword)s" + !define SHORTCUT "%(app_name)s" !define URLNAME "secondlife" - !define UNINSTALL_SETTINGS 1 - Caption "%(channel)s ${VERSION}" + Caption "%(caption)s" """ - if 'installer_name' in self.args: - installer_file = self.args['installer_name'] - else: - installer_file = installer_file % substitution_strings - if len(self.args['package_id']) > 0: - installer_file = installer_file.replace(self.args['package_id'], "") - installer_file = installer_file.replace(".exe", self.args['package_id'] + ".exe") - substitution_strings['installer_file'] = installer_file tempfile = "secondlife_setup_tmp.nsi" # the following replaces strings in the nsi template @@ -663,7 +661,7 @@ class WindowsManifest(ViewerManifest): self.package_file = installer_file -class DarwinManifest(ViewerManifest): +class Darwin_i386_Manifest(ViewerManifest): def is_packaging_viewer(self): # darwin requires full app bundle packaging even for debugging. return True @@ -685,7 +683,7 @@ class DarwinManifest(ViewerManifest): # most everything goes in the Resources directory if self.prefix(src="", dst="Resources"): - super(DarwinManifest, self).construct() + super(Darwin_i386_Manifest, self).construct() if self.prefix("cursors_mac"): self.path("*.tif") @@ -821,6 +819,7 @@ class DarwinManifest(ViewerManifest): self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) def package_finish(self): + global CHANNEL_VENDOR_BASE # Sign the app if requested. if 'signature' in self.args: identity = self.args['signature'] @@ -850,17 +849,9 @@ class DarwinManifest(ViewerManifest): # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. # If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick. - volname="Second Life Installer" # DO NOT CHANGE without understanding comment above + volname=CHANNEL_VENDOR_BASE+" Installer" # DO NOT CHANGE without understanding comment above - if len(self.args['package_id']) > 0: - imagename = imagename + self.args['package_id'] - elif self.default_channel(): - if not self.default_grid(): - # beta case - imagename = imagename + '_' + self.args['grid'].upper() - else: - # first look, etc - imagename = imagename + '_' + self.channel_oneword().upper() + imagename = self.installer_base_name() sparsename = imagename + ".sparseimage" finalname = imagename + ".dmg" @@ -894,7 +885,7 @@ class DarwinManifest(ViewerManifest): # will use the release .DS_Store, and will look broken. # - Ambroff 2008-08-20 dmg_template = os.path.join( - 'installers', 'darwin', '%s-dmg' % self.channel_lowerword()) + 'installers', 'darwin', '%s-dmg' % self.channel_type()) if not os.path.exists (self.src_path_of(dmg_template)): dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') @@ -977,8 +968,9 @@ class LinuxManifest(ViewerManifest): # recurse self.end_prefix("res-sdl") - # Get the icons based on the channel + # Get the icons based on the channel type icon_path = self.icon_path() + print "DEBUG: icon_path '%s'" % icon_path if self.prefix(src=icon_path, dst="") : self.path("secondlife_256.png","secondlife_icon.png") if self.prefix(src="",dst="res-sdl") : @@ -1004,18 +996,7 @@ class LinuxManifest(ViewerManifest): self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) def package_finish(self): - if 'installer_name' in self.args: - installer_name = self.args['installer_name'] - else: - installer_name_components = ['SecondLife_', self.args.get('arch')] - installer_name_components.extend(self.args['version']) - installer_name = "_".join(installer_name_components) - if self.default_channel(): - if not self.default_grid(): - installer_name += '_' + self.args['grid'].upper() - else: - installer_name += '_' + self.channel_oneword().upper() - installer_name = installer_name + self.args['package_id'] + installer_name = self.installer_base_name() self.strip_binaries() @@ -1057,9 +1038,9 @@ class LinuxManifest(ViewerManifest): print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build" self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure -class Linux_i686Manifest(LinuxManifest): +class Linux_i686_Manifest(LinuxManifest): def construct(self): - super(Linux_i686Manifest, self).construct() + super(Linux_i686_Manifest, self).construct() if self.prefix("../packages/lib/release", dst="lib"): self.path("libapr-1.so") @@ -1145,9 +1126,9 @@ class Linux_i686Manifest(LinuxManifest): self.strip_binaries() -class Linux_x86_64Manifest(LinuxManifest): +class Linux_x86_64_Manifest(LinuxManifest): def construct(self): - super(Linux_x86_64Manifest, self).construct() + super(Linux_x86_64_Manifest, self).construct() # support file for valgrind debug tool self.path("secondlife-i686.supp") -- cgit v1.2.3 From 79919ef9b6b9e9ede1580ae69231affee3f42ff8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sun, 24 Nov 2013 13:18:12 -0500 Subject: move setting default grid to settings_install.xml so that it works on all platforms --- .../installers/windows/installer_template.nsi | 12 ++----- indra/newview/viewer_manifest.py | 40 ++++++---------------- 2 files changed, 13 insertions(+), 39 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 8a6114f0d5..4742d7e178 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -72,16 +72,8 @@ LangString LanguageCode ${LANG_RUSSIAN} "ru" LangString LanguageCode ${LANG_TURKISH} "tr" LangString LanguageCode ${LANG_TRADCHINESE} "zh" -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Tweak for different servers/builds (this placeholder is replaced by viewer_manifest.py) -;; For example: -;; !define INSTFLAGS "%(flags)s" -;; !define INSTNAME "SecondLife%(grid_caps)s" -;; !define SHORTCUT "Second Life (%(grid_caps)s)" -;; !define URLNAME "secondlife%(grid)s" -;; !define UNINSTALL_SETTINGS 1 - -%%GRID_VARS%% +;; this placeholder is replaced by viewer_manifest.py +%%INST_VARS%% Name ${INSTNAME} diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index a657c4738c..9e8623c1f9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -112,6 +112,10 @@ class ViewerManifest(LLManifest): Persist=1, Type='String', Value=''), + CmdLineGridChoice=dict(Comment='Default grid', + Persist=0, + Type='String', + Value=''), CmdLineChannel=dict(Comment='Command line specified channel name', Persist=0, Type='String', @@ -123,11 +127,15 @@ class ViewerManifest(LLManifest): print "Set sourceid in settings_install.xml to '%s'" % self.args['sourceid'] if 'channel_suffix' in self.args and self.args['channel_suffix']: - print "DEBUG CmdLineChannel channel_suffix '%s'" % self.args['channel_suffix'] settings_install['CmdLineChannel'] = settings_template['CmdLineChannel'].copy() settings_install['CmdLineChannel']['Value'] = self.channel_with_pkg_suffix() print "Set CmdLineChannel in settings_install.xml to '%s'" % self.channel_with_pkg_suffix() + if 'grid' in self.args and self.args['grid']: + settings_install['CmdLineGridChoice'] = settings_template['CmdLineGridChoice'].copy() + settings_install['CmdLineGridChoice']['Value'] = self.grid() + print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid() + # did we actually copy anything into settings_install dict? if settings_install: # put_in_file(src=) need not be an actual pathname; it @@ -264,31 +272,6 @@ class ViewerManifest(LLManifest): def icon_path(self): return "icons/" + self.channel_type() - def flags_list(self): - """ Convenience function that returns the command-line flags - for the grid""" - - # The original role of this method seems to have been to build a - # grid-specific viewer: one that would, on launch, preselect a - # particular grid. (Apparently that dates back to when the protocol - # between viewer and simulator required them to be updated in - # lockstep, so that "the beta grid" required "a beta viewer.") But - # those viewer command-line switches no longer work without tweaking - # user_settings/grids.xml. In fact, going forward, it's unclear what - # use case that would address. - - # This method also set a channel-specific (or grid-and-channel- - # specific) user_settings/settings_something.xml file. It has become - # clear that saving user settings in a channel-specific file causes - # more problems (confusion) than it solves, so we've discontinued that. - - # In fact we now avoid forcing viewer command-line switches at all, - # instead introducing a settings_install.xml file. Command-line - # switches don't aggregate well; for instance the generated --channel - # switch actually prevented the user specifying --channel on the - # command line. Settings files have well-defined override semantics. - return None - def extract_names(self,src): try: contrib_file = open(src,'r') @@ -616,9 +599,8 @@ class Windows_i686_Manifest(ViewerManifest): else: substitution_strings['caption'] = self.app_name() + ' ${VERSION}' - grid_vars_template = """ + inst_vars_template = """ OutFile "%(installer_file)s" - !define INSTFLAGS "%(flags)s" !define INSTNAME "%(app_name_oneword)s" !define SHORTCUT "%(app_name)s" !define URLNAME "secondlife" @@ -631,7 +613,7 @@ class Windows_i686_Manifest(ViewerManifest): self.replace_in("installers/windows/installer_template.nsi", tempfile, { "%%VERSION%%":version_vars, "%%SOURCE%%":self.get_src_prefix(), - "%%GRID_VARS%%":grid_vars_template % substitution_strings, + "%%INST_VARS%%":inst_vars_template % substitution_strings, "%%INSTALL_FILES%%":self.nsi_file_commands(True), "%%DELETE_FILES%%":self.nsi_file_commands(False)}) -- cgit v1.2.3 From 6c44fe90f226efcf992ddb1d4380eff618633f76 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 25 Nov 2013 15:52:59 -0500 Subject: remove obsolete INSTFLAGS references from installer --- indra/newview/installers/windows/installer_template.nsi | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 4742d7e178..dd316cdbdf 100755 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -101,7 +101,6 @@ Page instfiles ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Var INSTPROG Var INSTEXE -Var INSTFLAGS Var INSTSHORTCUT Var COMMANDLINE ; command line passed to this installer, set in .onInit Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer @@ -139,7 +138,7 @@ label_ask_launch: label_launch: # Assumes SetOutPath $INSTDIR - Exec '"$INSTDIR\$INSTEXE" $INSTFLAGS $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM' label_no_launch: Pop $R0 FunctionEnd @@ -712,7 +711,6 @@ ShowUninstDetails show Section Uninstall ; Start with some default values. -StrCpy $INSTFLAGS "" StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" @@ -911,7 +909,6 @@ Section "" ; (default section) SetShellVarContext all ; install for all users (if you change this, change it in the uninstall as well) ; Start with some default values. -StrCpy $INSTFLAGS "${INSTFLAGS}" StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" @@ -958,7 +955,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" SetOutPath "$INSTDIR" CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM" + "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \ @@ -977,9 +974,9 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ ; Other shortcuts SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM" + "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$INSTFLAGS $SHORTCUT_LANG_PARAM" + "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' @@ -988,7 +985,6 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ ; Write registry WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Flags" "$INSTFLAGS" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG (remove only)" @@ -1001,13 +997,13 @@ WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "URL Protocol" "" WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$INSTEXE"' ;; URL param must be last item passed to viewer, it ignores subsequent params ;; to avoid parameter injection attacks. -WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" $INSTFLAGS -url "%1"' +WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"' WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info"(default)" "URL:Second Life" WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" "" WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$INSTEXE"' ;; URL param must be last item passed to viewer, it ignores subsequent params ;; to avoid parameter injection attacks. -WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" $INSTFLAGS -url "%1"' +WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"' ; write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" -- cgit v1.2.3 From 1a9b9f1bd1b5f64b35b9ce6eff458cdb7a79fe6e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 9 Dec 2013 14:52:47 -0500 Subject: increment viewer version to 3.6.13 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 8b7b0b52e5..3609cf7707 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.12 +3.6.13 -- cgit v1.2.3