diff --git a/indra/llmessage/llclassifiedflags.h b/indra/llmessage/llclassifiedflags.h index dafd0ceb62560feba8d65bd2fa9df18c5f5d2d55..9c6c268b397e76d5e9d51a8494e22b5d827e2cf2 100644 --- a/indra/llmessage/llclassifiedflags.h +++ b/indra/llmessage/llclassifiedflags.h @@ -47,7 +47,6 @@ const U8 CLASSIFIED_QUERY_INC_ADULT = 1 << 6; const U8 CLASSIFIED_QUERY_INC_NEW_VIEWER = (CLASSIFIED_QUERY_INC_PG | CLASSIFIED_QUERY_INC_MATURE | CLASSIFIED_QUERY_INC_ADULT); const S32 MAX_CLASSIFIEDS = 100; -const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ // This function is used in AO viewers to pack old query flags into the request // so that they can talk to old dataservers properly. When the AO servers are deployed on agni diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6afd76b44d80e094314d7f31755bb7b8d0deccf1..f3aa40b0c0286e4bc93510ba84da236c05d9e265 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -130,7 +130,6 @@ set(viewer_SOURCE_FILES llagentbenefits.cpp llagentcamera.cpp llagentdata.cpp - llagenthandler.cpp llagentlanguage.cpp llagentlistener.cpp llagentpicksinfo.cpp @@ -168,7 +167,6 @@ set(viewer_SOURCE_FILES llchiclet.cpp llchicletbar.cpp llclassifiedinfo.cpp - llclassifieditem.cpp llcofwearables.cpp llcolorswatch.cpp llcommanddispatcherlistener.cpp @@ -331,14 +329,12 @@ set(viewer_SOURCE_FILES llfloaterperformance.cpp llfloaterperms.cpp llfloaterprofile.cpp - llfloaterprofilelegacy.cpp llfloaterpreference.cpp llfloaterpreferencesgraphicsadvanced.cpp llfloaterpreferenceviewadvanced.cpp llfloaterpreviewtrash.cpp llfloaterprofiletexture.cpp llfloaterprogressview.cpp - llfloaterpublishclassified.cpp llfloaterregiondebugconsole.cpp llfloaterregioninfo.cpp llfloaterreporter.cpp @@ -370,7 +366,6 @@ set(viewer_SOURCE_FILES llfloatervoiceeffect.cpp llfloatervoicevolume.cpp llfloaterwebcontent.cpp - llfloaterwebprofile.cpp llfloaterwhitelistentry.cpp llfloaterwindowsize.cpp llfloaterworldmap.cpp @@ -489,7 +484,6 @@ set(viewer_SOURCE_FILES lloutputmonitorctrl.cpp llpanelappearancetab.cpp llpanelavatar.cpp - llpanelavatarlegacy.cpp llpanelavatartag.cpp llpanelblockedlist.cpp llpanelclassified.cpp @@ -538,7 +532,6 @@ set(viewer_SOURCE_FILES llpanelpeople.cpp llpanelpeoplemenus.cpp llpanelpermissions.cpp - llpanelpick.cpp llpanelplaceinfo.cpp llpanelplaceprofile.cpp llpanelplaces.cpp @@ -547,7 +540,6 @@ set(viewer_SOURCE_FILES llpanelpresetspulldown.cpp llpanelprimmediacontrols.cpp llpanelprofile.cpp - llpanelprofilelegacy.cpp llpanelprofileclassifieds.cpp llpanelprofilepicks.cpp llpanelsnapshot.cpp @@ -582,7 +574,6 @@ set(viewer_SOURCE_FILES llpersistentnotificationstorage.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp - llpickitem.cpp llpipelinelistener.cpp llplacesinventorybridge.cpp llplacesinventorypanel.cpp @@ -599,7 +590,6 @@ set(viewer_SOURCE_FILES llpreviewtexture.cpp llproductinforequest.cpp llprogressview.cpp - llprofileimagepicker.cpp llrecentpeople.cpp llreflectionmap.cpp llreflectionmapmanager.cpp @@ -906,7 +896,6 @@ set(viewer_HEADER_FILES llchiclet.h llchicletbar.h llclassifiedinfo.h - llclassifieditem.h llcofwearables.h llcolorswatch.h llcommanddispatcherlistener.h @@ -1072,14 +1061,12 @@ set(viewer_HEADER_FILES llfloaterperformance.h llfloaterperms.h llfloaterprofile.h - llfloaterprofilelegacy.h llfloaterpreference.h llfloaterpreferencesgraphicsadvanced.h llfloaterpreferenceviewadvanced.h llfloaterpreviewtrash.h llfloaterprofiletexture.h llfloaterprogressview.h - llfloaterpublishclassified.h llfloaterregiondebugconsole.h llfloaterregioninfo.h llfloaterreporter.h @@ -1111,7 +1098,6 @@ set(viewer_HEADER_FILES llfloatervoiceeffect.h llfloatervoicevolume.h llfloaterwebcontent.h - llfloaterwebprofile.h llfloaterwhitelistentry.h llfloaterwindowsize.h llfloaterworldmap.h @@ -1219,7 +1205,6 @@ set(viewer_HEADER_FILES lloutputmonitorctrl.h llpanelappearancetab.h llpanelavatar.h - llpanelavatarlegacy.h llpanelavatartag.h llpanelblockedlist.h llpanelclassified.h @@ -1269,7 +1254,6 @@ set(viewer_HEADER_FILES llpanelpeople.h llpanelpeoplemenus.h llpanelpermissions.h - llpanelpick.h llpanelplaceinfo.h llpanelplaceprofile.h llpanelplaces.h @@ -1278,7 +1262,6 @@ set(viewer_HEADER_FILES llpanelpresetspulldown.h llpanelprimmediacontrols.h llpanelprofile.h - llpanelprofilelegacy.h llpanelprofileclassifieds.h llpanelprofilepicks.h llpanelsnapshot.h @@ -1308,7 +1291,6 @@ set(viewer_HEADER_FILES llpersistentnotificationstorage.h llphysicsmotion.h llphysicsshapebuilderutil.h - llpickitem.h llpipelinelistener.h llplacesinventorybridge.h llplacesinventorypanel.h @@ -1324,7 +1306,6 @@ set(viewer_HEADER_FILES llpreviewsound.h llpreviewtexture.h llproductinforequest.h - llprofileimagepicker.h llprogressview.h llrecentpeople.h llreflectionmap.h diff --git a/indra/newview/alavataractions.cpp b/indra/newview/alavataractions.cpp index 7668577325aeea6de6fa34ebca902993d5e70b9c..b9bdbc2b13799bb4b0ed5020cfef95a9253d0a4c 100644 --- a/indra/newview/alavataractions.cpp +++ b/indra/newview/alavataractions.cpp @@ -36,11 +36,8 @@ #include "roles_constants.h" #include "llagent.h" -#include "llavataractions.h" -#include "llfloaterreg.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" -#include "llfloaterwebcontent.h" #include "llslurl.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -856,21 +853,3 @@ bool ALAvatarActions::handleGodKick(const LLSD& notification, const LLSD& respon } return false; } - -// Webprofile junk... for posterity! - -static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - LLFloaterWebContent::Params p; - p.url(getProfileURL(av_name.getAccountName())).id(agent_id.asString()); - LLFloaterReg::showInstance("webprofile", p); -} - -// static -void ALAvatarActions::showWebProfile(const LLUUID& id) -{ - if (id.notNull()) - { - LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2)); - } -} diff --git a/indra/newview/alavataractions.h b/indra/newview/alavataractions.h index 03dfe49e516ae470696a6b66fa54376e743c5a44..d6bb2f1792f574399b15a5751e95e94876b9da42 100644 --- a/indra/newview/alavataractions.h +++ b/indra/newview/alavataractions.h @@ -94,9 +94,6 @@ class ALAvatarActions static void godFreeze(const LLUUID& id); static void godUnfreeze(const LLUUID& id); - // Webprofile - static void showWebProfile(const LLUUID& id); - private: static bool handleParcelFreeze(const LLSD& notification, const LLSD& response); static bool handleParcelEject(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llagenthandler.cpp b/indra/newview/llagenthandler.cpp deleted file mode 100644 index 688aa2b6aee172bc3932488941ea929e79ea1464..0000000000000000000000000000000000000000 --- a/indra/newview/llagenthandler.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/** - * @file llagenthandler.cpp - * @brief Command handler involving agent requests - * - * $LicenseInfo:firstyear=2005&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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llavataractions.h" -#include "llcommandhandler.h" -#include "llfloaterreg.h" -#include "llfloaterreporter.h" -#include "llmutelist.h" -#include "llnotificationsutil.h" -//#include "llpanelblockedlist.h" -#include "llfloaterblocked.h" - -class LLAgentHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLAgentHandler() : LLCommandHandler("agent", UNTRUSTED_THROTTLE) { } - - virtual bool canHandleUntrusted( - const LLSD& params, - const LLSD& query_map, - LLMediaCtrl* web, - const std::string& nav_type) - { - if (params.size() < 2) - { - return true; // don't block, will fail later - } - - if (nav_type == NAV_TYPE_CLICKED - || nav_type == NAV_TYPE_EXTERNAL) - { - return true; - } - - const std::string verb = params[1].asString(); - if (verb == "about" || verb == "inspect" || verb == "reportAbuse") - { - return true; - } - return false; - } - - bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, - LLMediaCtrl* web) - { - if (params.size() < 2) return false; - LLUUID avatar_id; - if (!avatar_id.set(params[0].asStringRef(), FALSE)) - { - return false; - } - - const std::string verb = params[1].asString(); - if (verb == "about") - { - LLAvatarActions::showProfile(avatar_id); - return true; - } - - if (verb == "inspect") - { - LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", avatar_id)); - return true; - } - - if (verb == "im") - { - LLAvatarActions::startIM(avatar_id); - return true; - } - - if (verb == "pay") - { - if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableAvatarPay")) - { - LLNotificationsUtil::add("NoAvatarPay", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); - return true; - } - - LLAvatarActions::pay(avatar_id); - return true; - } - - if (verb == "offerteleport") - { - LLAvatarActions::offerTeleport(avatar_id); - return true; - } - - if (verb == "requestfriend") - { - LLAvatarActions::requestFriendshipDialog(avatar_id); - return true; - } - - if (verb == "removefriend") - { - LLAvatarActions::removeFriendDialog(avatar_id); - return true; - } - - if (verb == "mute") - { - if (! LLAvatarActions::isBlocked(avatar_id)) - { - LLAvatarActions::toggleBlock(avatar_id); - } - return true; - } - - if (verb == "unmute") - { - if (LLAvatarActions::isBlocked(avatar_id)) - { - LLAvatarActions::toggleBlock(avatar_id); - } - return true; - } - - if (verb == "block") - { - if (params.size() > 2) - { - const std::string object_name = LLURI::unescape(params[2].asString()); - LLMute mute(avatar_id, object_name, LLMute::OBJECT); - LLMuteList::getInstance()->add(mute); - LLFloaterBlocked::showMuteAndSelect(mute.mID); - //LLPanelBlockedList::showPanelAndSelect(mute.mID); - } - return true; - } - - if (verb == "unblock") - { - if (params.size() > 2) - { - const std::string object_name = params[2].asString(); - LLMute mute(avatar_id, object_name, LLMute::OBJECT); - LLMuteList::getInstance()->remove(mute); - } - return true; - } - - // reportAbuse is here due to convoluted avatar handling - // in LLScrollListCtrl and LLTextBase - if (verb == "reportAbuse" && web == NULL) - { - LLAvatarName av_name; - if (LLAvatarNameCache::get(avatar_id, &av_name)) - { - LLFloaterReporter::showFromAvatar(avatar_id, av_name.getCompleteName()); - } - else - { - LLFloaterReporter::showFromAvatar(avatar_id, "not avaliable"); - } - return true; - } - return false; - } -}; -LLAgentHandler gAgentHandler; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 15d364e33b781be0580062dbcad0c472dfb0701a..c6dede334e03f5380caefc7ee43a8b5df0263023 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -50,7 +50,6 @@ #include "llfloaterreg.h" #include "llfloaterpay.h" #include "llfloaterprofile.h" -#include "llfloaterprofilelegacy.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterwebcontent.h" #include "llfloaterworldmap.h" @@ -65,7 +64,6 @@ #include "llnotificationsutil.h" // for LLNotificationsUtil #include "llpaneloutfitedit.h" #include "llpanelprofile.h" -#include "llpanelprofilelegacy.h" #include "llparcel.h" #include "llrecentpeople.h" #include "lltrans.h" @@ -386,15 +384,7 @@ void LLAvatarActions::showProfile(const LLUUID& avatar_id) { if (avatar_id.notNull()) { - if (gSkinSettings.getBool("LegacyProfile")) - { - LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES); - } - else - { - LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)); - } + LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id)); } } @@ -403,21 +393,10 @@ void LLAvatarActions::showPicks(const LLUUID& avatar_id) { if (avatar_id.notNull()) { - if (gSkinSettings.getBool("LegacyProfile")) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES); - LLPanel* tab = profile->expandTab("avatar_picks_tab"); - tab->getChild<LLAccordionCtrl>("accordion")->expandTab("tab_picks"); - } - else + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) { - LLFloaterProfile* profile = LLFloaterReg::showTypedInstance<LLFloaterProfile>( - "profile", LLSD().with("id", avatar_id)); - if (profile) - { - profile->showPick(); - } + profilefloater->showPick(); } } } @@ -427,20 +406,10 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id) { if (avatar_id.notNull()) { - if (gSkinSettings.getBool("LegacyProfile")) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES); - /*auto* tab = */dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->expandTab("avatar_picks_tab")); - // *TODO: Finish - } - else + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) { - LLFloaterProfile* profile = LLFloaterReg::showTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id)); - if (profile) - { - profile->showPick(pick_id); - } + profilefloater->showPick(pick_id); } } } @@ -448,9 +417,9 @@ void LLAvatarActions::showPick(const LLUUID& avatar_id, const LLUUID& pick_id) // static void LLAvatarActions::createPick() { - + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); LLViewerRegion* region = gAgent.getRegion(); - if (region) + if (profilefloater && region) { LLPickData data; data.pos_global = gAgent.getPositionGlobal(); @@ -468,7 +437,8 @@ void LLAvatarActions::createPick() { data.name = region->getName(); } - createPick(data); + + profilefloater->createPick(data); } } @@ -477,21 +447,10 @@ bool LLAvatarActions::isPickTabSelected(const LLUUID& avatar_id) { if (avatar_id.notNull()) { - static LLCachedControl<bool> legacy_profile(gSkinSettings, "LegacyProfile"); - if (legacy_profile) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::findTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id)); - if (profile == nullptr) { return false; } - return dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->getExpandedTab()) != nullptr; - } - else + LLFloaterProfile* profilefloater = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id)); + if (profilefloater) { - LLFloaterProfile* profilefloater = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id)); - if (profilefloater) - { - return profilefloater->isPickTabSelected(); - } + return profilefloater->isPickTabSelected(); } } return false; @@ -502,21 +461,10 @@ void LLAvatarActions::showClassifieds(const LLUUID& avatar_id) { if (avatar_id.notNull()) { - if (gSkinSettings.getBool("LegacyProfile")) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES); - LLPanel* tab = profile->expandTab("avatar_picks_tab"); - tab->getChild<LLAccordionCtrl>("accordion")->expandTab("tab_classifieds"); - } - else + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) { - LLFloaterProfile* profilefloater = LLFloaterReg::showTypedInstance<LLFloaterProfile>( - "profile", LLSD().with("id", avatar_id)); - if (profilefloater) - { - profilefloater->showClassified(); - } + profilefloater->showClassified(); } } } @@ -526,22 +474,10 @@ void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& clas { if (avatar_id.notNull()) { - if (gSkinSettings.getBool("LegacyProfile")) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", avatar_id), TAKE_FOCUS_YES); - LLPanel* tab = profile->expandTab("avatar_picks_tab"); - tab->getChild<LLAccordionCtrl>("accordion")->expandTab("tab_classifieds"); - // *TODO: Finish - } - else + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); + if (profilefloater) { - LLFloaterProfile* profilefloater = - dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", avatar_id))); - if (profilefloater) - { - profilefloater->showClassified(classified_id, edit); - } + profilefloater->showClassified(classified_id, edit); } } } @@ -549,68 +485,35 @@ void LLAvatarActions::showClassified(const LLUUID& avatar_id, const LLUUID& clas // static void LLAvatarActions::createClassified() { - if (gSkinSettings.getBool("LegacyProfile")) + LLFloaterProfile* profilefloater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); + if (profilefloater) { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", gAgent.getID())); - auto* tab = dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->expandTab("avatar_picks_tab")); - tab->createNewClassified(); - - } - else - { - LLFloaterProfile* profilefloater = - dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); - if (profilefloater) - { - profilefloater->createClassified(); - } + profilefloater->createClassified(); } } //static bool LLAvatarActions::profileVisible(const LLUUID& avatar_id) { - LLFloater* floater = findProfileFloater(avatar_id); + LLSD sd; + sd["id"] = avatar_id; + LLFloater* floater = getProfileFloater(avatar_id); return floater && floater->isShown(); } //static -LLFloater* LLAvatarActions::findProfileFloater(const LLUUID& avatar_id) +LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& avatar_id) { - LLFloater* profile = nullptr; - static LLCachedControl<bool> legacy_profile(gSkinSettings, "LegacyProfile"); - if (legacy_profile) - profile = LLFloaterReg::findTypedInstance<LLFloaterProfileLegacy>("legacy_profile", LLSD().with("avatar_id", avatar_id)); - else - profile = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id)); - return profile; -} - -void LLAvatarActions::createPick(const LLPickData& data) -{ - if (gSkinSettings.getBool("LegacyProfile")) - { - const LLFloaterProfileLegacy* profile = LLFloaterReg::showTypedInstance<LLFloaterProfileLegacy>( - "legacy_profile", LLSD().with("avatar_id", gAgent.getID())); - auto* tab = dynamic_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(profile->expandTab("avatar_picks_tab")); - tab->createNewPick(); - } - else - { - LLFloaterProfile* floater = - dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgent.getID()))); - if (floater) - { - floater->createPick(data); - } - } + LLFloaterProfile* floater = LLFloaterReg::findTypedInstance<LLFloaterProfile>("profile", LLSD().with("id", avatar_id)); + return floater; } //static void LLAvatarActions::hideProfile(const LLUUID& avatar_id) { - LLFloater* floater = findProfileFloater(avatar_id); + LLSD sd; + sd["id"] = avatar_id; + LLFloater* floater = getProfileFloater(avatar_id); if (floater) { floater->closeFloater(); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index f69954bfe43b595fedcf8799dde076854ed15bf6..2493ec2b5030f90658b0ca32c57c7d3a681454bd 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -107,9 +107,7 @@ class LLAvatarActions static void hideProfile(const LLUUID& avatar_id); static bool profileVisible(const LLUUID& avatar_id); static bool isPickTabSelected(const LLUUID& avatar_id); - static LLFloater* findProfileFloater(const LLUUID& avatar_id); - - static void createPick(const LLPickData& data); + static LLFloater* getProfileFloater(const LLUUID& avatar_id); /** * Show avatar on world map. diff --git a/indra/newview/llclassifieditem.cpp b/indra/newview/llclassifieditem.cpp deleted file mode 100644 index 0f0f6924e0bec78c0befbca2f2b7d728aa03fb41..0000000000000000000000000000000000000000 --- a/indra/newview/llclassifieditem.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/** -* @file llclassifieditem.cpp -* @brief Widget -* -* $LicenseInfo:firstyear=2009&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$ -*/ - -#include "llviewerprecompiledheaders.h" -#include "llclassifieditem.h" - -#include "llpanelclassified.h" - -LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id) - : LLPanel() - , mAvatarId(avatar_id) - , mClassifiedId(classified_id) -{ - buildFromFile("panel_classifieds_list_item.xml"); - - LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); - LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); -} - -LLClassifiedItem::~LLClassifiedItem() -{ - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); -} - -void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) -{ - if (APT_CLASSIFIED_INFO != type) - { - return; - } - - LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); - if (!c_info || c_info->classified_id != getClassifiedId()) - { - return; - } - - setClassifiedName(c_info->name); - setDescription(c_info->description); - setSnapshotId(c_info->snapshot_id); - setPosGlobal(c_info->pos_global); - - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); -} - -BOOL LLClassifiedItem::postBuild() -{ - setMouseEnterCallback(std::bind(&set_child_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(std::bind(&set_child_visible, this, "hovered_icon", false)); - return TRUE; -} - -void LLClassifiedItem::setValue(const LLSD& value) -{ - if (!value.isMap()) return;; - if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible(value["selected"]); -} - -void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel) -{ - if (!panel) - { - return; - } - - setClassifiedName(panel->getClassifiedName()); - setDescription(panel->getDescription()); - setSnapshotId(panel->getSnapshotId()); - setCategory(panel->getCategory()); - setContentType(panel->getContentType()); - setAutoRenew(panel->getAutoRenew()); - setPriceForListing(panel->getPriceForListing()); - setPosGlobal(panel->getPosGlobal()); - setLocationText(panel->getClassifiedLocation()); -} - -void LLClassifiedItem::setClassifiedName(const std::string& name) -{ - getChild<LLUICtrl>("name")->setValue(name); -} - -void LLClassifiedItem::setDescription(const std::string& desc) -{ - getChild<LLUICtrl>("description")->setValue(desc); -} - -void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) -{ - getChild<LLUICtrl>("picture")->setValue(snapshot_id); -} - -LLUUID LLClassifiedItem::getSnapshotId() const -{ - return getChild<LLUICtrl>("picture")->getValue(); -} diff --git a/indra/newview/llclassifieditem.h b/indra/newview/llclassifieditem.h deleted file mode 100644 index 212a53ee0c693055e52ad60aecce0c99f95d5bc3..0000000000000000000000000000000000000000 --- a/indra/newview/llclassifieditem.h +++ /dev/null @@ -1,83 +0,0 @@ -/** -* @file llclassifieditem.h -* @brief Widget -* -* $LicenseInfo:firstyear=2009&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_CLASSIFIEDITEM_H -#define LL_CLASSIFIEDITEM_H - -#include "llavatarpropertiesprocessor.h" -#include "llpanel.h" - -class LLPanelClassifiedEdit; - -static const std::string CLASSIFIED_ID("classified_id"); -static const std::string CLASSIFIED_NAME("classified_name"); - -class LLClassifiedItem final : public LLPanel, public LLAvatarPropertiesObserver -{ -public: - - LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id); - virtual ~LLClassifiedItem(); - - void processProperties(void* data, EAvatarProcessorType type) override; - BOOL postBuild() override; - void setValue(const LLSD& value) override; - void fillIn(LLPanelClassifiedEdit* panel); - LLUUID getAvatarId() const { return mAvatarId; } - void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } - LLUUID getClassifiedId() const { return mClassifiedId; } - void setClassifiedId(const LLUUID& classified_id) { mClassifiedId = classified_id; } - void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } - const LLVector3d getPosGlobal() const { return mPosGlobal; } - void setLocationText(const std::string location) { mLocationText = std::move(location); } - std::string getLocationText() const { return mLocationText; } - void setClassifiedName(const std::string& name); - std::string getClassifiedName() const { return getChild<LLUICtrl>("name")->getValue().asString(); } - void setDescription(const std::string& desc); - std::string getDescription() const { return getChild<LLUICtrl>("description")->getValue().asString(); } - void setSnapshotId(const LLUUID& snapshot_id); - LLUUID getSnapshotId() const; - void setCategory(U32 cat) { mCategory = cat; } - U32 getCategory() const { return mCategory; } - void setContentType(U32 ct) { mContentType = ct; } - U32 getContentType() const { return mContentType; } - void setAutoRenew(U32 renew) { mAutoRenew = renew; } - bool getAutoRenew() const { return mAutoRenew; } - void setPriceForListing(S32 price) { mPriceForListing = price; } - S32 getPriceForListing() const { return mPriceForListing; } - -private: - LLUUID mAvatarId; - LLUUID mClassifiedId; - LLVector3d mPosGlobal; - std::string mLocationText; - U32 mCategory; - U32 mContentType; - bool mAutoRenew; - S32 mPriceForListing; -}; - -#endif // LL_CLASSIFIEDITEM_H diff --git a/indra/newview/llfloaterprofilelegacy.cpp b/indra/newview/llfloaterprofilelegacy.cpp deleted file mode 100644 index 78df15de899971f367e5c2dff917f83d16f1e3a1..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterprofilelegacy.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * @file llfloaterprofilelegacy.cpp - * @brief Floater that holds panel don't bitch about it, Dog; Merging is easy. - * - * Copyright (c) 2017-2022, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llfloaterprofilelegacy.h" - -#include "llavatarname.h" -#include "llavatarnamecache.h" -#include "llpanelprofilelegacy.h" - -LLFloaterProfileLegacy::LLFloaterProfileLegacy(LLSD const& key) -: LLFloater(key) -{ - -} - -LLFloaterProfileLegacy::~LLFloaterProfileLegacy() -{ - if (mAvatarNameCacheConnection.connected()) - mAvatarNameCacheConnection.disconnect(); -} - -BOOL LLFloaterProfileLegacy::postBuild() -{ - mPanel = dynamic_cast<LLPanelProfileLegacy*>(getChild<LLPanel>("panel_profile_legacy_sidetray")); - return TRUE; -} - -void LLFloaterProfileLegacy::onOpen(const LLSD& key) -{ - if (!key.has("avatar_id")) return; - const LLUUID av_id = key["avatar_id"].asUUID(); - - mAvatarNameCacheConnection = LLAvatarNameCache::get(av_id, - boost::bind(&LLFloaterProfileLegacy::onAvatarNameCache, this, _1, _2)); - - if (mPanel) { mPanel->onOpen(key); } -} - -void LLFloaterProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - setTitle(av_name.getCompleteName()); - mAvatarNameCacheConnection.disconnect(); -} - -LLPanel* LLFloaterProfileLegacy::expandTab(const std::string& name) const -{ - return mPanel != nullptr ? mPanel->expandTab(name) : nullptr; -} - -LLPanel* LLFloaterProfileLegacy::getExpandedTab() const -{ - return mPanel != nullptr ? mPanel->getExpandedTab() : nullptr; -} diff --git a/indra/newview/llfloaterprofilelegacy.h b/indra/newview/llfloaterprofilelegacy.h deleted file mode 100644 index 59c9381fd8640ba8bc56931e383b92220cdf4d79..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterprofilelegacy.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* @file llfloaterlegacyprofile.h -* @brief Floater that holds panel -* -* Copyright (c) 2017-2022, Cinder Roxley <cinder@sdf.org> -* -* Permission is hereby granted, free of charge, to any person or organization -* obtaining a copy of the software and accompanying documentation covered by -* this license (the "Software") to use, reproduce, display, distribute, -* execute, and transmit the Software, and to prepare derivative works of the -* Software, and to permit third-parties to whom the Software is furnished to -* do so, all subject to the following: -* -* The copyright notices in the Software and this entire statement, including -* the above license grant, this restriction and the following disclaimer, -* must be included in all copies of the Software, in whole or in part, and -* all derivative works of the Software, unless such copies or derivative -* works are solely in the form of machine-executable object code generated by -* a source language processor. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -*/ - -#ifndef LL_FLOATERLEGACYPROFILE_H -#define LL_FLOATERLEGACYPROFILE_H - -#include "llfloater.h" - -class LLAvatarName; -class LLPanelProfileLegacy; -class LLPanelProfileLegacyTab; - -class LLFloaterProfileLegacy final : public LLFloater -{ -public: - LLFloaterProfileLegacy(LLSD const& key); - BOOL postBuild() override; - void onOpen(const LLSD& key) override; - - LLPanel* expandTab(const std::string& name) const; - LLPanel* getExpandedTab() const; - -private: - ~LLFloaterProfileLegacy() override; - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - - LLPanelProfileLegacy* mPanel; - boost::signals2::connection mAvatarNameCacheConnection; -}; - -#endif // LL_FLOATERLEGACYPROFILE_H diff --git a/indra/newview/llfloaterpublishclassified.cpp b/indra/newview/llfloaterpublishclassified.cpp deleted file mode 100644 index b19cc8f97e2f33d3549a67054591561219116a49..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterpublishclassified.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file llfloaterpublishclassified.cpp - * @brief Publish classified floater - * - * $LicenseInfo:firstyear=2004&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$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llfloaterpublishclassified.h" - -LLFloaterPublishClassified::LLFloaterPublishClassified(const LLSD& key) - : LLFloater(key) -{ -} - -BOOL LLFloaterPublishClassified::postBuild() -{ - LLFloater::postBuild(); - - childSetAction("publish_btn", boost::bind(&LLFloater::closeFloater, this, false)); - childSetAction("cancel_btn", boost::bind(&LLFloater::closeFloater, this, false)); - - return TRUE; -} - -void LLFloaterPublishClassified::setPrice(S32 price) -{ - getChild<LLUICtrl>("price_for_listing")->setValue(price); -} - -S32 LLFloaterPublishClassified::getPrice() -{ - return getChild<LLUICtrl>("price_for_listing")->getValue().asInteger(); -} - -void LLFloaterPublishClassified::setPublishClickedCallback(const commit_signal_t::slot_type& cb) -{ - getChild<LLButton>("publish_btn")->setClickedCallback(cb); -} - -void LLFloaterPublishClassified::setCancelClickedCallback(const commit_signal_t::slot_type& cb) -{ - getChild<LLButton>("cancel_btn")->setClickedCallback(cb); -} diff --git a/indra/newview/llfloaterpublishclassified.h b/indra/newview/llfloaterpublishclassified.h deleted file mode 100644 index f5d79656119eb3c212d9fa0f5369f91188a2ff9b..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterpublishclassified.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file llfloaterpublishclassified.h - * @brief Publish classified floater - * - * $LicenseInfo:firstyear=2004&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_PUBLISHCLASSIFIEDFLOATER_H -#define LL_PUBLISHCLASSIFIEDFLOATER_H - -#include "llfloater.h" - -class LLFloaterPublishClassified final : public LLFloater -{ -public: - LLFloaterPublishClassified(const LLSD& key); - ~LLFloaterPublishClassified() override = default; - - BOOL postBuild() override; - - void setPrice(S32 price); - S32 getPrice(); - - void setPublishClickedCallback(const commit_signal_t::slot_type& cb); - void setCancelClickedCallback(const commit_signal_t::slot_type& cb); -}; - -#endif // LL_PUBLISHCLASSIFIEDFLOATER_H diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp deleted file mode 100644 index 05ec0028548ba3ba2c5c91034f428f46af3d6fa8..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterwebprofile.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file llfloaterwebprofile.cpp - * @brief Web profile floater. - * - * $LicenseInfo:firstyear=2009&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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterwebprofile.h" - -#include "llviewercontrol.h" - -LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) : - LLFloaterWebContent(key) -{ -} - -void LLFloaterWebProfile::onOpen(const LLSD& key) -{ - Params p(key); - p.show_chrome(true); - p.window_class("web_content"); - p.allow_address_entry(false); - p.trusted_content(true); - LLFloaterWebContent::onOpen(p); - applyPreferredRect(); -} - -// virtual -void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user) -{ - LL_DEBUGS() << "handleReshape: " << new_rect << LL_ENDL; - - if (by_user && !isMinimized()) - { - LL_DEBUGS() << "Storing new rect" << LL_ENDL; - gSavedSettings.setRect("WebProfileFloaterRect", new_rect); - } - - LLFloaterWebContent::handleReshape(new_rect, by_user); -} - -LLFloater* LLFloaterWebProfile::create(const LLSD& key) -{ - LLFloaterWebContent::Params p(key); - preCreate(p); - return new LLFloaterWebProfile(p); -} - -void LLFloaterWebProfile::applyPreferredRect() -{ - const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect"); - LL_DEBUGS() << "Applying preferred rect: " << preferred_rect << LL_ENDL; - - // Don't override position that may have been set by floater stacking code. - LLRect new_rect = getRect(); - new_rect.setLeftTopAndSize( - new_rect.mLeft, new_rect.mTop, - preferred_rect.getWidth(), preferred_rect.getHeight()); - setShape(new_rect); -} diff --git a/indra/newview/llfloaterwebprofile.h b/indra/newview/llfloaterwebprofile.h deleted file mode 100644 index df9ebc892850144353c0c85da8849a664433da4e..0000000000000000000000000000000000000000 --- a/indra/newview/llfloaterwebprofile.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file llfloaterwebprofile.h - * @brief Web profile floater. - * - * $LicenseInfo:firstyear=2009&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_LLFLOATERWEBPROFILE_H -#define LL_LLFLOATERWEBPROFILE_H - -#include "llfloaterwebcontent.h" -#include "llviewermediaobserver.h" - -class LLMediaCtrl; - -/** - * Displays avatar profile web page. - */ -class LLFloaterWebProfile final -: public LLFloaterWebContent -{ - LOG_CLASS(LLFloaterWebProfile); -public: - typedef LLFloaterWebContent::Params Params; - - LLFloaterWebProfile(const Params& key); - - /*virtual*/ void onOpen(const LLSD& key) override; - /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override; - - static LLFloater* create(const LLSD& key); - -private: - void applyPreferredRect(); -}; - -#endif // LL_LLFLOATERWEBPROFILE_H diff --git a/indra/newview/llpanelavatarlegacy.cpp b/indra/newview/llpanelavatarlegacy.cpp deleted file mode 100644 index c0a943b6757998982ebb0869f80cc034782aa329..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelavatarlegacy.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @file llpanelavatarlegacy.cpp - * @brief LLPanelAvatar and related class implementations - * - * $LicenseInfo:firstyear=2004&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$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelavatarlegacy.h" - -#include "llagent.h" -#include "llavataractions.h" -#include "llcallingcard.h" - -#include "llscrollcontainer.h" -#include "llavatariconctrl.h" -#include "lltextbox.h" - -LLPanelProfileLegacyTab::LLPanelProfileLegacyTab() -: LLPanel() -, mAvatarId(LLUUID::null) -{ -} - -LLPanelProfileLegacyTab::~LLPanelProfileLegacyTab() -{ - if(getAvatarId().notNull()) - { - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); - } -} - -void LLPanelProfileLegacyTab::setAvatarId(const LLUUID& id) -{ - if(id.notNull()) - { - if(getAvatarId().notNull()) - { - LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId,this); - } - mAvatarId = id; - LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(),this); - } -} - -void LLPanelProfileLegacyTab::onOpen(const LLSD& key) -{ - // Don't reset panel if we are opening it for same avatar. - if(getAvatarId() != key.asUUID()) - { - resetControls(); - resetData(); - - scrollToTop(); - } - - // Update data even if we are viewing same avatar profile as some data might been changed. - setAvatarId(key.asUUID()); - updateData(); - updateButtons(); -} - -void LLPanelProfileLegacyTab::scrollToTop() const -{ - LLScrollContainer* scrollContainer = findChild<LLScrollContainer>("profile_scroll"); - if (scrollContainer) - scrollContainer->goToTop(); -} - -void LLPanelProfileLegacyTab::onMapButtonClick() -{ - LLAvatarActions::showOnMap(getAvatarId()); -} - -void LLPanelProfileLegacyTab::updateButtons() -{ - bool is_buddy_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()); - - if(LLAvatarActions::isFriend(getAvatarId())) - { - getChildView("teleport")->setEnabled(is_buddy_online); - } - else - { - getChildView("teleport")->setEnabled(true); - } - - bool enable_map_btn = (is_buddy_online && LLAvatarActions::isAgentMappable(getAvatarId())) || gAgent.isGodlike(); - getChildView("show_on_map_btn")->setEnabled(enable_map_btn); -} diff --git a/indra/newview/llpanelavatarlegacy.h b/indra/newview/llpanelavatarlegacy.h deleted file mode 100644 index ef442b16bc55eb98eaa4569d48bee9ff00d79830..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelavatarlegacy.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file llpanelavatarlegacy.h - * @brief LLPanelAvatar and related class definitions - * - * $LicenseInfo:firstyear=2004&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_LLPANELAVATARLEGACY_H -#define LL_LLPANELAVATARLEGACY_H - -#include "llpanel.h" -#include "llavatarpropertiesprocessor.h" - -class LLComboBox; -class LLLineEditor; - -/** -* Base class for any Profile View. -*/ -class LLPanelProfileLegacyTab - : public LLPanel - , public LLAvatarPropertiesObserver -{ -public: - - /** - * Sets avatar ID, sets panel as observer of avatar related info replies from server. - */ - virtual void setAvatarId(const LLUUID& id); - - /** - * Returns avatar ID. - */ - virtual const LLUUID& getAvatarId() { return mAvatarId; } - - /** - * Sends update data request to server. - */ - virtual void updateData() = 0; - - /** - * Clears panel data if viewing avatar info for first time and sends update data request. - */ - void onOpen(const LLSD& key) override; - - /** - * Profile tabs should close any opened panels here. - * - * Called from LLPanelProfile::onOpen() before opening new profile. - * See LLPanelPicks::onClosePanel for example. LLPanelPicks closes picture info panel - * before new profile is displayed, otherwise new profile will - * be hidden behind picture info panel. - */ - virtual void onClosePanel() {} - - /** - * Resets controls visibility, state, etc. - */ - virtual void resetControls(){}; - - /** - * Clears all data received from server. - */ - virtual void resetData(){}; - - ~LLPanelProfileLegacyTab() override; - -protected: - - LLPanelProfileLegacyTab(); - - /** - * Scrolls panel to top when viewing avatar info for first time. - */ - void scrollToTop() const; - - virtual void onMapButtonClick(); - - virtual void updateButtons(); - -private: - - LLUUID mAvatarId; -}; - -#endif // LL_LLPANELAVATARLEGACY_H diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 53f3e818fb37c9d9b519edcef512f36718ae411e..11d12394592d427b73b3ff85c0432f98446ddee7 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -34,27 +34,16 @@ #include "lldispatcher.h" #include "llfloaterreg.h" -#include "llnotifications.h" -#include "llnotificationsutil.h" #include "llparcel.h" #include "llagent.h" #include "llclassifiedflags.h" -#include "llclassifiedinfo.h" #include "lliconctrl.h" -#include "lllineeditor.h" -#include "llcombobox.h" -#include "lllogininstance.h" #include "lltexturectrl.h" -#include "lltexteditor.h" -#include "llviewerparcelmgr.h" #include "llfloaterworldmap.h" #include "llviewergenericmessage.h" // send_generic_message #include "llviewerregion.h" -#include "llviewertexture.h" -#include "lltrans.h" #include "llscrollcontainer.h" -#include "llstatusbar.h" #include "llcorehttputil.h" //static @@ -114,10 +103,6 @@ LLPanelClassifiedInfo::LLPanelClassifiedInfo() LLPanelClassifiedInfo::~LLPanelClassifiedInfo() { - if (getAvatarId().notNull()) - { - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); - } sAllPanels.remove(this); if (getAvatarId().notNull()) @@ -126,17 +111,8 @@ LLPanelClassifiedInfo::~LLPanelClassifiedInfo() } } -// static -LLPanelClassifiedInfo* LLPanelClassifiedInfo::create() -{ - LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo(); - panel->buildFromFile("panel_classified_info.xml"); - return panel; -} - BOOL LLPanelClassifiedInfo::postBuild() { - childSetAction("back_btn", boost::bind(&LLPanelClassifiedInfo::onExit, this)); childSetAction("show_on_map_btn", boost::bind(&LLPanelClassifiedInfo::onMapClick, this)); childSetAction("teleport_btn", boost::bind(&LLPanelClassifiedInfo::onTeleportClick, this)); @@ -152,16 +128,6 @@ BOOL LLPanelClassifiedInfo::postBuild() return TRUE; } -void LLPanelClassifiedInfo::setExitCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("back_btn")->setClickedCallback(cb); -} - -void LLPanelClassifiedInfo::setEditClassifiedCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("edit_btn")->setClickedCallback(cb); -} - void LLPanelClassifiedInfo::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) { LLPanel::reshape(width, height, called_from_parent); @@ -190,7 +156,7 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLUUID avatar_id = key["classified_creator_id"]; if(avatar_id.isNull()) { - //return; + return; } if(getAvatarId().notNull()) @@ -214,7 +180,6 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); - gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough); if (gAgent.getRegion()) @@ -294,11 +259,9 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date)); getChild<LLUICtrl>("creation_date")->setValue(date_str); - date_str = date_fmt; - LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->expiration_date)); - getChild<LLUICtrl>("expiration_date")->setValue(date_str); - setInfoLoaded(true); + + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); } } } @@ -409,8 +372,9 @@ void LLPanelClassifiedInfo::setClickThrough( << teleport << ", " << map << ", " << profile << "] (" << (from_new_table ? "new" : "old") << ")" << LL_ENDL; - for (auto self : sAllPanels) + for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) { + LLPanelClassifiedInfo* self = *iter; if (self->getClassifiedId() != classified_id) { continue; @@ -602,551 +566,4 @@ void LLPanelClassifiedInfo::onTeleportClick() } } -void LLPanelClassifiedInfo::onExit() -{ - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); - gGenericDispatcher.addHandler("classifiedclickthrough", nullptr); // deregister our handler -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -static const S32 CB_ITEM_MATURE = 0; -static const S32 CB_ITEM_PG = 1; - -LLPanelClassifiedEdit::LLPanelClassifiedEdit() - : LLPanelClassifiedInfo() - , mIsNew(false) - , mIsNewWithErrors(false) - , mCanClose(false) - , mPublishFloater(nullptr) -{ -} - -LLPanelClassifiedEdit::~LLPanelClassifiedEdit() -{ -} - -//static -LLPanelClassifiedEdit* LLPanelClassifiedEdit::create() -{ - LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit(); - panel->buildFromFile("panel_edit_classified.xml"); - return panel; -} - -BOOL LLPanelClassifiedEdit::postBuild() -{ - LLPanelClassifiedInfo::postBuild(); - - LLUICtrl* edit_icon = getChild<LLUICtrl>("edit_icon"); - mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelClassifiedEdit::onTexturePickerMouseEnter, this, edit_icon)); - mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelClassifiedEdit::onTexturePickerMouseLeave, this, edit_icon)); - edit_icon->setVisible(false); - - LLLineEditor* line_edit = getChild<LLLineEditor>("classified_name"); - line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); - - LLTextEditor* text_edit = getChild<LLTextEditor>("classified_desc"); - text_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); - - LLComboBox* combobox = getChild<LLComboBox>( "category"); - LLClassifiedInfo::cat_map::iterator iter; - for (iter = LLClassifiedInfo::sCategories.begin(); - iter != LLClassifiedInfo::sCategories.end(); - iter++) - { - combobox->add(LLTrans::getString(iter->second)); - } - - combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); - - childSetCommitCallback("content_type", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); - childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); - childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onChange, this), nullptr); - - childSetAction("save_changes_btn", boost::bind(&LLPanelClassifiedEdit::onSaveClick, this)); - childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelClassifiedEdit::onSetLocationClick, this)); - - mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelClassifiedEdit::onTextureSelected, this)); - - return TRUE; -} - -void LLPanelClassifiedEdit::fillIn(const LLSD& key) -{ - setAvatarId(gAgent.getID()); - - if(key.isUndefined()) - { - setPosGlobal(gAgent.getPositionGlobal()); - - LLUUID snapshot_id = LLUUID::null; - std::string desc; - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if(parcel) - { - desc = parcel->getDesc(); - snapshot_id = parcel->getSnapshotID(); - } - - std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); - LLViewerRegion* region = gAgent.getRegion(); - if (region) - { - region_name = region->getName(); - } - - getChild<LLUICtrl>("classified_name")->setValue(makeClassifiedName()); - getChild<LLUICtrl>("classified_desc")->setValue(desc); - setSnapshotId(snapshot_id); - setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); - // server will set valid parcel id - setParcelId(LLUUID::null); - } - else - { - setClassifiedId(key["classified_id"]); - setClassifiedName(key["name"]); - setDescription(key["desc"]); - setSnapshotId(key["snapshot_id"]); - setCategory((U32)key["category"].asInteger()); - setContentType((U32)key["content_type"].asInteger()); - setClassifiedLocation(key["location_text"]); - getChild<LLUICtrl>("auto_renew")->setValue(key["auto_renew"]); - getChild<LLUICtrl>("price_for_listing")->setValue(key["price_for_listing"].asInteger()); - } -} - -void LLPanelClassifiedEdit::onOpen(const LLSD& key) -{ - mIsNew = key.isUndefined(); - - scrollToTop(); - - // classified is not created yet - bool is_new = isNew() || isNewWithErrors(); - - if(is_new) - { - resetData(); - resetControls(); - - fillIn(key); - - if(isNew()) - { - LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); - } - } - else - { - LLPanelClassifiedInfo::onOpen(key); - } - - std::string save_btn_label = is_new ? getString("publish_label") : getString("save_label"); - getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", save_btn_label); - - enableVerbs(is_new); - enableEditing(is_new); - showEditing(!is_new); - resetDirty(); - setInfoLoaded(false); -} - -void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type) -{ - if(APT_CLASSIFIED_INFO == type) - { - LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); - if(c_info && getClassifiedId() == c_info->classified_id) - { - // see LLPanelClassifiedEdit::sendUpdate() for notes - mIsNewWithErrors = false; - // for just created classified - panel will probably be closed when we get here. - if(!getVisible()) - { - return; - } - - enableEditing(true); - - setClassifiedName(c_info->name); - setDescription(c_info->description); - setSnapshotId(c_info->snapshot_id); - setParcelId(c_info->parcel_id); - setPosGlobal(c_info->pos_global); - - setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); - // *HACK see LLPanelClassifiedEdit::sendUpdate() - setCategory(c_info->category - 1); - - bool mature = is_cf_mature(c_info->flags); - bool auto_renew = is_cf_auto_renew(c_info->flags); - - setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG); - getChild<LLUICtrl>("auto_renew")->setValue(auto_renew); - getChild<LLUICtrl>("price_for_listing")->setValue(c_info->price_for_listing); - getChildView("price_for_listing")->setEnabled(isNew()); - - resetDirty(); - setInfoLoaded(true); - enableVerbs(false); - - // for just created classified - in case user opened edit panel before processProperties() callback - getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", getString("save_label")); - } - } -} - -BOOL LLPanelClassifiedEdit::isDirty() const -{ - if(mIsNew) - { - return TRUE; - } - - BOOL dirty = false; - - dirty |= LLPanelClassifiedInfo::isDirty(); - dirty |= getChild<LLUICtrl>("classified_snapshot")->isDirty(); - dirty |= getChild<LLUICtrl>("classified_name")->isDirty(); - dirty |= getChild<LLUICtrl>("classified_desc")->isDirty(); - dirty |= getChild<LLUICtrl>("category")->isDirty(); - dirty |= getChild<LLUICtrl>("content_type")->isDirty(); - dirty |= getChild<LLUICtrl>("auto_renew")->isDirty(); - dirty |= getChild<LLUICtrl>("price_for_listing")->isDirty(); - - return dirty; -} - -void LLPanelClassifiedEdit::resetDirty() -{ - LLPanelClassifiedInfo::resetDirty(); - getChild<LLUICtrl>("classified_snapshot")->resetDirty(); - getChild<LLUICtrl>("classified_name")->resetDirty(); - - LLTextEditor* desc = getChild<LLTextEditor>("classified_desc"); - // call blockUndo() to really reset dirty(and make isDirty work as intended) - desc->blockUndo(); - desc->resetDirty(); - - getChild<LLUICtrl>("category")->resetDirty(); - getChild<LLUICtrl>("content_type")->resetDirty(); - getChild<LLUICtrl>("auto_renew")->resetDirty(); - getChild<LLUICtrl>("price_for_listing")->resetDirty(); -} - -void LLPanelClassifiedEdit::setSaveCallback(const commit_signal_t::slot_type& cb) -{ - mSaveButtonClickedSignal.connect(cb); -} - -void LLPanelClassifiedEdit::setCancelCallback(const commit_signal_t::slot_type& cb) -{ - getChild<LLButton>("cancel_btn")->setClickedCallback(cb); -} - -void LLPanelClassifiedEdit::resetControls() -{ - LLPanelClassifiedInfo::resetControls(); - - getChild<LLComboBox>("category")->setCurrentByIndex(0); - getChild<LLComboBox>("content_type")->setCurrentByIndex(0); - getChild<LLUICtrl>("auto_renew")->setValue(false); - if (LLLoginInstance::getInstance()->hasResponse("classified_fee")) - { - getChild<LLUICtrl>("price_for_listing")->setValue(LLLoginInstance::getInstance()-> - getResponse("classified_fee").asInteger()); - } - else - { - getChild<LLUICtrl>("price_for_listing")->setValue(MINIMUM_PRICE_FOR_LISTING); - } - getChildView("price_for_listing")->setEnabled(TRUE); -} - -bool LLPanelClassifiedEdit::canClose() -{ - return mCanClose; -} - -void LLPanelClassifiedEdit::draw() -{ - LLPanel::draw(); - - // Need to re-stretch on every draw because LLTextureCtrl::onSelectCallback - // does not trigger callbacks when user navigates through images. - stretchSnapshot(); -} - -void LLPanelClassifiedEdit::stretchSnapshot() -{ - LLPanelClassifiedInfo::stretchSnapshot(); - - getChild<LLUICtrl>("edit_icon")->setShape(mSnapshotCtrl->getRect()); -} - -U32 LLPanelClassifiedEdit::getContentType() -{ - LLComboBox* ct_cb = getChild<LLComboBox>("content_type"); - return ct_cb->getCurrentIndex(); -} - -void LLPanelClassifiedEdit::setContentType(U32 content_type) -{ - LLComboBox* ct_cb = getChild<LLComboBox>("content_type"); - ct_cb->setCurrentByIndex(content_type); - ct_cb->resetDirty(); -} - -bool LLPanelClassifiedEdit::getAutoRenew() -{ - return getChild<LLUICtrl>("auto_renew")->getValue().asBoolean(); -} - -void LLPanelClassifiedEdit::sendUpdate() -{ - LLAvatarClassifiedInfo c_data; - - if(getClassifiedId().isNull()) - { - setClassifiedId(LLUUID::generateNewID()); - } - - c_data.agent_id = gAgent.getID(); - c_data.classified_id = getClassifiedId(); - // *HACK - // Categories on server start with 1 while combo-box index starts with 0 - c_data.category = getCategory() + 1; - c_data.name = getClassifiedName(); - c_data.description = getDescription(); - c_data.parcel_id = getParcelId(); - c_data.snapshot_id = getSnapshotId(); - c_data.pos_global = getPosGlobal(); - c_data.flags = getFlags(); - c_data.price_for_listing = getPriceForListing(); - - LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoUpdate(&c_data); - - if(isNew()) - { - // Lets assume there will be some error. - // Successful sendClassifiedInfoUpdate will trigger processProperties and - // let us know there was no error. - mIsNewWithErrors = true; - } -} - -U32 LLPanelClassifiedEdit::getCategory() -{ - LLComboBox* cat_cb = getChild<LLComboBox>("category"); - return cat_cb->getCurrentIndex(); -} - -void LLPanelClassifiedEdit::setCategory(U32 category) -{ - LLComboBox* cat_cb = getChild<LLComboBox>("category"); - cat_cb->setCurrentByIndex(category); - cat_cb->resetDirty(); -} - -U8 LLPanelClassifiedEdit::getFlags() -{ - bool auto_renew = getChild<LLUICtrl>("auto_renew")->getValue().asBoolean(); - - LLComboBox* content_cb = getChild<LLComboBox>("content_type"); - bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; - - return pack_classified_flags_request(auto_renew, false, mature, false); -} - -void LLPanelClassifiedEdit::enableVerbs(bool enable) -{ - getChildView("save_changes_btn")->setEnabled(enable); -} - -void LLPanelClassifiedEdit::enableEditing(bool enable) -{ - getChildView("classified_snapshot")->setEnabled(enable); - getChildView("classified_name")->setEnabled(enable); - getChildView("classified_desc")->setEnabled(enable); - getChildView("set_to_curr_location_btn")->setEnabled(enable); - getChildView("category")->setEnabled(enable); - getChildView("content_type")->setEnabled(enable); - getChildView("price_for_listing")->setEnabled(enable); - getChildView("auto_renew")->setEnabled(enable); -} - -void LLPanelClassifiedEdit::showEditing(bool show) -{ - getChildView("price_for_listing_label")->setVisible( show); - getChildView("price_for_listing")->setVisible( show); -} - -std::string LLPanelClassifiedEdit::makeClassifiedName() -{ - std::string name; - - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(parcel) - { - name = parcel->getName(); - } - - if(!name.empty()) - { - return name; - } - - LLViewerRegion* region = gAgent.getRegion(); - if(region) - { - name = region->getName(); - } - - return name; -} - -S32 LLPanelClassifiedEdit::getPriceForListing() -{ - return getChild<LLUICtrl>("price_for_listing")->getValue().asInteger(); -} - -void LLPanelClassifiedEdit::setPriceForListing(S32 price) -{ - getChild<LLUICtrl>("price_for_listing")->setValue(price); -} - -void LLPanelClassifiedEdit::onSetLocationClick() -{ - setPosGlobal(gAgent.getPositionGlobal()); - setParcelId(LLUUID::null); - - std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); - LLViewerRegion* region = gAgent.getRegion(); - if (region) - { - region_name = region->getName(); - } - - setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); - - // mark classified as dirty - setValue(LLSD()); - - onChange(); -} - -void LLPanelClassifiedEdit::onChange() -{ - enableVerbs(isDirty()); -} - -void LLPanelClassifiedEdit::onSaveClick() -{ - mCanClose = false; - - if(!isValidName()) - { - notifyInvalidName(); - return; - } - if(isNew() || isNewWithErrors()) - { - if(gStatusBar->getBalance() < getPriceForListing()) - { - LLNotificationsUtil::add("ClassifiedInsufficientFunds"); - return; - } - - mPublishFloater = LLFloaterReg::findTypedInstance<LLFloaterPublishClassified>( - "publish_classified", LLSD()); - - if(!mPublishFloater) - { - mPublishFloater = LLFloaterReg::getTypedInstance<LLFloaterPublishClassified>( - "publish_classified", LLSD()); - - mPublishFloater->setPublishClickedCallback(boost::bind - (&LLPanelClassifiedEdit::onPublishFloaterPublishClicked, this)); - } - - // set spinner value before it has focus or value wont be set - mPublishFloater->setPrice(getPriceForListing()); - mPublishFloater->openFloater(mPublishFloater->getKey()); - mPublishFloater->center(); - } - else - { - doSave(); - } -} - -void LLPanelClassifiedEdit::doSave() -{ - mCanClose = true; - sendUpdate(); - resetDirty(); - - mSaveButtonClickedSignal(this, LLSD()); -} - -void LLPanelClassifiedEdit::onPublishFloaterPublishClicked() -{ - setPriceForListing(mPublishFloater->getPrice()); - - doSave(); -} - -std::string LLPanelClassifiedEdit::getLocationNotice() -{ - static std::string location_notice = getString("location_notice"); - return location_notice; -} - -bool LLPanelClassifiedEdit::isValidName() -{ - std::string name = getClassifiedName(); - if (name.empty()) - { - return false; - } - if (!isalnum(name[0])) - { - return false; - } - - return true; -} - -void LLPanelClassifiedEdit::notifyInvalidName() -{ - std::string name = getClassifiedName(); - if (name.empty()) - { - LLNotificationsUtil::add("BlankClassifiedName"); - } - else if (!isalnum(name[0])) - { - LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); - } -} - -void LLPanelClassifiedEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) -{ - ctrl->setVisible(TRUE); -} - -void LLPanelClassifiedEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) -{ - ctrl->setVisible(FALSE); -} - -void LLPanelClassifiedEdit::onTextureSelected() -{ - setSnapshotId(mSnapshotCtrl->getValue().asUUID()); - onChange(); -} +//EOF diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index c201bf11b7dcb537469fc6b4f5b125556a423ba9..88346df6c332825e89cf8c907f48fa5014c47495 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -1,10 +1,10 @@ /** * @file llpanelclassified.h - * @brief LLPanelClassified class definition + * @brief LLPanelClassifiedInfo class definition * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * $LicenseInfo:firstyear=2021&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2021, 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 @@ -27,34 +27,31 @@ // Display of a classified used both for the global view in the // Find directory, and also for each individual user's classified in their // profile. - #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H #include "llavatarpropertiesprocessor.h" -#include "llfloaterpublishclassified.h" +#include "llclassifiedinfo.h" +#include "llfloater.h" #include "llpanel.h" #include "llrect.h" class LLScrollContainer; class LLTextureCtrl; -class LLUICtrl; class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver { LOG_CLASS(LLPanelClassifiedInfo); public: - static LLPanelClassifiedInfo* create(); - LLPanelClassifiedInfo(); virtual ~LLPanelClassifiedInfo(); - /*virtual*/ void onOpen(const LLSD& key) override; + /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ BOOL postBuild() override; + /*virtual*/ BOOL postBuild(); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } @@ -115,13 +112,9 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver const LLVector3d& global_pos, const std::string& sim_name); - void setExitCallback(const commit_callback_t& cb); - - void setEditClassifiedCallback(const commit_callback_t& cb); - - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void draw() override; + /*virtual*/ void draw(); protected: @@ -143,7 +136,6 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver void onMapClick(); void onTeleportClick(); - void onExit(); bool mSnapshotStreched; LLRect mSnapshotRect; @@ -173,109 +165,11 @@ class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver S32 mMapClicksNew; S32 mProfileClicksNew; -public: static void handleSearchStatResponse(LLUUID classifiedId, LLSD result); -private: typedef std::list<LLPanelClassifiedInfo*> panel_list_t; static panel_list_t sAllPanels; }; -class LLPanelClassifiedEdit : public LLPanelClassifiedInfo -{ - LOG_CLASS(LLPanelClassifiedEdit); -public: - - static LLPanelClassifiedEdit* create(); - - virtual ~LLPanelClassifiedEdit(); - - /*virtual*/ BOOL postBuild() override; - - void fillIn(const LLSD& key); - - /*virtual*/ void onOpen(const LLSD& key) override; - - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; - - /*virtual*/ BOOL isDirty() const override; - - /*virtual*/ void resetDirty() override; - - void setSaveCallback(const commit_signal_t::slot_type& cb); - - void setCancelCallback(const commit_signal_t::slot_type& cb); - - /*virtual*/ void resetControls() override; - - bool isNew() { return mIsNew; } - - bool isNewWithErrors() { return mIsNewWithErrors; } - - bool canClose(); - - void draw() override; - - void stretchSnapshot(); - - U32 getCategory(); - - void setCategory(U32 category); - - U32 getContentType(); - - void setContentType(U32 content_type); - - bool getAutoRenew(); - - S32 getPriceForListing(); - -protected: - - LLPanelClassifiedEdit(); - - void sendUpdate(); - - void enableVerbs(bool enable); - - void enableEditing(bool enable); - - void showEditing(bool show); - - std::string makeClassifiedName(); - - void setPriceForListing(S32 price); - - U8 getFlags(); - - std::string getLocationNotice(); - - bool isValidName(); - - void notifyInvalidName(); - - void onSetLocationClick(); - void onChange(); - void onSaveClick(); - - void doSave(); - - void onPublishFloaterPublishClicked(); - - void onTexturePickerMouseEnter(LLUICtrl* ctrl); - void onTexturePickerMouseLeave(LLUICtrl* ctrl); - - void onTextureSelected(); - -private: - bool mIsNew; - bool mIsNewWithErrors; - bool mCanClose; - - LLFloaterPublishClassified* mPublishFloater; - - commit_signal_t mSaveButtonClickedSignal; -}; - #endif // LL_LLPANELCLASSIFIED_H diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 95bc7896f44f7b90d6d837d9657c62b5af649d15..f05f92706713dd734736df804a5c119efef7ae9a 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1104,7 +1104,11 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, data.snapshot_id = parcel_data.snapshot_id; data.parcel_id = parcel_data.parcel_id; - LLAvatarActions::createPick(data); + LLFloaterProfile* profile_floater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgentID))); + if (profile_floater) + { + profile_floater->createPick(data); + } } void LLLandmarksPanel::doCreatePick(LLLandmark* landmark, const LLUUID &item_id) diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp deleted file mode 100644 index 113f9b0b9e418015289578820242b9e114ca8c76..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelpick.cpp +++ /dev/null @@ -1,612 +0,0 @@ -/** - * @file llpanelpick.cpp - * @brief LLPanelPick class implementation - * - * $LicenseInfo:firstyear=2004&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$ - */ - -// Display of a "Top Pick" used both for the global top picks in the -// Find directory, and also for each individual user's picks in their -// profile. - -#include "llviewerprecompiledheaders.h" - -#include "llpanelpick.h" - -#include "message.h" - -#include "llparcel.h" - -#include "llbutton.h" -#include "llfloaterreg.h" -#include "lliconctrl.h" -#include "lllineeditor.h" -#include "llpanel.h" -#include "llscrollcontainer.h" -#include "lltexteditor.h" - -#include "llagent.h" -#include "llagentpicksinfo.h" -#include "llavatarpropertiesprocessor.h" -#include "llfloaterworldmap.h" -#include "lltexturectrl.h" -#include "llviewerparcelmgr.h" -#include "llviewerregion.h" - -static const std::string XML_PANEL_EDIT_PICK("panel_edit_pick.xml"); -static const std::string XML_PANEL_PICK_INFO("panel_pick_info.xml"); - -static const std::string XML_NAME("pick_name"); -static const std::string XML_DESC("pick_desc"); -static const std::string XML_SNAPSHOT("pick_snapshot"); -static const std::string XML_LOCATION("pick_location"); - -static const std::string XML_BTN_ON_TXTR("edit_icon"); -static const std::string XML_BTN_SAVE("save_changes_btn"); - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//static -LLPanelPickInfo* LLPanelPickInfo::create() -{ - LLPanelPickInfo* panel = new LLPanelPickInfo(); - panel->buildFromFile(XML_PANEL_PICK_INFO); - return panel; -} - -LLPanelPickInfo::LLPanelPickInfo() - : LLPanel() - , LLAvatarPropertiesObserver() - , LLRemoteParcelInfoObserver() - , mScrollingPanelMinHeight(0) - , mScrollingPanelWidth(0) - , mScrollContainer(nullptr) - , mScrollingPanel(nullptr) - , mSnapshotCtrl(nullptr) - , mAvatarId(LLUUID::null) - , mParcelId(LLUUID::null) - , mPickId(LLUUID::null) - , mRequestedId(LLUUID::null) -{ -} - -LLPanelPickInfo::~LLPanelPickInfo() -{ - LLAvatarPropertiesProcessor::getInstance()->removeObserver(LLPanelPickInfo::getAvatarId(), this); - - if (mParcelId.notNull()) - { - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this); - } -} - -void LLPanelPickInfo::onOpen(const LLSD& key) -{ - LLUUID avatar_id = key["avatar_id"]; - if(avatar_id.isNull()) - { - return; - } - - if(getAvatarId().notNull()) - { - LLAvatarPropertiesProcessor::getInstance()->removeObserver( - getAvatarId(), this); - } - - setAvatarId(avatar_id); - - resetData(); - resetControls(); - - setPickId(key["pick_id"]); - setPickName(key["pick_name"]); - setPickDesc(key["pick_desc"]); - setSnapshotId(key["snapshot_id"]); - - LLAvatarPropertiesProcessor::getInstance()->addObserver( - getAvatarId(), this); - LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest( - getAvatarId(), getPickId()); -} - -BOOL LLPanelPickInfo::postBuild() -{ - mSnapshotCtrl = getChild<LLTextureCtrl>(XML_SNAPSHOT); - - childSetAction("teleport_btn", boost::bind(&LLPanelPickInfo::onClickTeleport, this)); - childSetAction("show_on_map_btn", boost::bind(&LLPanelPickInfo::onClickMap, this)); - childSetAction("back_btn", boost::bind(&LLPanelPickInfo::onClickBack, this)); - - mScrollingPanel = getChild<LLPanel>("scroll_content_panel"); - mScrollContainer = getChild<LLScrollContainer>("profile_scroll"); - - mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); - mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); - - LLTextEditor* text_desc = getChild<LLTextEditor>(XML_DESC); - text_desc->setContentTrusted(false); - - return TRUE; -} - -void LLPanelPickInfo::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - LLPanel::reshape(width, height, called_from_parent); - - if (!mScrollContainer || !mScrollingPanel) - return; - - static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); - - S32 scroll_height = mScrollContainer->getRect().getHeight(); - if (mScrollingPanelMinHeight >= scroll_height) - { - mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); - } - else - { - mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); - } -} - -void LLPanelPickInfo::processProperties(void* data, EAvatarProcessorType type) -{ - if(APT_PICK_INFO != type) - { - return; - } - LLPickData* pick_info = static_cast<LLPickData*>(data); - if(!pick_info - || pick_info->creator_id != getAvatarId() - || pick_info->pick_id != getPickId()) - { - return; - } - - mParcelId = pick_info->parcel_id; - setSnapshotId(pick_info->snapshot_id); - setPickName(pick_info->name); - setPickDesc(pick_info->desc); - setPosGlobal(pick_info->pos_global); - - // Send remote parcel info request to get parcel name and sim (region) name. - sendParcelInfoRequest(); - - // *NOTE dzaporozhan - // We want to keep listening to APT_PICK_INFO because user may - // edit the Pick and we have to update Pick info panel. - // revomeObserver is called from onClickBack -} - -void LLPanelPickInfo::sendParcelInfoRequest() -{ - if (mParcelId != mRequestedId) - { - LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelId, this); - LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelId); - - mRequestedId = mParcelId; - } -} - -void LLPanelPickInfo::setExitCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("back_btn")->setClickedCallback(cb); -} - -void LLPanelPickInfo::processParcelInfo(const LLParcelData& parcel_data) -{ - setPickLocation(createLocationText(LLStringUtil::null, parcel_data.name, - parcel_data.sim_name, getPosGlobal())); - - // We have received parcel info for the requested ID so clear it now. - mRequestedId.setNull(); - - if (mParcelId.notNull()) - { - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this); - } -} - -void LLPanelPickInfo::setEditPickCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("edit_btn")->setClickedCallback(cb); -} - -// PROTECTED AREA - -void LLPanelPickInfo::resetControls() -{ - if(getAvatarId() == gAgent.getID()) - { - getChildView("edit_btn")->setEnabled(TRUE); - getChildView("edit_btn")->setVisible( TRUE); - } - else - { - getChildView("edit_btn")->setEnabled(FALSE); - getChildView("edit_btn")->setVisible( FALSE); - } -} - -void LLPanelPickInfo::resetData() -{ - setPickName(LLStringUtil::null); - setPickDesc(LLStringUtil::null); - setPickLocation(LLStringUtil::null); - setPickId(LLUUID::null); - setSnapshotId(LLUUID::null); - mPosGlobal.clearVec(); - mParcelId.setNull(); - mRequestedId.setNull(); -} - -// static -std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, const std::string& original_name, const std::string& sim_name, const LLVector3d& pos_global) -{ - std::string location_text; - location_text.append(owner_name); - if (!original_name.empty()) - { - if (!location_text.empty()) location_text.append(", "); - location_text.append(original_name); - - } - if (!sim_name.empty()) - { - if (!location_text.empty()) location_text.append(", "); - location_text.append(sim_name); - } - - if (!location_text.empty()) location_text.append(" "); - - if (!pos_global.isNull()) - { - S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = ll_round((F32)pos_global.mdV[VZ]); - location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - } - return location_text; -} - -void LLPanelPickInfo::setSnapshotId(const LLUUID& id) -{ - mSnapshotCtrl->setImageAssetID(id); - mSnapshotCtrl->setValid(TRUE); -} - -void LLPanelPickInfo::setPickName(const std::string& name) -{ - getChild<LLUICtrl>(XML_NAME)->setValue(name); -} - -void LLPanelPickInfo::setPickDesc(const std::string& desc) -{ - getChild<LLUICtrl>(XML_DESC)->setValue(desc); -} - -void LLPanelPickInfo::setPickLocation(const std::string& location) -{ - getChild<LLUICtrl>(XML_LOCATION)->setValue(location); -} - -void LLPanelPickInfo::onClickMap() -{ - LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); - LLFloaterReg::showInstance("world_map", "center"); -} - -void LLPanelPickInfo::onClickTeleport() -{ - if (!getPosGlobal().isExactlyZero()) - { - gAgent.teleportViaLocation(getPosGlobal()); - LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); - } -} - -void LLPanelPickInfo::onClickBack() -{ - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); -} - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -//static -LLPanelPickEdit* LLPanelPickEdit::create() -{ - LLPanelPickEdit* panel = new LLPanelPickEdit(); - panel->buildFromFile(XML_PANEL_EDIT_PICK); - return panel; -} - -LLPanelPickEdit::LLPanelPickEdit() - : LLPanelPickInfo() - , mLocationChanged(false) - , mNeedData(true) - , mNewPick(false) - , text_icon(nullptr) -{ -} - -void LLPanelPickEdit::onOpen(const LLSD& key) -{ - LLUUID pick_id = key["pick_id"]; - mNeedData = true; - - // creating new Pick - if(pick_id.isNull()) - { - mNewPick = true; - - setAvatarId(gAgent.getID()); - - resetData(); - resetControls(); - - setPosGlobal(gAgent.getPositionGlobal()); - - LLUUID parcel_id = LLUUID::null, snapshot_id = LLUUID::null; - std::string pick_name, pick_desc, region_name; - - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(parcel) - { - parcel_id = parcel->getID(); - pick_name = parcel->getName(); - pick_desc = parcel->getDesc(); - snapshot_id = parcel->getSnapshotID(); - } - - LLViewerRegion* region = gAgent.getRegion(); - if(region) - { - region_name = region->getName(); - } - - setParcelID(parcel_id); - getChild<LLUICtrl>("pick_name")->setValue(pick_name.empty() ? region_name : pick_name); - getChild<LLUICtrl>("pick_desc")->setValue(pick_desc); - setSnapshotId(snapshot_id); - setPickLocation(createLocationText(getLocationNotice(), pick_name, region_name, getPosGlobal())); - - enableSaveButton(true); - } - // editing existing pick - else - { - mNewPick = false; - LLPanelPickInfo::onOpen(key); - - enableSaveButton(false); - } - - resetDirty(); -} - -void LLPanelPickEdit::setPickData(const LLPickData* pick_data) -{ - if(!pick_data) - { - return; - } - - mNeedData = false; - - setParcelID(pick_data->parcel_id); - getChild<LLUICtrl>("pick_name")->setValue(pick_data->name); - getChild<LLUICtrl>("pick_desc")->setValue(pick_data->desc); - setSnapshotId(pick_data->snapshot_id); - setPosGlobal(pick_data->pos_global); - setPickLocation(createLocationText(LLStringUtil::null, pick_data->name, - pick_data->sim_name, pick_data->pos_global)); -} - -BOOL LLPanelPickEdit::postBuild() -{ - LLPanelPickInfo::postBuild(); - - mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPickEdit::onSnapshotChanged, this)); - - LLLineEditor* line_edit = getChild<LLLineEditor>("pick_name"); - line_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1), nullptr); - - LLTextEditor* text_edit = getChild<LLTextEditor>("pick_desc"); - text_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1)); - - childSetAction(XML_BTN_SAVE, boost::bind(&LLPanelPickEdit::onClickSave, this)); - childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelPickEdit::onClickSetLocation, this)); - - initTexturePickerMouseEvents(); - - return TRUE; -} - -void LLPanelPickEdit::setSaveCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("save_changes_btn")->setClickedCallback(cb); -} - -void LLPanelPickEdit::setCancelCallback(const commit_callback_t& cb) -{ - getChild<LLButton>("cancel_btn")->setClickedCallback(cb); -} - -void LLPanelPickEdit::resetDirty() -{ - LLPanelPickInfo::resetDirty(); - - getChild<LLLineEditor>("pick_name")->resetDirty(); - getChild<LLTextEditor>("pick_desc")->resetDirty(); - mSnapshotCtrl->resetDirty(); - mLocationChanged = false; -} - -BOOL LLPanelPickEdit::isDirty() const -{ - if( mNewPick - || LLPanelPickInfo::isDirty() - || mLocationChanged - || mSnapshotCtrl->isDirty() - || getChild<LLLineEditor>("pick_name")->isDirty() - || getChild<LLTextEditor>("pick_desc")->isDirty()) - { - return TRUE; - } - return FALSE; -} - -void LLPanelPickEdit::sendUpdate() -{ - LLPickData pick_data; - - // If we don't have a pick id yet, we'll need to generate one, - // otherwise we'll keep overwriting pick_id 00000 in the database. - if (getPickId().isNull()) - { - getPickId().generate(); - } - - pick_data.agent_id = gAgent.getID(); - pick_data.session_id = gAgent.getSessionID(); - pick_data.pick_id = getPickId(); - pick_data.creator_id = gAgent.getID();; - - //legacy var need to be deleted - pick_data.top_pick = FALSE; - pick_data.parcel_id = mParcelId; - pick_data.name = getChild<LLUICtrl>(XML_NAME)->getValue().asString(); - pick_data.desc = getChild<LLUICtrl>(XML_DESC)->getValue().asString(); - pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); - pick_data.pos_global = getPosGlobal(); - pick_data.sort_order = 0; - pick_data.enabled = TRUE; - - LLAvatarPropertiesProcessor::instance().sendPickInfoUpdate(&pick_data); - - if(mNewPick) - { - // Assume a successful create pick operation, make new number of picks - // available immediately. Actual number of picks will be requested in - // LLAvatarPropertiesProcessor::sendPickInfoUpdate and updated upon server respond. - LLAgentPicksInfo::getInstance()->incrementNumberOfPicks(); - } -} - -void LLPanelPickEdit::onSnapshotChanged() -{ - enableSaveButton(true); -} - -void LLPanelPickEdit::onPickChanged(LLUICtrl* ctrl) -{ - enableSaveButton(isDirty()); -} - -void LLPanelPickEdit::resetData() -{ - LLPanelPickInfo::resetData(); - mLocationChanged = false; -} - -void LLPanelPickEdit::enableSaveButton(bool enable) -{ - getChildView(XML_BTN_SAVE)->setEnabled(enable); -} - -void LLPanelPickEdit::onClickSetLocation() -{ - // Save location for later use. - setPosGlobal(gAgent.getPositionGlobal()); - - std::string parcel_name, region_name; - - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) - { - mParcelId = parcel->getID(); - parcel_name = parcel->getName(); - } - - LLViewerRegion* region = gAgent.getRegion(); - if(region) - { - region_name = region->getName(); - } - - setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal())); - - mLocationChanged = true; - enableSaveButton(TRUE); -} - -void LLPanelPickEdit::onClickSave() -{ - sendUpdate(); - - mLocationChanged = false; - - LLSD params; - params["action"] = "save_new_pick"; - notifyParent(params); -} - -std::string LLPanelPickEdit::getLocationNotice() -{ - static std::string notice = getString("location_notice"); - return notice; -} - -void LLPanelPickEdit::processProperties(void* data, EAvatarProcessorType type) -{ - if(mNeedData) - { - LLPanelPickInfo::processProperties(data, type); - } -} - -// PRIVATE AREA - -void LLPanelPickEdit::initTexturePickerMouseEvents() -{ - text_icon = getChild<LLIconCtrl>(XML_BTN_ON_TXTR); - mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseEnter, this, _1)); - mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseLeave, this, _1)); - - text_icon->setVisible(FALSE); -} - -void LLPanelPickEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) -{ - text_icon->setVisible(TRUE); -} - -void LLPanelPickEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) -{ - text_icon->setVisible(FALSE); -} diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h deleted file mode 100644 index 21f2b7d702447d5bae55143fe0173c59334b08e8..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelpick.h +++ /dev/null @@ -1,255 +0,0 @@ -/** - * @file llpanelpick.h - * @brief LLPanelPick class definition - * - * $LicenseInfo:firstyear=2004&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$ - */ - -// Display of a "Top Pick" used both for the global top picks in the -// Find directory, and also for each individual user's picks in their -// profile. - -#ifndef LL_LLPANELPICK_H -#define LL_LLPANELPICK_H - -#include "llpanel.h" -#include "llremoteparcelrequest.h" -#include "llavatarpropertiesprocessor.h" - -class LLIconCtrl; -class LLTextureCtrl; -class LLScrollContainer; -class LLMessageSystem; -class LLAvatarPropertiesObserver; - -/** - * Panel for displaying Pick Information - snapshot, name, description, etc. - */ -class LLPanelPickInfo : public LLPanel, public LLAvatarPropertiesObserver, LLRemoteParcelInfoObserver -{ - LOG_CLASS(LLPanelPickInfo); -public: - - // Creates new panel - static LLPanelPickInfo* create(); - - virtual ~LLPanelPickInfo(); - - /** - * Initializes panel properties - * - * By default Pick will be created for current Agent location. - * Use setPickData to change Pick properties. - */ - /*virtual*/ void onOpen(const LLSD& key) override; - - /*virtual*/ BOOL postBuild() override; - - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) override; - - /** - * Sends remote parcel info request to resolve parcel name from its ID. - */ - void sendParcelInfoRequest(); - - /** - * Sets "Back" button click callback - */ - virtual void setExitCallback(const commit_callback_t& cb); - - /** - * Sets "Edit" button click callback - */ - virtual void setEditPickCallback(const commit_callback_t& cb); - - //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data) override; - /*virtual*/ void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; } - /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) override {}; - -protected: - - LLPanelPickInfo(); - - /** - * Resets Pick information - */ - virtual void resetData(); - - /** - * Resets UI controls (visibility, values) - */ - virtual void resetControls(); - - /** - * "Location text" is actually the owner name, the original - * name that owner gave the parcel, and the location. - */ - static std::string createLocationText( - const std::string& owner_name, - const std::string& original_name, - const std::string& sim_name, - const LLVector3d& pos_global); - - virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } - virtual LLUUID& getAvatarId() { return mAvatarId; } - - /** - * Sets snapshot id. - * - * Will mark snapshot control as valid if id is not null. - * Will mark snapshot control as invalid if id is null. If null id is a valid value, - * you have to manually mark snapshot is valid. - */ - virtual void setSnapshotId(const LLUUID& id); - - virtual void setPickId(const LLUUID& id) { mPickId = id; } - virtual LLUUID& getPickId() { return mPickId; } - - virtual void setPickName(const std::string& name); - - virtual void setPickDesc(const std::string& desc); - - virtual void setPickLocation(const std::string& location); - - virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } - virtual LLVector3d& getPosGlobal() { return mPosGlobal; } - - /** - * Callback for "Map" button, opens Map - */ - void onClickMap(); - - /** - * Callback for "Teleport" button, teleports user to Pick location. - */ - void onClickTeleport(); - - void onClickBack(); - - S32 mScrollingPanelMinHeight; - S32 mScrollingPanelWidth; - LLScrollContainer* mScrollContainer; - LLPanel* mScrollingPanel; - LLTextureCtrl* mSnapshotCtrl; - - LLUUID mAvatarId; - LLVector3d mPosGlobal; - LLUUID mParcelId; - LLUUID mPickId; - LLUUID mRequestedId; -}; - -/** - * Panel for creating/editing Pick. - */ -class LLPanelPickEdit final : public LLPanelPickInfo -{ - LOG_CLASS(LLPanelPickEdit); -public: - - /** - * Creates new panel - */ - static LLPanelPickEdit* create(); - - ~LLPanelPickEdit() = default; - void onOpen(const LLSD& key) override; - virtual void setPickData(const LLPickData* pick_data); - BOOL postBuild() override; - - /** - * Sets "Save" button click callback - */ - virtual void setSaveCallback(const commit_callback_t& cb); - - /** - * Sets "Cancel" button click callback - */ - virtual void setCancelCallback(const commit_callback_t& cb); - - /** - * Resets panel and all cantrols to unedited state - */ - void resetDirty() override; - - /** - * Returns true if any of Pick properties was changed by user. - */ - BOOL isDirty() const override; - - void processProperties(void* data, EAvatarProcessorType type) override; - - /** - * Sends Pick properties to server. - */ - void sendUpdate(); - -protected: - - LLPanelPickEdit(); - - /** - * Called when snapshot image changes. - */ - void onSnapshotChanged(); - - /** - * Callback for Pick snapshot, name and description changed event. - */ - void onPickChanged(LLUICtrl* ctrl); - - /*virtual*/ void resetData() override; - - /** - * Enables/disables "Save" button - */ - void enableSaveButton(bool enable); - - /** - * Callback for "Set Location" button click - */ - void onClickSetLocation(); - - /** - * Callback for "Save" button click - */ - void onClickSave(); - - std::string getLocationNotice(); - - bool mLocationChanged; - bool mNeedData; - bool mNewPick; - -private: - - void initTexturePickerMouseEvents(); - void onTexturePickerMouseEnter(LLUICtrl* ctrl); - void onTexturePickerMouseLeave(LLUICtrl* ctrl); - - LLIconCtrl* text_icon; -}; - -#endif // LL_LLPANELPICK_H diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index f1445ad4386d74b7afca8b458e140ca59eadd160..3f12deb36ad99bea57d9f8d99597b50bb8f13e86 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -321,7 +321,11 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global) data.snapshot_id = mSnapshotCtrl->getImageAssetID(); data.parcel_id = mParcelID; - LLAvatarActions::createPick(data); + LLFloaterProfile* profile_floater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgentID))); + if (profile_floater) + { + profile_floater->createPick(data); + } } // static diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index f5088e007b6b9fa8b59825a687ef9e033d4364c7..8a5a341f1240ae3ed856c2c1c8fb690a26a95e13 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -62,7 +62,8 @@ #include "llcommandhandler.h" #include "llfloaterprofiletexture.h" #include "llfloaterreg.h" -#include "lltexturectrl.h" +#include "llfloaterblocked.h" +#include "llfloaterreporter.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llgroupactions.h" @@ -103,14 +104,167 @@ static const std::string PROFILE_IMAGE_UPLOAD_CAP = "UploadAgentProfileImage"; ////////////////////////////////////////////////////////////////////////// +LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::string path_to_image, LLHandle<LLPanel> *handle) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpHeaders::ptr_t httpHeaders; + + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpOpts->setFollowRedirects(true); + + LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + // todo: notification? + LL_WARNS("AvatarProperties") << "Failed to get uploader cap " << status.toString() << LL_ENDL; + return LLUUID::null; + } + if (!result.has("uploader")) + { + // todo: notification? + LL_WARNS("AvatarProperties") << "Failed to get uploader cap, response contains no data." << LL_ENDL; + return LLUUID::null; + } + std::string uploader_cap = result["uploader"].asString(); + if (uploader_cap.empty()) + { + LL_WARNS("AvatarProperties") << "Failed to get uploader cap, cap invalid." << LL_ENDL; + return LLUUID::null; + } + + // Upload the image + LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); + LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); + LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); + S64 length; + + { + llifstream instream(path_to_image.c_str(), std::iostream::binary | std::iostream::ate); + if (!instream.is_open()) + { + LL_WARNS("AvatarProperties") << "Failed to open file " << path_to_image << LL_ENDL; + return LLUUID::null; + } + length = instream.tellg(); + } + + uploaderhttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, "application/jp2"); // optional + uploaderhttpHeaders->append(HTTP_OUT_HEADER_CONTENT_LENGTH, llformat("%d", length)); // required! + uploaderhttpOpts->setFollowRedirects(true); + + result = httpAdapter->postFileAndSuspend(uploaderhttpRequest, uploader_cap, path_to_image, uploaderhttpOpts, uploaderhttpHeaders); + + httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + LL_DEBUGS("AvatarProperties") << result << LL_ENDL; + + if (!status) + { + LL_WARNS("AvatarProperties") << "Failed to upload image " << status.toString() << LL_ENDL; + return LLUUID::null; + } + + if (result["state"].asString() != "complete") + { + if (result.has("message")) + { + LL_WARNS("AvatarProperties") << "Failed to upload image, state " << result["state"] << " message: " << result["message"] << LL_ENDL; + } + else + { + LL_WARNS("AvatarProperties") << "Failed to upload image " << result << LL_ENDL; + } + return LLUUID::null; + } + + return result["new_asset"].asUUID(); +} + +enum EProfileImageType +{ + PROFILE_IMAGE_SL, + PROFILE_IMAGE_FL, +}; + +void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::string path_to_image, LLHandle<LLPanel> *handle) +{ + LLSD data; + switch (type) + { + case PROFILE_IMAGE_SL: + data["profile-image-asset"] = "sl_image_id"; + break; + case PROFILE_IMAGE_FL: + data["profile-image-asset"] = "fl_image_id"; + break; + } + + LLUUID result = post_profile_image(cap_url, data, path_to_image, handle); + + // reset loading indicator + if (!handle->isDead()) + { + switch (type) + { + case PROFILE_IMAGE_SL: + { + LLPanelProfileSecondLife* panel = static_cast<LLPanelProfileSecondLife*>(handle->get()); + if (result.notNull()) + { + panel->setProfileImageUploaded(result); + } + else + { + // failure, just stop progress indicator + panel->setProfileImageUploading(false); + } + break; + } + case PROFILE_IMAGE_FL: + { + LLPanelProfileFirstLife* panel = static_cast<LLPanelProfileFirstLife*>(handle->get()); + if (result.notNull()) + { + panel->setProfileImageUploaded(result); + } + else + { + // failure, just stop progress indicator + panel->setProfileImageUploading(false); + } + break; + } + } + } + + if (type == PROFILE_IMAGE_SL && result.notNull()) + { + LLAvatarIconIDCache::getInstance()->add(gAgentID, result); + // Should trigger callbacks in icon controls + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID); + } + + // Cleanup + LLFile::remove(path_to_image); + delete handle; +} + ////////////////////////////////////////////////////////////////////////// -// LLWebProfileHandler +// LLProfileHandler -class LLWebProfileHandler : public LLCommandHandler +class LLProfileHandler : public LLCommandHandler { public: // requires trusted browser to trigger - LLWebProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { } + LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, @@ -126,8 +280,6 @@ class LLWebProfileHandler : public LLCommandHandler return true; } }; -LLWebProfileHandler gWebProfileHandler; -#if 0 // ALCHMERGE LLProfileHandler gProfileHandler; @@ -172,7 +324,7 @@ class LLAgentHandler : public LLCommandHandler { if (params.size() < 2) return false; LLUUID avatar_id; - if (!avatar_id.set(params[0], FALSE)) + if (!avatar_id.set(params[0].asString(), FALSE)) { return false; } @@ -251,7 +403,8 @@ class LLAgentHandler : public LLCommandHandler const std::string object_name = LLURI::unescape(params[2].asString()); LLMute mute(avatar_id, object_name, LLMute::OBJECT); LLMuteList::getInstance()->add(mute); - LLPanelBlockedList::showPanelAndSelect(mute.mID); + LLFloaterBlocked::showMuteAndSelect(mute.mID); + //LLPanelBlockedList::showPanelAndSelect(mute.mID); } return true; } @@ -286,7 +439,7 @@ class LLAgentHandler : public LLCommandHandler } }; LLAgentHandler gAgentHandler; -#endif + ///---------------------------------------------------------------------------- /// LLFloaterProfilePermissions @@ -1118,12 +1271,93 @@ void LLPanelProfileSecondLife::setLoaded() } } + +class LLProfileImagePicker : public LLFilePickerThread +{ +public: + LLProfileImagePicker(EProfileImageType type, LLHandle<LLPanel> *handle); + ~LLProfileImagePicker(); + void notify(const std::vector<std::string>& filenames) override; + +private: + LLHandle<LLPanel> *mHandle; + EProfileImageType mType; +}; + +LLProfileImagePicker::LLProfileImagePicker(EProfileImageType type, LLHandle<LLPanel> *handle) + : LLFilePickerThread(LLFilePicker::FFLOAD_IMAGE), + mHandle(handle), + mType(type) +{ +} + +LLProfileImagePicker::~LLProfileImagePicker() +{ + delete mHandle; +} + +void LLProfileImagePicker::notify(const std::vector<std::string>& filenames) +{ + if (mHandle->isDead()) + { + return; + } + if (filenames.empty()) + { + return; + } + std::string file_path = filenames[0]; + if (file_path.empty()) + { + return; + } + + // generate a temp texture file for coroutine + std::string temp_file = gDirUtilp->getTempFilename(); + U32 codec = LLImageBase::getCodecFromExtension(gDirUtilp->getExtension(file_path)); + const S32 MAX_DIM = 256; + if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, MAX_DIM)) + { + //todo: image not supported notification + LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", failed to open image" << LL_ENDL; + return; + } + + std::string cap_url = gAgent.getRegionCapability(PROFILE_IMAGE_UPLOAD_CAP); + if (cap_url.empty()) + { + LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", no cap found" << LL_ENDL; + return; + } + + switch (mType) + { + case PROFILE_IMAGE_SL: + { + LLPanelProfileSecondLife* panel = static_cast<LLPanelProfileSecondLife*>(mHandle->get()); + panel->setProfileImageUploading(true); + } + break; + case PROFILE_IMAGE_FL: + { + LLPanelProfileFirstLife* panel = static_cast<LLPanelProfileFirstLife*>(mHandle->get()); + panel->setProfileImageUploading(true); + } + break; + } + + LLCoros::instance().launch("postAgentUserImageCoro", + boost::bind(post_profile_image_coro, cap_url, mType, temp_file, mHandle)); + + mHandle = nullptr; // transferred to post_profile_image_coro +} + void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) { const std::string item_name = userdata.asString(); const LLUUID agent_id = getAvatarId(); // todo: consider moving this into LLAvatarActions::onCommit(name, id) - // and making all other floaters, like people menu, do the same + // and making all other flaoters, like people menu do the same if (item_name == "im") { LLAvatarActions::startIM(agent_id); @@ -1226,8 +1460,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) } else if (item_name == "upload_photo") { - (new LLProfileImagePicker(PROFILE_IMAGE_SL, new LLHandle<LLPanel>(LLPanel::getHandle()), - [this] (LLUUID const& id) { setProfileImageUploaded(id); }))->getFile(); + (new LLProfileImagePicker(PROFILE_IMAGE_SL, new LLHandle<LLPanel>(LLPanel::getHandle())))->getFile(); LLFloater* floaterp = mFloaterTexturePickerHandle.get(); if (floaterp) @@ -1777,8 +2010,7 @@ void LLPanelProfileFirstLife::commitUnsavedChanges() void LLPanelProfileFirstLife::onUploadPhoto() { - (new LLProfileImagePicker(PROFILE_IMAGE_FL, new LLHandle<LLPanel>(LLPanel::getHandle()), - [this](LLUUID const& id) { setProfileImageUploaded(id); }))->getFile(); + (new LLProfileImagePicker(PROFILE_IMAGE_FL, new LLHandle<LLPanel>(LLPanel::getHandle())))->getFile(); LLFloater* floaterp = mFloaterTexturePickerHandle.get(); if (floaterp) diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 248fefb4fdd6e3e9e2f53ef1cf890007b7f87ea9..fb9dd348333460dc8c8389dc7d9b9656a9b32b96 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -33,7 +33,6 @@ #include "llpanel.h" #include "llpanelavatar.h" #include "llmediactrl.h" -#include "llprofileimagepicker.h" #include "llvoiceclient.h" // class LLPanelProfileClassifieds; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index e2768ff807491c6821318d3c83496feca725aa91..23266a2279f78b2e8b5f7c5302bcb51e14487885 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -32,14 +32,13 @@ #include "llavataractions.h" #include "llavatarpropertiesprocessor.h" #include "llclassifiedflags.h" -#include "llclassifiedinfo.h" #include "llcombobox.h" #include "llcommandhandler.h" // for classified HTML detail page click tracking #include "llcorehttputil.h" #include "lldispatcher.h" #include "llfloaterclassified.h" #include "llfloaterreg.h" -#include "llfloaterpublishclassified.h" +#include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "lliconctrl.h" #include "lllineeditor.h" @@ -47,6 +46,7 @@ #include "llnotificationsutil.h" #include "llpanelavatar.h" #include "llparcel.h" +#include "llregistry.h" #include "llscrollcontainer.h" #include "llstartup.h" #include "llstatusbar.h" @@ -57,6 +57,8 @@ #include "llviewergenericmessage.h" // send_generic_message #include "llviewerparcelmgr.h" #include "llviewerregion.h" +#include "llviewertexture.h" +#include "llviewertexture.h" #include "rlvactions.h" #include "rlvhandler.h" @@ -64,6 +66,7 @@ //*TODO: verify this limit const S32 MAX_AVATAR_CLASSIFIEDS = 100; +const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ const S32 DEFAULT_EDIT_CLASSIFIED_SCROLL_HEIGHT = 530; //static @@ -134,7 +137,7 @@ class LLClassifiedHandler : public LLCommandHandler, public LLAvatarPropertiesOb // get the ID for the classified LLUUID classified_id; - if (!classified_id.set(params[0].asStringRef(), FALSE)) + if (!classified_id.set(params[0].asString(), FALSE)) { return false; } @@ -978,12 +981,12 @@ void LLPanelProfileClassified::onSaveClick() return; } - mPublishFloater = LLFloaterReg::findTypedInstance<LLFloaterPublishClassified>( + mPublishFloater = LLFloaterReg::findTypedInstance<LLPublishClassifiedFloater>( "publish_classified", LLSD()); if(!mPublishFloater) { - mPublishFloater = LLFloaterReg::getTypedInstance<LLFloaterPublishClassified>( + mPublishFloater = LLFloaterReg::getTypedInstance<LLPublishClassifiedFloater>( "publish_classified", LLSD()); mPublishFloater->setPublishClickedCallback(boost::bind @@ -1523,3 +1526,47 @@ void LLPanelProfileClassified::updateTabLabel(const std::string& title) parent->setCurrentTabName(title); } } + + +//----------------------------------------------------------------------------- +// LLPublishClassifiedFloater +//----------------------------------------------------------------------------- + +LLPublishClassifiedFloater::LLPublishClassifiedFloater(const LLSD& key) + : LLFloater(key) +{ +} + +LLPublishClassifiedFloater::~LLPublishClassifiedFloater() +{ +} + +BOOL LLPublishClassifiedFloater::postBuild() +{ + LLFloater::postBuild(); + + childSetAction("publish_btn", boost::bind(&LLFloater::closeFloater, this, false)); + childSetAction("cancel_btn", boost::bind(&LLFloater::closeFloater, this, false)); + + return TRUE; +} + +void LLPublishClassifiedFloater::setPrice(S32 price) +{ + getChild<LLUICtrl>("price_for_listing")->setValue(price); +} + +S32 LLPublishClassifiedFloater::getPrice() +{ + return getChild<LLUICtrl>("price_for_listing")->getValue().asInteger(); +} + +void LLPublishClassifiedFloater::setPublishClickedCallback(const commit_signal_t::slot_type& cb) +{ + getChild<LLButton>("publish_btn")->setClickedCallback(cb); +} + +void LLPublishClassifiedFloater::setCancelClickedCallback(const commit_signal_t::slot_type& cb) +{ + getChild<LLButton>("cancel_btn")->setClickedCallback(cb); +} diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index b24cfddb95b297b92be6b0d54bbe1e5d7363952a..5f029b22f4a1ba4c7dc0ab5d7aed71db58688b46 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -28,11 +28,14 @@ #define LL_PANELPROFILECLASSIFIEDS_H #include "llavatarpropertiesprocessor.h" -#include "llfloaterpublishclassified.h" +#include "llclassifiedinfo.h" +#include "llfloater.h" #include "llpanel.h" #include "llpanelavatar.h" +#include "llrect.h" #include "lluuid.h" #include "v3dmath.h" +#include "llcoros.h" #include "lleventcoro.h" class LLCheckBoxCtrl; @@ -44,6 +47,23 @@ class LLTextEditor; class LLTextureCtrl; class LLUICtrl; + +class LLPublishClassifiedFloater final : public LLFloater +{ +public: + LLPublishClassifiedFloater(const LLSD& key); + virtual ~LLPublishClassifiedFloater(); + + BOOL postBuild() override; + + void setPrice(S32 price); + S32 getPrice(); + + void setPublishClickedCallback(const commit_signal_t::slot_type& cb); + void setCancelClickedCallback(const commit_signal_t::slot_type& cb); +}; + + /** * Panel for displaying Avatar's picks. */ @@ -319,7 +339,7 @@ class LLPanelProfileClassified bool mCanClose; bool mEditOnLoad; - LLFloaterPublishClassified* mPublishFloater; + LLPublishClassifiedFloater* mPublishFloater; }; #endif // LL_PANELPROFILECLASSIFIEDS_H diff --git a/indra/newview/llpanelprofilelegacy.cpp b/indra/newview/llpanelprofilelegacy.cpp deleted file mode 100644 index de6167984017908e9b8af14a5766c9fea5ec6b1d..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelprofilelegacy.cpp +++ /dev/null @@ -1,1668 +0,0 @@ -/* - * @file llpanelprofilelegacy.cpp - * @brief Legacy protocol avatar profile panel - * - * Copyright (c) 2014-2022, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#include "llviewerprecompiledheaders.h" -#include "llpanelprofilelegacy.h" - -// libraries -#include "llaccordionctrl.h" -#include "llaccordionctrltab.h" -#include "llavatarnamecache.h" -#include "llcheckboxctrl.h" -#include "llflatlistview.h" -#include "llfloaterreg.h" -#include "lllineeditor.h" -#include "llloadingindicator.h" -#include "llnotificationsutil.h" -#include "lltexteditor.h" -#include "lltexturectrl.h" -#include "lltoggleablemenu.h" -#include "lltrans.h" - -// newview -#include "alavataractions.h" -#include "llagent.h" -#include "llagentdata.h" -#include "llagentpicksinfo.h" -#include "llavataractions.h" -#include "llcallingcard.h" // for LLAvatarTracker -#include "llclassifieditem.h" -#include "lldateutil.h" -#include "lldroptarget.h" -#include "llfloaterreporter.h" -#include "llfloaterworldmap.h" -#include "llgroupactions.h" -#include "llpanelclassified.h" -#include "llpanelpick.h" -#include "llpickitem.h" -#include "llmutelist.h" -#include "llsidetraypanelcontainer.h" -#include "llslurl.h" -#include "llviewerdisplayname.h" -#include "llviewermenu.h" // gMenuHolder - -static constexpr std::string_view AGENT_PROFILE_CAP("AgentProfile"); -//static constexpr std::string_view UPLOAD_AGENT_PROFILE_CAP("UploadAgentProfileImage"); - -// These are order-senstitive so don't fk with 'em! -static const std::array<std::string, 8> sWantCheckboxes{{"wanna_build", "wanna_explore", "wanna_yiff", "wanna_work", "wanna_group", "wanna_buy", "wanna_sell", "wanna_hire"}}; -static const std::array<std::string, 6> sSkillsCheckboxes{{"can_texture", "can_architect", "can_model", "can_event", "can_script", "can_characters"}}; - -static LLPanelInjector<LLPanelProfileLegacy> t_panel_lprofile("panel_profile_legacy_sidetray"); -static LLPanelInjector<LLPanelProfileLegacy::LLPanelProfileGroups> t_panel_group("panel_profile_legacy_groups"); -static LLPanelInjector<LLPanelProfileLegacy::LLPanelProfilePicks> t_panel_picks("panel_profile_legacy_picks"); - -LLPanelProfileLegacy::LLPanelProfileLegacy() -: LLPanelProfileLegacyTab() -, mPanelPicks(nullptr) -, mPanelGroups(nullptr) -{ - mChildStack.setParent(this); - //mCommitCallbackRegistrar.add("Profile.CommitInterest", boost::bind(&LLPanelProfileLegacy::onCommitInterest, this)); - mCommitCallbackRegistrar.add("Profile.CommitProperties", boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); - mCommitCallbackRegistrar.add("Profile.CommitRights", boost::bind(&LLPanelProfileLegacy::onCommitRights, this)); - mCommitCallbackRegistrar.add("Profile.CommitModifyObjectRights", boost::bind(&LLPanelProfileLegacy::onCommitModifyObjectsRights, this, _1)); - mCommitCallbackRegistrar.add("Profile.Action", boost::bind(&LLPanelProfileLegacy::onCommitAction, this, _2)); - mEnableCallbackRegistrar.add("Profile.Enable", boost::bind(&LLPanelProfileLegacy::isActionEnabled, this, _2)); -} - -LLPanelProfileLegacy::~LLPanelProfileLegacy() -{ - if (LLAvatarPropertiesProcessor::instanceExists() && LLPanelProfileLegacyTab::getAvatarId().notNull()) - LLAvatarPropertiesProcessor::getInstance()->removeObserver(LLPanelProfileLegacyTab::getAvatarId(), this); - if (mAvatarNameCacheConnection.connected()) - mAvatarNameCacheConnection.disconnect(); - if (mNameChangedConnection.connected()) - mNameChangedConnection.disconnect(); -} - -// virtual -BOOL LLPanelProfileLegacy::postBuild() -{ - mPanelGroups = static_cast<LLPanelProfileGroups*>(getChild<LLUICtrl>("avatar_groups_tab_panel")); - mPanelPicks = static_cast<LLPanelProfilePicks*>(getChild<LLUICtrl>("avatar_picks_tab_panel")); - mPanelPicks->setProfilePanel(this); - - if (dynamic_cast<LLSideTrayPanelContainer*>(getParent()) != nullptr) - getChild<LLUICtrl>("back")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onBackBtnClick, this)); - else if (dynamic_cast<LLFloater*>(getParent()) != nullptr) - getChild<LLUICtrl>("back")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::closeParentFloater, this)); - else - getChild<LLUICtrl>("back")->setEnabled(FALSE); - getChild<LLTextEditor>("sl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); - getChild<LLTextEditor>("fl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); - getChild<LLTextureCtrl>("sl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); - getChild<LLTextureCtrl>("fl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); - getChild<LLTextEditor>("notes")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitNotes, this, _1)); - getChild<LLTextEditor>("avatar_name")->setDoubleClickCallback(boost::bind(&LLPanelProfileLegacy::onDoubleClickName, this)); - return TRUE; -} - -// virtual -void LLPanelProfileLegacy::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - // Temporarily add saved children back and reshape them. - mChildStack.preParentReshape(); - LLPanel::reshape(width, height, called_from_parent); - mChildStack.postParentReshape(); -} - -// virtual -void LLPanelProfileLegacy::onOpen(const LLSD& key) -{ - if (!key.has("avatar_id")) return; - const LLUUID av_id = key["avatar_id"].asUUID(); - - if (key.has("action")) - { - // *TODO: Actions, if any - return; - } - - if (mNameChangedConnection.connected()) - { - mNameChangedConnection.disconnect(); - } - - setAvatarId(av_id); - - mPanelGroups->onOpen(LLSD(av_id)); - mPanelPicks->onOpen(LLSD(av_id)); - // Oh joy! - bool is_self = (getAvatarId() == gAgentID); - getChild<LLView>("sl_profile_pic")->setEnabled(is_self); - getChild<LLView>("fl_profile_pic")->setEnabled(is_self); - getChild<LLView>("sl_about")->setEnabled(is_self); - getChild<LLView>("fl_about")->setEnabled(is_self); - getChild<LLView>("www")->setVisible(!is_self); - getChild<LLView>("www_edit")->setVisible(is_self); - getChild<LLView>("allow_publish")->setVisible(is_self); - //childSetEnabled("wanna_something", is_self); - //childSetEnabled("can_something", is_self); - //childSetEnabled("languages", is_self); - for (const std::string& checkbox: sWantCheckboxes) - childSetEnabled(checkbox, is_self); - for (const std::string& checkbox: sSkillsCheckboxes) - childSetEnabled(checkbox, is_self); - childSetEnabled("drop_target", !is_self); - getChild<LLLayoutPanel>("avatar_in_search", is_self); - getChild<LLDropTarget>("drop_target")->setAgentID(av_id); - //resetInterestsControlValues(); - - updateData(); - resetControls(); - - getChild<LLAccordionCtrl>("avatar_accordion")->expandDefaultTab(); -} - -void LLPanelProfileLegacy::resetControls() -{ - LLButton* button = getChild<LLButton>("btn_chat"); - button->setEnabled(getAvatarId() != gAgentID); - button = getChild<LLButton>("btn_friend"); - button->setEnabled(getAvatarId() != gAgentID); - button->setLabel(getString((LLAvatarTracker::instance().getBuddyInfo(getAvatarId()) == nullptr) - ? "add_friend" : "remove_friend")); - button = getChild<LLButton>("btn_block"); - button->setEnabled(getAvatarId() != gAgentID); - button->setLabel(LLTrans::getString(LLMuteList::getInstance()->isMuted(getAvatarId()) - ? "UnmuteAvatar" - : "MuteAvatar")); -} - -//void LLPanelProfileLegacy::resetInterestsControlValues() -//{ -// for (U32 i = 0; i < sWantCheckboxes.size(); ++i) -// { -// getChild<LLCheckBoxCtrl>(sWantCheckboxes.at(i))->setValue(FALSE); -// } -// -// for (U32 i = 0; i < sSkillsCheckboxes.size(); ++i) -// { -// getChild<LLCheckBoxCtrl>(sSkillsCheckboxes.at(i))->setValue(FALSE); -// } -// getChild<LLLineEditor>("wanna_something")->setText(LLStringUtil::null); -// getChild<LLLineEditor>("can_something")->setText(LLStringUtil::null); -// getChild<LLLineEditor>("languages")->setText(LLStringUtil::null); -//} - -void LLPanelProfileLegacy::updateData() -{ - setProgress(true); - - const std::string cap_url = gAgent.getRegionCapability(AGENT_PROFILE_CAP); - if (!cap_url.empty()) - { - const auto& agent_id = getAvatarId(); - auto handle = getHandle(); - LLCoros::instance().launch("requestAvatarProfileCoro", [cap_url, agent_id, handle]() { - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("request_avatar_properties_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders; - - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - httpOpts->setFollowRedirects(true); - - std::string finalUrl = cap_url + "/" + agent_id.asString(); - - LLSD result = httpAdapter->getAndSuspend(httpRequest, finalUrl, httpOpts, httpHeaders); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - LL_DEBUGS("AvatarProperties") << "Agent id: " << agent_id << " Result: " << httpResults << LL_ENDL; - - if (!status - || !result.has("id") - || agent_id != result["id"].asUUID()) - { - LL_WARNS("AvatarProperties") << "Failed to get agent information for id " << agent_id << LL_ENDL; - return; - } - - if (handle.isDead()) - { - // panel is dead - return; - } - - LLPanelProfileLegacy* legacy_sidetray = (LLPanelProfileLegacy*)handle.get(); - if (!legacy_sidetray) - { - return; - } - - // AgentProfile dumps all results into a big ol' map. Let's build some structs and make a bunch of calls - // to processProperties() - LLAvatarData avatar_data; - - avatar_data.agent_id = agent_id; - avatar_data.avatar_id = agent_id; - avatar_data.image_id = result["sl_image_id"].asUUID(); - avatar_data.fl_image_id = result["fl_image_id"].asUUID(); - avatar_data.partner_id = result["partner_id"].asUUID(); - avatar_data.about_text = result["sl_about_text"].asString(); - avatar_data.fl_about_text = result["fl_about_text"].asString(); - avatar_data.born_on = result["member_since"].asDate(); - avatar_data.profile_url = result.has("home_page") - ? result["home_page"].asString() : getProfileURL(agent_id.asString()); - - avatar_data.flags = 0; - if (result["online"].asBoolean()) - { - avatar_data.flags |= AVATAR_ONLINE; - } - if (result["allow_publish"].asBoolean()) - { - avatar_data.flags |= AVATAR_ALLOW_PUBLISH; - } - if (result["identified"].asBoolean()) - { - avatar_data.flags |= AVATAR_IDENTIFIED; - } - if (result["transacted"].asBoolean()) - { - avatar_data.flags |= AVATAR_TRANSACTED; - } - - avatar_data.caption_index = 0; - if (result.has("charter_member")) // won't be present if "caption" is set - { - avatar_data.caption_index = result["charter_member"].asInteger(); - } - else if (result.has("caption")) - { - avatar_data.caption_text = result["caption"].asString(); - } - legacy_sidetray->processProperties(&avatar_data, APT_PROPERTIES); - - LLSD groups_array = result["groups"]; - LLAvatarGroups avatar_groups; - avatar_groups.agent_id = agent_id; - avatar_groups.avatar_id = agent_id; - - for (LLSD::array_const_iterator it = groups_array.beginArray(); - it != groups_array.endArray(); ++it) - { - const LLSD& group_info = *it; - LLAvatarGroups::LLGroupData group_data; - group_data.group_powers = 0; - group_data.group_title = group_info["name"].asString(); - group_data.group_id = group_info["id"].asUUID(); - group_data.group_name = group_info["name"].asString(); - group_data.group_insignia_id = group_info["image_id"].asUUID(); - - avatar_groups.group_list.push_back(group_data); - } - - auto* groups_panel = static_cast<LLPanelProfileGroups*>(legacy_sidetray->getChild<LLUICtrl>("avatar_groups_tab_panel")); - - groups_panel->processProperties(&avatar_groups, APT_GROUPS); - legacy_sidetray->processProperties(&avatar_groups, APT_GROUPS); - - LLAvatarNotes avatar_notes; - avatar_notes.agent_id = agent_id; - avatar_notes.target_id = agent_id; - avatar_notes.notes = result["notes"].asString(); - - legacy_sidetray->processProperties(&avatar_notes, APT_NOTES); - - LLSD picks_array = result["picks"]; - LLAvatarPicks avatar_picks; - avatar_picks.agent_id = agent_id; - avatar_picks.target_id = agent_id; - for (LLSD::array_const_iterator it = picks_array.beginArray(); - it != picks_array.endArray(); ++it) - { - const LLSD& pick_data = *it; - avatar_picks.picks_list.emplace_back(pick_data["id"].asUUID(), pick_data["name"].asString()); - } - - legacy_sidetray->processProperties(&avatar_picks, APT_PICKS); - - // bonus time... - if (result.has("customer_type")) - { - LLUICtrl* internal_icon = legacy_sidetray->getChild<LLUICtrl>("account_type_internal"); - LLUICtrl* premium_icon = legacy_sidetray->getChild<LLUICtrl>("account_type_premium"); - LLUICtrl* plus_icon = legacy_sidetray->getChild<LLUICtrl>("account_type_plus"); - const std::string& type = result["customer_type"].asStringRef(); - - if (type == "Internal") - { - internal_icon->setVisible(true); - premium_icon->setVisible(false); - plus_icon->setVisible(false); - } - else if (type == "Monthly" || type == "Quarterly" || type == "Annual") - { - internal_icon->setVisible(false); - premium_icon->setVisible(true); - plus_icon->setVisible(false); - } - else if (type.substr(0, 12) == "Premium_Plus") - { - internal_icon->setVisible(false); - premium_icon->setVisible(false); - plus_icon->setVisible(true); - } - else /* if (type == "Base") */ - { - internal_icon->setVisible(false); - premium_icon->setVisible(false); - plus_icon->setVisible(false); - } - } - - }); - } - - mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelProfileLegacy::onAvatarNameCache, this, _1, _2)); - - const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - bool is_other = (relation && getAvatarId() != gAgentID); - getChild<LLLayoutPanel>("avatar_perm")->setVisible(is_other); - if (is_other) - { - S32 rights = relation->getRightsGrantedTo(); - getChild<LLCheckBoxCtrl>("allow_show_online")->setValue(rights & LLRelationship::GRANT_ONLINE_STATUS ? TRUE : FALSE); - getChild<LLCheckBoxCtrl>("allow_mapping")->setValue(rights & LLRelationship::GRANT_MAP_LOCATION ? TRUE : FALSE); - getChild<LLCheckBoxCtrl>("allow_object_perms")->setValue(rights & LLRelationship::GRANT_MODIFY_OBJECTS ? TRUE : FALSE); - } -} - -void LLPanelProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) -{ - getChild<LLTextEditor>("avatar_name")->setText(av_name.getCompleteName()); -} - -void LLPanelProfileLegacy::sendAvatarProfileCoro(std::string url, LLSD payload) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("send_avatar_profile_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders; - - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - httpOpts->setFollowRedirects(true); - - std::string full_url = url + "/" + getAvatarId().asString(); - - LLSD result = httpAdapter->putAndSuspend(httpRequest, full_url, payload, httpOpts, httpHeaders); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - LL_WARNS("LegacyProfiles") << "Failed to put agent information " << payload << " for id " << getAvatarId() << LL_ENDL; - return; - } - - LL_DEBUGS("LegacyProfiles") << "Agent id: " << getAvatarId() << " Payload: " << payload << " Result: " << httpResults << LL_ENDL; -} - -void LLPanelProfileLegacy::processProperties(void* data, EAvatarProcessorType type) -{ - if (!data) return; - switch(type) - { - case APT_PROPERTIES: - { - const LLAvatarData* pData = static_cast<const LLAvatarData*>(data); - if (!pData || pData->avatar_id != getAvatarId()) return; - getChild<LLTextureCtrl>("sl_profile_pic")->setValue(pData->image_id); - getChild<LLTextureCtrl>("fl_profile_pic")->setValue(pData->fl_image_id); - if (pData->partner_id.notNull()) - { - getChild<LLTextBase>("partner_info")->setText(LLSLURL("agent", pData->partner_id, "inspect").getSLURLString()); - getChild<LLTextBase>("partner_label")->setVisible(TRUE); - getChild<LLTextBase>("partner_info")->setVisible(TRUE); - } - else - { - getChild<LLTextBase>("partner_label")->setVisible(FALSE); - getChild<LLTextBase>("partner_info")->setVisible(FALSE); - } - getChild<LLTextEditor>("sl_about")->setText(pData->about_text); - getChild<LLTextEditor>("fl_about")->setText(pData->fl_about_text); - getChild<LLTextBase>("www")->setText(pData->profile_url); - getChild<LLLineEditor>("www_edit")->setText(pData->profile_url); - - LLStringUtil::format_map_t args; - std::string birth_date = LLTrans::getString("AvatarBirthDateFormatFull"); - LLStringUtil::format(birth_date, LLSD().with("datetime", static_cast<S32>(pData->born_on.secondsSinceEpoch()))); - args["[AGE]"] = LLDateUtil::ageFromDate(pData->born_on, LLDate::now()); - args["[REZDAY]"] = birth_date; - args["[ACCOUNT_TYPE]"] = LLAvatarPropertiesProcessor::accountType(pData); - args["[PAYMENT_INFO]"] = LLAvatarPropertiesProcessor::paymentInfo(pData); - args["[AGE_VERIFIED]"] = pData->flags & AVATAR_AGEVERIFIED ? getString("age_verified") : LLStringUtil::null; - LLSD formatted_info(getString("account_info_fmt", args)); - getChild<LLTextBase>("account_info")->setValue(formatted_info); - formatted_info = LLSD(getString("rezday_fmt", args)); - getChild<LLTextBase>("rezday")->setValue(formatted_info); - getChild<LLView>("cake")->setVisible(pData->born_on.toHTTPDateString(LLStringExplicit("%d %b")) == - LLDate::now().toHTTPDateString(LLStringExplicit("%d %b"))); - getChild<LLCheckBoxCtrl>("allow_publish")->setValue(static_cast<bool>(pData->flags & AVATAR_ALLOW_PUBLISH)); - getChild<LLUICtrl>("online")->setVisible(static_cast<BOOL>(pData->flags & AVATAR_ONLINE || - pData->avatar_id == gAgentID)); - break; - } - case APT_NOTES: - { - const LLAvatarNotes* pData = static_cast<const LLAvatarNotes*>(data); - if (!pData || pData->target_id != getAvatarId()) return; - getChild<LLTextEditor>("notes")->setValue(pData->notes); - break; - } - //case APT_INTERESTS: - //{ - // const LLAvatarInterests* pData = static_cast<const LLAvatarInterests*>(data); - // if (!pData || pData->avatar_id != getAvatarId()) return; - - // for (U32 i = 0; i < sWantCheckboxes.size(); ++i) - // { - // getChild<LLCheckBoxCtrl>(sWantCheckboxes.at(i))->setValue(pData->want_to_mask & (1<<i) ? TRUE : FALSE); - // } - - // for (U32 i = 0; i < sSkillsCheckboxes.size(); ++i) - // { - // getChild<LLCheckBoxCtrl>(sSkillsCheckboxes.at(i))->setValue(pData->skills_mask & (1<<i) ? TRUE : FALSE); - // } - // getChild<LLLineEditor>("wanna_something")->setText(pData->want_to_text); - // getChild<LLLineEditor>("can_something")->setText(pData->skills_text); - // getChild<LLLineEditor>("languages")->setText(pData->languages_text); - // break; - //} - case APT_GROUPS: - { - const LLAvatarGroups* pData = static_cast<LLAvatarGroups*>(data); - if(!pData || getAvatarId() != pData->avatar_id) return; - - showTab("avatar_groups_tab", !pData->group_list.empty()); - break; - } - // These are handled by their respective panels - case APT_PICKS: - case APT_CLASSIFIEDS: - case APT_PICK_INFO: - case APT_CLASSIFIED_INFO: - // Used by LLAgent not profiles. ;) - case APT_TEXTURES: - default: - break; - } - setProgress(false); -} - -void LLPanelProfileLegacy::setProgress(bool started) -{ - LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("progress_indicator"); - indicator->setVisible(started); - if (started) - indicator->start(); - else - indicator->stop(); -} - -void LLPanelProfileLegacy::showTab(std::string_view name, bool show) const -{ - getChild<LLAccordionCtrlTab>(name)->setVisible(show); - getChild<LLAccordionCtrl>("avatar_accordion")->arrange(); -} - -LLPanel* LLPanelProfileLegacy::expandTab(const std::string& name) const -{ - getChild<LLAccordionCtrl>("avatar_accordion")->expandTab(name); - return getChild<LLAccordionCtrlTab>(name)->getChild<LLPanel>(name + "_panel"); -} - -LLPanel* LLPanelProfileLegacy::getExpandedTab() const -{ - const LLAccordionCtrlTab* tab = getChild<LLAccordionCtrl>("avatar_accordion")->getExpandedTab(); - return tab ? tab->getChild<LLPanel>(tab->getName() + "_panel") : nullptr; -} - -void LLPanelProfileLegacy::onCommitAction(const LLSD& userdata) -{ - const std::string action = userdata.asString(); - if (action == "friend") - { - if (LLAvatarTracker::instance().getBuddyInfo(getAvatarId()) == nullptr) - LLAvatarActions::requestFriendshipDialog(getAvatarId()); - else - LLAvatarActions::removeFriendDialog(getAvatarId()); - resetControls(); - } - else if (action == "block") - { - LLAvatarActions::toggleBlock(getAvatarId()); - resetControls(); - } - else if (action == "chat") - LLAvatarActions::startIM(getAvatarId()); - else if (action == "call") - LLAvatarActions::startCall(getAvatarId()); - else if (action == "share") - LLAvatarActions::share(getAvatarId()); - else if (action == "teleport") - LLAvatarActions::offerTeleport(getAvatarId()); - else if (action == "req_teleport") - LLAvatarActions::teleportRequest(getAvatarId()); - else if (action == "map") - LLAvatarActions::showOnMap(getAvatarId()); - else if (action == "pay") - LLAvatarActions::pay(getAvatarId()); - else if (action == "report_abuse") - LLFloaterReporter::showFromObject(getAvatarId()); - else if (action == "upload_sl") - { - // *TODO: - } - else if (action == "upload_fl") - { - // *TODO: - } - else if (action == "webprofile") - ALAvatarActions::showWebProfile(getAvatarId()); - else - LL_WARNS("LegacyProfiles") << "Unhandled action: " << action << LL_ENDL; -} - -bool LLPanelProfileLegacy::isActionEnabled(const LLSD& userdata) -{ - bool action_enabled = false; - const std::string check = userdata.asString(); - if (check == "can_has_telefono") - action_enabled = (LLAvatarActions::canCall() && getAvatarId() != gAgentID); - else if (check == "can_has_teleport") - action_enabled = (LLAvatarActions::canOfferTeleport(getAvatarId()) && getAvatarId() != gAgentID); - else if (check == "can_has_map") - { - action_enabled = (LLAvatarTracker::instance().isBuddyOnline(getAvatarId()) - && LLAvatarActions::isAgentMappable(getAvatarId())) - || gAgent.isGodlike(); - } - else if (check == "can_has_pay") - action_enabled = (getAvatarId() != gAgentID); - else if (check == "can_share") - action_enabled = (getAvatarId() != gAgentID); - else if (check == "can_drama") - action_enabled = (getAvatarId() != gAgentID); - else if (check == "can_upload_pic") - { - action_enabled = getAvatarId() == gAgentID - && !gAgent.getRegionCapability("UploadAgentProfileImage").empty(); - } - else - LL_INFOS("LegacyProfiles") << "Unhandled check " << check << LL_ENDL; - return action_enabled; -} - -void LLPanelProfileLegacy::onCommitAvatarProperties() -{ - if (getAvatarId() != gAgentID) return; - - - std::string cap = gAgent.getRegionCapability(AGENT_PROFILE_CAP); - if (!cap.empty()) - { - LLSD data; - data["sl_about_text"] = getChild<LLTextEditor>("sl_about")->getText(); - data["fl_about_text"] = getChild<LLTextEditor>("fl_about")->getText(); - data["profile_url"] = getChild<LLLineEditor>("www_edit")->getText(); - data["allow_publish"] = getChild<LLCheckBoxCtrl>("allow_publish")->getValue().asBoolean(); - - LLCoros::instance().launch( - "sendAvatarProfileCoro", - boost::bind(&LLPanelProfileLegacy::sendAvatarProfileCoro, this, cap, data)); - } -} - -void LLPanelProfileLegacy::onCommitNotes(LLUICtrl* ctrl) -{ - std::string cap = gAgent.getRegionCapability(AGENT_PROFILE_CAP); - if (!cap.empty()) - { - LLCoros::instance().launch("sendAvatarProfileCoro", - boost::bind(&LLPanelProfileLegacy::sendAvatarProfileCoro, this, cap, - LLSD().with("notes", ctrl->getValue().asString()))); - } -} - -void LLPanelProfileLegacy::onDoubleClickName() -{ - if (getAvatarId() == gAgentID) - { - LLFloaterReg::showInstance("display_name"); - mNameChangedConnection = LLViewerDisplayName::addNameChangedCallback(boost::bind(&LLPanelProfileLegacy::onNameChanged, this)); - } -} - -void LLPanelProfileLegacy::onNameChanged() -{ - mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelProfileLegacy::onAvatarNameCache, this, _1, _2)); -} - -void LLPanelProfileLegacy::onBackBtnClick() -{ - LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); - if(parent) - { - parent->openPreviousPanel(); - } -} - -void LLPanelProfileLegacy::onCommitModifyObjectsRights(LLUICtrl* ctrl) -{ - if (ctrl->getValue().asBoolean()) // We want to confirm that the user really wants to grant object rights - { - LLNotificationsUtil::add("GrantModifyRights", - LLSD().with("NAME", LLSLURL("agent", getAvatarId(), "inspect").getSLURLString()), - LLSD(), - boost::bind(&LLPanelProfileLegacy::handleConfirmModifyRightsCallback, this, _1, _2)); - } - else // No confirmation needed on removing rights - { - onCommitRights(); - } -} - -bool LLPanelProfileLegacy::handleConfirmModifyRightsCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - onCommitRights(); - return true; - } - // Make sure to flip the checkbox back off - findChild<LLCheckBoxCtrl>("allow_object_perms")->setValue(false); - return false; -} - -void LLPanelProfileLegacy::closeParentFloater() -{ - LLFloater* floater = dynamic_cast<LLFloater*>(getParent()); - if (floater) floater->closeFloater(); -} - -void LLPanelProfileLegacy::onCommitRights() -{ - if (!LLAvatarActions::isFriend(getAvatarId())) return; - S32 flags = 0; - if (getChild<LLCheckBoxCtrl>("allow_show_online")->getValue().asBoolean()) - flags |= LLRelationship::GRANT_ONLINE_STATUS; - if (getChild<LLCheckBoxCtrl>("allow_mapping")->getValue().asBoolean()) - flags |= LLRelationship::GRANT_MAP_LOCATION; - if (getChild<LLCheckBoxCtrl>("allow_object_perms")->getValue().asBoolean()) - flags |= LLRelationship::GRANT_MODIFY_OBJECTS; - - LLAvatarPropertiesProcessor::getInstance()->sendFriendRights(getAvatarId(), flags); -} - -void LLPanelProfileLegacy::openPanel(LLPanel* panel, const LLSD& params) -{ - // Hide currently visible panel. - mChildStack.push(); - - // Add the panel or bring it to front. - if (panel->getParent() != this) - { - addChild(panel); - } - else - { - sendChildToFront(panel); - } - - panel->setVisible(TRUE); - panel->setFocus(TRUE); // prevent losing focus by the floater - panel->onOpen(params); - - LLRect new_rect = getRect(); - panel->reshape(new_rect.getWidth(), new_rect.getHeight()); - new_rect.setLeftTopAndSize(0, new_rect.getHeight(), new_rect.getWidth(), new_rect.getHeight()); - panel->setRect(new_rect); -} - -void LLPanelProfileLegacy::closePanel(LLPanel* panel) -{ - panel->setVisible(FALSE); - - if (panel->getParent() == this) - { - removeChild(panel); - - // Make the underlying panel visible. - mChildStack.pop(); - - // Prevent losing focus by the floater - const child_list_t* child_list = getChildList(); - if (!child_list->empty()) - { - child_list->front()->setFocus(TRUE); - } - else - { - LL_WARNS() << "No underlying panel to focus." << LL_ENDL; - } - } -} - -// LLPanelProfilePicks // -LLPanelProfileLegacy::LLPanelProfilePicks::LLPanelProfilePicks() -: LLPanelProfileLegacyTab() -, mProfilePanel(nullptr) -, mClassifiedsList(nullptr) -, mPicksList(nullptr) -, mPanelPickEdit(nullptr) -, mPanelPickInfo(nullptr) -, mPanelClassifiedInfo(nullptr) -, mPopupMenuHandle() -, mPlusMenuHandle() -{ -} - -LLPanelProfileLegacy::LLPanelProfilePicks::~LLPanelProfilePicks() -{ - auto popup_menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get()); - auto plus_menu = mPlusMenuHandle.get(); - if (popup_menu) - { - popup_menu->die(); - mPopupMenuHandle.markDead(); - } - - if (plus_menu) - { - plus_menu->die(); - mPlusMenuHandle.markDead(); - } -} - -BOOL LLPanelProfileLegacy::LLPanelProfilePicks::postBuild() -{ - mPicksList = getChild<LLFlatListView>("picks_list"); - mClassifiedsList = getChild<LLFlatListView>("classifieds_list"); - childSetAction("add_btn", boost::bind(&LLPanelProfilePicks::onClickPlusBtn, this)); - childSetAction("teleport_btn", boost::bind(&LLPanelProfilePicks::onClickTeleport, this)); - childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePicks::onClickShowOnMap, this)); - childSetAction("info_btn", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); - - // setup menu - CommitCallbackRegistry::ScopedRegistrar registar; - registar.add("Pick.Info", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); - registar.add("Pick.Edit", boost::bind(&LLPanelProfilePicks::onPanelEdit, this)); - registar.add("Pick.Teleport", boost::bind(&LLPanelProfilePicks::onClickTeleport, this)); - registar.add("Pick.Map", boost::bind(&LLPanelProfilePicks::onClickShowOnMap, this)); - registar.add("Pick.Delete", boost::bind(&LLPanelProfilePicks::onClickDelete, this)); - //EnableCallbackRegistry::ScopedRegistrar enable_registar; - //enable_registar.add("Pick.Enable", boost::bind(&LLPanelProfilePicks::onEnableMenuItem, this, _2)); - - auto popup_menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_picks.xml", gMenuHolder, child_registry_t::instance()); - if (popup_menu) - mPopupMenuHandle = popup_menu->getHandle(); - - CommitCallbackRegistry::ScopedRegistrar plus_registar; - plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelProfilePicks::onPlusMenuItemClicked, this, _2)); - mEnableCallbackRegistrar.add("Picks.Plus.Enable", boost::bind(&LLPanelProfilePicks::isActionEnabled, this, _2)); - auto plus_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_plus.xml", gMenuHolder, child_registry_t::instance()); - if (plus_menu) - mPlusMenuHandle = plus_menu->getHandle(); - - updateButtons(); - return TRUE; -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onOpen(const LLSD& key) -{ - const LLUUID id(key.asUUID()); - BOOL self = (gAgent.getID() == id); - - setAvatarId(id); - updateData(); - - getChild<LLView>("add_btn_lp")->setVisible(self); - auto menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get()); - if (menu) - { - menu->setItemVisible("pick_delete", self); - menu->setItemVisible("pick_edit", self); - menu->setItemVisible("pick_separator", self); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::updateData() -{ - mPicksList->clear(); - mClassifiedsList->clear(); - LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId()); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::processProperties(void* data, EAvatarProcessorType type) -{ - if (APT_PICKS == type) - { - mPicksList->clear(); - LLAvatarPicks* avatar_picks = static_cast<LLAvatarPicks*>(data); - if (!avatar_picks || getAvatarId() != avatar_picks->target_id) return; - for (const LLAvatarPicks::pick_data_t& pick: avatar_picks->picks_list) - { - const LLUUID pick_id = pick.first; - const std::string pick_name = pick.second; - - LLPickItem* picture = LLPickItem::create(); - picture->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); - picture->setPickName(pick_name); - picture->setPickId(pick_id); - picture->setCreatorId(getAvatarId()); - - LLAvatarPropertiesProcessor::instance().addObserver(getAvatarId(), picture); - picture->update(); - - LLSD pick_value = LLSD(); - pick_value.insert(PICK_ID, pick_id); - pick_value.insert(PICK_NAME, pick_name); - pick_value.insert(PICK_CREATOR_ID, getAvatarId()); - - mPicksList->addItem(picture, pick_value); - picture->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this)); - picture->setRightMouseUpCallback(boost::bind(&LLPanelProfilePicks::onRightMouseUpItem, this, _1, _2, _3, _4)); - } - showAccordion("tab_picks", mPicksList->size()); - } - else if (APT_CLASSIFIEDS == type) - { - mClassifiedsList->clear(); - LLAvatarClassifieds* c_info = static_cast<LLAvatarClassifieds*>(data); - if (!c_info || getAvatarId() != c_info->target_id) return; - for (const LLAvatarClassifieds::classified_data& c_data: c_info->classifieds_list) - { - LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), c_data.classified_id); - c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); - c_item->setClassifiedName(c_data.name); - - LLSD pick_value = LLSD(); - pick_value.insert(CLASSIFIED_ID, c_data.classified_id); - pick_value.insert(CLASSIFIED_NAME, c_data.name); - - if (!findClassifiedById(c_data.classified_id)) - { - mClassifiedsList->addItem(c_item, pick_value); - } - c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this)); - c_item->setRightMouseUpCallback(boost::bind(&LLPanelProfilePicks::onRightMouseUpItem, this, _1, _2, _3, _4)); - } - showAccordion("tab_classifieds", mClassifiedsList->size()); - } - updateButtons(); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::showAccordion(const std::string& name, bool show) -{ - getChild<LLAccordionCtrlTab>(name)->setVisible(show); - LLAccordionCtrl* acc = getChild<LLAccordionCtrl>("accordion"); - acc->arrange(); -} - -LLClassifiedItem *LLPanelProfileLegacy::LLPanelProfilePicks::findClassifiedById(const LLUUID& classified_id) const -{ - // HACK - find item by classified id. Should be a better way. - std::vector<LLPanel*> items; - mClassifiedsList->getItems(items); - LLClassifiedItem* c_item = nullptr; - for(LLPanel* it: items) - { - LLClassifiedItem *test_item = dynamic_cast<LLClassifiedItem*>(it); - if (test_item && test_item->getClassifiedId() == classified_id) - { - c_item = test_item; - break; - } - } - return c_item; -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::updateButtons() -{ - bool has_selected = (mPicksList->numSelected() > 0|| - mClassifiedsList->numSelected() > 0); - - getChildView("info_btn")->setEnabled(has_selected); - getChildView("teleport_btn")->setEnabled(has_selected); - getChildView("show_on_map_btn")->setEnabled(has_selected); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onClickInfo() -{ - if(mClassifiedsList->numSelected() > 0) - openClassifiedInfo(); - else if(mPicksList->numSelected() > 0) - openPickInfo(); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onClickPlusBtn() -{ - auto menu = mPlusMenuHandle.get(); - if (menu) - { - LLRect rect(getChildView("add_btn")->getRect()); - menu->setButtonRect(rect, this); - LLMenuGL::showPopup(this, menu, rect.mLeft, rect.mTop); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onClickTeleport() -{ - LLPickItem* pick_item = static_cast<LLPickItem*>(mPicksList->getSelectedItem()); - LLClassifiedItem* c_item = getSelectedClassifiedItem(); - - LLVector3d pos; - if (pick_item) - { - pos = pick_item->getPosGlobal(); - } - else if (c_item) - { - pos = c_item->getPosGlobal(); - LLPanelClassifiedInfo::sendClickMessage("teleport", false, - c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null); - } - - if (!pos.isExactlyZero()) - { - gAgent.teleportViaLocation(pos); - LLFloaterWorldMap::getInstance()->trackLocation(pos); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onClickShowOnMap() -{ - LLPickItem* pick_item = static_cast<LLPickItem*>(mPicksList->getSelectedItem()); - LLClassifiedItem* c_item = getSelectedClassifiedItem(); - - LLVector3d pos; - if (pick_item) - { - pos = pick_item->getPosGlobal(); - } - else if (c_item) - { - LLPanelClassifiedInfo::sendClickMessage("map", false, - c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null); - pos = c_item->getPosGlobal(); - } - - LLFloaterWorldMap::getInstance()->trackLocation(pos); - LLFloaterReg::showInstance("world_map", "center"); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onClickDelete() -{ - LLSD value = mPicksList->getSelectedValue(); - if (value.isDefined()) - { - LLSD args; - args["PICK"] = value[PICK_NAME]; - LLNotificationsUtil::add("ProfileDeletePick", args, LLSD(), - boost::bind(&LLPanelProfilePicks::callbackDeletePick, this, _1, _2)); - return; - } - value = mClassifiedsList->getSelectedValue(); - if (value.isDefined()) - { - LLSD args; - args["CLASSIFIED"] = value[CLASSIFIED_NAME]; - LLNotificationsUtil::add("ProfileDeleteClassified", args, LLSD(), - boost::bind(&LLPanelProfilePicks::callbackDeleteClassified, this, _1, _2)); - return; - } -} - -bool LLPanelProfileLegacy::LLPanelProfilePicks::callbackDeletePick(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLSD pick_value = mPicksList->getSelectedValue(); - - if (0 == option) - { - LLAvatarPropertiesProcessor::instance().sendPickDelete(pick_value[PICK_ID]); - mPicksList->removeItemByValue(pick_value); - } - updateButtons(); - return false; -} - -bool LLPanelProfileLegacy::LLPanelProfilePicks::callbackDeleteClassified(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - LLSD value = mClassifiedsList->getSelectedValue(); - - if (0 == option) - { - LLAvatarPropertiesProcessor::instance().sendClassifiedDelete(value[CLASSIFIED_ID]); - mClassifiedsList->removeItemByValue(value); - } - updateButtons(); - return false; -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::openPickInfo() -{ - LLSD selected_value = mPicksList->getSelectedValue(); - if (selected_value.isUndefined()) return; - - LLPickItem* pick = dynamic_cast<LLPickItem*>(mPicksList->getSelectedItem()); - - if (!mPanelPickInfo) - { - mPanelPickInfo = LLPanelPickInfo::create(); - mPanelPickInfo->setExitCallback(boost::bind(&LLPanelProfilePicks::onPanelPickClose, this, mPanelPickInfo)); - mPanelPickInfo->setEditPickCallback(boost::bind(&LLPanelProfilePicks::onPanelPickEdit, this)); - mPanelPickInfo->setVisible(FALSE); - } - - LLSD params; - params["pick_id"] = pick->getPickId(); - params["avatar_id"] = pick->getCreatorId(); - params["snapshot_id"] = pick->getSnapshotId(); - params["pick_name"] = pick->getPickName(); - params["pick_desc"] = pick->getPickDesc(); - - getProfilePanel()->openPanel(mPanelPickInfo, params); -} - -// virtual -void LLPanelProfileLegacy::LLPanelProfilePicks::onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask) -{ - updateButtons(); - - auto menu = static_cast<LLContextMenu*>(mPopupMenuHandle.get()); - if (menu) - { - menu->buildDrawLabels(); - menu->show(x, y); - LLMenuGL::showPopup(item, menu, x, y); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::openClassifiedInfo() -{ - LLSD selected_value = mClassifiedsList->getSelectedValue(); - if (selected_value.isUndefined()) return; - - LLClassifiedItem* c_item = getSelectedClassifiedItem(); - - if (!mPanelClassifiedInfo) - { - mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); - mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelProfilePicks::onPanelClassifiedClose, this, mPanelClassifiedInfo)); - mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelProfilePicks::onPanelClassifiedEdit, this)); - mPanelClassifiedInfo->setVisible(FALSE); - } - - LLSD params; - params["classified_id"] = c_item->getClassifiedId(); - params["classified_creator_id"] = c_item->getAvatarId(); - params["classified_snapshot_id"] = c_item->getSnapshotId(); - params["classified_name"] = c_item->getClassifiedName(); - params["classified_desc"] = c_item->getDescription(); - params["from_search"] = false; - - getProfilePanel()->openPanel(mPanelClassifiedInfo, params); -} - -LLClassifiedItem* LLPanelProfileLegacy::LLPanelProfilePicks::getSelectedClassifiedItem() const -{ - LLPanel* selected_item = mClassifiedsList->getSelectedItem(); - if (!selected_item) return nullptr; - - return dynamic_cast<LLClassifiedItem*>(selected_item); -} - -LLPickItem* LLPanelProfileLegacy::LLPanelProfilePicks::getSelectedPickItem() const -{ - LLPanel* selected_item = mPicksList->getSelectedItem(); - if (!selected_item) return nullptr; - - return dynamic_cast<LLPickItem*>(selected_item); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) -{ - if (!panel->canClose()) - { - return; - } - - if (panel->isNew()) - { - mEditClassifiedPanels[panel->getClassifiedId()] = panel; - - LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), panel->getClassifiedId()); - c_item->fillIn(panel); - - LLSD c_value; - c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId()); - c_value.insert(CLASSIFIED_NAME, c_item->getClassifiedName()); - mClassifiedsList->addItem(c_item, c_value, ADD_TOP); - - //c_item->setDoubleClickCallback(boost::bind(&LLPanelProfilePicks::onDoubleClickClassifiedItem, this, _1)); - c_item->setRightMouseUpCallback(boost::bind(&LLPanelProfilePicks::onRightMouseUpItem, this, _1, _2, _3, _4)); - c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this)); - c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this)); - - // order does matter, showTab will invoke arrange for accordions. - //mClassifiedsAccTab->changeOpenClose(false); - //showTab("tab_classifieds", true); - } - else if (panel->isNewWithErrors()) - { - LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); - llassert(c_item); - if (c_item) - { - c_item->fillIn(panel); - } - } - else - { - onPanelClassifiedClose(panel); - return; - } - - onPanelPickClose(panel); - updateButtons(); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedClose(LLPanelClassifiedInfo* panel) -{ - if(panel->getInfoLoaded() && !panel->isDirty()) - { - std::vector<LLSD> values; - mClassifiedsList->getValues(values); - for (auto& value : values) - { - LLUUID c_id = value[CLASSIFIED_ID].asUUID(); - if(panel->getClassifiedId() == c_id) - { - LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getItemByValue(value)); - llassert(c_item); - if (c_item) - { - c_item->setClassifiedName(panel->getClassifiedName()); - c_item->setDescription(panel->getDescription()); - c_item->setSnapshotId(panel->getSnapshotId()); - } - } - } - } - - onPanelPickClose(panel); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onDoubleClickClassifiedItem(LLUICtrl* item) -{ - LLSD value = mClassifiedsList->getSelectedValue(); - if (value.isUndefined()) return; - - LLSD args; - args["CLASSIFIED"] = value[CLASSIFIED_NAME]; - LLNotificationsUtil::add("TeleportToClassified", args, LLSD(), - boost::bind(&LLPanelProfilePicks::callbackTeleport, this, _1, _2)); -} - -bool LLPanelProfileLegacy::LLPanelProfilePicks::callbackTeleport(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if (0 == option) - { - onClickTeleport(); - } - return false; -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelPickClose(LLPanel* panel) -{ - getProfilePanel()->closePanel(panel); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelPickSave(LLPanel* panel) -{ - getProfilePanel()->closePanel(panel); - updateButtons(); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelPickEditSave(LLPanelPickEdit* panel) -{ - panel->sendUpdate(); - getProfilePanel()->closePanel(panel); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelEdit() -{ - if (getSelectedPickItem()) - { - onPanelPickEdit(); - } - else if (getSelectedClassifiedItem()) - { - onPanelClassifiedEdit(); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedEdit() -{ - LLSD selected_value = mClassifiedsList->getSelectedValue(); - if (selected_value.isUndefined()) return; - - LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); - llassert(c_item); - if (!c_item) return; - editClassified(c_item->getClassifiedId()); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::editClassified(const LLUUID& classified_id) -{ - LLClassifiedItem* c_item = findClassifiedById(classified_id); - if (!c_item) - { - LL_WARNS() << "item not found for classified_id " << classified_id << LL_ENDL; - return; - } - - LLSD params; - params["classified_id"] = c_item->getClassifiedId(); - params["classified_creator_id"] = c_item->getAvatarId(); - params["snapshot_id"] = c_item->getSnapshotId(); - params["name"] = c_item->getClassifiedName(); - params["desc"] = c_item->getDescription(); - params["category"] = (S32)c_item->getCategory(); - params["content_type"] = (S32)c_item->getContentType(); - params["auto_renew"] = c_item->getAutoRenew(); - params["price_for_listing"] = c_item->getPriceForListing(); - params["location_text"] = c_item->getLocationText(); - - LLPanelClassifiedEdit* panel = mEditClassifiedPanels[c_item->getClassifiedId()]; - if (!panel) - { - createClassifiedEditPanel(&panel); - mEditClassifiedPanels[c_item->getClassifiedId()] = panel; - } - getProfilePanel()->openPanel(panel, params); - panel->setPosGlobal(c_item->getPosGlobal()); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelPickEdit() -{ - LLSD selected_value = mPicksList->getSelectedValue(); - if (selected_value.isUndefined()) return; - - LLPickItem* pick = dynamic_cast<LLPickItem*>(mPicksList->getSelectedItem()); - - LLSD params; - params["pick_id"] = pick->getPickId(); - params["avatar_id"] = pick->getCreatorId(); - params["snapshot_id"] = pick->getSnapshotId(); - params["pick_name"] = pick->getPickName(); - params["pick_desc"] = pick->getPickDesc(); - - mPanelPickEdit = LLPanelPickEdit::create(); - mPanelPickEdit->setExitCallback(boost::bind(&LLPanelProfilePicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelProfilePicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelProfilePicks::onPanelPickEditSave, this, mPanelPickEdit)); - getProfilePanel()->openPanel(mPanelPickEdit, params); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::onPlusMenuItemClicked(const LLSD& param) -{ - std::string value = param.asString(); - - if ("new_pick" == value) - { - createNewPick(); - } - else if ("new_classified" == value) - { - createNewClassified(); - } -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::createNewPick() -{ - createPickEditPanel(); - - getProfilePanel()->openPanel(mPanelPickEdit, LLSD()); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::createNewClassified() -{ - LLPanelClassifiedEdit* panel = nullptr; - createClassifiedEditPanel(&panel); - - getProfilePanel()->openPanel(panel, LLSD()); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::createPickEditPanel() -{ - mPanelPickEdit = LLPanelPickEdit::create(); - mPanelPickEdit->setExitCallback(boost::bind(&LLPanelProfilePicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setSaveCallback(boost::bind(&LLPanelProfilePicks::onPanelPickSave, this, mPanelPickEdit)); - mPanelPickEdit->setCancelCallback(boost::bind(&LLPanelProfilePicks::onPanelPickClose, this, mPanelPickEdit)); - mPanelPickEdit->setVisible(FALSE); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::createClassifiedEditPanel(LLPanelClassifiedEdit** panel) -{ - - if (panel) - { - LLPanelClassifiedEdit* new_panel = LLPanelClassifiedEdit::create(); - new_panel->setExitCallback(boost::bind(&LLPanelProfilePicks::onPanelClassifiedClose, this, new_panel)); - new_panel->setSaveCallback(boost::bind(&LLPanelProfilePicks::onPanelClassifiedSave, this, new_panel)); - new_panel->setCancelCallback(boost::bind(&LLPanelProfilePicks::onPanelClassifiedClose, this, new_panel)); - new_panel->setVisible(FALSE); - *panel = new_panel; - } -} - -bool LLPanelProfileLegacy::LLPanelProfilePicks::isActionEnabled(const LLSD& userdata) const -{ - return (!(userdata.asString() == LLStringExplicit("new_pick") && LLAgentPicksInfo::getInstance()->isPickLimitReached())); -} - -void LLPanelProfileLegacy::LLPanelProfilePicks::setProfilePanel(LLPanelProfileLegacy* profile_panel) -{ - mProfilePanel = profile_panel; -} - -inline LLPanelProfileLegacy* LLPanelProfileLegacy::LLPanelProfilePicks::getProfilePanel() const -{ - llassert_always(mProfilePanel != nullptr); - return mProfilePanel; -} - -// LLPanelProfileGroups // - -LLPanelProfileLegacy::LLPanelProfileGroups::LLPanelProfileGroups() -: LLPanelProfileLegacyTab() -, mGroupsText(nullptr) -, mGroupsList(nullptr) -{ - -} - -BOOL LLPanelProfileLegacy::LLPanelProfileGroups::postBuild() -{ - mGroupsList = getChild<LLFlatListView>("groups_detail_list"); - mGroupsText = getChild<LLTextBase>("groups_panel_text"); - return TRUE; -} - -void LLPanelProfileLegacy::LLPanelProfileGroups::onOpen(const LLSD& key) -{ - const LLUUID id(key.asUUID()); - setAvatarId(id); - - updateData(); -} - -void LLPanelProfileLegacy::LLPanelProfileGroups::updateData() -{ - mGroupsText->setVisible(TRUE); - mGroupsList->clear(); -} - -void LLPanelProfileLegacy::LLPanelProfileGroups::processProperties(void* data, EAvatarProcessorType type) -{ - if (APT_GROUPS != type) return; - const LLAvatarGroups* avatar_groups = static_cast<LLAvatarGroups*>(data); - if(!avatar_groups || getAvatarId() != avatar_groups->avatar_id) return; - - for (auto const& gdata: avatar_groups->group_list) - { - LLProfileGroupItem* item = LLProfileGroupItem::create(); - item->childSetAction("info_chevron", boost::bind(&LLPanelProfileGroups::showGroup, this, gdata.group_id)); - item->init(gdata); - - LLSD item_value = LLSD(); - item_value.insert("group_id", gdata.group_id); - item_value.insert("group_name", gdata.group_name); - item_value.insert("group_icon", gdata.group_insignia_id); - item_value.insert("group_desc", LLStringUtil::null); - - if (!mGroupsList->valueExists(item_value)) - { - mGroupsList->addItem(item, item_value); - } - } -} - -void LLPanelProfileLegacy::LLPanelProfileGroups::showGroup(const LLUUID& id) -{ - LLGroupActions::show(id); -} - -// LLProfileGroupItem // - -LLPanelProfileLegacy::LLProfileGroupItem::LLProfileGroupItem() -: LLPanel() -, mInsignia(LLUUID::null) -, mGroupName(LLStringUtil::null) -, mCharter(LLStringUtil::null) -{ - buildFromFile("panel_profile_legacy_group_list_item.xml"); -} - -LLPanelProfileLegacy::LLProfileGroupItem::~LLProfileGroupItem() -{ - LLGroupMgr::getInstance()->removeObserver(this); -} - -//static -LLPanelProfileLegacy::LLProfileGroupItem* LLPanelProfileLegacy::LLProfileGroupItem::create() -{ - return new LLProfileGroupItem(); -} - -void LLPanelProfileLegacy::LLProfileGroupItem::init(const LLAvatarGroups::LLGroupData& data) -{ - setId(data.group_id); - setGroupName(data.group_name); - setInsignia(data.group_insignia_id); - LLGroupMgr::getInstance()->addObserver(this); - LLGroupMgr::getInstance()->sendGroupPropertiesRequest(data.group_id); - - LLTextureCtrl* picture = getChild<LLTextureCtrl>("picture"); - picture->setImageAssetID(data.group_insignia_id); -} - -BOOL LLPanelProfileLegacy::LLProfileGroupItem::postBuild() -{ - setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false)); - return TRUE; -} - -void LLPanelProfileLegacy::LLProfileGroupItem::setValue(const LLSD& value) -{ - if (!value.isMap()) return;; - if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible( value["selected"]); -} - -void LLPanelProfileLegacy::LLProfileGroupItem::setId(const LLUUID& id) -{ - mID = id; -} - -void LLPanelProfileLegacy::LLProfileGroupItem::setInsignia(const LLUUID& id) -{ - mInsignia = id; - getChild<LLTextureCtrl>("picture")->setImageAssetID(id); -} - -void LLPanelProfileLegacy::LLProfileGroupItem::setGroupName(const std::string& name) -{ - mGroupName = name; - getChild<LLUICtrl>("name")->setValue(name); -} - -void LLPanelProfileLegacy::LLProfileGroupItem::setCharter(const std::string& charter) -{ - mCharter = charter; - getChild<LLUICtrl>("description")->setValue(charter); -} - -void LLPanelProfileLegacy::LLProfileGroupItem::changed(LLGroupChange gc) -{ - if (gc != GC_PROPERTIES) return; - LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mID); - if (group_data) - { - setCharter(group_data->mCharter); - } - LLGroupMgr::getInstance()->removeObserver(this); -} - -// ChildStack // - -LLPanelProfileLegacy::ChildStack::ChildStack() -: mParent(nullptr) -{ -} - -LLPanelProfileLegacy::ChildStack::~ChildStack() -{ - while (!mStack.empty()) - { - view_list_t& top = mStack.back(); - for (auto viewp : top) - { - if (viewp) - { - viewp->die(); - } - } - mStack.pop_back(); - } -} - -void LLPanelProfileLegacy::ChildStack::setParent(LLPanel* parent) -{ - llassert_always(parent != nullptr); - mParent = parent; -} - -/// Save current parent's child views and remove them from the child list. -bool LLPanelProfileLegacy::ChildStack::push() -{ - view_list_t vlist = *mParent->getChildList(); - - for (auto viewp : vlist) - { - mParent->removeChild(viewp); - } - - mStack.push_back(vlist); - dump(); - return true; -} - -/// Restore saved children (adding them back to the child list). -bool LLPanelProfileLegacy::ChildStack::pop() -{ - if (mStack.empty()) - { - LL_WARNS() << "Empty stack" << LL_ENDL; - llassert(mStack.size() == 0); - return false; - } - - view_list_t& top = mStack.back(); - for (auto viewp : top) - { - mParent->addChild(viewp); - } - - mStack.pop_back(); - dump(); - return true; -} - -/// Temporarily add all saved children back. -void LLPanelProfileLegacy::ChildStack::preParentReshape() -{ - mSavedStack = mStack; - while(!mStack.empty()) - { - pop(); - } -} - -/// Add the temporarily saved children back. -void LLPanelProfileLegacy::ChildStack::postParentReshape() -{ - mStack = mSavedStack; - mSavedStack = stack_t(); - - for (const auto& vlist : mStack) - { - for (auto viewp : vlist) - { - LL_DEBUGS() << "removing " << viewp->getName() << LL_ENDL; - mParent->removeChild(viewp); - } - } -} - -void LLPanelProfileLegacy::ChildStack::dump() -{ - unsigned lvl = 0; - LL_DEBUGS() << "child stack dump:" << LL_ENDL; - for (const auto& vlist : mStack) - { - ++lvl; - std::ostringstream dbg_line; - dbg_line << "lvl #" << lvl << ":"; - for (const auto& list_it : vlist) - { - dbg_line << " " << list_it->getName(); - } - LL_DEBUGS() << dbg_line.str() << LL_ENDL; - } -} diff --git a/indra/newview/llpanelprofilelegacy.h b/indra/newview/llpanelprofilelegacy.h deleted file mode 100644 index 9c30519ab5c49af4e66117e632c30fce82f73a80..0000000000000000000000000000000000000000 --- a/indra/newview/llpanelprofilelegacy.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * @file llpanelprofilelegacy.h - * @brief Legacy protocol avatar profile panel - * - * Copyright (c) 2014-2022, Cinder Roxley <cinder@sdf.org> - * - * Permission is hereby granted, free of charge, to any person or organization - * obtaining a copy of the software and accompanying documentation covered by - * this license (the "Software") to use, reproduce, display, distribute, - * execute, and transmit the Software, and to prepare derivative works of the - * Software, and to permit third-parties to whom the Software is furnished to - * do so, all subject to the following: - * - * The copyright notices in the Software and this entire statement, including - * the above license grant, this restriction and the following disclaimer, - * must be included in all copies of the Software, in whole or in part, and - * all derivative works of the Software, unless such copies or derivative - * works are solely in the form of machine-executable object code generated by - * a source language processor. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT - * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE - * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef LL_PANELPROFILELEGACY_H -#define LL_PANELPROFILELEGACY_H - -#include "llgroupmgr.h" -#include "llpanelavatarlegacy.h" - -class LLAvatarName; -class LLClassifiedItem; -class LLFlatListView; -class LLPanel; -class LLPanelPickEdit; -class LLPanelPickInfo; -class LLPanelClassifiedInfo; -class LLPanelClassifiedEdit; -class LLPickItem; -class LLTextBase; -class LLToggleableMenu; - -class LLPanelProfileLegacy final : public LLPanelProfileLegacyTab -{ -public: - LLPanelProfileLegacy(); - BOOL postBuild() override; - void onOpen(const LLSD& key) override; - void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; - void showTab(std::string_view name, bool show) const; - LLPanel* expandTab(const std::string& name) const; - LLPanel* getExpandedTab() const; - -protected: - void openPanel(LLPanel* panel, const LLSD& params); - void closePanel(LLPanel* panel); - -private: - ~LLPanelProfileLegacy() override; - void updateData() override; - void processProperties(void* data, EAvatarProcessorType type) override; - void resetControls() override; - void resetInterestsControlValues(); - void setProgress(bool started); - void sendAvatarProfileCoro(std::string url, LLSD payload); - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); - void onCommitAvatarProperties(); - void onCommitInterest(); - void onCommitNotes(LLUICtrl* ctrl); - void onDoubleClickName(); - void onCommitRights(); - void onBackBtnClick(); - void onCommitModifyObjectsRights(LLUICtrl* ctrl); - void onCommitAction(const LLSD& userdata); - void onNameChanged(); - bool isActionEnabled(const LLSD& userdata); - bool handleConfirmModifyRightsCallback(const LLSD& notification, const LLSD& response); - void closeParentFloater(); - - boost::signals2::connection mAvatarNameCacheConnection; - boost::signals2::connection mNameChangedConnection; - - class ChildStack - { - public: - ChildStack(); - ~ChildStack(); - void setParent(LLPanel* parent); - - bool push(); - bool pop(); - void preParentReshape(); - void postParentReshape(); - - private: - void dump(); - - typedef LLView::child_list_t view_list_t; - typedef std::list<view_list_t> stack_t; - - stack_t mStack; - stack_t mSavedStack; - LLPanel* mParent; - }; - ChildStack mChildStack; - -public: - class LLPanelProfilePicks final : public LLPanelProfileLegacyTab - { - friend class LLPanelProfileLegacy; - public: - LLPanelProfilePicks(); - ~LLPanelProfilePicks() override; - BOOL postBuild() override; - - void createNewPick(); - void createNewClassified(); - - protected: - void onOpen(const LLSD& key) override; - - private: - void updateData() override; - void processProperties(void* data, EAvatarProcessorType type) override; - void resetControls() override {}; - void showAccordion(const std::string& name, bool show); - void setProfilePanel(LLPanelProfileLegacy* profile_panel); - LLPanelProfileLegacy* getProfilePanel() const; - void onPanelPickClose(LLPanel* panel); - void onPanelPickSave(LLPanel* panel); - void onPanelPickEditSave(LLPanelPickEdit* panel); - void onPanelEdit(); - void onPanelClassifiedEdit(); - void onPanelPickEdit(); - void onPlusMenuItemClicked(const LLSD& param); - void editClassified(const LLUUID& classified_id); - void updateButtons() override; - void onClickPlusBtn(); - void onClickInfo(); - void onClickTeleport(); - void onClickShowOnMap(); - void onClickDelete(); - void openPickInfo(); - void openClassifiedInfo(); - void onPanelClassifiedSave(LLPanelClassifiedEdit* panel); - void onPanelClassifiedClose(LLPanelClassifiedInfo* panel); - void onDoubleClickClassifiedItem(LLUICtrl* item); - LLClassifiedItem* findClassifiedById(const LLUUID& classified_id) const; - LLClassifiedItem* getSelectedClassifiedItem() const; - LLPickItem* getSelectedPickItem() const; - - void createPickEditPanel(); - void createClassifiedEditPanel(LLPanelClassifiedEdit** panel); - - bool isActionEnabled(const LLSD& userdata) const; - bool callbackDeletePick(const LLSD& notification, const LLSD& response); - bool callbackDeleteClassified(const LLSD& notification, const LLSD& response); - bool callbackTeleport(const LLSD& notification, const LLSD& response); - virtual void onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask); - - LLPanelProfileLegacy* mProfilePanel; - LLFlatListView* mClassifiedsList; - LLFlatListView* mPicksList; - LLPanelPickEdit* mPanelPickEdit; - LLPanelPickInfo* mPanelPickInfo; - LLPanelClassifiedInfo* mPanelClassifiedInfo; - LLHandle<LLView> mPopupMenuHandle; - LLHandle<LLToggleableMenu> mPlusMenuHandle; - - // This map is needed for newly created classifieds. The purpose of panel is to - // sit in this map and listen to LLPanelClassifiedEdit::processProperties callback. - std::map<LLUUID, LLPanelClassifiedEdit*> mEditClassifiedPanels; - }; - - class LLPanelProfileGroups final : public LLPanelProfileLegacyTab - { - friend class LLPanelProfileLegacy; - public: - LLPanelProfileGroups(); - BOOL postBuild() override; - - protected: - void onOpen(const LLSD& key) override; - - private: - void updateData() override; - void processProperties(void* data, EAvatarProcessorType type) override; - void resetControls() override {}; - void showGroup(const LLUUID& id); - - LLTextBase* mGroupsText; - LLFlatListView* mGroupsList; - }; - - class LLProfileGroupItem final : public LLPanel, public LLGroupMgrObserver - { - public: - LLProfileGroupItem(); - ~LLProfileGroupItem() override; - static LLProfileGroupItem* create(); - void init(const LLAvatarGroups::LLGroupData& data); - BOOL postBuild() override; - - void setValue(const LLSD& value) override; - void setId(const LLUUID& id); - void setInsignia(const LLUUID& id); - void setGroupName(const std::string& name); - void setCharter(const std::string& charter); - - protected: - void changed(LLGroupChange gc) override; - - private: - LLUUID mInsignia; - std::string mGroupName; - std::string mCharter; - }; - -private: - LLPanelProfilePicks* mPanelPicks; - LLPanelProfileGroups* mPanelGroups; -}; - -#endif //LL_PANELPROFILELEGACY_H diff --git a/indra/newview/llpickitem.cpp b/indra/newview/llpickitem.cpp deleted file mode 100644 index 55e59d125511a65783fd9d62e3c044931af89a26..0000000000000000000000000000000000000000 --- a/indra/newview/llpickitem.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/** -* @file llpickitem.cpp -* @brief Widget -* -* $LicenseInfo:firstyear=2009&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$ -*/ - -#include "llviewerprecompiledheaders.h" -#include "llpickitem.h" - -#include "lltexturectrl.h" - -LLPickItem::LLPickItem() - : LLPanel() - , mPickID(LLUUID::null) - , mCreatorID(LLUUID::null) - , mParcelID(LLUUID::null) - , mSnapshotID(LLUUID::null) - , mNeedData(true) -{ - buildFromFile("panel_pick_list_item.xml"); -} - -LLPickItem::~LLPickItem() -{ - if (mCreatorID.notNull()) - { - LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); - } - -} - -LLPickItem* LLPickItem::create() -{ - return new LLPickItem(); -} - -void LLPickItem::init(LLPickData* pick_data) -{ - setPickDesc(pick_data->desc); - setSnapshotId(pick_data->snapshot_id); - mPosGlobal = pick_data->pos_global; - mSimName = pick_data->sim_name; - mPickDescription = pick_data->desc; - mUserName = pick_data->user_name; - mOriginalName = pick_data->original_name; - - LLTextureCtrl* picture = getChild<LLTextureCtrl>("picture"); - picture->setImageAssetID(pick_data->snapshot_id); -} - -void LLPickItem::setPickName(const std::string& name) -{ - mPickName = name; - getChild<LLUICtrl>("picture_name")->setValue(name); - -} - -const std::string& LLPickItem::getPickName() const -{ - return mPickName; -} - -const LLUUID& LLPickItem::getCreatorId() const -{ - return mCreatorID; -} - -const LLUUID& LLPickItem::getSnapshotId() const -{ - return mSnapshotID; -} - -void LLPickItem::setPickDesc(const std::string& descr) -{ - getChild<LLUICtrl>("picture_descr")->setValue(descr); -} - -void LLPickItem::setPickId(const LLUUID& id) -{ - mPickID = id; -} - -const LLUUID& LLPickItem::getPickId() const -{ - return mPickID; -} - -const LLVector3d& LLPickItem::getPosGlobal() const -{ - return mPosGlobal; -} - -const std::string LLPickItem::getDescription() const -{ - return getChild<LLUICtrl>("picture_descr")->getValue().asString(); -} - -void LLPickItem::update() -{ - setNeedData(true); - LLAvatarPropertiesProcessor::instance().sendPickInfoRequest(mCreatorID, mPickID); -} - -void LLPickItem::processProperties(void *data, EAvatarProcessorType type) -{ - if (APT_PICK_INFO != type) - { - return; - } - - LLPickData* pick_data = static_cast<LLPickData *>(data); - if (!pick_data || mPickID != pick_data->pick_id) - { - return; - } - - init(pick_data); - setNeedData(false); - LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this); -} - -BOOL LLPickItem::postBuild() -{ - setMouseEnterCallback(std::bind(&set_child_visible, this, "hovered_icon", true)); - setMouseLeaveCallback(std::bind(&set_child_visible, this, "hovered_icon", false)); - return TRUE; -} - -void LLPickItem::setValue(const LLSD& value) -{ - if (!value.isMap()) return;; - if (!value.has("selected")) return; - getChildView("selected_icon")->setVisible(value["selected"]); -} - diff --git a/indra/newview/llpickitem.h b/indra/newview/llpickitem.h deleted file mode 100644 index 0ddcbd4bf86490c4e1d176e3ddae09e92c768a62..0000000000000000000000000000000000000000 --- a/indra/newview/llpickitem.h +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @file llpickitem.h -* @brief Widget -* -* $LicenseInfo:firstyear=2009&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_PICKITEM_H -#define LL_PICKITEM_H - -#include "llavatarpropertiesprocessor.h" -#include "llpanel.h" - -struct LLPickData; - -static const std::string PICK_ID("pick_id"); -static const std::string PICK_CREATOR_ID("pick_creator_id"); -static const std::string PICK_NAME("pick_name"); - -class LLPickItem final : public LLPanel, public LLAvatarPropertiesObserver -{ -public: - LLPickItem(); - ~LLPickItem(); - BOOL postBuild() override; - - static LLPickItem* create(); - void init(LLPickData* pick_data); - void setPickName(const std::string& name); - void setPickDesc(const std::string& descr); - void setPickId(const LLUUID& id); - void setCreatorId(const LLUUID& id) { mCreatorID = id; }; - void setSnapshotId(const LLUUID& id) { mSnapshotID = id; }; - void setNeedData(bool need) { mNeedData = need; }; - const LLUUID& getPickId() const; - const std::string& getPickName() const; - const LLUUID& getCreatorId() const; - const LLUUID& getSnapshotId() const; - const LLVector3d& getPosGlobal() const; - const std::string getDescription() const; - const std::string& getSimName() const { return mSimName; } - const std::string& getUserName() const { return mUserName; } - const std::string& getOriginalName() const { return mOriginalName; } - const std::string& getPickDesc() const { return mPickDescription; } - void processProperties(void* data, EAvatarProcessorType type) override; - void update(); - - /** setting on/off background icon to indicate selected state */ - void setValue(const LLSD& value) override; - -protected: - LLUUID mPickID; - LLUUID mCreatorID; - LLUUID mParcelID; - LLUUID mSnapshotID; - LLVector3d mPosGlobal; - bool mNeedData; - - std::string mPickName; - std::string mUserName; - std::string mOriginalName; - std::string mPickDescription; - std::string mSimName; -}; - -#endif // LL_PICKITEM_H diff --git a/indra/newview/llprofileimagepicker.cpp b/indra/newview/llprofileimagepicker.cpp deleted file mode 100644 index 9930b6eea7818ef444207f8cac038dd888bcf372..0000000000000000000000000000000000000000 --- a/indra/newview/llprofileimagepicker.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** -* @file llprofileimagepicker.cpp -* @brief Specialized profile image filepicker -* -* $LicenseInfo:firstyear=2022&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2022, 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 "llprofileimagepicker.h" - -#include "llavatariconctrl.h" -#include "llagent.h" -#include "llloadingindicator.h" -#include "llnotificationsutil.h" -#include "llpanel.h" -#include "llviewertexturelist.h" - -static constexpr std::string_view PROFILE_IMAGE_UPLOAD_CAP("UploadAgentProfileImage"); - -static void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::string path_to_image, - LLProfileImagePicker::ugly_picker_cb_t cb); -static LLUUID post_profile_image(std::string cap_url, const LLSD& first_data, std::string path_to_image); -static void setImageUploading(LLPanel* panel, bool loading); - - -LLProfileImagePicker::LLProfileImagePicker(EProfileImageType type, LLHandle<LLPanel>* handle, ugly_picker_cb_t const& cb) -: LLFilePickerThread(LLFilePicker::FFLOAD_IMAGE) -, mHandle(handle) -, mType(type), - mCallback(cb) -{ } - -LLProfileImagePicker::~LLProfileImagePicker() -{ - delete mHandle; -} - -void LLProfileImagePicker::notify(const std::vector<std::string>& filenames) -{ - if (mHandle->isDead()) - { - return; - } - if (filenames.empty()) - { - return; - } - const std::string& file_path = filenames.at(0); - if (file_path.empty()) - { - return; - } - - // generate a temp texture file for coroutine - std::string const& temp_file = gDirUtilp->getTempFilename(); - U32 codec = LLImageBase::getCodecFromExtension(gDirUtilp->getExtension(file_path)); - const S32 MAX_DIM = 256; - if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, MAX_DIM)) - { - LLSD notif_args; - notif_args["REASON"] = LLImage::getLastThreadError().c_str(); - LLNotificationsUtil::add("CannotUploadTexture", notif_args); - LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", failed to open image" << LL_ENDL; - return; - } - - std::string cap_url = gAgent.getRegionCapability(PROFILE_IMAGE_UPLOAD_CAP); - if (cap_url.empty()) - { - LLSD args; - args["CAPABILITY"] = std::string(PROFILE_IMAGE_UPLOAD_CAP); - LLNotificationsUtil::add("RegionCapabilityRequestError", args); - LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", no cap found" << LL_ENDL; - return; - } - - setImageUploading(mHandle->get(), true); - LLCoros::instance().launch("postAgentUserImageCoro", - [cap_url, this, temp_file] - { - return post_profile_image_coro(cap_url, mType, temp_file, mCallback); - }); -} - -LLUUID post_profile_image(std::string cap_url, const LLSD& first_data, std::string path_to_image) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders; - - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - httpOpts->setFollowRedirects(true); - - LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - // todo: notification? - LL_WARNS("AvatarProperties") << "Failed to get uploader cap " << status.toString() << LL_ENDL; - return LLUUID::null; - } - if (!result.has("uploader")) - { - // todo: notification? - LL_WARNS("AvatarProperties") << "Failed to get uploader cap, response contains no data." << LL_ENDL; - return LLUUID::null; - } - std::string uploader_cap = result["uploader"].asString(); - if (uploader_cap.empty()) - { - LL_WARNS("AvatarProperties") << "Failed to get uploader cap, cap invalid." << LL_ENDL; - return LLUUID::null; - } - - // Upload the image - - LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); - S64 length; - - { - llifstream instream(path_to_image.c_str(), std::iostream::binary | std::iostream::ate); - if (!instream.is_open()) - { - LL_WARNS("AvatarProperties") << "Failed to open file " << path_to_image << LL_ENDL; - return LLUUID::null; - } - length = instream.tellg(); - } - - uploaderhttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, "application/jp2"); // optional - uploaderhttpHeaders->append(HTTP_OUT_HEADER_CONTENT_LENGTH, llformat("%d", length)); // required! - uploaderhttpOpts->setFollowRedirects(true); - - result = httpAdapter->postFileAndSuspend(uploaderhttpRequest, uploader_cap, path_to_image, uploaderhttpOpts, uploaderhttpHeaders); - - httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - LL_WARNS("AvatarProperties") << result << LL_ENDL; - - if (!status) - { - LL_WARNS("AvatarProperties") << "Failed to upload image " << status.toString() << LL_ENDL; - return LLUUID::null; - } - - if (result["state"].asString() != "complete") - { - if (result.has("message")) - { - LL_WARNS("AvatarProperties") << "Failed to upload image, state " << result["state"] << " message: " << result["message"] << LL_ENDL; - } - else - { - LL_WARNS("AvatarProperties") << "Failed to upload image " << result << LL_ENDL; - } - return LLUUID::null; - } - - return result["new_asset"].asUUID(); -} - -void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::string path_to_image, - LLProfileImagePicker::ugly_picker_cb_t cb) -{ - LLSD data; - switch (type) - { - case PROFILE_IMAGE_SL: - data["profile-image-asset"] = "sl_image_id"; - break; - case PROFILE_IMAGE_FL: - data["profile-image-asset"] = "fl_image_id"; - break; - } - - LLUUID result = post_profile_image(cap_url, data, path_to_image); - - cb(result); - - if (type == PROFILE_IMAGE_SL && result.notNull()) - { - LLAvatarIconIDCache::getInstance()->add(gAgentID, result); - // Should trigger callbacks in icon controls - LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgentID); - } - - // Cleanup - LLFile::remove(path_to_image); -} - -void setImageUploading(LLPanel* panel, bool loading) -{ - LLLoadingIndicator* indicator = panel->findChild<LLLoadingIndicator>("image_upload_indicator"); - if (indicator) - { - indicator->setVisible(loading); - if (loading) - { - indicator->start(); - } - else - { - indicator->stop(); - } - } -} diff --git a/indra/newview/llprofileimagepicker.h b/indra/newview/llprofileimagepicker.h deleted file mode 100644 index a67d0859b08efd4fbc6fb85f39f876ad215c28e3..0000000000000000000000000000000000000000 --- a/indra/newview/llprofileimagepicker.h +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @file llprofileimagepicker.h -* @brief Specialized profile image filepicker -* -* $LicenseInfo:firstyear=2022&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2022, 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_PROFILEIMAGEPICKER_H -#define LL_PROFILEIMAGEPICKER_H - -#include "llviewermenufile.h" - -enum EProfileImageType -{ - PROFILE_IMAGE_SL, - PROFILE_IMAGE_FL, -}; - -class LLProfileImagePicker final : public LLFilePickerThread -{ -public: - typedef std::function<void(LLUUID const&)> ugly_picker_cb_t; - - LLProfileImagePicker(EProfileImageType type, LLHandle<LLPanel>* handle, ugly_picker_cb_t const& cb); - ~LLProfileImagePicker() override; - void notify(const std::vector<std::string>& filenames) override; - -private: - LLHandle<LLPanel>* mHandle; - EProfileImageType mType; - ugly_picker_cb_t mCallback; -}; - -#endif // LL_PROFILEIMAGEPICKER_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index d808228a3cfea4e8989d92a270c7fb61376bf827..75ca28428f540c057c73b60710379764ecbec2d5 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -144,9 +144,7 @@ #include "llfloaterpreferenceviewadvanced.h" #include "llfloaterpreviewtrash.h" #include "llfloaterprofile.h" -#include "llfloaterprofilelegacy.h" #include "llfloaterprogressview.h" -#include "llfloaterpublishclassified.h" #include "llfloaterregiondebugconsole.h" #include "llfloaterregioninfo.h" #include "llfloaterregionrestarting.h" @@ -193,6 +191,7 @@ #include "llmoveview.h" #include "llfloaterimnearbychat.h" #include "llpanelblockedlist.h" +#include "llpanelprofileclassifieds.h" #include "llpanelemojicomplete.h" #include "llpreviewanim.h" #include "llpreviewgesture.h" @@ -208,7 +207,6 @@ // *NOTE: Please add files in alphabetical order to keep merges easy. // [RLVa:KB] - Checked: 2010-03-11 -#include "llfloaterwebprofile.h" #include "rlvfloaters.h" // [/RLVa:KB] // handle secondlife:///app/openfloater/{NAME} URLs @@ -500,7 +498,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("preview_sound", "floater_preview_sound.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewSound>, "preview"); LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewTexture>, "preview"); LLFloaterReg::add("preview_trash", "floater_preview_trash.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreviewTrash>); - LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPublishClassified>); + LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPublishClassifiedFloater>); LLFloaterReg::add("save_pref_preset", "floater_save_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSavePrefPreset>); LLFloaterReg::add("save_camera_preset", "floater_save_camera_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSaveCameraPreset>); LLFloaterReg::add("script_colors", "floater_script_ed_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptEdPrefs>); @@ -576,7 +574,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("delete_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeleteQueue>); LLFloaterReg::add("generic_text", "floater_generic_text.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGenericText>); LLFloaterReg::add("group_profile", "floater_group_profile.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupProfile>); - LLFloaterReg::add("legacy_profile", "floater_profile_legacy.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterProfileLegacy>); LLFloaterReg::add("lightbox", "floater_lightbox_settings.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<ALFloaterLightBox>); LLFloaterReg::add("message_builder", "floater_message_builder.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMessageBuilder>); LLFloaterReg::add("message_log", "floater_message_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMessageLog>); @@ -591,8 +588,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("region_tracker", "floater_region_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterRegionTracker>); LLFloaterReg::add("settings_color", "floater_settings_color.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterSettingsColor>); LLFloaterReg::add("sound_explorer", "floater_explore_sounds.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterExploreSounds>); - LLFloaterReg::add("webprofile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); - LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a79377d2053530b387c2aa37f56e59ac4e69389c..d1fb13e78428f7976af85237a101753228f0f130 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3895,7 +3895,7 @@ void handle_avatar_eject(const LLSD& avatar_id) bool my_profile_visible() { - LLFloater* floaterp = LLAvatarActions::findProfileFloater(gAgentID); + LLFloater* floaterp = LLAvatarActions::getProfileFloater(gAgentID); return floaterp && floaterp->isInVisibleChain(); } @@ -6720,7 +6720,7 @@ class LLAvatarToggleMyProfile : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloater* instance = LLAvatarActions::findProfileFloater(gAgent.getID()); + LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID()); if (LLFloater::isMinimized(instance)) { instance->setMinimized(FALSE); @@ -6746,7 +6746,7 @@ class LLAvatarTogglePicks : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloater * instance = LLAvatarActions::findProfileFloater(gAgent.getID()); + LLFloater * instance = LLAvatarActions::getProfileFloater(gAgent.getID()); if (LLFloater::isMinimized(instance) || (instance && !instance->hasFocus() && !instance->getIsChrome())) { instance->setMinimized(FALSE); diff --git a/indra/newview/skins/alchemy/colors.xml b/indra/newview/skins/alchemy/colors.xml index fd72faa3f24bde3049adec7f70f701ab56dce829..ac16fb8113a959ea9f16f43749ef701ca0596209 100644 --- a/indra/newview/skins/alchemy/colors.xml +++ b/indra/newview/skins/alchemy/colors.xml @@ -1139,9 +1139,6 @@ <color name="StatBarMeanBarColor" reference="Red_80" /> - <color - name="ProfileOnlineIndicatorColor" - reference="Green" /> <color name="FriendChatColor" reference="White" /> diff --git a/indra/newview/skins/alchemy/skin_settings.xml b/indra/newview/skins/alchemy/skin_settings.xml index 1f56287b50d1684ef534e7fe8e54126780c124c1..03ac8fb0eca54393fbbea459181a0de586e45e0e 100644 --- a/indra/newview/skins/alchemy/skin_settings.xml +++ b/indra/newview/skins/alchemy/skin_settings.xml @@ -1,20 +1,7 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="llsd.xsd"> <map> - <key>LegacyProfile</key> - <map> - <key>Comment</key> - <string>Use Legacy Profiles rather than standard</string> - <key>Persist</key> - <integer>0</integer> - <key>HideFromEditor</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <boolean>0</boolean> - </map> <key>LegacyNotificationWell</key> <map> <key>Comment</key> diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index c93686df3d9614c09e2718798c353f3f0ac2856a..db03b869897bc89ec65ff828e3d71b3ca9d17f1e 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -1039,11 +1039,7 @@ name="PanelNotificationListItem" value="0.3 0.3 0.3 .3" /> - <color - name="ProfileOnlineIndicatorColor" - reference="Green" /> - - <!-- dildo profiles --> + <!-- profiles --> <color name="StatusUserOnline" reference="White" /> diff --git a/indra/newview/skins/default/skin_settings.xml b/indra/newview/skins/default/skin_settings.xml index 1f56287b50d1684ef534e7fe8e54126780c124c1..03ac8fb0eca54393fbbea459181a0de586e45e0e 100644 --- a/indra/newview/skins/default/skin_settings.xml +++ b/indra/newview/skins/default/skin_settings.xml @@ -1,20 +1,7 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="llsd.xsd"> <map> - <key>LegacyProfile</key> - <map> - <key>Comment</key> - <string>Use Legacy Profiles rather than standard</string> - <key>Persist</key> - <integer>0</integer> - <key>HideFromEditor</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <boolean>0</boolean> - </map> <key>LegacyNotificationWell</key> <map> <key>Comment</key> diff --git a/indra/newview/skins/default/textures/icon_group.png b/indra/newview/skins/default/textures/icon_group.png deleted file mode 100644 index 4c206fd883470dabb2235e6e44fb26dd4cd87fce..0000000000000000000000000000000000000000 Binary files a/indra/newview/skins/default/textures/icon_group.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/icon_group.tga b/indra/newview/skins/default/textures/icon_group.tga new file mode 100644 index 0000000000000000000000000000000000000000..79cd71689d0b982cc016cfe685e605098dfc8f67 Binary files /dev/null and b/indra/newview/skins/default/textures/icon_group.tga differ diff --git a/indra/newview/skins/default/xui/en/floater_profile_legacy.xml b/indra/newview/skins/default/xui/en/floater_profile_legacy.xml deleted file mode 100644 index 2a896d10796abe463d06208dd50d4cb6859f77dc..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/floater_profile_legacy.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - positioning="cascading" - can_close="true" - can_resize="true" - height="580" - min_height="350" - min_width="260" - layout="topleft" - name="floater_profile_legacy" - save_rect="true" - title="PROFILE" - width="370"> - <panel - class="panel_profile_legacy_sidetray" - name="panel_profile_legacy_sidetray" - filename="panel_profile_legacy_sidetray.xml" - label="Profile" - font="SansSerifBold" - follows="all" - layout="topleft" - min_height="350" - left="1" - right="-1" - top="0" - bottom="-8"/> -</floater> diff --git a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml b/indra/newview/skins/default/xui/en/menu_profile_legacy.xml deleted file mode 100644 index 93724bbca1a0e59e67f2f1151d08045ddfd660c1..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml +++ /dev/null @@ -1,135 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<toggleable_menu - name="menu_profile_legacy" - left="0" bottom="0" visible="false" - mouse_opaque="false"> - <menu_item_call - label="Open Webprofile..." - name="webprofile"> - <menu_item_call.on_click - function="Profile.Action" - parameter="webprofile"/> - </menu_item_call> - <menu_item_separator/> - <!--<menu - label="Upload profile image" - layout="topleft" - name="upload_image_menu"> - <menu_item_call - label="Second Life..." - name="upload_second_life"> - <menu_item_call.on_click - function="Profile.Action" - parameter="upload_sl"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_upload_pic" /> - </menu_item_call> - <menu_item_call - label="First Life..." - name="upload_first_life"> - <menu_item_call.on_click - function="Profile.Action" - parameter="upload_fl"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_upload_pic" /> - </menu_item_call> - </menu>--> - <menu_item_call - label="Share..." - name="share"> - <menu_item_call.on_click - function="Profile.Action" - parameter="share"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_share" /> - </menu_item_call> - <menu_item_call - label="Call Avatar..." - name="call"> - <menu_item_call.on_click - function="Profile.Action" - parameter="call"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_has_telefono" /> - </menu_item_call> - <menu_item_call - label="Offer teleport..." - name="teleport"> - <menu_item_call.on_click - function="Profile.Action" - parameter="teleport"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_has_teleport" /> - </menu_item_call> - <menu_item_call - label="Request teleport..." - name="request_teleport"> - <menu_item_call.on_click - function="Profile.Action" - parameter="req_teleport"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_has_teleport" /> - </menu_item_call> - <menu_item_call - label="Show on map..." - name="map"> - <menu_item_call.on_click - function="Profile.Action" - parameter="map"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_has_map" /> - </menu_item_call> - <menu_item_call - label="Pay..." - name="pay"> - <menu_item_call.on_click - function="Profile.Action" - parameter="pay"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_has_pay" /> - </menu_item_call> - <menu_item_call - label="Report Abuse..." - name="report_abuse"> - <menu_item_call.on_click - function="Profile.Action" - parameter="report_abuse"/> - <menu_item_call.on_enable - function="Profile.Enable" - parameter="can_drama" /> - </menu_item_call> - <menu_item_separator /> - <menu_item_call - label="Copy Name" - name="Copy Name"> - <menu_item_call.on_click - function="Avatar.CopyData" - parameter="account_name"/> - <menu_item_call.on_enable - function="RLV.CanShowName" /> - </menu_item_call> - <menu_item_call - label="Copy SLurl" - name="Copy SLurl"> - <menu_item_call.on_click - function="Avatar.CopyData" - parameter="slurl"/> - <menu_item_call.on_enable - function="RLV.CanShowName" /> - </menu_item_call> - <menu_item_call - label="Copy UUID" - name="Copy ID"> - <menu_item_call.on_click - function="Avatar.CopyData" - parameter="id"/> - </menu_item_call> -</toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index e3fd1cd5a1fab2799f387eada4da0a9ffdc88a7e..0febf62b4355e3b2f7dabb09bf345bbe73b31934 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -38,28 +38,15 @@ name="auto_renew_off"> Disabled </panel.string> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back_btn" - left="10" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> <text follows="top|left|right" font="SansSerifHugeBold" height="26" layout="topleft" - left_pad="4" + left="12" name="title" text_color="LtGray" - top="0" + top="2" value="Classified Info" use_ellipses="true" width="275" /> @@ -420,7 +407,7 @@ height="23" label="Teleport" layout="topleft" - left="0" + left="2" name="teleport_btn" top="0" width="101" /> @@ -443,24 +430,6 @@ top="0" width="100" /> </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="edit_btn_lp" - auto_resize="true" - width="101"> - <button - follows="bottom|left|right" - height="23" - label="Edit" - layout="topleft" - name="edit_btn" - top="0" - width="101" /> - </layout_panel> </layout_stack> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml deleted file mode 100644 index 39f1817705dfece84146b65b9b4c6e3aa55afa16..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ /dev/null @@ -1,238 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - background_visible="true" - bevel_style="in" - follows="left|top|right|bottom" - height="569" - label="Edit Pick" - layout="topleft" - left="0" - min_height="350" - name="panel_edit_pick" - help_topic="profile_edit_pick" - top="0" - width="333"> - <panel.string - name="location_notice"> - (will update after save) - </panel.string> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back_btn" - left="10" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> - <text - type="string" - length="1" - follows="top" - font="SansSerifHugeBold" - height="26" - layout="topleft" - left_pad="4" - name="title" - text_color="LtGray" - top="2" - width="250"> - Edit Pick - </text> - <scroll_container - color="PanelDefaultBackgroundColor" - follows="all" - height="502" - layout="topleft" - left="8" - top_pad="10" - name="profile_scroll" - opaque="true" - width="312"> - <panel - name="scroll_content_panel" - follows="left|top|right" - min_height="300" - layout="topleft" - top="0" - background_visible="false" - height="500" - left="0" - width="285"> - <texture_picker - fallback_image="default_land_picture.j2c" - follows="left|top|right" - height="197" - width="272" - layout="topleft" - no_commit_on_selection="true" - top="10" - left="11" - name="pick_snapshot" /> - <icon - height="197" - image_name="spacer24.tga" - layout="topleft" - name="edit_icon" - label="" - tool_tip="Click to select an image" - top="10" - left="11" - width="286" /> - <text - type="string" - length="1" - follows="left|top|right" - height="15" - font="SansSerifSmall" - font.style="BOLD" - layout="topleft" - left="10" - top="215" - name="Name:" - text_color="white" - width="280"> - Title: - </text> - <line_editor - follows="left|top|right" - font="SansSerif" - height="20" - layout="topleft" - left="10" - top_pad="2" - max_length_bytes="63" - name="pick_name" - width="273" /> - <text - type="string" - length="1" - follows="left|top|right" - height="15" - font="SansSerifSmall" - font.style="BOLD" - layout="topleft" - left="10" - top_pad="20" - name="description_label" - text_color="white" - width="280"> - Description: - </text> - <text_editor - follows="left|top|right" - height="100" - width="273" - hide_scrollbar="false" - layout="topleft" - left="10" - top_pad="2" - max_length="1023" - name="pick_desc" - spellcheck="true" - word_wrap="true" - show_emoji_helper="true" /> - <text - type="string" - length="1" - font="SansSerifSmall" - font.style="BOLD" - follows="left|top|right" - height="15" - layout="topleft" - left="10" - name="location_label" - text_color="white" - top_pad="20" - width="280"> - Location: - </text> - <text - type="string" - length="1" - follows="left|top|right" - height="50" - layout="topleft" - left="10" - name="pick_location" - top_pad="2" - width="280" - word_wrap="true"> - loading... - </text> - <button - follows="left|top" - height="23" - label="Set to Current Location" - layout="topleft" - left="8" - top_pad="0" - name="set_to_curr_location_btn" - width="200" /> - </panel> - </scroll_container> - <panel - follows="left|right|bottom" - height="23" - label="bottom_panel" - layout="topleft" - left="8" - name="bottom_panel" - top_pad="5" - width="315"> - - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - name="layout_stack1" - left="0" - orientation="horizontal" - top_pad="0" - width="313"> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="topleft" - left="0" - name="layout_panel1" - auto_resize="true" - width="150"> - <button - follows="bottom|left|right" - height="23" - label="Save Pick" - layout="topleft" - name="save_changes_btn" - top="0" - left="1" - width="149" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="topleft" - left_pad="4" - name="layout_panel2" - auto_resize="true" - width="146"> - <button - follows="bottom|left|right" - height="23" - label="Cancel" - layout="topleft" - name="cancel_btn" - top="0" - left="1" - width="145" /> - </layout_panel> - </layout_stack> - - </panel> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml deleted file mode 100644 index 06ac5450355ecd17dfee5382f556351dfcd38590..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_pick_info.xml +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - background_visible="true" - follows="all" - height="570" - layout="topleft" - left="0" - min_height="350" - name="panel_pick_info" - help_topic="profile_pick_info" - top="0" - width="333"> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back_btn" - left="10" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> - <text - follows="top|left|right" - font="SansSerifHugeBold" - height="26" - layout="topleft" - left_pad="4" - name="title" - text_color="LtGray" - top="2" - value="Pick Info" - use_ellipses="true" - width="275" /> - <scroll_container - color="PanelDefaultBackgroundColor" - opaque="true" - follows="all" - height="503" - layout="topleft" - left="8" - top_pad="10" - name="profile_scroll" - width="312"> - <panel - name="scroll_content_panel" - follows="left|top|right" - min_height="300" - layout="topleft" - top="0" - background_visible="false" - height="400" - left="0" - width="285"> - <texture_picker - fallback_image="default_land_picture.j2c" - enabled="false" - follows="left|top|right" - height="197" - layout="topleft" - left="11" - name="pick_snapshot" - top="10" - width="272" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top|right" - h_pad="0" - height="35" - width="280" - layout="topleft" - font="SansSerifBig" - font.style="BOLD" - left="10" - top_pad="10" - name="pick_name" - read_only="true" - text_color="white" - v_pad="0" - value="[name]" - use_ellipses="true" /> - <text_editor - allow_scroll="false" - bg_visible="false" - follows="left|top|right" - h_pad="0" - height="25" - layout="topleft" - left="10" - name="pick_location" - read_only="true" - width="280" - word_wrap="true" - v_pad="0" - value="[loading...]" /> - <text_editor - bg_readonly_color="DkGray2" - follows="all" - height="100" - width="280" - parse_urls="true" - layout="topleft" - left="10" - top_pad="2" - max_length="1023" - name="pick_desc" - read_only="true" - text_readonly_color="white" - value="[description]" - wrap="true" /> - </panel> - </scroll_container> - <panel - follows="left|right|bottom" - height="23" - layout="topleft" - top_pad="5" - left="8" - name="buttons"> - - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - name="layout_stack1" - left="0" - orientation="horizontal" - top_pad="0" - width="312"> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left="0" - name="layout_panel1" - auto_resize="true" - width="101"> - <button - follows="bottom|left|right" - height="23" - label="Teleport" - layout="topleft" - name="teleport_btn" - top="0" - width="101" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="show_on_map_btn_lp" - auto_resize="true" - width="100"> - <button - follows="bottom|left|right" - height="23" - label="Map" - layout="topleft" - name="show_on_map_btn" - top_pad="0" - width="100" /> - </layout_panel> - - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="edit_btn_lp" - auto_resize="true" - width="101"> - <button - follows="bottom|left|right" - height="23" - label="Edit" - layout="topleft" - name="edit_btn" - top_pad="0" - width="101" /> - </layout_panel> - </layout_stack> - </panel> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_firstlife.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_firstlife.xml deleted file mode 100644 index 8e32d3e70191945d8b61f5506f63186aa9ea727f..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_firstlife.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - label="First Life" - height="360" - width="304" - name="avatar_firstlife_tab"> - <panel - name="avatar_info_top" - follows="top|left|right" - top="0" - left="0" - height="129" - width="304" - layout="topleft"> - <texture_picker - default_image_name="Generic_Person_Large" - fallback_image="Generic_Person_Large" - follows="left|top" - height="143" - label="" - layout="topleft" - left="5" - name="fl_profile_pic" - no_commit_on_selection="true" - tool_tip="Click to choose a picture" - top="6" - width="120" /> - </panel> - <text_editor - type="string" - follows="all" - left="3" - height="200" - layout="topleft" - max_length="65000" - name="fl_about" - top="134" - right="-4" - bg_readonly_color="DkGray2" - text_readonly_color="White" - commit_on_focus_lost="true" - word_wrap="true" - show_emoji_helper="true" /> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_group_list_item.xml deleted file mode 100644 index ed0b4a8825ed949560b73303ee90184e9eebd7c3..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_group_list_item.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - bevel_style="none" - follows="top|left|right" - height="85" - layout="topleft" - left="0" - name="panel_group_item" - top="0" - width="313"> - <icon - follows="all" - height="85" - image_name="ListItem_Over" - right="-2" - mouse_opaque="false" - name="hovered_icon" - top="1" - scale_image="true" - visible="false" - width="308"/> - <icon - follows="all" - height="85" - image_name="ListItem_Select" - right="-2" - mouse_opaque="false" - name="selected_icon" - top="1" - scale_image="true" - visible="false" - width="308"/> - <texture_picker - allow_no_texture="true" - fallback_image="Generic_Group_Large" - enabled="false" - follows="left|top" - height="80" - layout="topleft" - left="10" - mouse_opaque="false" - name="picture" - tab_stop="false" - top="10" - top_pad="10" - width="90" /> - <text - follows="top|left|right" - font="SansSerifSmall" - height="15" - layout="topleft" - left="110" - name="name" - text_color="white" - top="9" - use_ellipses="true" - width="193" - word_wrap="false" /> - <expandable_text - follows="top|left|right" - font="SansSerifSmall" - height="55" - layout="topleft" - left="103" - name="description" - textbox.max_length="1024" - textbox.show_context_menu="false" - textbox.word_wrap="true" - top_pad="0" - width="178" /> - <button - follows="right" - height="20" - image_overlay="ForwardArrow_Off" - layout="topleft" - left_pad="5" - right="-8" - name="info_chevron" - top_delta="24" - width="20" /> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_groups.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_groups.xml deleted file mode 100644 index b09eaa02455a50b3f59ce5087bfb0b54ff63c22e..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_groups.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - bg_opaque_color="PanelDefaultBackgroundColor" - background_visible="true" - background_opaque="true" - follows="all" - height="360" - label="Groups" - layout="topleft" - left="0" - name="panel_profile_groups" - top_pad="0" - width="304"> - <text - type="string" - follows="all" - height="35" - layout="topleft" - left="6" - right="-6" - name="groups_panel_text" - wrap="true" - top="10"> - No Groups - </text> - <flat_list_view - color="PanelDefaultBackgroundColor" - follows="all" - layout="topleft" - left="0" - right="-1" - name="groups_detail_list" - opaque="true" - top="0" - height="360" /> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_interests.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_interests.xml deleted file mode 100644 index a99e004b599838c74ea628b56ef6f4782972eebe..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_interests.xml +++ /dev/null @@ -1,254 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - label="Interests" - height="360" - width="304" - name="avatar_interests_tab"> - <text - font="SansSerifSmall" - text_color="White_50" - width="190" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - name="i_want_label" - top="2"> - I want to: - </text> - <check_box - height="16" - initial_value="false" - label="Build" - layout="topleft" - top_pad="4" - left="25" - name="wanna_build" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Explore" - layout="topleft" - top_delta="0" - left_pad="4" - name="wanna_explore" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Meet" - layout="topleft" - top_pad="4" - left="25" - name="wanna_yiff" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Be Hired" - layout="topleft" - top_delta="0" - left_pad="4" - name="wanna_work" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Group" - layout="topleft" - top_pad="4" - left="25" - name="wanna_group" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Buy" - layout="topleft" - top_delta="0" - left_pad="4" - name="wanna_buy" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Sell" - layout="topleft" - top_pad="4" - left="25" - name="wanna_sell" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Hire" - layout="topleft" - top_delta="0" - left_pad="4" - name="wanna_hire" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <line_editor - top_pad="4" - follows="left|top|right" - height="20" - left="25" - text_pad_left="5" - name="wanna_something" - right="-40"> - <line_editor.commit_callback - function="Profile.CommitInterest" /> - </line_editor> - - <text - font="SansSerifSmall" - text_color="White_50" - width="190" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - name="skills_label" - top_pad="8"> - Skills: - </text> - <check_box - height="16" - initial_value="false" - label="Textures" - layout="topleft" - top_pad="4" - left="25" - name="can_texture" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Architecture" - layout="topleft" - top_delta="0" - left_pad="4" - name="can_architect" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Modeling" - layout="topleft" - top_pad="4" - left="25" - name="can_model" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Event Planning" - layout="topleft" - top_delta="0" - left_pad="4" - name="can_event" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Scripting" - layout="topleft" - top_pad="4" - left="25" - name="can_script" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Custom Characters" - layout="topleft" - top_delta="0" - left_pad="4" - name="can_characters" - width="140"> - <check_box.commit_callback - function="Profile.CommitInterest" /> - </check_box> - <line_editor - top_pad="4" - follows="left|top|right" - height="20" - left="25" - text_pad_left="5" - name="can_something" - right="-40"> - <line_editor.commit_callback - function="Profile.CommitInterest" /> - </line_editor> - <text - top_pad="8" - font="SansSerifSmall" - text_color="White_50" - width="190" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - name="language_label" > - Languages: - </text> - <line_editor - top_pad="4" - follows="left|top|right" - height="20" - left="25" - text_pad_left="5" - name="languages" - right="-40"> - <line_editor.commit_callback - function="Profile.CommitInterest" /> - </line_editor> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_notes.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_notes.xml deleted file mode 100644 index 295e001f138c3bb28006b30422e2f745694aaaa8..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_notes.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - label="Notes" - height="360" - width="304" - name="avatar_notes_tab"> - <text - font="SansSerifSmall" - text_color="White_50" - width="190" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - name="notes_label" - top="2"> - Private notes: - </text> - <text_editor - type="string" - follows="all" - left="3" - height="320" - layout="topleft" - max_length="65530" - name="notes" - top_pad="4" - right="-4" - bg_readonly_color="DkGray2" - text_readonly_color="White" - commit_on_focus_lost="true" - word_wrap="true" - show_emoji_helper="true" /> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_picks.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_picks.xml deleted file mode 100644 index 3cd7d825d781e3e66f4581e4939d8ab878c56131..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_picks.xml +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - bg_opaque_color="PanelDefaultBackgroundColor" - background_visible="true" - background_opaque="true" - follows="all" - height="360" - label="Picks" - layout="topleft" - left="0" - name="panel_profile_picks" - top="0" - width="304"> - <text - type="string" - follows="all" - height="35" - layout="topleft" - left="6" - right="-6" - name="picks_panel_text" - wrap="true" - top="10"> - No Picks - </text> - <accordion - fit_parent="true" - follows="all" - height="332" - layout="topleft" - left="0" - right="-1" - name="accordion" - top="0" - single_expansion="true"> - <accordion_tab - layout="topleft" - height="101" - min_height="150" - name="tab_picks" - title="Picks" - visible="true"> - <flat_list_view - color="PanelDefaultBackgroundColor" - follows="all" - layout="topleft" - left="0" - name="picks_list" - opaque="true" - top="0" - width="313" /> - </accordion_tab> - <accordion_tab - layout="topleft" - height="101" - name="tab_classifieds" - title="Classifieds" - visible="true"> - <flat_list_view - color="PanelDefaultBackgroundColor" - follows="all" - layout="topleft" - left="0" - name="classifieds_list" - opaque="true" - top="0" - width="313" /> - </accordion_tab> - </accordion> - <panel - bg_opaque_color="PanelDefaultBackgroundColor" - background_visible="true" - background_opaque="true" - follows="bottom|left|right" - layout="topleft" - left="0" - height="30" - name="buttons_cucks" - top_pad="0" - width="304"> - <layout_stack - follows="bottom|left|right" - height="28" - layout="topleft" - left="2" - name="buttons_cucks_ls" - orientation="horizontal" - top="0" - width="304"> - <layout_panel - follows="bottom|left|right" - height="28" - layout="topleft" - left="0" - name="info_btn_lp" - auto_resize="true" - top="0" - width="95"> - <button - enabled="false" - follows="top|left|right" - height="23" - label="Info" - layout="topleft" - name="info_btn" - tab_stop="false" - tool_tip="Show pick information" - width="95" /> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="28" - layout="bottomleft" - left_pad="2" - name="teleport_btn_lp" - auto_resize="true" - width="117"> - <button - enabled="false" - follows="top|left|right" - height="23" - label="Teleport" - layout="topleft" - name="teleport_btn" - tab_stop="false" - tool_tip="Teleport to the corresponding area" - width="117" /> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="28" - layout="bottomleft" - name="show_on_map_btn_lp" - auto_resize="true" - left_pad="2" - width="90"> - <button - enabled="false" - follows="top|left|right" - height="23" - label="Map" - layout="topleft" - name="show_on_map_btn" - tab_stop="false" - tool_tip="Show the corresponding area on the World Map" - width="88" /> - </layout_panel> - </layout_stack> - </panel> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_secondlife.xml deleted file mode 100644 index 13560cd0f10c755a59075e040c7d2c6ab7318f48..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_secondlife.xml +++ /dev/null @@ -1,308 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="all" - label="Second Life" - height="360" - width="304" - class="panel_avatar_secondlife" - name="avatar_secondlife_tab"> - <layout_stack - follows="all" - animate="false" - top="0" - height="360" - left="0" - width="304" - layout="topleft" - orientation="vertical" - show_drag_handle="false"> - <layout_panel - name="avatar_info_top" - follows="top|left|right" - top="0" - left="0" - height="125" - right="-1" - auto_resize="false" - layout="topleft"> - <texture_picker - default_image_name="Generic_Person_Large" - fallback_image="Generic_Person_Large" - follows="left|top" - height="143" - label="" - layout="topleft" - left="5" - name="sl_profile_pic" - no_commit_on_selection="true" - tool_tip="Click to choose a picture" - top="0" - width="120" /> - <text - font="SansSerifSmall" - text_color="White_50" - width="87" - follows="top|left" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="129" - name="rezday_label" - top_delta="0"> - Born: - </text> - <icon - height="16" - width="16" - visible="false" - image_name="Cake" - tool_tip="Happy rezday" - mouse_opaque="true" - name="cake" - left_pad="2" /> - <text - font="SansSerifSmall" - text_color="ProfileOnlineIndicatorColor" - width="57" - follows="right|top" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - right="-15" - name="online" - top_delta="0" > - Online - </text> - <icon - follows="right|top" - height="14" - visible="false" - image_name="AccountLevel_Internal" - layout="topleft" - right="-1" - top_delta="0" - mouse_opaque="false" - name="account_type_internal" - width="14" /> - <icon - follows="right|top" - height="14" - visible="false" - image_name="AccountLevel_Premium" - layout="topleft" - right="-1" - top_delta="0" - mouse_opaque="false" - name="account_type_premium" - width="14" /> - <icon - follows="right|top" - height="14" - visible="false" - image_name="AccountLevel_Plus" - layout="topleft" - right="-1" - top_delta="0" - mouse_opaque="false" - name="account_type_plus" - width="14" /> - <text - font="SansSerifSmall" - text_color="White_50" - width="175" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="129" - name="rezday" - top_pad="0" > - (Unknown) - </text> - <text - font="SansSerifSmall" - text_color="White_50" - width="175" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="48" - length="1" - left_delta="0" - name="account_info" - top_pad="2" /> - <text - font="SansSerifSmall" - text_color="White_50" - width="175" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left_delta="0" - name="partner_label" - top_pad="2"> - Partner: - </text> - <text - font="SansSerifSmall" - text_color="White_50" - width="175" - follows="top|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left_delta="0" - name="partner_info" - top_pad="2"> - secondlife:///app/agent/00000000-0000-0000-0000-000000000000/inspect - </text> - </layout_panel> - <layout_panel - name="avatar_desc" - follows="top|left|right" - top_pad="1" - left="0" - height="125" - width="304" - auto_resize="true" - layout="topleft"> - <text_editor - type="string" - follows="all" - left="3" - layout="topleft" - max_length="65000" - name="sl_about" - top="0" - bottom="-20" - right="-4" - bg_readonly_color="DkGray2" - text_readonly_color="White" - commit_on_focus_lost="true" - word_wrap="true" - show_emoji_helper="true" /> - <text - font="SansSerifSmall" - text_color="White_50" - follows="bottom|left|right" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - right="-4" - name="www" - top_pad="2" /> - <line_editor - top_delta="-2" - follows="left|bottom|right" - layout="topleft" - height="20" - max_length_chars="254" - left="2" - right="-4" - text_pad_left="5" - tool_tip="Website link" - name="www_edit"> - <line_editor.commit_callback - function="Profile.CommitProperties" /> - </line_editor> - </layout_panel> - <layout_panel - visible="true" - name="avatar_perm" - follows="top|left|right" - top_pad="1" - left="0" - height="74" - width="304" - auto_resize="false" - layout="topleft"> - <text - font="SansSerifSmall" - text_color="White_50" - width="190" - follows="top|left" - layout="topleft" - mouse_opaque="false" - type="string" - height="16" - length="1" - left="3" - name="permissions_label" - top_pad="2"> - Allow this avatar to: - </text> - <check_box - height="16" - initial_value="false" - label="See when I am online" - layout="topleft" - top_pad="4" - left="5" - name="allow_show_online" - width="150"> - <check_box.commit_callback - function="Profile.CommitRights" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Find me on the world map" - layout="topleft" - top_pad="2" - name="allow_mapping" - width="150"> - <check_box.commit_callback - function="Profile.CommitRights" /> - </check_box> - <check_box - height="16" - initial_value="false" - label="Edit, delete, or take my objects" - layout="topleft" - top_pad="2" - name="allow_object_perms" - width="150"> - <check_box.commit_callback - function="Profile.CommitModifyObjectRights" /> - </check_box> - </layout_panel> - <layout_panel - visible="false" - name="avatar_in_search" - follows="top|left|right" - top_pad="1" - left="0" - height="18" - width="304" - auto_resize="false" - layout="topleft"> - <check_box - height="16" - initial_value="true" - label="Show in search" - layout="topleft" - top_pad="0" - left="5" - name="allow_publish" - width="150"> - <check_box.commit_callback - function="Profile.CommitProperties" /> - </check_box> - </layout_panel> - </layout_stack> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile_legacy_sidetray.xml b/indra/newview/skins/default/xui/en/panel_profile_legacy_sidetray.xml deleted file mode 100644 index 8d4a3a2e504acf80ff2ace8a320d6f6e3e3db52f..0000000000000000000000000000000000000000 --- a/indra/newview/skins/default/xui/en/panel_profile_legacy_sidetray.xml +++ /dev/null @@ -1,311 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - bg_opaque_color="PanelDefaultBackgroundColor" - background_opaque="true" - background_visible="true" - follows="all" - height="570" - label="Profile" - layout="topleft" - min_height="350" - left="0" - top="20" - name="Avatar Profile" - width="313"> - <panel.string - name="account_info_fmt"> -[ACCOUNT_TYPE] -[PAYMENT_INFO] -[AGE_VERIFIED] - </panel.string> - <panel.string - name="age_verified"> -Age Verified - </panel.string> - <panel.string - name="rezday_fmt"> -[REZDAY] ([AGE]) - </panel.string> - <panel.string - name="add_friend"> -Add Friend - </panel.string> - <panel.string - name="remove_friend"> -Remove Friend - </panel.string> - <panel - name="avatar_info_top" - bg_opaque_color="PanelDefaultBackgroundColor" - background_visible="true" - background_opaque="true" - follows="top|left|right" - top="0" - left="0" - height="29" - width="313" - layout="topleft"> - <button - follows="top|left" - height="24" - image_hover_unselected="BackButton_Over" - image_pressed="BackButton_Press" - image_unselected="BackButton_Off" - layout="topleft" - name="back" - left="7" - tab_stop="false" - top="2" - width="30" - use_draw_context_alpha="false" /> - <text_editor - allow_scroll="false" - bg_visible="false" - read_only="true" - layout="topleft" - name="avatar_name" - v_pad="0" - value="(Loading...)" - font="SansSerifHugeBold" - h_pad="0" - height="26" - left_pad="8" - text_color="LtGray" - top="1" - use_ellipses="true" - width="268" - follows="top|left|right" - word_wrap="false" - mouse_opaque="false"/> - <loading_indicator - height="25" - follows="top|right" - layout="topleft" - left_pad="-32" - name="progress_indicator" - top_delta="1" - width="25" /> - </panel> - <layout_stack - name="layout" - orientation="vertical" - follows="all" - left="6" - top_pad="0" - height="506" - width="302" - border_size="0"> - <layout_panel - bg_opaque_color="PanelDefaultBackgroundColor" - background_visible="true" - background_opaque="true" - name="avatar_accordions" - follows="all" - layout="topleft" - auto_resize="true" - user_resize="true" - height="513" - width="313"> - <accordion - left="0" - top="0" - single_expansion="true" - fit_parent="true" - follows="all" - layout="topleft" - name="avatar_accordion" - height="513" - width="313"> - <accordion_tab - expanded="true" - layout="topleft" - name="avatar_secondlife_tab" - title="Second Life" - fit_panel="true"> - <panel - border="false" - filename="panel_profile_legacy_secondlife.xml" - layout="topleft" - left="0" - follows="all" - name="avatar_secondlife_tab_panel" - top="0" /> - </accordion_tab> - <accordion_tab - expanded="false" - layout="topleft" - name="avatar_groups_tab" - title="Groups" - fit_panel="true"> - <panel - border="false" - class="panel_profile_legacy_groups" - filename="panel_profile_legacy_groups.xml" - follows="all" - layout="topleft" - left="0" - name="avatar_groups_tab_panel" - top="0" /> - </accordion_tab> - <accordion_tab - expanded="false" - layout="topleft" - name="avatar_picks_tab" - title="Picks" - fit_panel="true"> - <panel - border="false" - class="panel_profile_legacy_picks" - filename="panel_profile_legacy_picks.xml" - follows="all" - layout="topleft" - left="0" - name="avatar_picks_tab_panel" - top="0" /> - </accordion_tab> - <accordion_tab - expanded="false" - layout="topleft" - name="avatar_firstlife_tab" - title="First Life" - fit_panel="true"> - <panel - border="false" - filename="panel_profile_legacy_firstlife.xml" - follows="left|top|right" - layout="topleft" - left="0" - name="avatar_firstlife_tab_panel" - top="0" /> - </accordion_tab> - <accordion_tab - expanded="false" - layout="topleft" - name="avatar_notes_tab" - title="Notes" - fit_panel="true"> - <panel - border="false" - filename="panel_profile_legacy_notes.xml" - follows="all" - layout="topleft" - left="0" - name="avatar_notes_tab_panel" - top="0" /> - </accordion_tab> - </accordion> - </layout_panel> - </layout_stack> - - <layout_stack - follows="bottom|left|right" - height="25" - layout="topleft" - name="button_row_ls" - left="6" - orientation="horizontal" - top_pad="5" - width="299"> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left="0" - name="btn_chat_lp" - auto_resize="true" - width="91"> - <button - follows="bottom|left|right" - left="1" - height="23" - name="btn_chat" - label="Chat" - layout="topleft" - tool_tip="Send an instant message" - top="0" - width="90"> - <button.commit_callback - function="Profile.Action" - parameter="chat" /> - </button> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="btn_friend_lp" - auto_resize="true" - width="91"> - <button - follows="bottom|left|right" - left="1" - height="23" - name="btn_friend" - label="Add Friend" - layout="topleft" - top="0" - width="90"> - <button.commit_callback - function="Profile.Action" - parameter="friend" /> - </button> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="btn_block_lp" - auto_resize="true" - width="91"> - <button - follows="bottom|left|right" - left="1" - height="23" - name="btn_block" - label="Block" - layout="topleft" - tool_tip="Block this avatar" - top="0" - width="90"> - <button.commit_callback - function="Profile.Action" - parameter="block" /> - </button> - </layout_panel> - <layout_panel - follows="bottom|left|right" - height="23" - layout="bottomleft" - left_pad="3" - name="btn_menu_lp" - auto_resize="false" - width="30"> - <menu_button - follows="bottom|left|right" - height="23" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="OptionsMenu_Off" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" - menu_filename="menu_profile_legacy.xml" - menu_position="bottomleft" - tool_tip="Actions on this avatar" - layout="topleft" - left="1" - top="0" - name="btn_menu" - width="30" /> - </layout_panel> - </layout_stack> - <drop_target - top="0" - bottom="-1" - left="0" - right="-1" - layout="topleft" - follows="all" - name="drop_target" - mouse_opaque="false" /> -</panel> diff --git a/indra/newview/skins/heretic/colors.xml b/indra/newview/skins/heretic/colors.xml index 19b8501e24888ff799b145df1dae0067da4482a6..f97407cd628562e4a1b51bd195da644ac8157b60 100644 --- a/indra/newview/skins/heretic/colors.xml +++ b/indra/newview/skins/heretic/colors.xml @@ -1155,9 +1155,6 @@ <color name="StatBarMeanBarColor" reference="Red_80" /> - <color - name="ProfileOnlineIndicatorColor" - reference="Green" /> <color name="MusicTickerGridColor" reference="White_50"/> diff --git a/indra/newview/skins/heretic/skin_settings.xml b/indra/newview/skins/heretic/skin_settings.xml index d0d8c5c8f85c796960cef1e71cbcc31cf4f1b557..abf6124a13db7e27ea9c7de849b46e638db73165 100644 --- a/indra/newview/skins/heretic/skin_settings.xml +++ b/indra/newview/skins/heretic/skin_settings.xml @@ -2,19 +2,6 @@ <llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="llsd.xsd"> <map> - <key>LegacyProfile</key> - <map> - <key>Comment</key> - <string>Use Legacy Profiles rather than standard</string> - <key>Persist</key> - <integer>0</integer> - <key>HideFromEditor</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <boolean>0</boolean> - </map> <key>LegacyNotificationWell</key> <map> <key>Comment</key>