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(+) 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 --- doc/contributions.txt | 1 + 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 +++++++++++ 9 files changed, 100 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 04edfb4bea..cc5fb53b57 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -629,6 +629,7 @@ Jonathan Yap STORM-1809 STORM-1793 STORM-1810 + STORM-1838 Kadah Coba STORM-1060 Jondan Lundquist 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(-) 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(+) 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 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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 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 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 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(-) 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(-) 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 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(+) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(+) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(+) 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 --- doc/contributions.txt | 1 + indra/newview/llfloaterpreference.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 09c0d01b11..28de94f186 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -301,6 +301,7 @@ Ciaran Laval Cinder Roxley BUG-2326 STORM-1703 + STORM-1888 Clara Young Coaldust Numbers VWR-1095 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(-) 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(+) 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(+) 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(-) 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(+) 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(-) 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(+) 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 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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(-) 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 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(-) 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(+) 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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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(-) 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 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(-) 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 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(-) 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 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(-) 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(-) 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(-) 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 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(-) 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(-) 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(+) 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(-) 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(-) 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 b75213b39ad7456d04d3e1644f2116853ead0da0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 5 Aug 2013 11:19:54 -0400 Subject: open-185: remove duplicate gperftools entry in autobuild.xml --- autobuild.xml | 36 ------------------------------------ doc/contributions.txt | 1 + 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 628d3f6883..e13536c3b3 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -879,42 +879,6 @@ - gperftools - - license - bsd - license_file - LICENSES/gperftools.txt - name - gperftools - platforms - - linux - - archive - - hash - 8aedfdcf670348c18a9991ae1b384a61 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2 - - name - linux - - windows - - archive - - hash - f62841804acb91e1309603a84f3f0ce8 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2 - - name - windows - - - gstreamer license diff --git a/doc/contributions.txt b/doc/contributions.txt index 72096a0ab7..18e8ba0189 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -300,6 +300,7 @@ Christopher Organiser Ciaran Laval Cinder Roxley BUG-2326 + OPEN-185 STORM-1703 STORM-1958 STORM-1951 -- 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(-) 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 c7342bc6c0950add28918159935b8001c4ad2dc8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales 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(-) 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(-) 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 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(-) 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(-) 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 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 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(-) 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 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(-) 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 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(-) 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(-) 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(-) 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 4595978d59d905bc9ef95efd759eac8cb62b57c3 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 14 Aug 2013 20:02:31 +0100 Subject: removed momentary error message upon connecting to Facebook --- indra/newview/llfacebookconnect.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 0a4fefbd24..abfacdb93c 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -81,18 +81,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(); } + + // connect to facebook + if (query_map.has("code")) + { + LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state")); + } return true; } } -- 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 --- doc/contributions.txt | 1 + indra/newview/llviewerobjectlist.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 7712f16ade..caeda19496 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -176,6 +176,7 @@ Ansariel Hiller STORM-1713 STORM-1899 MAINT-2368 + MAINT-2773 Aralara Rajal Ardy Lay STORM-859 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 6c45b3677ee06cd58056447a4b7b45fa78df8b74 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 24 Aug 2013 02:15:08 +0100 Subject: added Google Analytics query parameters to URLs for FBC photos and checkins for ACME-854 --- indra/newview/llfloatersocial.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4c17d9e40d..2a74c8e3ea 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -55,6 +55,8 @@ 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://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; +const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; +const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare"; std::string get_map_url() { @@ -345,12 +347,19 @@ void LLSocialPhotoPanel::sendPhoto() bool add_location = mLocationCheckbox->getValue().asBoolean(); if (add_location) { + // Get the SLURL for the location LLSLURL slurl; LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS; + + // Add it to the caption (pretty crude, but we don't have a better option with photos) if (caption.empty()) - caption = slurl.getSLURLString(); + caption = slurl_string; else - caption = caption + " " + slurl.getSLURLString(); + caption = caption + " " + slurl_string; } // Get the image @@ -592,6 +601,9 @@ void LLSocialCheckinPanel::sendCheckin() { slurl_string = DEFAULT_CHECKIN_LOCATION_URL; } + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS; // Get the region name std::string region_name = gAgent.getRegion()->getName(); -- cgit v1.2.3 From ecc4f2357df4cc139aa4e6a6a22f1ac5460f6871 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 26 Aug 2013 16:42:31 -0400 Subject: remove unused --logevents command line option because new validation causes unmapped options to be errors --- indra/newview/app_settings/cmd_line.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 789a07fbe2..a9f6079630 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -177,14 +177,6 @@ UserLoginInfo - logevents - - desc - Log ui events for later playback - map-to - LogEvents - - logmetrics desc -- cgit v1.2.3 From a4e74449857c57bf67104087015560baa69789ab Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 26 Aug 2013 16:43:03 -0400 Subject: correct merge error in llupdatechecker.cpp --- .../viewer_components/updater/llupdatechecker.cpp | 39 +++------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 3e170e44f4..abdace979a 100755 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -149,40 +149,11 @@ void LLUpdateChecker::Implementation::completed(U32 status, server_error += content["error_text"].asString(); } - if (status == 404) - { - if (mProtocol == sProtocolVersion) - { - mProtocol = sLegacyProtocolVersion; - std::string retryUrl = buildUrl(mUrlBase, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); - - LL_WARNS("UpdaterService") - << "update response using " << sProtocolVersion - << " was HTTP 404 (" << server_error - << "); retry with legacy protocol " << mProtocol - << "\n at " << retryUrl - << LL_ENDL; - - mHttpClient.get(retryUrl, this); - } - else - { - LL_WARNS("UpdaterService") - << "update response using " << sLegacyProtocolVersion - << " was 404 (" << server_error - << "); request failed" - << LL_ENDL; - mClient.error(reason); - } - } - else - { - LL_WARNS("UpdaterService") << "response error " << status - << " " << reason - << " (" << server_error << ")" - << LL_ENDL; - mClient.error(reason); - } + LL_WARNS("UpdaterService") << "response error " << status + << " " << reason + << " (" << server_error << ")" + << LL_ENDL; + mClient.error(reason); } else { -- cgit v1.2.3 From 7614589adcf796e889c7d1d4ccda56a4b9353d31 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 27 Aug 2013 16:31:36 -0400 Subject: MAINT-3074: Remove warning log that kills FPS --- indra/llui/llview.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9a42fc637b..262d9335c0 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -995,7 +995,6 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) BOOL LLView::handleUnicodeCharHere(llwchar uni_char ) { - llwarns << "LLView::handleUnicodeCharHere - about to return false - key is not being handled - a class somewhere should implement this method" << llendl; return FALSE; } -- cgit v1.2.3 From 306b2d810effdc677194f4db26c906a59e7386ff Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 27 Aug 2013 16:27:19 -0400 Subject: Fix coding style fails --- indra/llui/llview.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 262d9335c0..20015dca1a 100755 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -760,15 +760,15 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA if ((viewp->*method)( local_x, local_y, extra ) || (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y ))) { - lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; - lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl; + lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl; + lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl; - LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); + LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname()); - // This is NOT event recording related - viewp->logMouseEvent(); + // This is NOT event recording related + viewp->logMouseEvent(); - return viewp; + return viewp; } } return NULL; @@ -936,7 +936,8 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) // For event logging we don't care which widget handles it // So we capture the key at the end of this function once we know if it was handled handled = handleKeyHere( key, mask ); - if (handled) { + if (handled) + { llwarns << "Key handled by " << getName() << llendl; } } @@ -985,7 +986,8 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) handled = mParentView->handleUnicodeChar(uni_char, FALSE); } - if (handled) { + if (handled) + { LLViewerEventRecorder::instance().logKeyUnicodeEvent(uni_char); } @@ -1018,21 +1020,16 @@ BOOL LLView::hasMouseCapture() BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask) { - - LLView* r = childrenHandleMouseUp( x, y, mask ); return (r!=NULL); - } BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask) { - LLView* r= childrenHandleMouseDown(x, y, mask ); return (r!=NULL); - } BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From 3364614f8b3c61a369760b4effc2ed9382be75f9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 09:27:12 -0400 Subject: add "Settings" logging tag to make debugging settings loading easier --- indra/llxml/llcontrol.cpp | 31 ++++++++++++++++--------------- indra/newview/llappviewer.cpp | 22 +++++++++++----------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 16f2290787..97fad7feb0 100755 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -391,7 +391,7 @@ LLControlVariable* LLControlGroup::declareControl(const std::string& name, eCont } else { - llwarns << "Control named " << name << " already exists, ignoring new declaration." << llendl; + LL_WARNS("Settings") << "Control named " << name << " already exists, ignoring new declaration." << LL_ENDL; } return existing_control; } @@ -630,14 +630,14 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require if (!xml_controls.parseFile(filename)) { - llwarns << "Unable to open control file " << filename << llendl; + LL_WARNS("Settings") << "Unable to open control file " << filename << LL_ENDL; return 0; } LLXmlTreeNode* rootp = xml_controls.getRoot(); if (!rootp || !rootp->hasAttribute("version")) { - llwarns << "No valid settings header found in control file " << filename << llendl; + LL_WARNS("Settings") << "No valid settings header found in control file " << filename << LL_ENDL; return 0; } @@ -650,7 +650,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require // Check file version if (version != CURRENT_VERSION) { - llinfos << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << llendl; + LL_INFOS("Settings") << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << LL_ENDL; return 0; } @@ -668,7 +668,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require if (!name.empty()) { //read in to end of line - llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl; + LL_WARNS("Settings") << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << LL_ENDL; } child_nodep = rootp->getNextChild(); continue; @@ -822,7 +822,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only LLControlVariable* control = iter->second; if (!control) { - llwarns << "Tried to save invalid control: " << iter->first << llendl; + LL_WARNS("Settings") << "Tried to save invalid control: " << iter->first << LL_ENDL; } else if( control->shouldSave(nondefault_only) ) { @@ -838,12 +838,12 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only { LLSDSerialize::toPrettyXML(settings, file); file.close(); - llinfos << "Saved to " << filename << llendl; + LL_INFOS("Settings") << "Saved to " << filename << LL_ENDL; } else { // This is a warning because sometime we want to use settings files which can't be written... - llwarns << "Unable to open settings file: " << filename << llendl; + LL_WARNS("Settings") << "Unable to open settings file: " << filename << LL_ENDL; return 0; } return num_saved; @@ -856,14 +856,14 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v infile.open(filename); if(!infile.is_open()) { - llwarns << "Cannot find file " << filename << " to load." << llendl; + LL_WARNS("Settings") << "Cannot find file " << filename << " to load." << LL_ENDL; return 0; } if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings, infile)) { infile.close(); - llwarns << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << llendl; + LL_WARNS("Settings") << "Unable to parse LLSD control file " << filename << ". Trying Legacy Method." << LL_ENDL; return loadFromFileLegacy(filename, TRUE, TYPE_STRING); } @@ -976,6 +976,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v ++validitems; } + LL_DEBUGS("Settings") << "Loaded " << validitems << " settings from " << filename << LL_ENDL; return validitems; } @@ -1012,7 +1013,7 @@ void main() BOOL_CONTROL baz; U32 count = gGlobals.loadFromFile("controls.ini"); - llinfos << "Loaded " << count << " controls" << llendl; + LL_INFOS("Settings") << "Loaded " << count << " controls" << LL_ENDL; // test insertion foo = new LLControlVariable("gFoo", 5.f, 1.f, 20.f); @@ -1273,19 +1274,19 @@ LLColor4 convert_from_llsd(const LLSD& sd, eControlType type, const st LLColor4 color(sd); if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f) { - llwarns << "Color " << control_name << " red value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " red value out of range: " << color << LL_ENDL; } else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f) { - llwarns << "Color " << control_name << " green value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " green value out of range: " << color << LL_ENDL; } else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f) { - llwarns << "Color " << control_name << " blue value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " blue value out of range: " << color << LL_ENDL; } else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f) { - llwarns << "Color " << control_name << " alpha value out of range: " << color << llendl; + LL_WARNS("Settings") << "Color " << control_name << " alpha value out of range: " << color << LL_ENDL; } return LLColor4(sd); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 338558c937..8a7c24c5b5 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2227,13 +2227,13 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, BOOST_FOREACH(const SettingsFile& file, group.files) { - llinfos << "Attempting to load settings for the group " << file.name() - << " - from location " << location_key << llendl; + LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() + << " - from location " << location_key << LL_ENDL; LLControlGroup* settings_group = LLControlGroup::getInstance(file.name); if(!settings_group) { - llwarns << "No matching settings group for name " << file.name() << llendl; + LL_WARNS("Settings") << "No matching settings group for name " << file.name() << LL_ENDL; continue; } @@ -2262,7 +2262,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, if(settings_group->loadFromFile(full_settings_path, set_defaults, file.persistent)) { // success! - llinfos << "Loaded settings file " << full_settings_path << llendl; + LL_INFOS("Settings") << "Loaded settings file " << full_settings_path << LL_ENDL; } else { // failed to load @@ -2276,7 +2276,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, // only complain if we actually have a filename at this point if (!full_settings_path.empty()) { - llinfos << "Cannot load " << full_settings_path << " - No settings found." << llendl; + LL_INFOS("Settings") << "Cannot load " << full_settings_path << " - No settings found." << LL_ENDL; } } } @@ -2435,8 +2435,8 @@ bool LLAppViewer::initConfiguration() gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, clp.getOption("settings")[0]); gSavedSettings.setString("ClientSettingsFile", user_settings_filename); - llinfos << "Using command line specified settings filename: " - << user_settings_filename << llendl; + LL_INFOS("Settings") << "Using command line specified settings filename: " + << user_settings_filename << LL_ENDL; } // - load overrides from user_settings @@ -2452,8 +2452,8 @@ bool LLAppViewer::initConfiguration() { std::string session_settings_filename = clp.getOption("sessionsettings")[0]; gSavedSettings.setString("SessionSettingsFile", session_settings_filename); - llinfos << "Using session settings filename: " - << session_settings_filename << llendl; + LL_INFOS("Settings") << "Using session settings filename: " + << session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("Session"); @@ -2461,8 +2461,8 @@ bool LLAppViewer::initConfiguration() { std::string user_session_settings_filename = clp.getOption("usersessionsettings")[0]; gSavedSettings.setString("UserSessionSettingsFile", user_session_settings_filename); - llinfos << "Using user session settings filename: " - << user_session_settings_filename << llendl; + LL_INFOS("Settings") << "Using user session settings filename: " + << user_session_settings_filename << LL_ENDL; } loadSettingsFromDirectory("UserSession"); -- cgit v1.2.3 From ea305b74d124aedf64afbb89d2b3685dae49bed9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 12:56:20 -0400 Subject: remove refresh of search attributes from draw method in About Land floater; does not seem to be needed and slows things down --- indra/newview/llfloaterland.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index f6d4f9a605..ba9fbbc84e 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2092,7 +2092,6 @@ void LLPanelLandOptions::refresh() // virtual void LLPanelLandOptions::draw() { - refreshSearch(); // Is this necessary? JC LLPanel::draw(); } -- cgit v1.2.3 From 357ded33cf48247ce0a305419f9e42c87e19062d Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 29 Aug 2013 12:06:46 -0700 Subject: removing test code --- indra/newview/llparticipantlist.cpp | 15 --------------- indra/newview/llparticipantlist.h | 1 - 2 files changed, 16 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index b5c9f4a310..ee6893907e 100755 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -404,21 +404,6 @@ void LLParticipantList::addAvatarIDExceptAgent(const LLUUID& 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) - { - 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 936e289c08..3a3ae76604 100755 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -50,7 +50,6 @@ 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. -- cgit v1.2.3 From d43a302eaf1b0ca521d4b865e39a8d849da5d5b8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 16:51:59 -0400 Subject: MAINT-3075: don't display the target user name as a SLURL in the RequestTeleport dialog --- indra/newview/llavataractions.cpp | 9 ++++++++- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 5f1f57f550..70cc48f12b 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -445,7 +445,14 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) { LLSD notification; notification["uuid"] = id; - notification["NAME_SLURL"] = LLSLURL("agent", id, "about").getSLURLString(); + LLAvatarName av_name; + if (!LLAvatarNameCache::get(id, &av_name)) + { + // unlikely ... they just picked this name from somewhere... + LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id)); + return; // reinvoke this when the name resolves + } + notification["NAME"] = av_name.getCompleteName(); LLSD payload; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9ed9a6f409..fce21b403b 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4073,7 +4073,7 @@ Join me in [REGION] icon="alertmodal.tga" name="TeleportRequestPrompt" type="alertmodal"> -Request a teleport to [NAME_SLURL] with the following message +Request a teleport to [NAME] with the following message confirm -- cgit v1.2.3 From ed828365b8a5371b1deadaa8cc1c2f1fdf729227 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 29 Aug 2013 16:05:49 -0700 Subject: ACME-866 User receives error when hitting Disconnect in Facebook floater, if access token was cleared manually on backend: Problem was that when the user was already disconnected the Facebook connection state was not being set to disconnected. --- indra/newview/llfacebookconnect.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index abfacdb93c..451c0f5767 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -190,17 +190,28 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING); } + void setUserDisconnected() + { + // Clear data + LLFacebookConnect::instance().clearInfo(); + LLFacebookConnect::instance().clearContent(); + //Notify state change + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + } + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { - if (isGoodStatus(status)) + if (isGoodStatus(status)) { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - - // Clear data - LLFacebookConnect::instance().clearInfo(); - LLFacebookConnect::instance().clearContent(); - //Notify state change - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + setUserDisconnected(); + + } + //User not found so already disconnected + else if(status == 404) + { + LL_DEBUGS("FacebookConnect") << "Already disconnected. content: " << content << LL_ENDL; + setUserDisconnected(); } else { -- cgit v1.2.3 From 5172d4edac75fbca2209279ffd8a837cfe99434d Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 3 Sep 2013 13:50:35 -0400 Subject: OPEN-187: Properly cleanup all allocated OpenSSL structures. --- doc/contributions.txt | 1 + indra/newview/llsechandler_basic.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index a6d522de2f..17c38ce343 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -924,6 +924,7 @@ Nicky Dasmijn BUG-2432 BUG-3605 CHUIBUG-197 + OPEN-187 Nicky Perian OPEN-1 STORM-1087 diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 928d26646b..c4d5450e2b 100755 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -207,6 +207,7 @@ LLSD _basic_constraints_ext(X509* cert) } } + BASIC_CONSTRAINTS_free( bs ); } return result; } @@ -268,6 +269,8 @@ LLSD _ext_key_usage_ext(X509* cert) ASN1_OBJECT_free(usage); } } + + EXTENDED_KEY_USAGE_free( eku ); } return result; } @@ -280,6 +283,8 @@ LLSD _subject_key_identifier_ext(X509 *cert) if(skeyid) { result = cert_string_from_octet_string(skeyid); + + ASN1_OCTET_STRING_free( skeyid ); } return result; } @@ -300,6 +305,9 @@ LLSD _authority_key_identifier_ext(X509* cert) { result[CERT_AUTHORITY_KEY_IDENTIFIER_SERIAL] = cert_string_from_asn1_integer(akeyid->serial); } + + + AUTHORITY_KEYID_free( akeyid ); } // we ignore the issuer name in the authority key identifier, we check the issue name via @@ -1049,6 +1057,8 @@ void LLBasicCertificateStore::validate(int validation_policy, throw LLInvalidCertificate((*current_cert)); } std::string sha1_hash((const char *)cert_x509->sha1_hash, SHA_DIGEST_LENGTH); + X509_free( cert_x509 ); + cert_x509 = NULL; t_cert_cache::iterator cache_entry = mTrustedCertCache.find(sha1_hash); if(cache_entry != mTrustedCertCache.end()) { -- cgit v1.2.3 From 3ba9cf20486ac80276f262c57a9280dc875504eb Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 3 Sep 2013 19:11:20 -0700 Subject: ACME-789: Remove SLShareHost setting from settings.xml --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llfacebookconnect.cpp | 15 --------------- 2 files changed, 26 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 098693eb98..b199929d91 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3533,17 +3533,6 @@ Value 0 - SLShareHost - - Comment - Host for contacting SL FB services - Persist - 1 - Type - String - Value - - FastCacheFetchEnabled Comment diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 451c0f5767..9c70757278 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -32,7 +32,6 @@ #include "llagent.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcommandhandler.h" -#include "llcontrol.h" #include "llhttpclient.h" #include "llnotificationsutil.h" #include "llurlaction.h" @@ -49,8 +48,6 @@ boost::scoped_ptr LLFacebookConnect::sStateWatcher(new LLEventStrea boost::scoped_ptr LLFacebookConnect::sInfoWatcher(new LLEventStream("FacebookConnectInfo")); boost::scoped_ptr LLFacebookConnect::sContentWatcher(new LLEventStream("FacebookConnectContent")); -extern LLControlGroup gSavedSettings; - // 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) { @@ -360,18 +357,6 @@ void LLFacebookConnect::openFacebookWeb(std::string url) std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - - //*TODO : Remove this code along with extern and llcontrol.h header - std::string host = gSavedSettings.getString("SLShareHost"); - if (!host.empty()) - { - sFacebookConnectUrl = host + "/fbc/agent/" + gAgentID.asString(); // TEMPORARY HACK FOR FB DEMO - Cho - } - else - { - sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - } - //End removable part std::string url = sFacebookConnectUrl + route; if (include_read_from_master && mReadFromMaster) -- cgit v1.2.3 From 2108e9de5bb93d60a040ff385f50552ceed9b076 Mon Sep 17 00:00:00 2001 From: "katharine@exodusviewer.com" Date: Wed, 4 Sep 2013 16:37:33 -0400 Subject: OPEN-149: fix documentation of LLColor4 constructor for F32 vector --- doc/contributions.txt | 1 + indra/llmath/v4color.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index c377de8513..b2df058614 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -688,6 +688,7 @@ Kagehi Kohn Kaimen Takahe Katharine Berry STORM-1900 + OPEN-149 Keklily Longfall Ken Lavender Ken March diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index b047f86e6e..8c8c315808 100755 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -50,7 +50,7 @@ class LLColor4 LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1) LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a) LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc)) - LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1) + LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], vec[3]) LLColor4(const LLColor3 &vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a) explicit LLColor4(const LLSD& sd); explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion -- cgit v1.2.3 From 035ab9f3747dc555148b17b87888fcf60ccc0114 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 11:41:19 -0400 Subject: open-183: improve local build number generation to account for multiple heads --- indra/cmake/BuildVersion.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index af2063ce6d..e4b63dc7cb 100755 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -16,22 +16,26 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n else (DEFINED ENV{revision}) find_program(MERCURIAL hg) - if (DEFINED MERCURIAL) + find_program(WORDCOUNT wc) + find_program(SED sed) + if (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) execute_process( - COMMAND ${MERCURIAL} log -r tip --template "{rev}" + COMMAND ${MERCURIAL} log -r tip:0 --template '\\n' + COMMAND ${WORDCOUNT} -l + COMMAND ${SED} "s/ //g" OUTPUT_VARIABLE VIEWER_VERSION_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") message("Revision (from hg) ${VIEWER_VERSION_REVISION}") else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") + message("Revision not set (repository not found?); using 0") set(VIEWER_VERSION_REVISION 0 ) - message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}") endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$") - else (DEFINED MERCURIAL) + else (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) + message("Revision not set: 'hg', 'wc' or 'sed' not found; using 0") set(VIEWER_VERSION_REVISION 0) - message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}") - endif (DEFINED MERCURIAL) + endif (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED) endif (DEFINED ENV{revision}) message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) -- cgit v1.2.3 From 8dc273b942ca3bae7469dcbaf7bab171b889eea1 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 15:18:58 -0400 Subject: correct some doc strings in the autobuild config file --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index e047d4d686..3ffe77451f 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1965,11 +1965,11 @@ package_description description - Spell checking dictionaries + Second Life Viewer license - various open + LGPL name - dictionaries + Second Life Viewer platforms common -- cgit v1.2.3 From fcdd0e578ca1ac7b025c5583df1c42bd286b07af Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 6 Sep 2013 10:04:41 -0700 Subject: ACME-903: Link the 'Learn about posting to Facebook' text to the proper KB article --- indra/newview/skins/default/xui/en/panel_social_account.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 882e410bdb..d7235396fe 100644 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ b/indra/newview/skins/default/xui/en/panel_social_account.xml @@ -69,7 +69,7 @@ name="account_learn_more_label" top_pad="20" type="string"> - [https://support.secondlife.com/ Learn about posting to Facebook] + [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook] -- cgit v1.2.3 From bf22b7150d2884fb68982764cd6a122d9c23909a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 6 Sep 2013 18:26:21 -0700 Subject: ACME-905 : Get the FacebookConnect cap each time we need it (it's not that much) --- indra/newview/llfacebookconnect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 9c70757278..611d18d6d6 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -356,9 +356,9 @@ void LLFacebookConnect::openFacebookWeb(std::string url) std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, bool include_read_from_master) { - static std::string sFacebookConnectUrl = gAgent.getRegion()->getCapability("FacebookConnect"); - - std::string url = sFacebookConnectUrl + route; + std::string url = gAgent.getRegion()->getCapability("FacebookConnect"); + url += route; + if (include_read_from_master && mReadFromMaster) { url += "?read_from_master=true"; -- cgit v1.2.3 From eaf287cc20efbad97fba17a65efd57eeba0f7278 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 9 Sep 2013 13:36:34 -0700 Subject: ACME-906 : Clean up xml from overzealous background color and opacity settings --- indra/newview/skins/default/xui/en/floater_social.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 39df777d1b..426c5507e4 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -1,5 +1,4 @@ - @@ -30,9 +26,6 @@ tab_min_width="70" tab_height="30" tab_position="top" - background_visible="true" - bg_opaque_color="DkGray" - bg_alpha_color="DkGray_66" top="7" height="437" halign="center"> @@ -68,9 +61,6 @@ Date: Tue, 10 Sep 2013 14:35:53 -0400 Subject: remove llversionviewer.h (incorrectly re-created in a merge) --- indra/llcommon/llversionviewer.h | 41 ---------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 indra/llcommon/llversionviewer.h diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h deleted file mode 100644 index 6a5ff314e4..0000000000 --- a/indra/llcommon/llversionviewer.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file llversionviewer.h - * @brief - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLVERSIONVIEWER_H -#define LL_LLVERSIONVIEWER_H - -const S32 LL_VERSION_MAJOR = 3; -const S32 LL_VERSION_MINOR = 4; -const S32 LL_VERSION_PATCH = 6; -const S32 LL_VERSION_BUILD = 0; - -const char * const LL_CHANNEL = "Second Life Developer"; - -#if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; -#endif - -#endif -- cgit v1.2.3 From f4d2e21f4fdf6953cfa375bd716b1458e3de14e8 Mon Sep 17 00:00:00 2001 From: ZaiLynch Date: Wed, 11 Sep 2013 12:17:22 -0400 Subject: Changing shortcut to toggle preference floater --- doc/contributions.txt | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index f33cf36ec2..404103cf91 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1365,6 +1365,7 @@ YongYong Francois Zak Westminster Zai Lynch VWR-19505 + STORM-1902 Zana Kohime Zaren Alexander Zarkonnen Decosta diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index dabfc4eebd..0e95a9d9a9 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -180,7 +180,7 @@ name="Preferences" shortcut="control|P">
Date: Wed, 11 Sep 2013 19:02:36 -0400 Subject: OPEN-189 Add missing header guard --- doc/contributions.txt | 1 + indra/llwindow/llwindowmacosx-objc.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 0035d4f597..4e3ce70e0b 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1122,6 +1122,7 @@ Slee Mayo snowy Sidran Sovereign Engineer MAINT-2334 + OPEN-189 SpacedOut Frye VWR-34 VWR-45 diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 32b3bfb078..3b6295fba8 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -25,6 +25,9 @@ * $/LicenseInfo$ */ +#ifndef LL_LLWINDOWMACOSX_OBJC_H +#define LL_LLWINDOWMACOSX_OBJC_H + #include #include @@ -143,3 +146,5 @@ NSWindowRef getMainAppWindow(); GLViewRef getGLView(); unsigned int getModifiers(); + +#endif // LL_LLWINDOWMACOSX_OBJC_H -- cgit v1.2.3 From bcff609fb839dc576c7e4f7529e1c751847ffd32 Mon Sep 17 00:00:00 2001 From: JJ Linden Date: Mon, 16 Sep 2013 12:58:40 -0700 Subject: changes for additional packages to be packaged from the same build. see BuildParams for example environment variables used to specify the packages and their channels and sourceids. also updated mac packages to use a larger virtual drive and auto-open on download --- BuildParams | 7 ++- build.sh | 28 ++++++++-- indra/lib/python/indra/util/llmanifest.py | 87 ++++++++++++++++++++++++++++++- indra/newview/viewer_manifest.py | 41 ++++++++------- 4 files changed, 135 insertions(+), 28 deletions(-) diff --git a/BuildParams b/BuildParams index 327530934d..63812d33c1 100755 --- a/BuildParams +++ b/BuildParams @@ -26,8 +26,13 @@ codeticket_since = 3.3.0-release Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 -# Setup default sourceid so Windows can pick up the TeamCity override +# Setup default packaging parameters. sourceid = "" +additional_packages = "Amazon Desura" +Amazon_sourceid = "1207v_Amazon" +Amazon_viewer_channel_suffix = " Amazon" +Desura_sourceid = "1208_desura" +Desura_viewer_channel_suffix = " Desura" ################################################################ #### Examples of how to set the viewer_channel #### diff --git a/build.sh b/build.sh index a78f368e47..4875ef39f7 100755 --- a/build.sh +++ b/build.sh @@ -38,22 +38,22 @@ build_dir_CYGWIN() installer_Darwin() { - ls -1td "$(build_dir_Darwin ${last_built_variant:-Release})/newview/"*.dmg 2>/dev/null | sed 1q + ls -1tr "$(build_dir_Darwin ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.dmg 2>/dev/null | sed 1q } installer_Linux() { - ls -1td "$(build_dir_Linux ${last_built_variant:-Release})/newview/"*.tar.bz2 2>/dev/null | sed 1q + ls -1tr "$(build_dir_Linux ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.tar.bz2 2>/dev/null | grep -v symbols | sed 1q } installer_CYGWIN() { v=${last_built_variant:-Release} d=$(build_dir_CYGWIN $v) - if [ -r "$d/newview/$v/touched.bat" ] + if [ -r "$d/newview/$additional_package_name$v/touched.bat" ] then - p=$(sed 's:.*=::' "$d/newview/$v/touched.bat") - echo "$d/newview/$v/$p" + p=$(sed 's:.*=::' "$d/newview/$additional_package_name$v/touched.bat") + echo "$d/newview/$additional_package_name$v/$p" fi } @@ -355,10 +355,28 @@ then # Coverity doesn't package, so it's ok, anything else is fail succeeded=$build_coverity else + # Upload base package. upload_item installer "$package" binary/octet-stream upload_item quicklink "$package" binary/octet-stream [ -f $build_dir/summary.json ] && upload_item installer $build_dir/summary.json text/plain + # Upload additional packages. + for package_id in $additional_packages + do + case $arch in + CYGWIN) export additional_package_name="$package_id/" ;; + *) export additional_package_name=$package_id ;; + esac + package=$(installer_$arch) + if [ x"$package" != x ] + then + upload_item installer "$package" binary/octet-stream + else + record_failure "Failed to upload $package_id package." + fi + done + export additional_package_name="" + case "$last_built_variant" in Release) # Upload crash reporter files diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 54049b5545..52b4acbc94 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -224,15 +224,98 @@ def main(): for opt in args: print "Option:", opt, "=", args[opt] + # pass in sourceid as an argument now instead of an environment variable + try: + args['sourceid'] = os.environ["sourceid"] + except KeyError: + args['sourceid'] = "" + + # Build base package. + touch = args.get('touch') + if touch: + print 'Creating base package' + args['package_id'] = "" # base package has no package ID wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args) wm.do(*args['actions']) - + # Store package file for later if making touched file. + base_package_file = "" + if touch: + print 'Created base package ', wm.package_file + base_package_file = "" + wm.package_file + + # handle multiple packages if set + try: + additional_packages = os.environ["additional_packages"] + except KeyError: + additional_packages = "" + if additional_packages: + # Determine destination prefix / suffix for additional packages. + base_dest_postfix = args['dest'] + base_dest_prefix = "" + base_dest_parts = args['dest'].split(os.sep) + if len(base_dest_parts) > 1: + base_dest_postfix = base_dest_parts[len(base_dest_parts) - 1] + base_dest_prefix = base_dest_parts[0] + i = 1 + while i < len(base_dest_parts) - 1: + base_dest_prefix = base_dest_prefix + os.sep + base_dest_parts[i] + i = i + 1 + # Determine touched prefix / suffix for additional packages. + base_touch_postfix = "" + base_touch_prefix = "" + if touch: + base_touch_postfix = touch + base_touch_parts = touch.split('/') + if "arwin" in args['platform']: + if len(base_touch_parts) > 1: + base_touch_postfix = base_touch_parts[len(base_touch_parts) - 1] + base_touch_prefix = base_touch_parts[0] + i = 1 + while i < len(base_touch_parts) - 1: + base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i] + i = i + 1 + else: + if len(base_touch_parts) > 2: + base_touch_postfix = base_touch_parts[len(base_touch_parts) - 2] + '/' + base_touch_parts[len(base_touch_parts) - 1] + base_touch_prefix = base_touch_parts[0] + i = 1 + while i < len(base_touch_parts) - 2: + base_touch_prefix = base_touch_prefix + '/' + base_touch_parts[i] + i = i + 1 + # Store base channel name. + base_channel_name = args['channel'] + # Build each additional package. + package_id_list = additional_packages.split(" ") + for package_id in package_id_list: + try: + args['package_id'] = package_id + args['channel'] = base_channel_name + os.environ[package_id + "_viewer_channel_suffix"] + if package_id + "_sourceid" in os.environ: + args['sourceid'] = os.environ[package_id + "_sourceid"] + else: + args['sourceid'] = "" + args['dest'] = base_dest_prefix + os.sep + package_id + os.sep + base_dest_postfix + except KeyError: + sys.stderr.write("Failed to create package for package_id: %s" % package_id) + sys.stderr.flush() + continue + if touch: + print 'Creating additional package for ', package_id, ' in ', args['dest'] + wm = LLManifest.for_platform(args['platform'], args.get('arch'))(args) + wm.do(*args['actions']) + if touch: + print 'Created additional package ', wm.package_file, ' for ', package_id + faketouch = base_touch_prefix + '/' + package_id + '/' + base_touch_postfix + fp = open(faketouch, 'w') + fp.write('set package_file=%s\n' % wm.package_file) + fp.close() + # Write out the package file in this format, so that it can easily be called # and used in a .bat file - yeah, it sucks, but this is the simplest... touch = args.get('touch') if touch: fp = open(touch, 'w') - fp.write('set package_file=%s\n' % wm.package_file) + fp.write('set package_file=%s\n' % base_package_file) fp.close() print 'touched', touch return 0 diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 19863dd845..effe3994a3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -106,24 +106,18 @@ class ViewerManifest(LLManifest): # CHOP-955: If we have "sourceid" in the build process # environment, generate it into settings_install.xml. - try: - sourceid = os.environ["sourceid"] - except KeyError: - # no sourceid, no settings_install.xml file - pass - else: - if sourceid: - # Single-entry subset of the LLSD content of settings.xml - content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', - Persist=1, - Type='String', - Value=sourceid)) - # put_in_file(src=) need not be an actual pathname; it - # only needs to be non-empty - settings_install = self.put_in_file(llsd.format_pretty_xml(content), - "settings_install.xml", - src="environment") - print "Put sourceid '%s' in %s" % (sourceid, settings_install) + if self.args['sourceid']: + # Single-entry subset of the LLSD content of settings.xml + content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', + Persist=1, + Type='String', + Value=self.args['sourceid'])) + # put_in_file(src=) need not be an actual pathname; it + # only needs to be non-empty + settings_install = self.put_in_file(llsd.format_pretty_xml(content), + "settings_install.xml", + src="environment") + print "Put sourceid '%s' in %s" % (self.args['sourceid'], settings_install) self.end_prefix("app_settings") @@ -611,6 +605,9 @@ class WindowsManifest(ViewerManifest): installer_file = self.args['installer_name'] else: installer_file = installer_file % substitution_strings + if len(self.args['package_id']) > 0: + installer_file = installer_file.replace(self.args['package_id'], "") + installer_file = installer_file.replace(".exe", self.args['package_id'] + ".exe") substitution_strings['installer_file'] = installer_file tempfile = "secondlife_setup_tmp.nsi" @@ -838,7 +835,9 @@ class DarwinManifest(ViewerManifest): volname="Second Life Installer" # DO NOT CHANGE without understanding comment above - if self.default_channel(): + if len(self.args['package_id']) > 0: + imagename = imagename + self.args['package_id'] + elif self.default_channel(): if not self.default_grid(): # beta case imagename = imagename + '_' + self.args['grid'].upper() @@ -851,7 +850,7 @@ class DarwinManifest(ViewerManifest): # make sure we don't have stale files laying about self.remove(sparsename, finalname) - self.run_command('hdiutil create %(sparse)r -volname %(vol)r -fs HFS+ -type SPARSE -megabytes 700 -layout SPUD' % { + self.run_command('hdiutil create %(sparse)r -volname %(vol)r -fs HFS+ -type SPARSE -megabytes 1000 -layout SPUD' % { 'sparse':sparsename, 'vol':volname}) @@ -926,6 +925,7 @@ class DarwinManifest(ViewerManifest): print "Converting temp disk image to final disk image" self.run_command('hdiutil convert %(sparse)r -format UDZO -imagekey zlib-level=9 -o %(final)r' % {'sparse':sparsename, 'final':finalname}) + self.run_command('hdiutil internet-enable -yes %(final)r' % {'final':finalname}) # get rid of the temp file self.package_file = finalname self.remove(sparsename) @@ -998,6 +998,7 @@ class LinuxManifest(ViewerManifest): installer_name += '_' + self.args['grid'].upper() else: installer_name += '_' + self.channel_oneword().upper() + installer_name = installer_name + self.args['package_id'] self.strip_binaries() -- cgit v1.2.3 From be84aefc40719dacb9ab2c0ace9a2a706d768ffc Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 18 Sep 2013 10:42:43 -0700 Subject: add experimental packaging --- BuildParams | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/BuildParams b/BuildParams index 63812d33c1..0d7a0b5a51 100755 --- a/BuildParams +++ b/BuildParams @@ -26,14 +26,6 @@ codeticket_since = 3.3.0-release Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 -# Setup default packaging parameters. -sourceid = "" -additional_packages = "Amazon Desura" -Amazon_sourceid = "1207v_Amazon" -Amazon_viewer_channel_suffix = " Amazon" -Desura_sourceid = "1208_desura" -Desura_viewer_channel_suffix = " Desura" - ################################################################ #### Examples of how to set the viewer_channel #### # @@ -54,6 +46,18 @@ Desura_viewer_channel_suffix = " Desura" ################################################################ viewer_channel = "Second Life Test" +# Setup default packaging parameters. +sourceid = "" +additional_packages = "Amazon Desura B C" +Amazon_sourceid = "1207v_Amazon" +Amazon_viewer_channel_suffix = " Amazon" +Desura_sourceid = "1208_desura" +Desura_viewer_channel_suffix = " Desura" +B_sourceid = "1301_B" +B_viewer_channel_suffix = " B" +C_sourceid = "1302_C" +C_viewer_channel_suffix = " C" + # Report changes since... viewer-development.show_changes_since = last_sprint -- cgit v1.2.3 From f53b2bd880875b5194b6d298e1aad7d8951db9f3 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 20 Sep 2013 14:11:07 -0700 Subject: ACME-902: Link the '?' button to the proper viewer-help article or articles --- indra/newview/skins/default/xui/en/floater_social.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 426c5507e4..b7ff374d5f 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -3,7 +3,7 @@ positioning="cascading" can_close="true" can_resize="false" - help_topic="social floater" + help_topic="floater_social" layout="topleft" name="floater_social" save_rect="true" @@ -34,28 +34,24 @@ class="llsocialstatuspanel" follows="all" label="STATUS" - help_topic="panel_social_status" name="panel_social_status"/> Date: Mon, 23 Sep 2013 13:26:24 -0700 Subject: made change to include channel name in the settings_install.xml file generated. changed so that sourceid is not part of a list of options pulled into that file, along with the channel --- indra/newview/viewer_manifest.py | 41 ++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index effe3994a3..894e368427 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -104,20 +104,37 @@ class ViewerManifest(LLManifest): self.path("dictionaries") self.end_prefix(pkgdir) - # CHOP-955: If we have "sourceid" in the build process - # environment, generate it into settings_install.xml. - if self.args['sourceid']: - # Single-entry subset of the LLSD content of settings.xml - content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', - Persist=1, - Type='String', - Value=self.args['sourceid'])) + # CHOP-955: If we have "sourceid" or "viewer_channel" in the + # build process environment, generate it into + # settings_install.xml. + settings_template = dict( + sourceid=dict(Comment='Identify referring agency to Linden web servers', + Persist=1, + Type='String', + Value=''), + CmdLineChannel=dict(Comment='Command line specified channel name', + Persist=0, + Type='String', + Value='')) + settings_install = {} + for key, setting in (("sourceid", "sourceid"), + ("channel", "CmdLineChannel")): + if key in self.args: + # only set if value is non-empty + if self.args[key]: + # copy corresponding setting from settings_template + settings_install[setting] = settings_template[setting].copy() + # then fill in Value + settings_install[setting]["Value"] = self.args[key] + print "Put %s '%s' in settings_install.xml" % (setting, self.args[key]) + + # did we actually copy anything into settings_install dict? + if settings_install: # put_in_file(src=) need not be an actual pathname; it # only needs to be non-empty - settings_install = self.put_in_file(llsd.format_pretty_xml(content), - "settings_install.xml", - src="environment") - print "Put sourceid '%s' in %s" % (self.args['sourceid'], settings_install) + self.put_in_file(llsd.format_pretty_xml(settings_install), + "settings_install.xml", + src="environment") self.end_prefix("app_settings") -- cgit v1.2.3 From ba7a564700ba20c6ece7ab16197c2415ebec42cb Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 3 Oct 2013 18:21:19 -0400 Subject: improve preference label for fly/jump --- indra/newview/skins/default/xui/en/panel_preferences_move.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 198fcf9355..8794e3bf95 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -133,7 +133,7 @@ control_name="AutomaticFly" follows="left|top" height="20" - label="Fly/land on holding up/down" + label="Hold jump or crouch key to start or stop flying" layout="topleft" left_delta="0" name="automatic_fly" @@ -270,4 +270,4 @@ function="Floater.Show" parameter="pref_joystick" /> - \ No newline at end of file + -- cgit v1.2.3 From 76908954b93708e80f115b1d4348d398748788db Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 23 Oct 2013 11:52:24 -0400 Subject: Added tag 3.6.9-release for changeset 70eda3721d36 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 2efe658de2..c81c919d1a 100755 --- a/.hgtags +++ b/.hgtags @@ -467,3 +467,4 @@ fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release d40c66e410741de7e90b1ed6dac28dd8a2d7e1f6 3.6.8-release +70eda3721d36df3e00730629c42a1304e5bc65b8 3.6.9-release -- cgit v1.2.3 From ea1e1b0925b386cf83178539b8eae9e25c573548 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 23 Oct 2013 12:15:35 -0400 Subject: increment viewer version to 3.6.10 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index cff2619cfb..c47e8b5872 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.9 +3.6.10 -- cgit v1.2.3