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') 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/llmessage/message_prehash.cpp | 1 + indra/llmessage/message_prehash.h | 1 + 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 +++++++++++ 8 files changed, 99 insertions(+) (limited to 'indra') diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index e71fb96540..64fb6a78a2 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1379,3 +1379,4 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs"); char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds"); char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds"); +char const* const _PREHASH_RequestTeleport = LLMessageStringTable::getInstance()->getString("RequestTeleport"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index dd2c2dbd64..4da1fa7a95 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1379,4 +1379,5 @@ extern char const* const _PREHASH_ProductSKU; extern char const* const _PREHASH_SeeAVs; extern char const* const _PREHASH_AnyAVSounds; extern char const* const _PREHASH_GroupAVSounds; +extern char const* const _PREHASH_RequestTeleport; #endif 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: 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') 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: 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') 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 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') 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 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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 46c690bd50c588f126d8b5dba67a6802d255c2bd Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales 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') 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') 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 828334ac553182e6e9db6806c3a1b8203e64bc43 Mon Sep 17 00:00:00 2001 From: Cho 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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 933cff41a6b03f2b11403970866db9fbbcf7e85f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 2 May 2013 16:41:16 -0700 Subject: ACME-307 Fix crash when clicking profile button: The crash was caused by existing code which was taking the last focused element and assuming it was a pointer to a LLUICtrl. Now assume the pointer is of type LLView since there is not need to have it as a LLUICtrl pointer. --- indra/llui/llfloater.cpp | 2 +- indra/llui/llfocusmgr.cpp | 4 ++-- indra/llui/llfocusmgr.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 09e27a264a..ef4b1450ca 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1346,7 +1346,7 @@ void LLFloater::setFocus( BOOL b ) { return; } - LLUICtrl* last_focus = gFocusMgr.getLastFocusForGroup(this); + LLView* last_focus = gFocusMgr.getLastFocusForGroup(this); // a descendent already has focus BOOL child_had_focus = hasFocus(); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 724d190307..f03c8d444b 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -469,7 +469,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus) mAppHasFocus = focus; } -LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const +LLView* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const { if (subtree_root) { @@ -477,7 +477,7 @@ LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const if (found_it != mImpl->mFocusHistory.end()) { // found last focus for this subtree - return static_cast(found_it->second.get()); + return found_it->second.get(); } } return NULL; diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index 25ae1d2579..1c7326260c 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -97,7 +97,7 @@ public: void triggerFocusFlash(); BOOL getAppHasFocus() const { return mAppHasFocus; } void setAppHasFocus(BOOL focus); - LLUICtrl* getLastFocusForGroup(LLView* subtree_root) const; + LLView* getLastFocusForGroup(LLView* subtree_root) const; void clearLastFocusForGroup(LLView* subtree_root); // If setKeyboardFocus(NULL) is called, and there is a non-NULL default -- 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') 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') 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') 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') 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/llui/llfolderview.cpp | 5 +++++ indra/llui/llfolderviewitem.cpp | 16 +++++++++++++++- indra/newview/llpanelpeople.cpp | 1 + indra/newview/llpersonfolderview.cpp | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index cf449217f5..679a76e26f 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1652,6 +1652,11 @@ void LLFolderView::update() } BOOL is_visible = isInVisibleChain(); + + if (getName() == "Persons") + { + llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl; + } // Puts folders/items in proper positions // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6c147ccc12..88bc0ccfd4 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -953,6 +953,12 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { + llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl; + if (getName() == "Facebook Friends Tab Two") + { + llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl; + } + // Sort before laying out contents // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); @@ -1109,7 +1115,11 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) BOOL LLFolderViewFolder::needsArrange() { - return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); + if (getName() != "") + { + llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl; + } + return mLastArrangeGeneration != getRoot()->getArrangeGeneration(); } // Passes selection information on to children and record selection @@ -1631,6 +1641,10 @@ void LLFolderViewFolder::requestArrange() void LLFolderViewFolder::toggleOpen() { + if (getName() == "Facebook Friends Tab Two") + { + llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl; + } setOpen(!isOpen()); } 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') 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') 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') 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') 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') 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/llui/llfolderview.cpp | 5 ----- indra/llui/llfolderviewitem.cpp | 16 +--------------- indra/newview/llpersonmodelcommon.cpp | 28 ++++++++++++++++++++++++---- indra/newview/llpersonmodelcommon.h | 14 ++++++++------ 4 files changed, 33 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 679a76e26f..9cf822892e 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1653,11 +1653,6 @@ void LLFolderView::update() BOOL is_visible = isInVisibleChain(); - if (getName() == "Persons") - { - llinfos << "Merov : update Persons, is_visible = " << is_visible << llendl; - } - // Puts folders/items in proper positions // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) // It also handles the open/close folder animation diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 88bc0ccfd4..0c0c54c38c 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -953,12 +953,6 @@ static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); // * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { - llinfos << "Merov : LLFolderViewFolder::arrange, folder = " << getName() << llendl; - if (getName() == "Facebook Friends Tab Two") - { - llinfos << "Merov : Arranging Facebook Friends Tab Two, needs arrange = " << needsArrange() << ", is open = " << isOpen() << llendl; - } - // Sort before laying out contents // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); @@ -1115,11 +1109,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height ) BOOL LLFolderViewFolder::needsArrange() { - if (getName() != "") - { - llinfos << "Merov : needsArrange for " << getName() << ", last = " << mLastArrangeGeneration << ", current = " << getRoot()->getArrangeGeneration() << ", need = " << (mLastArrangeGeneration < getRoot()->getArrangeGeneration() ? "true" : "false") << llendl; - } - return mLastArrangeGeneration != getRoot()->getArrangeGeneration(); + return mLastArrangeGeneration < getRoot()->getArrangeGeneration(); } // Passes selection information on to children and record selection @@ -1641,10 +1631,6 @@ void LLFolderViewFolder::requestArrange() void LLFolderViewFolder::toggleOpen() { - if (getName() == "Facebook Friends Tab Two") - { - llinfos << "Merov : toggleOpen, currently open is = " << isOpen() << llendl; - } setOpen(!isOpen()); } 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') 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 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/llmessage/llhttpclient.cpp | 35 +++++++++++++++++++------------- indra/llmessage/llhttpclient.h | 19 +++++++++++------ indra/llmessage/llurlrequest.cpp | 21 +++++++++++++------ indra/llmessage/llurlrequest.h | 9 ++++---- indra/newview/llpanelpeople.cpp | 15 +++++++++++--- indra/newview/tests/lltranslate_test.cpp | 4 ++-- 6 files changed, 68 insertions(+), 35 deletions(-) (limited to 'indra') diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 3561459bb4..2d16237161 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -217,7 +217,8 @@ static void request( Injector* body_injector, LLCurl::ResponderPtr responder, const F32 timeout = HTTP_REQUEST_EXPIRY_SECS, - const LLSD& headers = LLSD() + const LLSD& headers = LLSD(), + bool follow_redirects = true ) { if (!LLHTTPClient::hasPump()) @@ -231,7 +232,7 @@ static void request( } LLPumpIO::chain_t chain; - LLURLRequest* req = new LLURLRequest(method, url); + LLURLRequest* req = new LLURLRequest(method, url, follow_redirects); if(!req->isValid())//failed { if (responder) @@ -334,7 +335,8 @@ void LLHTTPClient::getByteRange( S32 bytes, ResponderPtr responder, const LLSD& hdrs, - const F32 timeout) + const F32 timeout, + bool follow_redirects /* = true */) { LLSD headers = hdrs; if(offset > 0 || bytes > 0) @@ -342,37 +344,42 @@ void LLHTTPClient::getByteRange( std::string range = llformat("bytes=%d-%d", offset, offset+bytes-1); headers["Range"] = range; } - request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers); + request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects); } void LLHTTPClient::head( const std::string& url, ResponderPtr responder, const LLSD& headers, - const F32 timeout) + const F32 timeout, + bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout, + bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers, + const F32 timeout, bool follow_redirects /* = true */) { - request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers); + request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects); } -void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout) +void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout, + bool follow_redirects /* = true */) { - getHeaderOnly(url, responder, LLSD(), timeout); + getHeaderOnly(url, responder, LLSD(), timeout, follow_redirects); } -void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, const F32 timeout) +void LLHTTPClient::get(const std::string& url, const LLSD& query, ResponderPtr responder, const LLSD& headers, + const F32 timeout, bool follow_redirects /* = true */) { LLURI uri; uri = LLURI::buildHTTP(url, LLSD::emptyArray(), query); - get(uri.asString(), responder, headers, timeout); + get(uri.asString(), responder, headers, timeout, follow_redirects); } // A simple class for managing data returned from a curl http request. diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index a7236ba169..5de257a4f6 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -63,10 +63,15 @@ public: const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), - const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr, const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void getByteRange(const std::string& url, S32 offset, S32 bytes, ResponderPtr, + const LLSD& headers=LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void get(const std::string& url, ResponderPtr, const LLSD& headers = LLSD(), + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); + static void get(const std::string& url, const LLSD& query, ResponderPtr, const LLSD& headers = LLSD(), + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); static void put( const std::string& url, @@ -74,8 +79,10 @@ public: ResponderPtr, const LLSD& headers = LLSD(), const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); - static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); + static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, + bool follow_redirects = true); + static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers, + const F32 timeout=HTTP_REQUEST_EXPIRY_SECS, bool follow_redirects = true); static void post( const std::string& url, diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 627d591839..49f8144ee7 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -150,16 +150,19 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action) return VERBS[action]; } -LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) : - mAction(action) +LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); } LLURLRequest::LLURLRequest( LLURLRequest::ERequestAction action, - const std::string& url) : - mAction(action) + const std::string& url, + bool follow_redirects /* = true */) : + mAction(action), + mFollowRedirects(follow_redirects) { initialize(); setURL(url); @@ -479,12 +482,18 @@ bool LLURLRequest::configure() case HTTP_HEAD: mDetail->mCurlRequest->setopt(CURLOPT_HEADER, 1); mDetail->mCurlRequest->setopt(CURLOPT_NOBODY, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } rv = true; break; case HTTP_GET: mDetail->mCurlRequest->setopt(CURLOPT_HTTPGET, 1); - mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + if (mFollowRedirects) + { + mDetail->mCurlRequest->setopt(CURLOPT_FOLLOWLOCATION, 1); + } // Set Accept-Encoding to allow response compression mDetail->mCurlRequest->setoptString(CURLOPT_ENCODING, ""); diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h index 44d358d906..20d6e30d17 100644 --- a/indra/llmessage/llurlrequest.h +++ b/indra/llmessage/llurlrequest.h @@ -95,7 +95,7 @@ public: * * @param action One of the ERequestAction enumerations. */ - LLURLRequest(ERequestAction action); + LLURLRequest(ERequestAction action, bool follow_redirects = true); /** * @brief Constructor. @@ -103,7 +103,7 @@ public: * @param action One of the ERequestAction enumerations. * @param url The url of the request. It should already be encoded. */ - LLURLRequest(ERequestAction action, const std::string& url); + LLURLRequest(ERequestAction action, const std::string& url, bool follow_redirects = true); /** * @brief Destructor. @@ -219,10 +219,11 @@ protected: }; EState mState; ERequestAction mAction; + bool mFollowRedirects; LLURLRequestDetail* mDetail; LLIOPipe::ptr_t mCompletionCallback; - S32 mRequestTransferedBytes; - S32 mResponseTransferedBytes; + S32 mRequestTransferedBytes; + S32 mResponseTransferedBytes; static CURLcode _sslCtxCallback(CURL * curl, void *sslctx, void *param); 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') 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') 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') 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') 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 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/llui/llfolderviewitem.cpp | 12 +++++++++++- indra/newview/llpanelpeople.cpp | 6 +++--- indra/newview/llpersontabview.cpp | 25 +++++++++++++------------ 3 files changed, 27 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 0c0c54c38c..f061313645 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -307,7 +307,12 @@ std::set LLFolderViewItem::getSelectionList() const // addToFolder() returns TRUE if it succeeds. FALSE otherwise void LLFolderViewItem::addToFolder(LLFolderViewFolder* folder) { - folder->addItem(this); + folder->addItem(this); + + // Compute indentation since parent folder changed + mIndentation = (getParentFolder()) + ? getParentFolder()->getIndentation() + mLocalIndentation + : 0; } @@ -940,6 +945,11 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) { folder->addFolder(this); + + // Compute indentation since parent folder changed + mIndentation = (getParentFolder()) + ? getParentFolder()->getIndentation() + mLocalIndentation + : 0; } static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); 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/llui/llfolderview.cpp | 2 +- indra/newview/llpanelpeople.cpp | 4 ++-- indra/newview/llpersontabview.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 9cf822892e..20eade892d 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -185,7 +185,7 @@ LLFolderView::LLFolderView(const Params& p) mAutoOpenCandidate = NULL; mAutoOpenTimer.stop(); mKeyboardSelection = FALSE; - mIndentation = p.folder_indentation; + mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0; //clear label // go ahead and render root folder as usual 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') 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') 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') 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') 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 7ba7f6d3c2db80e412e5658a5c6ce8755b75997b Mon Sep 17 00:00:00 2001 From: Merov Linden 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') 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 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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/llinventory/llparcel.cpp | 5 +++++ indra/newview/llfloaterland.cpp | 26 +++++++------------------- 2 files changed, 12 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 37c603348e..fdb056b4a1 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -521,6 +521,11 @@ S32 LLParcel::blockAccess(const LLUUID& agent_id, const LLUUID& group_id, return BA_ALLOWED; } + if(getParcelFlag(PF_DENY_ANONYMOUS) && is_agent_identified && is_agent_transacted) + { + return BA_ALLOWED; + } + return BA_NOT_IN_GROUP; } 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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 be9d94637530a9e6f5b97d5fc7e40787965e0c0a Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Wed, 14 Aug 2013 11:32:23 +0300 Subject: MAINT-2897 MAINT-2897 Need to be able to save textures from inventory as PNG --- indra/newview/llfilepicker.cpp | 62 ++++++++++++++++++++++++++ indra/newview/llfilepicker.h | 3 ++ indra/newview/llpreviewtexture.cpp | 22 +++++++-- indra/newview/skins/default/xui/en/strings.xml | 2 + 4 files changed, 85 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index d13f85baa2..65aa75c9ce 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -425,6 +425,19 @@ 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()) { @@ -1089,6 +1102,20 @@ 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) @@ -1260,6 +1287,24 @@ 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; @@ -1297,6 +1342,15 @@ 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", @@ -1349,9 +1403,17 @@ 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 4f602f63f1..8a0ecb124a 100755 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -106,6 +106,7 @@ public: FFSAVE_PNG = 13, FFSAVE_JPEG = 14, FFSAVE_SCRIPT = 15, + FFSAVE_TGAPNG = 16 }; // open the dialog. This is a modal operation @@ -175,6 +176,8 @@ 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/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 91a98792eb..1ed48a978f 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -36,6 +36,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llimagetga.h" +#include "llimagepng.h" #include "llinventory.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -261,7 +262,7 @@ void LLPreviewTexture::saveAs() LLFilePicker& file_picker = LLFilePicker::instance(); const LLInventoryItem* item = getItem() ; - if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGA, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) + if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_TGAPNG, item ? LLDir::getScrubbedFileName(item->getName()) : LLStringUtil::null) ) { // User canceled or we failed to acquire save file. return; @@ -358,14 +359,27 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, if( self && final && success ) { - LLPointer image_tga = new LLImageTGA; - if( !image_tga->encode( src ) ) + 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 ) ) { LLSD args; args["FILE"] = self->mSaveFileName; LLNotificationsUtil::add("CannotEncodeFile", args); } - else if( !image_tga->save( self->mSaveFileName ) ) + else if( image && !image->save( self->mSaveFileName ) ) { LLSD args; args["FILE"] = self->mSaveFileName; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index d4a37a9813..ed862dd269 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -447,6 +447,8 @@ 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 -- cgit v1.2.3 From 2503f825ec6749f02607a83f6af0053b51594446 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 14 Aug 2013 15:50:37 -0700 Subject: MAINT-2897 Need to be able to save textures from inventory as PNG --- indra/newview/llfilepicker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 65aa75c9ce..a105fdee09 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -764,13 +764,16 @@ OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& fi creator = 'TVOD'; extension = CFSTR(".wav"); break; - case FFSAVE_TGA: type = 'TPIC'; creator = 'prvw'; extension = CFSTR(".tga"); break; - + case FFSAVE_TGAPNG: + type = 'PNG'; + creator = 'prvw'; + extension = CFSTR(".png"); + break; case FFSAVE_BMP: type = 'BMPf'; creator = 'prvw'; -- cgit v1.2.3 From aa916288b1fb6cce42dda0e61a7d04117117d306 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Tue, 20 Aug 2013 12:07:54 +0300 Subject: MAINT-3005 FIXED Set max persistent notifications to reduce log-in time --- indra/llcommon/llsd.cpp | 5 +++++ indra/llcommon/llsd.h | 6 ++++- indra/newview/app_settings/settings.xml | 11 +++++++++ indra/newview/llpersistentnotificationstorage.cpp | 27 +++++++++++++++++------ 4 files changed, 41 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 8276ec836a..f962485284 100755 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -506,6 +506,8 @@ namespace LLSD::array_iterator beginArray() { return mData.begin(); } LLSD::array_iterator endArray() { return mData.end(); } + LLSD::reverse_array_iterator rbeginArray() { return mData.rbegin(); } + LLSD::reverse_array_iterator rendArray() { return mData.rend(); } virtual LLSD::array_const_iterator beginArray() const { return mData.begin(); } virtual LLSD::array_const_iterator endArray() const { return mData.end(); } @@ -947,6 +949,9 @@ LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); } LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); } LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); } +LLSD::reverse_array_iterator LLSD::rbeginArray() { return makeArray(impl).rbeginArray(); } +LLSD::reverse_array_iterator LLSD::rendArray() { return makeArray(impl).rendArray(); } + namespace llsd { diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 5eb69059ac..a3792c1f9d 100755 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -320,11 +320,15 @@ public: typedef std::vector::iterator array_iterator; typedef std::vector::const_iterator array_const_iterator; - + typedef std::vector::reverse_iterator reverse_array_iterator; + array_iterator beginArray(); array_iterator endArray(); array_const_iterator beginArray() const; array_const_iterator endArray() const; + + reverse_array_iterator rbeginArray(); + reverse_array_iterator rendArray(); //@} /** @name Type Testing */ diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a4a79d4d97..2949d62a1a 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5822,6 +5822,17 @@ Value 1.6 + MaxPersistentNotifications + + Comment + Maximum amount of persistent notifications + Persist + 1 + Type + S32 + Value + 250 + MaxSelectDistance Comment diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 666f10df96..c5104d54f2 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -76,6 +76,14 @@ 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); @@ -89,9 +97,6 @@ void LLPersistentNotificationStorage::loadNotifications() LL_INFOS("LLPersistentNotificationStorage") << "start loading notifications" << LL_ENDL; - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); - LLSD input; if (!readNotifications(input) ||input.isUndefined()) { @@ -109,9 +114,9 @@ void LLPersistentNotificationStorage::loadNotifications() findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); LLNotifications& instance = LLNotifications::instance(); - - for (LLSD::array_const_iterator notification_it = data.beginArray(); - notification_it != data.endArray(); + S32 processed_notifications = 0; + for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); + notification_it != data.rendArray(); ++notification_it) { LLSD notification_params = *notification_it; @@ -130,8 +135,16 @@ 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; } -- cgit v1.2.3 From 87add5bfb6d8eff4aebcf1b59068d9ecc0f8f6f2 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Tue, 20 Aug 2013 20:49:36 +0300 Subject: MAINT-2850 FIXED Windows 8.1 detected as running in windows 8 compatibility mode always --- indra/llcommon/llsys.cpp | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 57a6de9060..17099b812c 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -108,6 +108,9 @@ static const F32 MEM_INFO_THROTTLE = 20; static const F32 MEM_INFO_WINDOW = 10*60; #if LL_WINDOWS +// We cannot trust GetVersionEx function on Win8.1 , we should check this value when creating OS string +static const U32 WINNT_WINBLUE = 0x0603; + #ifndef DLLVERSIONINFO typedef struct _DllVersionInfo { @@ -208,6 +211,24 @@ static bool regex_search_no_exc(const S& string, M& match, const R& regex) } } +// GetVersionEx should not works correct with Windows 8.1 and the later version. We need to check this case +static bool check_for_version(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) +{ + OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 }; + DWORDLONG const dwlConditionMask = VerSetConditionMask( + VerSetConditionMask( + VerSetConditionMask( + 0, VER_MAJORVERSION, VER_GREATER_EQUAL), + VER_MINORVERSION, VER_GREATER_EQUAL), + VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); + + osvi.dwMajorVersion = wMajorVersion; + osvi.dwMinorVersion = wMinorVersion; + osvi.wServicePackMajor = wServicePackMajor; + + return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; +} + LLOSInfo::LLOSInfo() : mMajorVer(0), mMinorVer(0), mBuild(0), mOSVersionString("") @@ -216,6 +237,7 @@ LLOSInfo::LLOSInfo() : #if LL_WINDOWS OSVERSIONINFOEX osvi; BOOL bOsVersionInfoEx; + BOOL bShouldUseShellVersion = false; // Try calling GetVersionEx using the OSVERSIONINFOEX structure. ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); @@ -278,10 +300,18 @@ LLOSInfo::LLOSInfo() : } else if(osvi.dwMinorVersion == 2) { - if(osvi.wProductType == VER_NT_WORKSTATION) - mOSStringSimple = "Microsoft Windows 8 "; + if (check_for_version(HIBYTE(WINNT_WINBLUE), LOBYTE(WINNT_WINBLUE), 0)) + { + mOSStringSimple = "Microsoft Windows 8.1 "; + bShouldUseShellVersion = true; // GetVersionEx failed, going to use shell version + } else - mOSStringSimple = "Windows Server 2012 "; + { + if(osvi.wProductType == VER_NT_WORKSTATION) + mOSStringSimple = "Microsoft Windows 8 "; + else + mOSStringSimple = "Windows Server 2012 "; + } } ///get native system info if available.. @@ -348,9 +378,8 @@ LLOSInfo::LLOSInfo() : } else { - tmpstr = llformat("%s (Build %d)", - csdversion.c_str(), - (osvi.dwBuildNumber & 0xffff)); + tmpstr = !bShouldUseShellVersion ? llformat("%s (Build %d)", csdversion.c_str(), (osvi.dwBuildNumber & 0xffff)): + llformat("%s (Build %d)", csdversion.c_str(), shell32_build); } mOSString = mOSStringSimple + tmpstr; @@ -386,7 +415,7 @@ LLOSInfo::LLOSInfo() : std::string compatibility_mode; if(got_shell32_version) { - if(osvi.dwMajorVersion != shell32_major || osvi.dwMinorVersion != shell32_minor) + if((osvi.dwMajorVersion != shell32_major || osvi.dwMinorVersion != shell32_minor) && !bShouldUseShellVersion) { compatibility_mode = llformat(" compatibility mode. real ver: %d.%d (Build %d)", shell32_major, -- cgit v1.2.3 From ce6d63be47a7588b7b8ff53bf38d73eabc4ab04b Mon Sep 17 00:00:00 2001 From: Simon Linden Date: Wed, 21 Aug 2013 20:41:30 +0000 Subject: Fix file EOL format --- indra/llcommon/llsys.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 17099b812c..a3832ee447 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -212,21 +212,21 @@ static bool regex_search_no_exc(const S& string, M& match, const R& regex) } // GetVersionEx should not works correct with Windows 8.1 and the later version. We need to check this case -static bool check_for_version(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) -{ - OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 }; - DWORDLONG const dwlConditionMask = VerSetConditionMask( - VerSetConditionMask( - VerSetConditionMask( - 0, VER_MAJORVERSION, VER_GREATER_EQUAL), - VER_MINORVERSION, VER_GREATER_EQUAL), - VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - - osvi.dwMajorVersion = wMajorVersion; - osvi.dwMinorVersion = wMinorVersion; - osvi.wServicePackMajor = wServicePackMajor; - - return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; +static bool check_for_version(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) +{ + OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 }; + DWORDLONG const dwlConditionMask = VerSetConditionMask( + VerSetConditionMask( + VerSetConditionMask( + 0, VER_MAJORVERSION, VER_GREATER_EQUAL), + VER_MINORVERSION, VER_GREATER_EQUAL), + VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); + + osvi.dwMajorVersion = wMajorVersion; + osvi.dwMinorVersion = wMinorVersion; + osvi.wServicePackMajor = wServicePackMajor; + + return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; } -- cgit v1.2.3 From be07694b9cc8d2203cfedc777bcb00021dfa91a1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 22 Aug 2013 00:51:15 +0200 Subject: MAINT-2773: Disable texture animation doesn't work --- indra/newview/llviewerobjectlist.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 66615657d8..b4e287c446 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -954,15 +954,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) objectp = *idle_iter; llassert(objectp->isActive()); objectp->idleUpdate(agent, world, frame_time); - - } + } //update flexible objects LLVolumeImplFlexible::updateClass(); //update animated textures - LLViewerTextureAnim::updateClass(); - } + if (gAnimateTextures) + { + LLViewerTextureAnim::updateClass(); + } + } -- cgit v1.2.3 From f515c132e426c9da9f8823b6c2083952351de6df Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 22 Aug 2013 11:38:42 +0300 Subject: MAINT-2850 Fix for linux build --- indra/llcommon/llsys.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index a3832ee447..c2bd476d69 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -211,6 +211,7 @@ static bool regex_search_no_exc(const S& string, M& match, const R& regex) } } +#if LL_WINDOWS // GetVersionEx should not works correct with Windows 8.1 and the later version. We need to check this case static bool check_for_version(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) { @@ -228,6 +229,7 @@ static bool check_for_version(WORD wMajorVersion, WORD wMinorVersion, WORD wServ return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; } +#endif LLOSInfo::LLOSInfo() : -- cgit v1.2.3 From 99fb8b6725996382d05b8f90ebfd4ec8707b308c Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 22 Aug 2013 12:05:44 +0300 Subject: MAINT-2852 FIXED Update Help Menu and behavior: F1 Help menu no longer delivers results when searching dance, appearance or scripts --- indra/newview/skins/default/xui/en/menu_viewer.xml | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index db45e515ad..647e2f1b2b 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1288,19 +1288,19 @@ tear_off="true"> + name="How To" + shortcut="F1"> - - + label="Quickstart" + name="Quickstart"> + +
- - - - - - - + + + -- cgit v1.2.3 From f2b5bfc60509c3ee69d9376b7abf0e5b347e474d Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 22 Aug 2013 13:32:56 +0300 Subject: MAINT-2904 FIXED (Users of "LittleSight" viewer are invisible but can listen to spatial chat) --- indra/newview/llagent.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3b83811c78..4247c84a3a 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -1090,11 +1090,19 @@ const LLVector3d &LLAgent::getPositionGlobal() const //----------------------------------------------------------------------------- const LLVector3 &LLAgent::getPositionAgent() { - if (isAgentAvatarValid() && !gAgentAvatarp->mDrawable.isNull()) + if (isAgentAvatarValid()) { - mFrameAgent.setOrigin(gAgentAvatarp->getRenderPosition()); + if(gAgentAvatarp->mDrawable.isNull()) + { + mFrameAgent.setOrigin(gAgentAvatarp->getPositionAgent()); + } + else + { + mFrameAgent.setOrigin(gAgentAvatarp->getRenderPosition()); + } } + return mFrameAgent.getOrigin(); } -- cgit v1.2.3 From ac2dc34ed0abbac8d5a8eb7f887037fe387c6a7a Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 26 Aug 2013 20:09:58 +0300 Subject: MAINT-3041 (crash in LLScrollContainer::updateScroll() on Windows) --- indra/llui/llscrollcontainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index cbcce0ece5..238eae21c2 100755 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -519,7 +519,7 @@ bool LLScrollContainer::addChild(LLView* view, S32 tab_group) void LLScrollContainer::updateScroll() { - if (!mScrolledView) + if (!getVisible() || !mScrolledView) { return; } -- cgit v1.2.3 From 8735f383c8393d3cf102681e8243a2ac64220649 Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 29 Aug 2013 11:47:46 +0300 Subject: MAINT-3068 FIXED Inconsistent option menus on resident names in Conversations floater --- indra/newview/llchathistory.cpp | 105 ++++++++++++++++++++- .../skins/default/xui/en/menu_avatar_icon.xml | 70 +++++++++++++- 2 files changed, 168 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index af3c6eff11..afa6d4eaeb 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -60,6 +60,8 @@ #include "llstring.h" #include "llurlaction.h" #include "llviewercontrol.h" +#include "llviewerobjectlist.h" +#include "llmutelist.h" static LLDefaultChildRegistry::Register r("chat_history"); @@ -181,6 +183,18 @@ 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); @@ -189,13 +203,75 @@ 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()); @@ -460,7 +536,7 @@ protected: if(menu) { - bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL; + bool is_friend = LLAvatarActions::isFriend(mAvatarID); menu->setItemEnabled("Add Friend", !is_friend); menu->setItemEnabled("Remove Friend", is_friend); @@ -470,13 +546,34 @@ 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); } - - if (mSessionID == LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID)) + else { - menu->setItemVisible("Send IM", false); + 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->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); 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 50910dff32..77b9095f7c 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" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 19f20baffba3fcbc1558e882fee64a4ac6c28d4b Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 23 Aug 2013 20:31:02 +0300 Subject: MAINT-2575 FIXED Resident can accept unlimited number of friendship requests if they were sent before his first accept --- indra/newview/llchathistory.cpp | 51 ++++++++++++++++++++++++------------ indra/newview/lltoastnotifypanel.cpp | 22 ++++++++++++++++ indra/newview/lltoastnotifypanel.h | 2 ++ indra/newview/lltoastpanel.cpp | 6 +++++ indra/newview/lltoastpanel.h | 1 + indra/newview/llviewermessage.cpp | 42 ++++++++++++++++++++--------- 6 files changed, 95 insertions(+), 29 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index afa6d4eaeb..64ae01c82a 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -1075,25 +1075,42 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // notify processing if (chat.mNotifId.notNull()) { - LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); - if (notification != NULL) + bool create_toast = true; + for (LLToastNotifyPanel::instance_iter ti(LLToastNotifyPanel::beginInstances()) + , tend(LLToastNotifyPanel::endInstances()); ti != tend; ++ti) { - LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( + 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( 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); + } } } @@ -1123,7 +1140,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/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 94d07b37ef..3a41bf28b4 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -407,6 +407,28 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) } } +bool LLToastNotifyPanel::isControlPanelEnabled() const +{ + bool cp_enabled = mControlPanel->getEnabled(); + bool some_buttons_enabled = false; + if (cp_enabled) + { + LLView::child_list_const_iter_t child_it = mControlPanel->beginChild(); + LLView::child_list_const_iter_t child_it_end = mControlPanel->endChild(); + for(; child_it != child_it_end; ++child_it) + { + LLButton * buttonp = dynamic_cast(*child_it); + if (buttonp && buttonp->getEnabled()) + { + some_buttons_enabled = true; + break; + } + } + } + + return cp_enabled && some_buttons_enabled; +} + ////////////////////////////////////////////////////////////////////////// LLIMToastNotifyPanel::LLIMToastNotifyPanel(LLNotificationPtr& pNotification, const LLUUID& session_id, const LLRect& rect /* = LLRect::null */, diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index d02171b512..fe7f1cf8f3 100755 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -69,6 +69,8 @@ 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 a30f841980..e1b764a943 100755 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -52,6 +52,12 @@ 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 e4ab95007e..51630381f2 100755 --- a/indra/newview/lltoastpanel.h +++ b/indra/newview/lltoastpanel.h @@ -45,6 +45,7 @@ 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 151a7c6213..c6f3ef6ae3 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -45,6 +45,7 @@ #include "llsd.h" #include "llsdserialize.h" #include "llteleportflags.h" +#include "lltoastnotifypanel.h" #include "lltransactionflags.h" #include "llvfile.h" #include "llvfs.h" @@ -3214,7 +3215,20 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["online"] = (offline == IM_ONLINE); payload["sender"] = msg->getSender().getIPandPort(); - if (is_muted) + 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) { LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); } @@ -3225,18 +3239,22 @@ 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(message.empty()) - { - //support for frienship offers from clients before July 2008 - LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); - } - else + + if (add_notification) { - args["[MESSAGE]"] = message; - LLNotification::Params params("OfferFriendship"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); + if(message.empty()) + { + //support for frienship offers from clients before July 2008 + LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); + } + else + { + args["[MESSAGE]"] = message; + LLNotification::Params params("OfferFriendship"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); + } } } } -- cgit v1.2.3 From edf2b52cb2476e8d7dada9529354e8f1755d141b Mon Sep 17 00:00:00 2001 From: simon_linden Date: Tue, 3 Sep 2013 17:18:59 -0700 Subject: MAINT-3082 : Remove unused viewer LLParcel code --- indra/llinventory/llparcel.cpp | 116 ----------------------------------------- indra/llinventory/llparcel.h | 17 ------ 2 files changed, 133 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index fdb056b4a1..5eb5fb442d 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -414,122 +414,6 @@ BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const } -bool LLParcel::isAgentBlockedFromParcel(LLParcel* parcelp, - const LLUUID& agent_id, - const uuid_vec_t& group_ids, - const BOOL is_agent_identified, - const BOOL is_agent_transacted, - const BOOL is_agent_ageverified) -{ - S32 current_group_access = parcelp->blockAccess(agent_id, LLUUID::null, is_agent_identified, is_agent_transacted, is_agent_ageverified); - S32 count; - bool is_allowed = (current_group_access == BA_ALLOWED) ? true: false; - LLUUID group_id; - - count = group_ids.size(); - for (int i = 0; i < count && !is_allowed; i++) - { - group_id = group_ids[i]; - current_group_access = parcelp->blockAccess(agent_id, group_id, is_agent_identified, is_agent_transacted, is_agent_ageverified); - - if (current_group_access == BA_ALLOWED) is_allowed = true; - } - - return !is_allowed; -} - -BOOL LLParcel::isAgentBanned(const LLUUID& agent_id) const -{ - // Test ban list - if (mBanList.find(agent_id) != mBanList.end()) - { - return TRUE; - } - - return FALSE; -} - -S32 LLParcel::blockAccess(const LLUUID& agent_id, const LLUUID& group_id, - const BOOL is_agent_identified, - const BOOL is_agent_transacted, - const BOOL is_agent_ageverified) const -{ - // Test ban list - if (isAgentBanned(agent_id)) - { - return BA_BANNED; - } - - // Always allow owner on (unless he banned himself, useful for - // testing). We will also allow estate owners/managers in if they - // are not explicitly banned. - if (agent_id == mOwnerID) - { - return BA_ALLOWED; - } - - // Special case when using pass list where group access is being restricted but not - // using access list. In this case group members are allowed only if they buy a pass. - // We return BA_NOT_IN_LIST if not in list - BOOL passWithGroup = getParcelFlag(PF_USE_PASS_LIST) && !getParcelFlag(PF_USE_ACCESS_LIST) - && getParcelFlag(PF_USE_ACCESS_GROUP) && !mGroupID.isNull() && group_id == mGroupID; - - - // Test group list - if (getParcelFlag(PF_USE_ACCESS_GROUP) - && !mGroupID.isNull() - && group_id == mGroupID - && !passWithGroup) - { - return BA_ALLOWED; - } - - // Test access list - if (getParcelFlag(PF_USE_ACCESS_LIST) || passWithGroup ) - { - if (mAccessList.find(agent_id) != mAccessList.end()) - { - return BA_ALLOWED; - } - - return BA_NOT_ON_LIST; - } - - // If we're not doing any other limitations, all users - // can enter, unless - if ( !getParcelFlag(PF_USE_ACCESS_GROUP) - && !getParcelFlag(PF_USE_ACCESS_LIST)) - { - //If the land is group owned, and you are in the group, bypass these checks - if(getIsGroupOwned() && group_id == mGroupID) - { - return BA_ALLOWED; - } - - // Test for "payment" access levels - // Anonymous - No Payment Info on File - if(getParcelFlag(PF_DENY_ANONYMOUS) && !is_agent_identified && !is_agent_transacted) - { - return BA_NO_ACCESS_LEVEL; - } - // AgeUnverified - Not Age Verified - if(getParcelFlag(PF_DENY_AGEUNVERIFIED) && !is_agent_ageverified) - { - return BA_NOT_AGE_VERIFIED; - } - - return BA_ALLOWED; - } - - if(getParcelFlag(PF_DENY_ANONYMOUS) && is_agent_identified && is_agent_transacted) - { - return BA_ALLOWED; - } - - return BA_NOT_IN_GROUP; - -} - void LLParcel::setArea(S32 area, S32 sim_object_limit) { diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 0279e8bef9..c4363a48df 100755 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -527,23 +527,6 @@ public: // Can this agent change the shape of the land? BOOL allowTerraformBy(const LLUUID &agent_id) const; - // Returns 0 if access is OK, otherwise a BA_ return code above. - S32 blockAccess(const LLUUID& agent_id, - const LLUUID& group_id, - const BOOL is_agent_identified, - const BOOL is_agent_transacted, - const BOOL is_agent_ageverified) const; - - // Only checks if the agent is explicitly banned from this parcel - BOOL isAgentBanned(const LLUUID& agent_id) const; - - static bool isAgentBlockedFromParcel(LLParcel* parcelp, - const LLUUID& agent_id, - const uuid_vec_t& group_ids, - const BOOL is_agent_identified, - const BOOL is_agent_transacted, - const BOOL is_agent_ageverified); - bool operator==(const LLParcel &rhs) const; // Calculate rent - area * rent * discount rate -- cgit v1.2.3 From 90b85d1c1d3e7da49e16f78f19a20108fb839e7d Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 4 Sep 2013 17:19:40 +0300 Subject: MAINT-3086 FIXED Groups count in groups list does not display if floater is resized --- indra/newview/skins/default/xui/en/panel_people.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 20b20f722b..d22cddb601 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -484,7 +484,7 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M Date: Fri, 6 Sep 2013 11:31:11 -0700 Subject: MAINT-3109 - Add "can't attach" notification to the viewer --- indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9894136808..6fd64596ad 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9511,6 +9511,14 @@ Cannot attach object because you do not have permission to move it. Not enough script resources available to attach object! + + fail + Cannot attach object because it is already being removed. + + Date: Mon, 9 Sep 2013 21:19:44 +0300 Subject: MAINT-3117 FIXED crash in LLFloaterConversationPreview::showHistory() --- indra/newview/llfloaterconversationpreview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index b570de14aa..7cb313af33 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -126,7 +126,10 @@ void LLFloaterConversationPreview::draw() void LLFloaterConversationPreview::onOpen(const LLSD& key) { - showHistory(); + if(mChatHistoryLoaded) + { + showHistory(); + } } void LLFloaterConversationPreview::showHistory() -- cgit v1.2.3 From d995782edf1a55c327ad3f3349bd9d4b6ec3d9e6 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Tue, 10 Sep 2013 10:34:20 +0300 Subject: MAINT-3117 FIXED crash in LLFloaterConversationPreview::showHistory() Updated fix with a more complex and stable version. Integrated solution from the CHUI-836. --- indra/newview/llfloaterconversationpreview.cpp | 43 ++++++++++++-------------- indra/newview/llfloaterconversationpreview.h | 3 +- 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 7cb313af33..39630320a9 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -43,14 +43,15 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mCurrentPage(0), mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), - mCompleteName(session_id[LL_FCP_COMPLETE_NAME]) + mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), + mMutex(NULL) { } BOOL LLFloaterConversationPreview::postBuild() { mChatHistory = getChild("chat_history"); - LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::SetPages, this, _1, _2)); + LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID); std::string name; @@ -90,19 +91,19 @@ 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) { + // additional protection to avoid changes of mMessages in setPages + LLMutexLock lock(&mMutex); mMessages = messages; + mCurrentPage = (mMessages.size() ? (mMessages.size() - 1) / mPageSize : 0); - - mCurrentPage = mMessages.size() / mPageSize; mPageSpinner->setEnabled(true); mPageSpinner->setMaxValue(mCurrentPage+1); mPageSpinner->set(mCurrentPage+1); @@ -119,7 +120,6 @@ void LLFloaterConversationPreview::draw() if(mChatHistoryLoaded) { showHistory(); - mChatHistoryLoaded = false; } LLFloater::draw(); } @@ -134,32 +134,27 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key) void LLFloaterConversationPreview::showHistory() { - if (!mMessages.size()) + if (!mChatHistoryLoaded) { return; } + mChatHistoryLoaded = false; - mChatHistory->clear(); - - std::ostringstream message; - std::list::const_iterator iter = mMessages.begin(); - - int delta = 0; - if (mCurrentPage) + // additional protection to avoid changes of mMessages in setPages + LLMutexLock lock(&mMutex); + if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) { - int remainder = mMessages.size() % mPageSize; - delta = (remainder == 0) ? 0 : (mPageSize - remainder); + return; } - std::advance(iter, (mCurrentPage * mPageSize) - delta); + mChatHistory->clear(); - for (int msg_num = 0; (iter != mMessages.end() && msg_num < mPageSize); ++iter, ++msg_num) + 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) { - if (iter->size() == 0) - { - continue; - } - LLSD msg = *iter; LLUUID from_id = LLUUID::null; diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index 389f3dfd09..f8796127ba 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -42,7 +42,7 @@ public: virtual ~LLFloaterConversationPreview(){}; virtual BOOL postBuild(); - void SetPages(std::list& messages,const std::string& file_name); + void setPages(std::list& messages,const std::string& file_name); virtual void draw(); virtual void onOpen(const LLSD& key); @@ -51,6 +51,7 @@ private: void onMoreHistoryBtnClick(); void showHistory(); + LLMutex mMutex; LLSpinCtrl* mPageSpinner; LLChatHistory* mChatHistory; LLUUID mSessionID; -- cgit v1.2.3 From 60b20e3bd899198771b3c1b255be042864618cad Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 10 Sep 2013 22:12:11 +0300 Subject: MAINT-3117 FIXED crash in LLFloaterConversationPreview::showHistory() - optimization --- indra/newview/llfloaterconversationpreview.cpp | 24 +++++++++--------------- indra/newview/llfloaterconversationpreview.h | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index dd8bea01b4..5041f4689d 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -44,7 +44,8 @@ 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) + mMutex(NULL), + mShowHistory(false) { } @@ -110,35 +111,27 @@ 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); - mChatHistoryLoaded = true; + mShowHistory = true; } } void LLFloaterConversationPreview::draw() { - if(mChatHistoryLoaded) + if(mShowHistory) { showHistory(); + mShowHistory = false; } LLFloater::draw(); } void LLFloaterConversationPreview::onOpen(const LLSD& key) { - if(mChatHistoryLoaded) - { - showHistory(); - } + mShowHistory = true; } void LLFloaterConversationPreview::showHistory() { - if (!mChatHistoryLoaded) - { - return; - } - mChatHistoryLoaded = false; - // additional protection to avoid changes of mMessages in setPages LLMutexLock lock(&mMutex); if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) @@ -201,10 +194,11 @@ void LLFloaterConversationPreview::showHistory() void LLFloaterConversationPreview::onMoreHistoryBtnClick() { mCurrentPage = (int)(mPageSpinner->getValueF32()); - if (--mCurrentPage < 0) + if (!mCurrentPage) { return; } - showHistory(); + mCurrentPage--; + mShowHistory = true; } diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index f8796127ba..b0488f4ff1 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 mChatHistoryLoaded; + bool mShowHistory; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ -- cgit v1.2.3 From 9e451513d95691d073519bea12b3899807784d21 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Wed, 11 Sep 2013 11:21:27 +0300 Subject: MAINT-3069 FIXED Adding/removing item from blocklist blocks viewer up to a disconnect --- indra/newview/llblocklist.cpp | 110 ++++++++++++++++++++++++++++++++++++------ indra/newview/llblocklist.h | 21 +++++++- indra/newview/llmutelist.cpp | 17 +++++++ indra/newview/llmutelist.h | 2 + 4 files changed, 132 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 066cb71677..ac41b26a34 100755 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -41,10 +41,14 @@ static const LLBlockListNameTypeComparator NAME_TYPE_COMPARATOR; LLBlockList::LLBlockList(const Params& p) : LLFlatListViewEx(p), mSelectedItem(NULL), - mDirty(true) + mDirty(true), + mShouldAddAll(true), + mActionType(NONE), + mMuteListSize(0) { LLMuteList::getInstance()->addObserver(this); + mMuteListSize = LLMuteList::getInstance()->getMutes().size(); // Set up context menu. LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -73,6 +77,41 @@ 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); @@ -88,6 +127,16 @@ 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; @@ -136,28 +185,56 @@ void LLBlockList::refresh() bool have_filter = !mNameFilter.empty(); // save selection to restore it after list rebuilt - LLUUID selected = getSelectedUUID(); + LLUUID selected = getSelectedUUID(), next_selected; - // 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)) + if(mShouldAddAll) // creating list of blockers { - selectNextItemPair(true, 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; } - LLUUID next_selected = getSelectedUUID(); - - clear(); - - std::vector mutes = LLMuteList::instance().getMutes(); - std::vector::const_iterator mute_it = mutes.begin(); - for (; mute_it != mutes.end(); ++mute_it) + // handle filter functionality + if(have_filter || (!have_filter && !mPrevNameFilter.empty())) { - if (have_filter && !findInsensitive(mute_it->mName, mNameFilter)) - continue; + // 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(); - addNewItem(&*mute_it); + for(; it != allItems.end() ; ++it) + { + LLBlockedListItem * curItem = dynamic_cast (*it); + if(curItem) + { + hideListItem(curItem, findInsensitive(curItem->getName(), mNameFilter)); + } + } } + mPrevNameFilter = mNameFilter; if (getItemPair(selected)) { @@ -169,6 +246,7 @@ 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 1a215710f4..b1ea7e98e5 100755 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -34,6 +34,8 @@ class LLBlockedListItem; class LLMute; +enum BlockListActionType {NONE, ADD, REMOVE}; + /** * List of blocked avatars and objects. * This list represents contents of the LLMuteList. @@ -56,7 +58,8 @@ public: LLToggleableMenu* getContextMenu() const { return mContextMenu.get(); } LLBlockedListItem* getBlockedItem() const; - virtual void onChange() { refresh(); } + virtual void onChange() { } + virtual void onChangeDetailed(const LLMute& ); virtual void draw(); void setNameFilter(const std::string& filter); @@ -67,18 +70,32 @@ 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/llmutelist.cpp b/indra/newview/llmutelist.cpp index 54522bb7f6..0720d443f8 100755 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -251,6 +251,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) llinfos << "Muting by name " << mute.mName << llendl; updateAdd(mute); notifyObservers(); + notifyObserversDetailed(mute); return TRUE; } else @@ -299,6 +300,7 @@ 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 @@ -396,6 +398,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) } // Must be after erase. + notifyObserversDetailed(localmute); setLoaded(); // why is this here? -MG } else @@ -409,6 +412,7 @@ 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 } } @@ -762,3 +766,16 @@ 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 7a70370fe3..3e998b4f0e 100755 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -123,6 +123,7 @@ private: void setLoaded(); void notifyObservers(); + void notifyObserversDetailed(const LLMute &mute); void updateAdd(const LLMute& mute); void updateRemove(const LLMute& mute); @@ -173,6 +174,7 @@ class LLMuteListObserver public: virtual ~LLMuteListObserver() { } virtual void onChange() = 0; + virtual void onChangeDetailed(const LLMute& ) { } }; -- cgit v1.2.3 From 186113144e950adf78eaf452d76d3a59b6af2974 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 11 Sep 2013 14:17:56 +0300 Subject: MAINT-2894 FIXED Handle mouse events for popup menus in modal dialogs. --- indra/llui/llmodaldialog.cpp | 37 ++++++++++++++++++++++++++++++++++--- indra/newview/lltoast.cpp | 2 +- 2 files changed, 35 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index 8c2be44904..ff85b0ad09 100755 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -34,7 +34,7 @@ #include "llui.h" #include "llwindow.h" #include "llkeyboard.h" - +#include "llmenugl.h" // static std::list LLModalDialog::sModalStack; @@ -161,6 +161,18 @@ void LLModalDialog::setVisible( BOOL visible ) BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask) { + LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu(); + if (popup_menu != NULL) + { + S32 mx, my; + LLUI::getMousePositionScreen(&mx, &my); + LLRect menu_screen_rc = popup_menu->calcScreenRect(); + if(!menu_screen_rc.pointInRect(mx, my)) + { + LLMenuGL::sMenuContainer->hideMenus(); + } + } + if (mModal) { if (!LLFloater::handleMouseDown(x, y, mask)) @@ -173,16 +185,34 @@ BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask) { LLFloater::handleMouseDown(x, y, mask); } + + return TRUE; } BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask) -{ +{ if( childrenHandleHover(x, y, mask) == NULL ) { getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; } + + LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu(); + if (popup_menu != NULL) + { + S32 mx, my; + LLUI::getMousePositionScreen(&mx, &my); + LLRect menu_screen_rc = popup_menu->calcScreenRect(); + if(menu_screen_rc.pointInRect(mx, my)) + { + S32 local_x = mx - popup_menu->getRect().mLeft; + S32 local_y = my - popup_menu->getRect().mBottom; + popup_menu->handleHover(local_x, local_y, mask); + gFocusMgr.setMouseCapture(NULL); + } + } + return TRUE; } @@ -210,6 +240,7 @@ BOOL LLModalDialog::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLModalDialog::handleRightMouseDown(S32 x, S32 y, MASK mask) { + LLMenuGL::sMenuContainer->hideMenus(); childrenHandleRightMouseDown(x, y, mask); return TRUE; } diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index d876c9a3f4..448fae48de 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 LLFloater::handleMouseDown(x, y, mask); + return LLModalDialog::handleMouseDown(x, y, mask); } //-------------------------------------------------------------------------- -- cgit v1.2.3 From 2a93275a2b73c0710fc21923212766d26509ea28 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 12 Sep 2013 17:26:13 +0300 Subject: MAINT-3137 FIXED We should handle condition when viewer is quitting --- indra/newview/llfloaterimcontainer.cpp | 6 +++--- indra/newview/llfloaterimcontainer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 836a455a67..2b4585cc47 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -2098,7 +2098,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() +void LLFloaterIMContainer::onClickCloseBtn(bool app_quitting/* = false*/) { // Always unminimize before trying to close. // Most of the time the user will never see this state. @@ -2107,7 +2107,7 @@ void LLFloaterIMContainer::onClickCloseBtn() LLMultiFloater::setMinimized(FALSE); } - LLFloater::closeFloater(); + LLFloater::closeFloater(app_quitting); } void LLFloaterIMContainer::closeHostedFloater() @@ -2154,7 +2154,7 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) if(app_quitting) { closeAllConversations(); - onClickCloseBtn(); + onClickCloseBtn(app_quitting); } else { diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 36da457cac..a118ab51d2 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(); + /*virtual*/ void onClickCloseBtn(bool app_quitting = false); /*virtual*/ void closeHostedFloater(); void collapseConversationsPane(bool collapse, bool save_is_allowed=true); -- cgit v1.2.3 From a6c4863a6a14123d59955ad8fb0df82a8ac74faf Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Fri, 13 Sep 2013 13:11:41 +0300 Subject: Build fix after patch for MAINT-3137 --- indra/llui/llfloater.cpp | 2 +- indra/llui/llfloater.h | 2 +- indra/newview/llfasttimerview.cpp | 2 +- indra/newview/llfasttimerview.h | 2 +- indra/newview/llfloaterimnearbychat.cpp | 3 ++- indra/newview/llfloaterimnearbychat.h | 2 +- indra/newview/llfloaterimsession.cpp | 2 +- indra/newview/llfloaterimsession.h | 2 +- indra/newview/llfloatersidepanelcontainer.cpp | 2 +- indra/newview/llfloatersidepanelcontainer.h | 2 +- indra/newview/llsceneview.cpp | 2 +- indra/newview/llsceneview.h | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 273ceb4038..03ad664928 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1802,7 +1802,7 @@ void LLFloater::onClickClose( LLFloater* self ) self->onClickCloseBtn(); } -void LLFloater::onClickCloseBtn() +void LLFloater::onClickCloseBtn(bool app_quitting) { closeFloater(false); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 59448530d9..1693af318d 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -389,7 +389,7 @@ protected: void destroy(); // Don't call this directly. You probably want to call closeFloater() - virtual void onClickCloseBtn(); + virtual void onClickCloseBtn(bool app_quitting = false); virtual void updateTitleButtons(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 8e1a1df211..06119620de 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() +void LLFastTimerView::onClickCloseBtn(bool) { setVisible(false); } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 5766cfa0b0..1349b1e99c 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(); + virtual void onClickCloseBtn(bool app_quitting = false); private: typedef std::vector > bar_positions_t; bar_positions_t mBarStart; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 3d77ea4f0b..86e64c25e3 100755 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -308,7 +308,8 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting) } // virtual -void LLFloaterIMNearbyChat::onClickCloseBtn() +void LLFloaterIMNearbyChat::onClickCloseBtn(bool) + { if (!isTornOff()) { diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h index 05b48cccb0..f0daacd6a9 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(); + /*virtual*/ void onClickCloseBtn(bool app_qutting = false); 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 5cb9df5625..14e1a486d3 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -112,7 +112,7 @@ void LLFloaterIMSession::onTearOffClicked() } // virtual -void LLFloaterIMSession::onClickCloseBtn() +void LLFloaterIMSession::onClickCloseBtn(bool) { LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h index a0e0171b34..d6718843ca 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(); + /*virtual*/ void onClickCloseBtn(bool app_qutting); // Update the window title and input field help text /*virtual*/ void updateSessionName(const std::string& name); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 5f9556a870..c5248719e9 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() +void LLFloaterSidePanelContainer::onClickCloseBtn(bool) { 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 491723471f..65ec8f604e 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(); + /*virtual*/ void onClickCloseBtn(bool app_quitting = false); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp index 09e799e4f7..cbd8bee9d5 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() +void LLSceneView::onClickCloseBtn(bool) { setVisible(false); } diff --git a/indra/newview/llsceneview.h b/indra/newview/llsceneview.h index 2a3a14bbee..1fceecb9e1 100755 --- a/indra/newview/llsceneview.h +++ b/indra/newview/llsceneview.h @@ -38,7 +38,7 @@ public: virtual void draw(); protected: - virtual void onClickCloseBtn(); + virtual void onClickCloseBtn(bool app_qutting = false); }; -- cgit v1.2.3 From e3963666fd54f5cb1b43bc70b77660079bad5ab5 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Fri, 13 Sep 2013 14:40:22 +0300 Subject: MAINT-3133 FIXED Expand Nearby Chat participant list on first open of Conversations floater, per login session --- indra/newview/app_settings/settings_per_account.xml | 11 +++++++++++ indra/newview/llfloaterimcontainer.cpp | 19 +++++++++++++++++++ indra/newview/llfloaterimcontainer.h | 1 + 3 files changed, 31 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 636caf5ef3..500151c935 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -77,6 +77,17 @@ 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/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 2b4585cc47..3ef0cc63b1 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -101,6 +101,7 @@ LLFloaterIMContainer::~LLFloaterIMContainer() gSavedPerAccountSettings.setBOOL("ConversationsListPaneCollapsed", mConversationsPane->isCollapsed()); gSavedPerAccountSettings.setBOOL("ConversationsMessagePaneCollapsed", mMessagesPane->isCollapsed()); + gSavedPerAccountSettings.setBOOL("ConversationsParticipantListCollapsed", !isParticipantListExpanded()); if (!LLSingleton::destroyed()) { @@ -250,6 +251,11 @@ 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(); @@ -2082,6 +2088,19 @@ 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 diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index a118ab51d2..5d88b7881a 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -172,6 +172,7 @@ private: void toggleAllowTextChat(const LLUUID& participant_uuid); void toggleMute(const LLUUID& participant_id, U32 flags); void openNearbyChat(); + bool isParticipantListExpanded(); LLButton* mExpandCollapseBtn; LLButton* mStubCollapseBtn; -- cgit v1.2.3 From 433b90c44d4ea85d87a47c23aa1736b932b972c2 Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 16 Sep 2013 18:08:29 +0300 Subject: MAINT-3018 (Remove long distracting messages appearing in nearby chat) --- indra/newview/llviewermessage.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1e63977ceb..6bc480f0ed 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3822,19 +3822,6 @@ 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; @@ -4111,18 +4098,6 @@ 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(); -- cgit v1.2.3 From 6184ad34e44968e27c987e16247b5d4663eb06fa Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 16 Sep 2013 12:23:46 -0700 Subject: MAINT-3107 speculative changes to try to ameliorate rigged crasher on Intel HD with crappy default driver --- .../shaders/class1/avatar/avatarSkinV.glsl | 8 ++++--- .../shaders/class1/avatar/objectSkinV.glsl | 15 ++++++++----- indra/newview/llvoavatar.cpp | 26 +++++++++++++++++++--- 3 files changed, 37 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index bc63d07d72..3df4d333ce 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -31,10 +31,12 @@ uniform vec4 matrixPalette[45]; mat4 getSkinnedTransform() { mat4 ret; - int i = int(floor(weight.x)); + float x = fract(weight.x); - - ret[0] = mix(matrixPalette[i+0], matrixPalette[i+1], x); + int i = int(floor(weight.x)); + i = min(i, 15); + i = max(i, 0); + 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); ret[3] = vec4(0,0,0,1); diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index efd0d03965..12996cf0d6 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -34,14 +34,17 @@ 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; - - mat4 mat = matrixPalette[int(index.x)]*w.x; - mat += matrixPalette[int(index.y)]*w.y; - mat += matrixPalette[int(index.z)]*w.z; - mat += matrixPalette[int(index.w)]*w.w; + + mat4 mat = matrixPalette[int(index.x)]*w.x; + mat += matrixPalette[int(index.y)]*w.y; + mat += matrixPalette[int(index.z)]*w.z; + mat += matrixPalette[int(index.w)]*w.w; return mat; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6a504e10c4..076b2524bf 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5512,7 +5512,10 @@ void LLVOAvatar::addChild(LLViewerObject *childp) LLViewerObject::addChild(childp); if (childp->mDrawable) { - attachObject(childp); + if (!attachObject(childp)) + { + mPendingAttachment.push_back(childp); + } } else { @@ -5546,7 +5549,21 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (!attachment) { llwarns << "Object attachment point invalid: " << attachmentID << llendl; - attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + + for (int i = 0; i < 15 && !attachment; i++) + { + attachment = get_if_there(mAttachmentPoints, i, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + + if (attachment) + { + llwarns << "Object attachment point falling back to : " << i << llendl; + } + } + + if (!attachment) + { + llerrs << "Could not find any object attachment point for: " << attachmentID << llendl; + } } return attachment; @@ -5619,7 +5636,10 @@ void LLVOAvatar::lazyAttach() { if (mPendingAttachment[i]->mDrawable) { - attachObject(mPendingAttachment[i]); + if (!attachObject(mPendingAttachment[i])) + { + still_pending.push_back(mPendingAttachment[i]); + } } else { -- cgit v1.2.3 From ea9af8b873c9c088ff640a556f14f3a5989f9547 Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Tue, 17 Sep 2013 11:33:17 +0300 Subject: MAINT-3142 Hover over highlighting broken in Second Life 3.6.6 (280797) FIXED --- indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') 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 3edeb9aa36..c7edba21f8 100755 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -87,6 +87,7 @@ direction="down" height="23" image_overlay="Arrow_Left_Off" + image_hover_unselected="PushButton_Over" image_bottom_pad="1" layout="topleft" left="10" @@ -99,6 +100,7 @@ direction="down" height="23" image_overlay="Arrow_Right_Off" + image_hover_unselected="PushButton_Over" image_bottom_pad="1" layout="topleft" left_pad="0" @@ -111,6 +113,7 @@ height="23" image_bottom_pad="1" image_overlay="Home_Off" + image_hover_unselected="PushButton_Over" layout="topleft" left_pad="7" name="home_btn" -- cgit v1.2.3 From 8fa463113c19682a64988d2f8c527ef5e5dd156c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 17 Sep 2013 12:20:28 +0300 Subject: MAINT-3119 FIXED Select auto-completed part using cursor position --- indra/llui/lltexteditor.cpp | 8 ++++++++ indra/llui/lltexteditor.h | 2 ++ indra/newview/llfloaterimnearbychat.cpp | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 0c16e06109..764f0b8b36 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -666,6 +666,14 @@ void LLTextEditor::selectAll() updatePrimary(); } +void LLTextEditor::selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos) +{ + setCursorPos(prev_cursor_pos); + startSelection(); + setCursorPos(next_cursor_pos); + endSelection(); +} + BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 32b543ec0e..d3b7bc0eb7 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -144,6 +144,8 @@ public: virtual void selectAll(); virtual BOOL canSelectAll() const; + void selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos); + virtual bool canLoadOrSaveToFile(); void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE); diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 86e64c25e3..323e84751f 100755 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -494,11 +494,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->selectNext(rest_of_match, false); + mInputEditor->selectByCursorPosition(utf8_out_str.size()-rest_of_match.size(),utf8_out_str.size()); } + } else if (matchChatTypeTrigger(utf8_trigger, &utf8_out_str)) { -- cgit v1.2.3 From 3e934d5089abacbfb1c7bfbaff4a2d415587bfbb Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Mon, 23 Sep 2013 09:14:53 +0300 Subject: MAINT-3151 (Issue with urls being autoclicked when holding left click into an unfocused textbox then dragging pointer over a url and releasing.) --- indra/llui/lltextbase.cpp | 2 +- indra/llui/lltexteditor.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index cc171661ce..5ec4cf4fe5 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1029,7 +1029,7 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask) { LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); - if (cur_segment && cur_segment->handleMouseUp(x, y, mask)) + if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask)) { // Did we just click on a link? if (mURLClickSignal diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 764f0b8b36..7f309a5ff6 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -721,7 +721,6 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) setCursorAtLocalPos( x, y, true ); startSelection(); } - gFocusMgr.setMouseCapture( this ); } handled = TRUE; @@ -730,6 +729,10 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) // Delay cursor flashing resetCursorBlink(); + if (handled) + { + gFocusMgr.setMouseCapture( this ); + } return handled; } -- cgit v1.2.3 From 3bfac42f07b1896bea3fd1ece762c56e3f1fc819 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 23 Sep 2013 13:07:56 +0300 Subject: MAINT-3159 FIXED Disable buttons when refreshing ui. --- indra/newview/llfloaterland.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 22f42875fb..abe094d748 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2544,7 +2544,11 @@ 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) { -- cgit v1.2.3 From f48581b62523670558f6a9fb01fa012d3dc9d61e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 25 Sep 2013 13:52:10 -0700 Subject: Fix decl of merged genBBoxes func to match merge impl --- indra/newview/llface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llface.h b/indra/newview/llface.h index fe16920aa4..c9037ce1eb 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -195,7 +195,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, const LLMatrix3& mat_normal_in, BOOL global_volume = FALSE); + const LLMatrix4& mat_vert_in, BOOL global_volume = FALSE); void init(LLDrawable* drawablep, LLViewerObject* objp); void destroy(); -- cgit v1.2.3 From 05c6d59faa3f604a97df4125b6905c4138763dec Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 25 Sep 2013 14:08:58 -0700 Subject: BUG-3984 fix broken rendering of particles using blend funcs --- indra/newview/lldrawpoolalpha.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 7741dd66e5..6c5d229dba 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -578,10 +578,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) } } + 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.mFullbright ? (LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); 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 && @@ -616,6 +621,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLVertexBuffer::unbind(); if (!light_enabled) -- cgit v1.2.3 From 4709ca96975e24e49eba00760dd840a5b026fcb9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 26 Sep 2013 09:23:47 -0700 Subject: NORSPEC-259 revive fix stomped with materials->bear merge --- indra/llrender/llrendertarget.cpp | 4 +++- indra/newview/llviewershadermgr.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index d7f141bd92..353e61105a 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -583,8 +583,10 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0 { if (!source.mFBO) { - llerrs << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + return; } + { GLboolean write_depth = mask & GL_DEPTH_BUFFER_BIT ? TRUE : FALSE; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 0e099b8299..50f0a5f1af 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -314,7 +314,6 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredAlphaProgram); - mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredAlphaImpostorProgram); mShaderList.push_back(&gDeferredAlphaWaterProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); -- cgit v1.2.3 From b8a1fd33f5e5d438eaa708ff4687215d9f1a79c8 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 26 Sep 2013 10:12:33 -0700 Subject: Try all you want multichar constant, but you'll never be a string to me! (fix mac build errors from 'curious' filepicker literals) --- indra/newview/llfilepicker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 3fec81b627..9da8e82c49 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -659,9 +659,9 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena extension = "tga"; break; case FFSAVE_TGAPNG: - type = 'PNG'; - creator = 'prvw'; - extension = CFSTR(".png"); + type = "PNG"; + creator = "prvw"; + extension = "png"; break; case FFSAVE_BMP: type = "BMPf"; -- cgit v1.2.3 From e285d515d5b94acce280edf586a16272931749d9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 26 Sep 2013 11:32:57 -0700 Subject: NORSPEC-281 bring back a classic normal generation fix from runitai's personal collection --- indra/llmath/llvolume.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 2b865b4a8e..f74c934b21 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -166,7 +166,8 @@ void calc_tangent_from_triangle( F32 rd = s1*t2-s2*t1; - float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero + float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd) + : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero llassert(llfinite(r)); llassert(!llisnan(r)); @@ -6789,7 +6790,8 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe F32 rd = s1*t2-s2*t1; - float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero + float r = ((rd*rd) > FLT_EPSILON) ? (1.0f / rd) + : ((rd > 0.0f) ? 1024.f : -1024.f); //some made up large ratio for division by zero llassert(llfinite(r)); llassert(!llisnan(r)); -- 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/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx-objc.mm | 2 +- indra/newview/llappdelegate-objc.mm | 13 +++++++++ indra/newview/llappviewermacosx.cpp | 53 ++++++++++++----------------------- 4 files changed, 33 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 32b3bfb078..2cae6f3f72 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -49,6 +49,7 @@ void handleQuit(); bool runMainLoop(); void initMainLoop(); void cleanupViewer(); +void handleUrl(const char* url); /* Defined in llwindowmacosx-objc.mm: */ int createNSApp(int argc, const char **argv); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 0354c2b717..0768d0352e 100755 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -57,7 +57,7 @@ void setupCocoa() [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; [pool release]; - + inited = true; } } 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') 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') 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 63cc379c72e3f30a6e45c4b81c5a2e7078be0f1e Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 4 Oct 2013 02:50:50 +0300 Subject: MAINT-3270 FIXED crash in LLControlCache::LLControlCache: Control named RenderAutoMuteFunctionsnot found --- indra/llui/llfolderviewitem.cpp | 2 +- indra/llui/llui.h | 5 ----- indra/llxml/llcontrol.h | 10 ---------- indra/newview/llautoreplace.cpp | 4 ++-- indra/newview/llavatarrenderinfoaccountant.cpp | 2 +- indra/newview/llface.cpp | 2 +- indra/newview/llspatialpartition.cpp | 2 +- indra/newview/lltexturefetch.cpp | 20 ++++++++++---------- indra/newview/lltoastalertpanel.cpp | 2 +- indra/newview/lltooldraganddrop.cpp | 2 +- indra/newview/llviewerjoystick.cpp | 2 +- indra/newview/llviewermedia.cpp | 6 +++--- indra/newview/llviewershadermgr.cpp | 2 +- indra/newview/llviewertexture.cpp | 10 +++++----- indra/newview/llviewertexturelist.cpp | 6 +++--- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoavatar.cpp | 22 +++++++++++----------- indra/newview/llvoiceclient.cpp | 4 ++-- indra/newview/llvovolume.cpp | 6 +++--- 19 files changed, 48 insertions(+), 63 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 6c147ccc12..1750ca0ed4 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -521,7 +521,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) { - static LLCachedControl drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold"); + static LLCachedControl drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold", 3); mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight)); diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 0a0e0e164e..0bc4424a8c 100755 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -405,11 +405,6 @@ public: const std::string& comment = "Declared In Code") : LLCachedControl(LLUI::getControlControlGroup(name), name, default_value, comment) {} - - // This constructor will signal an error if the control doesn't exist in the control group - LLUICachedControl(const std::string& name) - : LLCachedControl(LLUI::getControlControlGroup(name), name) - {} }; namespace LLInitParam diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index e1f9be80dd..f46d21408b 100755 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -408,16 +408,6 @@ public: } } - LLCachedControl(LLControlGroup& group, - const std::string& name) - { - mCachedControlPtr = LLControlCache::getInstance(name); - if (mCachedControlPtr.isNull()) - { - mCachedControlPtr = new LLControlCache(group, name); - } - } - operator const T&() const { return mCachedControlPtr->getValue(); } operator boost::function () const { return boost::function(*this); } const T& operator()() { return mCachedControlPtr->getValue(); } diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index 1d72397cbc..dd9354fe3a 100755 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -39,7 +39,7 @@ void LLAutoReplace::autoreplaceCallback(S32& replacement_start, S32& replacement replacement_length = 0; replacement_string.clear(); - static LLCachedControl perform_autoreplace(gSavedSettings, "AutoReplace"); + static LLCachedControl perform_autoreplace(gSavedSettings, "AutoReplace", 0); if (perform_autoreplace) { S32 word_end = cursor_pos - 1; @@ -679,7 +679,7 @@ bool LLAutoReplaceSettings::decreaseListPriority(std::string listName) std::string LLAutoReplaceSettings::replaceWord(const std::string currentWord) { std::string returnedWord = currentWord; // in case no replacement is found - static LLCachedControl autoreplace_enabled(gSavedSettings, "AutoReplace"); + static LLCachedControl autoreplace_enabled(gSavedSettings, "AutoReplace", false); if ( autoreplace_enabled ) { LL_DEBUGS("AutoReplace")<<"checking '"< render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions"); + static LLCachedControl render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0); static U32 prev_render_auto_mute_functions = (U32) -1; if (prev_render_auto_mute_functions != render_auto_mute_functions) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index dbbfceb532..ae62be0ad0 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1386,7 +1386,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } } - static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback", false); #ifdef GL_TRANSFORM_FEEDBACK_BUFFER if (use_transform_feedback && diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d7ae897604..605ed541ba 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1580,7 +1580,7 @@ void LLSpatialGroup::checkOcclusion() { glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available); - static LLCachedControl wait_for_query(gSavedSettings, "RenderSynchronousOcclusion"); + static LLCachedControl wait_for_query(gSavedSettings, "RenderSynchronousOcclusion", true); if (wait_for_query && mOcclusionIssued[LLViewerCamera::sCurCameraID] < gFrameCount) { //query was issued last frame, wait until it's available diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 6173e76a35..def26b3885 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1270,7 +1270,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == LOAD_FROM_NETWORK) { - static LLCachedControl use_http(gSavedSettings,"ImagePipelineUseHTTP"); + static LLCachedControl use_http(gSavedSettings,"ImagePipelineUseHTTP", true); // if (mHost != LLHost::invalid) get_url = false; if ( use_http && mCanUseHTTP && mUrl.empty())//get http url. @@ -1697,7 +1697,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == DECODE_IMAGE) { - static LLCachedControl textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled"); + static LLCachedControl textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled", false); setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it if (textures_decode_disabled) @@ -1873,9 +1873,9 @@ bool LLTextureFetchWorker::doWork(S32 param) // virtual void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) { - static LLCachedControl log_to_viewer_log(gSavedSettings, "LogTextureDownloadsToViewerLog"); - static LLCachedControl log_to_sim(gSavedSettings, "LogTextureDownloadsToSimulator"); - static LLCachedControl log_texture_traffic(gSavedSettings, "LogTextureNetworkTraffic") ; + static LLCachedControl log_to_viewer_log(gSavedSettings, "LogTextureDownloadsToViewerLog", false); + static LLCachedControl log_to_sim(gSavedSettings, "LogTextureDownloadsToSimulator", false); + static LLCachedControl log_texture_traffic(gSavedSettings, "LogTextureNetworkTraffic", false) ; LLMutexLock lock(&mWorkMutex); // +Mw @@ -2876,7 +2876,7 @@ void LLTextureFetch::commonUpdate() //virtual S32 LLTextureFetch::update(F32 max_time_ms) { - static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS"); + static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS", 500.0); { mNetworkQueueMutex.lock(); // +Mfnq @@ -3099,8 +3099,8 @@ void LLTextureFetch::sendRequestListToSimulators() // llinfos << "IMAGE REQUEST: " << req->mID << " Discard: " << req->mDesiredDiscard // << " Packet: " << packet << " Priority: " << req->mImagePriority << llendl; - static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); - static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog", false); + static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator", false); if (log_to_viewer_log || log_to_sim) { mTextureInfo.setRequestStartTime(req->mID, LLTimer::getTotalTime()); @@ -3359,8 +3359,8 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1 if (packet_num >= (worker->mTotalPackets - 1)) { - static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog"); - static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator"); + static LLCachedControl log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog", false); + static LLCachedControl log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator", false); if (log_to_viewer_log || log_to_sim) { diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 3f75f8da5e..6083210080 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -492,7 +492,7 @@ void LLToastAlertPanel::draw() } static LLUIColor shadow_color = LLUIColorTable::instance().getColor("ColorDropShadow"); - static LLUICachedControl shadow_lines ("DropShadowFloater"); + static LLUICachedControl shadow_lines ("DropShadowFloater", 5); gl_drop_shadow( 0, LLToastPanel::getRect().getHeight(), LLToastPanel::getRect().getWidth(), 0, shadow_color, shadow_lines); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index ef7d0cd81b..1a137f7129 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -355,7 +355,7 @@ void LLToolDragAndDrop::setDragStart(S32 x, S32 y) BOOL LLToolDragAndDrop::isOverThreshold(S32 x,S32 y) { - static LLCachedControl drag_and_drop_threshold(gSavedSettings,"DragAndDropDistanceThreshold"); + static LLCachedControl drag_and_drop_threshold(gSavedSettings,"DragAndDropDistanceThreshold", 3); S32 mouse_delta_x = x - mDragStartX; S32 mouse_delta_y = y - mDragStartY; diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index f6e840adcd..aeeb591d55 100755 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -919,7 +919,7 @@ void LLViewerJoystick::moveFlycam(bool reset) { if (i == X_I || i == Y_I || i == Z_I) { - static LLCachedControl build_mode_scale(gSavedSettings,"FlycamBuildModeScale"); + static LLCachedControl build_mode_scale(gSavedSettings,"FlycamBuildModeScale", 1.0); cur_delta[i] *= build_mode_scale; } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2df028de69..fd98e0fd3e 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3758,18 +3758,18 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const // If it is attached to an avatar and the pref is off, we shouldn't show it if (attached_to_another_avatar) { - static LLCachedControl show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); + static LLCachedControl show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING, false); return show_media_on_others; } if (inside_parcel) { - static LLCachedControl show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + static LLCachedControl show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING, true); return show_media_within_parcel; } else { - static LLCachedControl show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); + static LLCachedControl show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING, true); return show_media_outside_parcel; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 50f0a5f1af..553f6a2d59 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -461,7 +461,7 @@ void LLViewerShaderMgr::setShaders() S32 deferred_class = 0; S32 transform_class = gGLManager.mHasTransformFeedback ? 1 : 0; - static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback", false); if (!use_transform_feedback) { transform_class = 0; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 84f66c359f..693eca8a06 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1422,7 +1422,7 @@ void LLViewerFetchedTexture::processTextureStats() { updateVirtualSize() ; - static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); + static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes", false); if (textures_fullres) { @@ -1747,9 +1747,9 @@ bool LLViewerFetchedTexture::setDebugFetching(S32 debug_level) bool LLViewerFetchedTexture::updateFetch() { - static LLCachedControl textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled"); - static LLCachedControl sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold"); - static LLCachedControl sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost"); + static LLCachedControl textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled", false); + static LLCachedControl sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold", 0.2); + static LLCachedControl sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost", 3); if(textures_decode_disabled) { return false ; @@ -2828,7 +2828,7 @@ void LLViewerLODTexture::processTextureStats() { updateVirtualSize() ; - static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes"); + static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes", false); if (textures_fullres) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2efe4665fa..783d1f2202 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -500,7 +500,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id, LLGLenum primary_format, LLHost request_from_host) { - static LLCachedControl fast_cache_fetching_enabled(gSavedSettings, "FastCacheFetchEnabled"); + static LLCachedControl fast_cache_fetching_enabled(gSavedSettings, "FastCacheFetchEnabled", true); LLPointer imagep ; switch(texture_type) @@ -1373,7 +1373,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) // static void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_data) { - static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ; LLFastTimer t(FTM_PROCESS_IMAGES); @@ -1445,7 +1445,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d // static void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_data) { - static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ; LLFastTimer t(FTM_PROCESS_IMAGES); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bf11bce3da..54cf7cf28d 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -313,7 +313,7 @@ public: void update() { - static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ; + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ; std::string wind_vel_text; std::string wind_vector_text; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 68abb8c72e..ce0b520983 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -707,7 +707,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisualComplexityStale(TRUE), mLoadedCallbacksPaused(FALSE), mHasPelvisOffset( FALSE ), - mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar")), + mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), @@ -2707,8 +2707,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) LLFontGL::getFontSansSerifSmall()); } - static LLUICachedControl show_display_names("NameTagShowDisplayNames"); - static LLUICachedControl show_usernames("NameTagShowUsernames"); + static LLUICachedControl show_display_names("NameTagShowDisplayNames", true); + static LLUICachedControl show_usernames("NameTagShowUsernames", true); if (LLAvatarName::useDisplayNames()) { @@ -2934,7 +2934,7 @@ void LLVOAvatar::idleUpdateNameTagAlpha(BOOL new_name, F32 alpha) LLColor4 LLVOAvatar::getNameTagColor(bool is_friend) { - static LLUICachedControl show_friends("NameTagShowFriends"); + static LLUICachedControl show_friends("NameTagShowFriends", false); const char* color_name; if (show_friends && is_friend) { @@ -2989,7 +2989,7 @@ bool LLVOAvatar::isVisuallyMuted() if (!isSelf()) { - static LLCachedControl render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions"); + static LLCachedControl render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0); if (render_auto_mute_functions) // Hacky debug switch for developing feature { // Priority order (highest priority first) @@ -3001,9 +3001,9 @@ bool LLVOAvatar::isVisuallyMuted() // - AND aren't over the thresholds // * otherwise visually mute all other avatars - static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); - static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); - static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit"); + static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); + static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0.0); + static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) { // Always want to see this AV as an impostor @@ -3390,8 +3390,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3 pelvisDir( mRoot->getWorldMatrix().getFwdRow4().mV ); - static LLCachedControl s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow"); - static LLCachedControl s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast"); + static LLCachedControl s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow", 60.0); + static LLCachedControl s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast", 2.0); F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast); @@ -7897,7 +7897,7 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d void LLVOAvatar::idleUpdateRenderCost() { - static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit"); + static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); static const U32 ARC_LIMIT = 20000; if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES)) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index af55c8f741..815965fb0a 100755 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -113,8 +113,8 @@ LLVoiceClient::LLVoiceClient() : mVoiceModule(NULL), m_servicePump(NULL), - mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled")), - mVoiceEffectDefault(LLCachedControl(gSavedPerAccountSettings, "VoiceEffectDefault")), + mVoiceEffectEnabled(LLCachedControl(gSavedSettings, "VoiceMorphingEnabled", true)), + mVoiceEffectDefault(LLCachedControl(gSavedPerAccountSettings, "VoiceEffectDefault", "00000000-0000-0000-0000-000000000000")), mPTTDirty(true), mPTT(true), mUsePTT(true), diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 436e226f3e..17efc5482b 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -693,7 +693,7 @@ void LLVOVolume::updateTextureVirtualSize(bool forced) } } - static LLCachedControl dont_load_textures(gSavedSettings,"TextureDisable"); + static LLCachedControl dont_load_textures(gSavedSettings,"TextureDisable", false); if (dont_load_textures || LLAppViewer::getTextureFetch()->mDebugPause) // || !mDrawable->isVisible()) { @@ -1036,7 +1036,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } - static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback", false); bool cache_in_vram = use_transform_feedback && gTransformPositionProgram.mProgramObject && (!mVolumeImpl || !mVolumeImpl->isVolumeUnique()); @@ -5175,7 +5175,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac U32 buffer_usage = group->mBufferUsage; - static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback", false); if (use_transform_feedback && gTransformPositionProgram.mProgramObject && //transform shaders are loaded -- cgit v1.2.3 From e4c43d6bedcd463ad9fdae7a0564b8bbb467ccb7 Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Fri, 4 Oct 2013 13:43:45 +0300 Subject: MAINT-3247 FIXED Check that gfilter is not NULL. --- indra/newview/llfilepicker.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 9da8e82c49..16eacc9392 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -939,17 +939,19 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer // 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")) + if(gfilter) { - picker->mCurrentExtension = ".tga"; - } + 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)); -- cgit v1.2.3 From f8e5ae8006b144b111f474640beb96ae135ae8ed Mon Sep 17 00:00:00 2001 From: dmitrykproductengine Date: Fri, 4 Oct 2013 14:04:31 +0300 Subject: MAINT-3142 FIXED Hover over highlighting broken in Second Life 3.6.6 (280797) --- indra/llui/llcommandmanager.cpp | 6 ++- indra/llui/llcommandmanager.h | 9 ++-- indra/llui/lltoolbar.cpp | 3 +- indra/newview/app_settings/commands.xml | 55 ++++++++++++++++++--- indra/newview/skins/default/textures/textures.xml | 4 +- .../textures/toolbar_icons/highlighting.png | Bin 500 -> 457 bytes .../toolbar_icons/highlighting_selected.png | Bin 0 -> 615 bytes .../default/textures/widgets/ComboButton_Hover.png | Bin 0 -> 459 bytes .../default/xui/en/widgets/location_input.xml | 1 + 9 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 indra/newview/skins/default/textures/toolbar_icons/highlighting_selected.png create mode 100644 indra/newview/skins/default/textures/widgets/ComboButton_Hover.png (limited to 'indra') diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index ab37ee48b6..49cfb2255e 100755 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -50,7 +50,8 @@ const LLCommandId LLCommandId::null = LLCommandId("null command"); LLCommand::Params::Params() : available_in_toybox("available_in_toybox", false) , icon("icon") - , hover_icon("hover_icon") + , hover_icon_unselected("hover_icon_unselected") + , hover_icon_selected("hover_icon_selected") , label_ref("label_ref") , name("name") , tooltip_ref("tooltip_ref") @@ -72,7 +73,8 @@ LLCommand::LLCommand(const LLCommand::Params& p) : mIdentifier(p.name) , mAvailableInToybox(p.available_in_toybox) , mIcon(p.icon) - , mHoverIcon(p.hover_icon) + , mHoverIconUnselected(p.hover_icon_unselected) + , mHoverIconSelected(p.hover_icon_selected) , mLabelRef(p.label_ref) , mName(p.name) , mTooltipRef(p.tooltip_ref) diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index 47a9b86785..9f276f712d 100755 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -96,7 +96,8 @@ public: Mandatory name; Mandatory tooltip_ref; - Optional hover_icon; + Optional hover_icon_selected; + Optional hover_icon_unselected; Mandatory execute_function; Optional execute_parameters; @@ -126,7 +127,8 @@ public: const std::string& labelRef() const { return mLabelRef; } const std::string& name() const { return mName; } const std::string& tooltipRef() const { return mTooltipRef; } - const std::string& hoverIcon() const {return mHoverIcon; } + const std::string& hoverIconUnselected() const {return mHoverIconUnselected; } + const std::string& hoverIconSelected() const {return mHoverIconSelected; } const std::string& executeFunctionName() const { return mExecuteFunction; } const LLSD& executeParameters() const { return mExecuteParameters; } @@ -153,7 +155,8 @@ private: std::string mLabelRef; std::string mName; std::string mTooltipRef; - std::string mHoverIcon; + std::string mHoverIconUnselected; + std::string mHoverIconSelected; std::string mExecuteFunction; LLSD mExecuteParameters; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 75f52b8e34..6bfe113933 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -928,7 +928,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = LLTrans::getString(commandp->tooltipRef()); button_p.image_overlay = LLUI::getUIImage(commandp->icon()); - button_p.image_hover_unselected = LLUI::getUIImage(commandp->hoverIcon()); + button_p.image_hover_unselected = LLUI::getUIImage(commandp->hoverIconUnselected()); + button_p.image_hover_selected = LLUI::getUIImage(commandp->hoverIconSelected()); button_p.button_flash_enable = commandp->isFlashingAllowed(); button_p.overwriteFrom(mButtonParams[mButtonType]); LLToolBarButton* button = LLUICtrlFactory::create(button_p); diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index aa8e3b5166..376e1a70af 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -3,6 +3,8 @@ - + + @@ -163,6 +164,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/toolbar_icons/highlighting.png b/indra/newview/skins/default/textures/toolbar_icons/highlighting.png index 093bace257..c227f07513 100644 Binary files a/indra/newview/skins/default/textures/toolbar_icons/highlighting.png and b/indra/newview/skins/default/textures/toolbar_icons/highlighting.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/highlighting_selected.png b/indra/newview/skins/default/textures/toolbar_icons/highlighting_selected.png new file mode 100644 index 0000000000..aa1bb26a56 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/highlighting_selected.png differ diff --git a/indra/newview/skins/default/textures/widgets/ComboButton_Hover.png b/indra/newview/skins/default/textures/widgets/ComboButton_Hover.png new file mode 100644 index 0000000000..d492b30b40 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/ComboButton_Hover.png differ diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 61ec046649..4ea1aa6efb 100755 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -150,6 +150,7 @@ Date: Fri, 11 Oct 2013 23:06:25 +0300 Subject: MAINT-3289 (User is not able to open mini inspector by one click on 'i' icon) --- indra/llui/lltexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 7f309a5ff6..62140dd9d6 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -729,7 +729,7 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) // Delay cursor flashing resetCursorBlink(); - if (handled) + if (handled && !gFocusMgr.getMouseCapture()) { gFocusMgr.setMouseCapture( this ); } -- cgit v1.2.3 From e43058e7640bbdb8507e153bf63a5e6adb016101 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/llappearance/lltexlayer.cpp | 5 +- indra/llrender/llcubemap.cpp | 2 +- indra/llrender/llimagegl.cpp | 127 +++++------------------------------ indra/llrender/llimagegl.h | 11 +-- indra/llrender/llrendertarget.cpp | 8 +-- indra/llrender/llvertexbuffer.cpp | 22 ++---- indra/llrender/llvertexbuffer.h | 4 -- indra/newview/llspatialpartition.cpp | 31 +++++---- indra/newview/llvoavatar.cpp | 6 +- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/pipeline.cpp | 12 ++-- 11 files changed, 56 insertions(+), 174 deletions(-) (limited to 'indra') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index f951a982e5..a3a8616864 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1123,7 +1123,10 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height) // *TODO: Is this correct? //gPipeline.disableLights(); stop_glerror(); - glDisable(GL_LIGHTING); + if (!LLGLSLShader::sNoFixedFunction) + { + glDisable(GL_LIGHTING); + } stop_glerror(); bool use_shaders = LLGLSLShader::sNoFixedFunction; diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 362452d837..45a3b18179 100755 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -81,7 +81,7 @@ void LLCubeMap::initGL() { U32 texname = 0; - LLImageGL::generateTextures(LLTexUnit::TT_CUBE_MAP, GL_RGB8, 1, &texname); + LLImageGL::generateTextures(1, &texname); for (int i = 0; i < 6; i++) { diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 6a37d31415..ab875141c5 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -54,8 +54,6 @@ S32 LLImageGL::sGlobalTextureMemoryInBytes = 0; S32 LLImageGL::sBoundTextureMemoryInBytes = 0; S32 LLImageGL::sCurBoundTextureMemory = 0; S32 LLImageGL::sCount = 0; -LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE]; -U32 LLImageGL::sCurTexName = 1; BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; F32 LLImageGL::sLastFrameTime = 0.f; @@ -716,7 +714,12 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) mMipLevels = wpo2(llmax(w, h)); //use legacy mipmap generation mode (note: making this condional can cause rendering issues) - glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); + // -- but making it not conditional triggers deprecation warnings when core profile is enabled + // (some rendering issues while core profile is enabled are acceptable at this point in time) + if (!LLRender::sGLCoreProfile) + { + glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); + } LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, @@ -1084,95 +1087,19 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_ // static static LLFastTimer::DeclareTimer FTM_GENERATE_TEXTURES("generate textures"); -void LLImageGL::generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures) +void LLImageGL::generateTextures(S32 numTextures, U32 *textures) { LLFastTimer t(FTM_GENERATE_TEXTURES); - bool empty = true; - - if (LLRender::sGLCoreProfile) - { - switch (format) - { - case GL_LUMINANCE8: format = GL_RGB8; break; - case GL_LUMINANCE8_ALPHA8: - case GL_ALPHA8: format = GL_RGBA8; break; - } - } - - dead_texturelist_t::iterator iter = sDeadTextureList[type].find(format); - - if (iter != sDeadTextureList[type].end()) - { - empty = iter->second.empty(); - } - - for (S32 i = 0; i < numTextures; ++i) - { - if (!empty) - { - textures[i] = iter->second.front(); - iter->second.pop_front(); - empty = iter->second.empty(); - } - else - { - textures[i] = sCurTexName++; - } - } + glGenTextures(numTextures, textures); } // static -void LLImageGL::deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 mip_levels, S32 numTextures, U32 *textures, bool immediate) +void LLImageGL::deleteTextures(S32 numTextures, U32 *textures) { if (gGLManager.mInited) { - switch (format) - { - case 0: - - // We get ARB errors in debug when attempting to use glTexImage2D with these deprecated pix formats - // - case GL_LUMINANCE8: - case GL_INTENSITY8: - case GL_ALPHA8: - glDeleteTextures(numTextures, textures); - break; - - default: - { - if (type == LLTexUnit::TT_CUBE_MAP || mip_levels == -1) - { //unknown internal format or unknown number of mip levels, not safe to reuse - glDeleteTextures(numTextures, textures); - } - else - { - for (S32 i = 0; i < numTextures; ++i) - { //remove texture from VRAM by setting its size to zero - - for (S32 j = 0; j <= mip_levels; j++) - { - gGL.getTexUnit(0)->bindManual(type, textures[i]); - U32 internal_type = LLTexUnit::getInternalType(type); - glTexImage2D(internal_type, j, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - stop_glerror(); - } - - llassert(std::find(sDeadTextureList[type][format].begin(), - sDeadTextureList[type][format].end(), textures[i]) == - sDeadTextureList[type][format].end()); - - sDeadTextureList[type][format].push_back(textures[i]); - } - } + glDeleteTextures(numTextures, textures); } - break; - } - } - - /*if (immediate) - { - LLImageGL::deleteDeadTextures(); - }*/ } // static @@ -1300,11 +1227,11 @@ BOOL LLImageGL::createGLTexture() if(mTexName) { - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, (reinterpret_cast(&mTexName))) ; + LLImageGL::deleteTextures(1, (reinterpret_cast(&mTexName))) ; } - LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); + LLImageGL::generateTextures(1, &mTexName); stop_glerror(); if (!mTexName) { @@ -1419,7 +1346,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ } else { - LLImageGL::generateTextures(mBindTarget, mFormatInternal, 1, &mTexName); + LLImageGL::generateTextures(1, &mTexName); stop_glerror(); { llverify(gGL.getTexUnit(0)->bind(this)); @@ -1464,7 +1391,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ { sGlobalTextureMemoryInBytes -= mTextureMemory; - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, &old_name); + LLImageGL::deleteTextures(1, &old_name); stop_glerror(); } @@ -1593,30 +1520,6 @@ void LLImageGL::deleteDeadTextures() { bool reset = false; - /*while (!sDeadTextureList.empty()) - { - GLuint tex = sDeadTextureList.front(); - sDeadTextureList.pop_front(); - for (int i = 0; i < gGLManager.mNumTextureImageUnits; i++) - { - LLTexUnit* tex_unit = gGL.getTexUnit(i); - - if (tex_unit && tex_unit->getCurrTexture() == tex) - { - tex_unit->unbind(tex_unit->getCurrType()); - stop_glerror(); - - if (i > 0) - { - reset = true; - } - } - } - - glDeleteTextures(1, &tex); - stop_glerror(); - }*/ - if (reset) { gGL.getTexUnit(0)->activate(); @@ -1633,7 +1536,7 @@ void LLImageGL::destroyGLTexture() mTextureMemory = 0; } - LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, &mTexName); + LLImageGL::deleteTextures(1, &mTexName); mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. mTexName = 0; mGLTextureCreated = FALSE ; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 57a052b258..0c62dd0d33 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -45,16 +45,9 @@ class LLImageGL : public LLRefCount { friend class LLTexUnit; public: - static U32 sCurTexName; - - //previously used but now available texture names - // sDeadTextureList[][] - typedef std::map > dead_texturelist_t; - static dead_texturelist_t sDeadTextureList[LLTexUnit::TT_NONE]; - // These 2 functions replace glGenTextures() and glDeleteTextures() - static void generateTextures(LLTexUnit::eTextureType type, U32 format, S32 numTextures, U32 *textures); - static void deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 mip_levels, S32 numTextures, U32 *textures, bool immediate = false); + static void generateTextures(S32 numTextures, U32 *textures); + static void deleteTextures(S32 numTextures, U32 *textures); static void deleteDeadTextures(); // Size calculation diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 353e61105a..b82b370d6e 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -194,7 +194,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) } U32 tex; - LLImageGL::generateTextures(mUsage, color_fmt, 1, &tex); + LLImageGL::generateTextures(1, &tex); gGL.getTexUnit(0)->bindManual(mUsage, tex); stop_glerror(); @@ -280,7 +280,7 @@ bool LLRenderTarget::allocateDepth() } else { - LLImageGL::generateTextures(mUsage, GL_DEPTH_COMPONENT24, 1, &mDepth); + LLImageGL::generateTextures(1, &mDepth); gGL.getTexUnit(0)->bindManual(mUsage, mDepth); U32 internal_type = LLTexUnit::getInternalType(mUsage); @@ -357,7 +357,7 @@ void LLRenderTarget::release() } else { - LLImageGL::deleteTextures(mUsage, 0, 0, 1, &mDepth, true); + LLImageGL::deleteTextures(1, &mDepth); stop_glerror(); } mDepth = 0; @@ -389,7 +389,7 @@ void LLRenderTarget::release() if (mTex.size() > 0) { sBytesAllocated -= mResX*mResY*4*mTex.size(); - LLImageGL::deleteTextures(mUsage, mInternalFormat[0], 0, mTex.size(), &mTex[0], true); + LLImageGL::deleteTextures(mTex.size(), &mTex[0]); mTex.clear(); mInternalFormat.clear(); } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index f168b3af14..e6f20cd40e 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -91,7 +91,6 @@ LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_ U32 LLVBOPool::sBytesPooled = 0; U32 LLVBOPool::sIndexBytesPooled = 0; -U32 LLVBOPool::sCurGLName = 1; std::list LLVertexBuffer::sAvailableVAOName; U32 LLVertexBuffer::sCurVAOName = 1; @@ -125,16 +124,8 @@ U32 LLVBOPool::genBuffer() { U32 ret = 0; - if (mGLNamePool.empty()) - { - ret = sCurGLName++; - } - else - { - ret = mGLNamePool.front(); - mGLNamePool.pop_front(); - } - + glGenBuffersARB(1, &ret); + return ret; } @@ -146,12 +137,9 @@ void LLVBOPool::deleteBuffer(U32 name) glBindBufferARB(mType, name); glBufferDataARB(mType, 0, NULL, mUsage); - - llassert(std::find(mGLNamePool.begin(), mGLNamePool.end(), name) == mGLNamePool.end()); - - mGLNamePool.push_back(name); - glBindBufferARB(mType, 0); + + glDeleteBuffersARB(1, &name); } } @@ -1333,7 +1321,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) //actually allocate space for the vertex buffer if using VBO mapping flush(); - if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO)) + if (gGLManager.mHasVertexArrayObject && useVBOs() && sUseVAO) { #if GL_ARB_vertex_array_object mGLArray = getVAOName(); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index de58207c23..619a0cec46 100755 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -57,8 +57,6 @@ public: static U32 sBytesPooled; static U32 sIndexBytesPooled; - static U32 sCurGLName; - LLVBOPool(U32 vboUsage, U32 vboType); const U32 mUsage; @@ -86,8 +84,6 @@ public: volatile U8* mClientData; }; - std::list mGLNamePool; - typedef std::list record_list_t; std::vector mFreeList; std::vector mMissCount; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 605ed541ba..10dbfa26ff 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 ce0b520983..6d29919784 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 ; } } @@ -7292,7 +7292,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); @@ -7329,7 +7329,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 465809711e69a95cbdc9d0b5066a308a5077e0a0 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') 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 10dbfa26ff..2c83f6d0b7 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 dbb67c326f3dca8e418b10e0b898b0ad3e4e84ba Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 14 Oct 2013 14:17:54 +0300 Subject: merge --- indra/newview/llfloatergroupinvite.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 0c735dec1f..d0f3289769 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 "llagent.h" #include "llgroupmgr.h" class LLFloaterGroupInvite::impl @@ -126,6 +127,7 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen (LLFloaterGroupInvite*)NULL); // refresh group information + gAgent.sendAgentDataUpdateRequest(); LLGroupMgr::getInstance()->clearGroupData(group_id); -- cgit v1.2.3 From 04b84ce07dd5bc8364f948ef0004e3dc5328f1b4 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 14 Oct 2013 14:21:06 +0300 Subject: MAINT-3290 FIXED Handle correctly Mouse Capture for LLTextBox. --- indra/llui/lltextbox.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 11cfa1d263..d175204e6d 100755 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -59,11 +59,14 @@ BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) } if (!handled && mClickedCallback) + { + handled = TRUE; + } + + if (handled) { // Route future Mouse messages here preemptively. (Release on mouse up.) gFocusMgr.setMouseCapture( this ); - - handled = TRUE; } return handled; @@ -71,7 +74,7 @@ BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; + BOOL handled = LLTextBase::handleMouseUp(x, y, mask); if (getSoundFlags() & MOUSE_UP) { @@ -93,10 +96,6 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) handled = TRUE; } } - else - { - handled = LLTextBase::handleMouseUp(x, y, mask); - } return handled; } -- cgit v1.2.3 From 913e55b5ce4c5e018d18678b9a78b06541976da1 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 16 Oct 2013 12:06:42 -0700 Subject: MAINT-3312 : crash in LLVOAvatar::lazyAttach(). Reverted some earlier changes --- indra/newview/llvoavatar.cpp | 50 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6d29919784..f92fa0371e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5523,7 +5523,12 @@ void LLVOAvatar::addChild(LLViewerObject *childp) { if (!attachObject(childp)) { - mPendingAttachment.push_back(childp); + llwarns << "addChild() failed for " + << childp->getID() + << " item " << childp->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + // mPendingAttachment.push_back(childp); } } else @@ -5557,21 +5562,26 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (!attachment) { - llwarns << "Object attachment point invalid: " << attachmentID << llendl; + llwarns << "Object attachment point invalid: " << attachmentID + << " trying to use 1 (chest)" + << llendl; - for (int i = 0; i < 15 && !attachment; i++) + attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + if (attachment) { - attachment = get_if_there(mAttachmentPoints, i, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) - - if (attachment) - { - llwarns << "Object attachment point falling back to : " << i << llendl; - } + llwarns << "Object attachment point invalid: " << attachmentID + << " on object " << viewer_object->getID() + << " attachment item " << viewer_object->getAttachmentItemID() + << " falling back to 1 (chest)" + << llendl; } - - if (!attachment) + else { - llerrs << "Could not find any object attachment point for: " << attachmentID << llendl; + llwarns << "Object attachment point invalid: " << attachmentID + << " on object " << viewer_object->getID() + << " attachment item " << viewer_object->getAttachmentItemID() + << "Unable to use fallback attachment point 1 (chest)" + << llendl; } } @@ -5643,16 +5653,22 @@ void LLVOAvatar::lazyAttach() for (U32 i = 0; i < mPendingAttachment.size(); i++) { - if (mPendingAttachment[i]->mDrawable) + LLPointer cur_attachment = mPendingAttachment[i]; + if (cur_attachment->mDrawable) { - if (!attachObject(mPendingAttachment[i])) - { - still_pending.push_back(mPendingAttachment[i]); + if (!attachObject(cur_attachment)) + { // Drop it + llwarns << "attachObject() failed for " + << cur_attachment->getID() + << " item " << cur_attachment->getAttachmentItemID() + << llendl; + // MAINT-3312 backout + //still_pending.push_back(cur_attachment); } } else { - still_pending.push_back(mPendingAttachment[i]); + still_pending.push_back(cur_attachment); } } -- cgit v1.2.3 From d61b6425b7a90b50ea121656ac34cc2a989f9bfb Mon Sep 17 00:00:00 2001 From: MaximB ProductEngine Date: Thu, 17 Oct 2013 00:47:55 +0300 Subject: MAINT-3294 (Microphone button clipped when resizing Conversations List in CHUI) --- indra/newview/skins/default/xui/en/floater_im_container.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') 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 b639d534c3..28c89868bd 100755 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -42,7 +42,7 @@ user_resize="true" name="conversations_layout_panel" min_dim="43" - expanded_min_dim="136"> + expanded_min_dim="140"> + width="35">