From b82d70cf2aa2b56a2c0bfdd941ee4f74e690e4df Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Mon, 4 Mar 2019 00:18:45 -0800 Subject: Added viewer based profiles Split picks and classifieds in to separate panels Moved getProfileURL to LLAvatarActions Removed dead XUI panels Removed picks/classifieds floater --- indra/newview/llavataractions.cpp | 109 ++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 17 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f0b74e7439..ecfb2cd5a8 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -48,6 +48,7 @@ #include "llfloatergroups.h" #include "llfloaterreg.h" #include "llfloaterpay.h" +#include "llfloaterprofile.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterwebcontent.h" #include "llfloaterworldmap.h" @@ -67,6 +68,7 @@ #include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure +#include "llviewernetwork.h" //LLGridManager #include "llviewerregion.h" #include "lltrans.h" #include "llcallingcard.h" @@ -81,6 +83,18 @@ const U32 KICK_FLAGS_FREEZE = 1 << 0; const U32 KICK_FLAGS_UNFREEZE = 1 << 1; +std::string getProfileURL(const std::string& agent_name) +{ + std::string url = "[WEB_PROFILE_URL][AGENT_NAME]"; + LLSD subs; + subs["WEB_PROFILE_URL"] = LLGridManager::getInstance()->getWebProfileURL(); + subs["AGENT_NAME"] = agent_name; + url = LLWeb::expandURLSubstitutions(url, subs); + LLStringUtil::toLower(url); + return url; +} + + // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) { @@ -319,7 +333,7 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float static const char* get_profile_floater_name(const LLUUID& avatar_id) { // Use different floater XML for our profile to be able to save its rect. - return avatar_id == gAgentID ? "my_profile" : "profile"; + return avatar_id == gAgentID ? "my_profile_web" : "profile_web"; } static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name) @@ -333,40 +347,101 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa } // static -void LLAvatarActions::showProfile(const LLUUID& id) +void LLAvatarActions::showProfile(const LLUUID& avatar_id) +{ + if (avatar_id.notNull()) + { + LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)); + } +} + +// static +void LLAvatarActions::showPicks(const LLUUID& avatar_id) { - if (id.notNull()) + if (avatar_id.notNull()) { - LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2)); + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) + { + profilefloater->showPick(); + } + } +} + +// static +void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id) +{ + if (avatar_id.notNull()) + { + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) + { + profilefloater->showPick(pick_id); + } + } +} + +// static +void LLAvatarActions::showClassifieds(const LLUUID& avatar_id) +{ + if (avatar_id.notNull()) + { + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) + { + profilefloater->showClassified(); + } + } +} + +// static +void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& classified_id, bool edit) +{ + if (avatar_id.notNull()) + { + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) + { + profilefloater->showClassified(classified_id, edit); + } } } //static -bool LLAvatarActions::profileVisible(const LLUUID& id) +bool LLAvatarActions::profileVisible(const LLUUID& avatar_id) { LLSD sd; - sd["id"] = id; - LLFloater* browser = getProfileFloater(id); - return browser && browser->isShown(); + sd["id"] = avatar_id; + LLFloater* floater = getProfileFloater(avatar_id); + return floater && floater->isShown(); } //static -LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) +LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& avatar_id) +{ + LLFloaterProfile* floater = LLFloaterReg::findTypedInstance("profile", LLSD().with("id", avatar_id)); + return floater; +} + +// static +void LLAvatarActions::showProfileWeb(const LLUUID& avatar_id) { - LLFloaterWebContent *browser = dynamic_cast - (LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id))); - return browser; + if (avatar_id.notNull()) + { + LLAvatarNameCache::get(avatar_id, boost::bind(&on_avatar_name_show_profile, _1, _2)); + } } + //static -void LLAvatarActions::hideProfile(const LLUUID& id) +void LLAvatarActions::hideProfile(const LLUUID& avatar_id) { LLSD sd; - sd["id"] = id; - LLFloater* browser = getProfileFloater(id); - if (browser) + sd["id"] = avatar_id; + LLFloater* floater = getProfileFloater(avatar_id); + if (floater) { - browser->closeFloater(); + floater->closeFloater(); } } -- cgit v1.2.3 From e0b24ee960c7a7eebb9e7d6e4b5974973eb3da00 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 25 Mar 2019 15:38:26 +0200 Subject: SL-10798 FIXED [Legacy Profiles] 'Picks' toolbar button does nothing --- indra/newview/llavataractions.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index ecfb2cd5a8..fa4090c5fe 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -381,6 +381,20 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id) } } +// static +bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id) +{ + if (avatar_id.notNull()) + { + LLFloaterProfile* profilefloater = LLFloaterReg::findTypedInstance("profile", LLSD().with("id", avatar_id)); + if (profilefloater) + { + return profilefloater->isPickTabSelected(); + } + } + return false; +} + // static void LLAvatarActions::showClassifieds(const LLUUID& avatar_id) { -- cgit v1.2.3 From 458d318aebd7a7da8ea2c594b8df2f285f7efded Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 25 Mar 2019 17:19:11 +0200 Subject: SL-10804 [Legacy Profiles] Second Life tab block button size and focus --- indra/newview/llavataractions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index fa4090c5fe..ff00157459 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -1076,7 +1076,7 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL } // static -void LLAvatarActions::toggleBlock(const LLUUID& id) +bool LLAvatarActions::toggleBlock(const LLUUID& id) { LLAvatarName av_name; LLAvatarNameCache::get(id, &av_name); @@ -1086,10 +1086,12 @@ void LLAvatarActions::toggleBlock(const LLUUID& id) if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { LLMuteList::getInstance()->remove(mute); + return false; } else { LLMuteList::getInstance()->add(mute); + return true; } } -- cgit v1.2.3 From b1ac8092eecf5fc9dc4b4867370a51e5dfba4331 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 13 Nov 2019 09:31:26 +0200 Subject: SL-10790 Don't show excessive information on the Profile Feed tab --- indra/newview/llavataractions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index ff00157459..bc9dc968f2 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -83,12 +83,13 @@ const U32 KICK_FLAGS_FREEZE = 1 << 0; const U32 KICK_FLAGS_UNFREEZE = 1 << 1; -std::string getProfileURL(const std::string& agent_name) +std::string getProfileURL(const std::string& agent_name, bool feed_only) { - std::string url = "[WEB_PROFILE_URL][AGENT_NAME]"; + std::string url = "[WEB_PROFILE_URL][AGENT_NAME][FEED_ONLY]"; LLSD subs; subs["WEB_PROFILE_URL"] = LLGridManager::getInstance()->getWebProfileURL(); subs["AGENT_NAME"] = agent_name; + subs["FEED_ONLY"] = feed_only ? "/?feed_only=true" : ""; url = LLWeb::expandURLSubstitutions(url, subs); LLStringUtil::toLower(url); return url; -- cgit v1.2.3 From ad1052039cfdd0e9a95304874cf1347e1472d36f Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 5 Feb 2020 19:33:36 +0200 Subject: SL-12550 Profile feed tab cleanup SL-12550 Profile feed tab cleanup --- indra/newview/llavataractions.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index bc9dc968f2..590787c411 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -438,16 +438,6 @@ LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& avatar_id) return floater; } -// static -void LLAvatarActions::showProfileWeb(const LLUUID& avatar_id) -{ - if (avatar_id.notNull()) - { - LLAvatarNameCache::get(avatar_id, boost::bind(&on_avatar_name_show_profile, _1, _2)); - } -} - - //static void LLAvatarActions::hideProfile(const LLUUID& avatar_id) { -- cgit v1.2.3 From 90ff108278475bc70c182050d5ba3a32d3b3a9bf Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 6 Feb 2020 22:37:28 +0200 Subject: SL-12550 Leftovers cleanup --- indra/newview/llavataractions.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 590787c411..afd62f3149 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -337,16 +337,6 @@ static const char* get_profile_floater_name(const LLUUID& avatar_id) return avatar_id == gAgentID ? "my_profile_web" : "profile_web"; } -static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - std::string url = getProfileURL(av_name.getAccountName()); - - // PROFILES: open in webkit window - LLFloaterWebContent::Params p; - p.url(url).id(agent_id.asString()); - LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p); -} - // static void LLAvatarActions::showProfile(const LLUUID& avatar_id) { -- cgit v1.2.3 From f18ee2becc7e1911d97c201d652d87110e6c9cf2 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 7 Feb 2020 17:18:40 +0200 Subject: SL-10675 More leftovers cleanup = --- indra/newview/llavataractions.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index afd62f3149..ba97574149 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -331,12 +331,6 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float make_ui_sound("UISndStartIM"); } -static const char* get_profile_floater_name(const LLUUID& avatar_id) -{ - // Use different floater XML for our profile to be able to save its rect. - return avatar_id == gAgentID ? "my_profile_web" : "profile_web"; -} - // static void LLAvatarActions::showProfile(const LLUUID& avatar_id) { -- cgit v1.2.3 From c4335939d90346a778eb18acb7611135742231df Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 10 Aug 2022 19:03:12 +0300 Subject: SL-17925 Fix SLURL based creation of picks and classifieds --- indra/newview/llavataractions.cpp | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'indra/newview/llavataractions.cpp') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 112a2f6624..25ba7c365f 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -63,12 +63,14 @@ #include "llnotificationsutil.h" // for LLNotificationsUtil #include "llpaneloutfitedit.h" #include "llpanelprofile.h" +#include "llparcel.h" #include "llrecentpeople.h" #include "lltrans.h" #include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure #include "llviewernetwork.h" //LLGridManager +#include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "lltrans.h" #include "llcallingcard.h" @@ -366,6 +368,34 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id) } } +// static +void LLAvatarActions::createPick() +{ + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); + LLViewerRegion* region = gAgent.getRegion(); + if (profilefloater && region) + { + LLPickData data; + data.pos_global = gAgent.getPositionGlobal(); + data.sim_name = region->getName(); + + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (parcel) + { + data.name = parcel->getName(); + data.desc = parcel->getDesc(); + data.snapshot_id = parcel->getSnapshotID(); + data.parcel_id = parcel->getID(); + } + else + { + data.name = region->getName(); + } + + profilefloater->createPick(data); + } +} + // static bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id) { @@ -406,6 +436,16 @@ void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& clas } } +// static +void LLAvatarActions::createClassified() +{ + LLFloaterProfile* profilefloater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); + if (profilefloater) + { + profilefloater->createClassified(); + } +} + //static bool LLAvatarActions::profileVisible(const LLUUID& avatar_id) { -- cgit v1.2.3