From 993136fe347075b71f649ec70ce1a463afb073f8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Oct 2010 08:43:16 -0400 Subject: Initial hooks for web profiles support --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llavataractions.cpp | 18 ++++++++++++++++++ indra/newview/llpanelprofile.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 742a20a849..a7d3b6436d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3854,6 +3854,17 @@ Value http://search.secondlife.com/viewer/[CATEGORY]?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + WebProfileURL + + Comment + URL for Web Profiles + Persist + 0 + Type + String + Value + http://profiles.secondlife.local/[AGENT_NAME] + HighResSnapshot Comment diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 79b0c63b38..42701bcff9 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -59,6 +59,7 @@ #include "llrecentpeople.h" #include "llsidetray.h" #include "lltrans.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure #include "llviewerregion.h" @@ -314,6 +315,22 @@ void LLAvatarActions::showProfile(const LLUUID& id) params["id"] = id; params["open_tab_name"] = "panel_profile"; + // PROFILES: open in webkit window + std::string first_name,last_name; + if (gCacheName->getName(id,first_name,last_name)) + { + llinfos << "opening web profile for " << first_name << "." << last_name << llendl; + std::string url = gSavedSettings.getString("WebProfileURL"); + LLSD subs; + subs["AGENT_NAME"] = first_name + "." + last_name; + url = LLWeb::expandURLSubstitutions(url,subs); + LLWeb::loadURL(url); + } + else + { + llwarns << "no name info for agent id " << id << llendl; + } +#if 0 //Show own profile if(gAgent.getID() == id) { @@ -324,6 +341,7 @@ void LLAvatarActions::showProfile(const LLUUID& id) { LLSideTray::getInstance()->showPanel("panel_profile_view", params); } +#endif } } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 4e63563979..00191b17bd 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -33,10 +33,34 @@ #include "llcommandhandler.h" #include "llpanelpicks.h" #include "lltabcontainer.h" +#include "llviewercontrol.h" static const std::string PANEL_PICKS = "panel_picks"; static const std::string PANEL_PROFILE = "panel_profile"; +class LLProfileHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 1) return false; + std::string agent_name = params[0]; + llinfos << "Profile, agent_name " << agent_name << llendl; + std::string url = gSavedSettings.getString("WebProfileURL"); + LLSD subs; + subs["AGENT_NAME"] = agent_name; + url = LLWeb::expandURLSubstitutions(url,subs); + LLWeb::loadURL(url); + + return true; + } +}; +LLProfileHandler gProfileHandler; + class LLAgentHandler : public LLCommandHandler { public: -- cgit v1.2.3 From 5ef8545f63221db002d14cdcd1c7bac2e96a5e0a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 18 Oct 2010 18:11:29 -0400 Subject: consolidate generating profile URL, force to lower case --- indra/newview/llavataractions.cpp | 9 ++++----- indra/newview/llpanelprofile.cpp | 15 +++++++++++---- indra/newview/llpanelprofile.h | 2 ++ 3 files changed, 17 insertions(+), 9 deletions(-) mode change 100644 => 100755 indra/newview/llavataractions.cpp mode change 100644 => 100755 indra/newview/llpanelprofile.cpp mode change 100644 => 100755 indra/newview/llpanelprofile.h diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp old mode 100644 new mode 100755 index 42701bcff9..219fca66bd --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -56,6 +56,7 @@ #include "llmutelist.h" #include "llnotificationsutil.h" // for LLNotificationsUtil #include "llpaneloutfitedit.h" +#include "llpanelprofile.h" #include "llrecentpeople.h" #include "llsidetray.h" #include "lltrans.h" @@ -319,11 +320,9 @@ void LLAvatarActions::showProfile(const LLUUID& id) std::string first_name,last_name; if (gCacheName->getName(id,first_name,last_name)) { - llinfos << "opening web profile for " << first_name << "." << last_name << llendl; - std::string url = gSavedSettings.getString("WebProfileURL"); - LLSD subs; - subs["AGENT_NAME"] = first_name + "." + last_name; - url = LLWeb::expandURLSubstitutions(url,subs); + std::string agent_name = first_name + "." + last_name; + llinfos << "opening web profile for " << agent_name << llendl; + std::string url = getProfileURL(agent_name); LLWeb::loadURL(url); } else diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp old mode 100644 new mode 100755 index 00191b17bd..38683ab5f7 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -38,6 +38,16 @@ static const std::string PANEL_PICKS = "panel_picks"; static const std::string PANEL_PROFILE = "panel_profile"; +std::string getProfileURL(const std::string& agent_name) +{ + std::string url = gSavedSettings.getString("WebProfileURL"); + LLSD subs; + subs["AGENT_NAME"] = agent_name; + url = LLWeb::expandURLSubstitutions(url,subs); + LLStringUtil::toLower(url); + return url; +} + class LLProfileHandler : public LLCommandHandler { public: @@ -50,10 +60,7 @@ public: if (params.size() < 1) return false; std::string agent_name = params[0]; llinfos << "Profile, agent_name " << agent_name << llendl; - std::string url = gSavedSettings.getString("WebProfileURL"); - LLSD subs; - subs["AGENT_NAME"] = agent_name; - url = LLWeb::expandURLSubstitutions(url,subs); + std::string url = getProfileURL(agent_name); LLWeb::loadURL(url); return true; diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h old mode 100644 new mode 100755 index 0546c18583..c330a15939 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -33,6 +33,8 @@ class LLTabContainer; +std::string getProfileURL(const std::string& agent_name); + /** * Base class for Profile View and My Profile. */ -- cgit v1.2.3 From dd1b70f712849b7d0c96f0720e28453121b2bf1e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 20 Oct 2010 17:03:36 -0400 Subject: SOCIAL-84, SOCIAL-85 WIP --- indra/newview/llavataractions.cpp | 2 +- indra/newview/llpanelpicks.cpp | 75 ++++++++++++++++++++++++++++++++------- indra/newview/llpanelprofile.cpp | 2 +- 3 files changed, 65 insertions(+), 14 deletions(-) mode change 100644 => 100755 indra/newview/llpanelpicks.cpp diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 219fca66bd..811d07418c 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -323,7 +323,7 @@ void LLAvatarActions::showProfile(const LLUUID& id) std::string agent_name = first_name + "." + last_name; llinfos << "opening web profile for " << agent_name << llendl; std::string url = getProfileURL(agent_name); - LLWeb::loadURL(url); + LLWeb::loadURLInternal(url); } else { diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp old mode 100644 new mode 100755 index 27787ac211..e70c7be728 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -70,6 +70,39 @@ static const std::string CLASSIFIED_NAME("classified_name"); static LLRegisterPanelClassWrapper t_panel_picks("panel_picks"); +class LLPickHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLPickHandler() : LLCommandHandler("pick", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 1) return false; + const std::string verb = params[0]; + + if (verb == "create") + { + // Open "create pick" in side tab. + } + else if (verb == "edit") + { + // How to identify the pick? + llwarns << "how to identify pick?" << llendl; + } + else + { + llwarns << "unknown verb " << verb << llendl; + return false; + } + + return true; + } +}; + +LLPickHandler gPickHandler; + class LLClassifiedHandler : public LLCommandHandler, public LLAvatarPropertiesObserver @@ -80,6 +113,8 @@ public: std::set mClassifiedIds; + std::string mRequestVerb; + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { // handle app/classified/create urls first @@ -107,6 +142,15 @@ public: const std::string verb = params[1].asString(); if (verb == "about") { + mRequestVerb = verb; + mClassifiedIds.insert(classified_id); + LLAvatarPropertiesProcessor::getInstance()->addObserver(LLUUID(), this); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(classified_id); + return true; + } + else if (verb == "edit") + { + mRequestVerb = verb; mClassifiedIds.insert(classified_id); LLAvatarPropertiesProcessor::getInstance()->addObserver(LLUUID(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(classified_id); @@ -128,18 +172,25 @@ public: void openClassified(LLAvatarClassifiedInfo* c_info) { - // open the classified info panel on the Me > Picks sidetray - LLSD params; - params["id"] = c_info->creator_id; - params["open_tab_name"] = "panel_picks"; - params["show_tab_panel"] = "classified_details"; - params["classified_id"] = c_info->classified_id; - params["classified_creator_id"] = c_info->creator_id; - params["classified_snapshot_id"] = c_info->snapshot_id; - params["classified_name"] = c_info->name; - params["classified_desc"] = c_info->description; - params["from_search"] = true; - LLSideTray::getInstance()->showPanel("panel_profile_view", params); + if (mRequestVerb == "about") + { + // open the classified info panel on the Me > Picks sidetray + LLSD params; + params["id"] = c_info->creator_id; + params["open_tab_name"] = "panel_picks"; + params["show_tab_panel"] = "classified_details"; + params["classified_id"] = c_info->classified_id; + params["classified_creator_id"] = c_info->creator_id; + params["classified_snapshot_id"] = c_info->snapshot_id; + params["classified_name"] = c_info->name; + params["classified_desc"] = c_info->description; + params["from_search"] = true; + LLSideTray::getInstance()->showPanel("panel_profile_view", params); + } + else if (mRequestVerb == "edit") + { + llwarns << "edit in progress" << llendl; + } } /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 38683ab5f7..1268c181ad 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -61,7 +61,7 @@ public: std::string agent_name = params[0]; llinfos << "Profile, agent_name " << agent_name << llendl; std::string url = getProfileURL(agent_name); - LLWeb::loadURL(url); + LLWeb::loadURLInternal(url); return true; } -- cgit v1.2.3 From e12ec78127ce3a52931d1b0fe62ff50cdf238960 Mon Sep 17 00:00:00 2001 From: prep linden Date: Thu, 21 Oct 2010 13:26:13 -0400 Subject: secondlife:///app/maptrackavatar/lluid secondlife:///app/sharewithavatar/lluid secondlife:///app/socialcallhandler/lluid <-work in progress --- indra/newview/llfloaterworldmap.cpp | 405 +++++++++++++++++++++--------------- indra/newview/llfloaterworldmap.h | 4 + indra/newview/llviewerinventory.cpp | 32 +++ 3 files changed, 274 insertions(+), 167 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7236894542..d5ebcfab4c 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -72,7 +72,8 @@ #include "llweb.h" #include "llslider.h" #include "message.h" - +#include "llviewerobjectlist.h" +#include "llvoicechannel.h" #include "llwindow.h" // copyTextToClipboard() //--------------------------------------------------------------------------- @@ -106,8 +107,8 @@ class LLWorldMapHandler : public LLCommandHandler { public: // requires trusted browser to trigger - LLWorldMapHandler() : LLCommandHandler("worldmap", UNTRUSTED_THROTTLE) { } - + LLWorldMapHandler() : LLCommandHandler("worldmap", UNTRUSTED_THROTTLE ) { } + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { @@ -117,24 +118,88 @@ public: LLFloaterReg::showInstance("world_map", "center"); return true; } - + // support the secondlife:///app/worldmap/{LOCATION}/{COORDS} SLapp const std::string region_name = LLURI::unescape(params[0].asString()); S32 x = (params.size() > 1) ? params[1].asInteger() : 128; S32 y = (params.size() > 2) ? params[2].asInteger() : 128; S32 z = (params.size() > 3) ? params[3].asInteger() : 0; - + LLFloaterWorldMap::getInstance()->trackURL(region_name, x, y, z); LLFloaterReg::showInstance("world_map", "center"); - + return true; } }; LLWorldMapHandler gWorldMapHandler; +//prep# +// SocialMap handler secondlife:///app/maptrackavatar/id +class LLMapTrackAvatarHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLMapTrackAvatarHandler() : LLCommandHandler("maptrackavatar", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE )) + { + return false; + } + + LLFloaterWorldMap::getInstance()->avatarTrackFromSlapp( id ); + LLFloaterReg::showInstance( "world_map", "center" ); + + return true; + } +}; +LLMapTrackAvatarHandler gMapTrackAvatar; LLFloaterWorldMap* gFloaterWorldMap = NULL; +//prep# call +class LLSocialCallHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLSocialCallHandler() : LLCommandHandler("socialcallhandler", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE )) + { + return false; + } + + //instigate call with this avatar + LLVoiceClient::getInstance()->callUser( id ); + + return true; + } +}; +LLSocialCallHandler gSocialCallHandler; + class LLMapInventoryObserver : public LLInventoryObserver { public: @@ -142,7 +207,7 @@ public: virtual ~LLMapInventoryObserver() {} virtual void changed(U32 mask); }; - + void LLMapInventoryObserver::changed(U32 mask) { // if there's a change we're interested in. @@ -184,16 +249,16 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001" LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) : LLFloater(key), - mInventory(NULL), - mInventoryObserver(NULL), - mFriendObserver(NULL), - mCompletingRegionName(), - mCompletingRegionPos(), - mWaitingForTracker(FALSE), - mIsClosing(FALSE), - mSetToUserPosition(TRUE), - mTrackedLocation(0,0,0), - mTrackedStatus(LLTracker::TRACKING_NOTHING) +mInventory(NULL), +mInventoryObserver(NULL), +mFriendObserver(NULL), +mCompletingRegionName(), +mCompletingRegionPos(), +mWaitingForTracker(FALSE), +mIsClosing(FALSE), +mSetToUserPosition(TRUE), +mTrackedLocation(0,0,0), +mTrackedStatus(LLTracker::TRACKING_NOTHING) { gFloaterWorldMap = this; @@ -210,7 +275,7 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mCommitCallbackRegistrar.add("WMap.ShowAgent", boost::bind(&LLFloaterWorldMap::onShowAgentBtn, this)); mCommitCallbackRegistrar.add("WMap.Clear", boost::bind(&LLFloaterWorldMap::onClearBtn, this)); mCommitCallbackRegistrar.add("WMap.CopySLURL", boost::bind(&LLFloaterWorldMap::onCopySLURL, this)); - + gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterWorldMap::onChangeMaturity, this)); } @@ -223,32 +288,32 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { mPanel = getChild("objects_mapview"); - + LLComboBox *avatar_combo = getChild("friend combo"); avatar_combo->selectFirstItem(); avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) ); avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); - + LLSearchEditor *location_editor = getChild("location"); location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1)); location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this)); getChild("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); - + LLComboBox *landmark_combo = getChild( "landmark combo"); landmark_combo->selectFirstItem(); landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) ); landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); - + mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); getChild("zoom slider")->setValue(LLWorldMapView::sMapScale); - + setDefaultBtn(NULL); - + mZoomTimer.stop(); - + onChangeMaturity(); - + return TRUE; } @@ -257,11 +322,11 @@ LLFloaterWorldMap::~LLFloaterWorldMap() { // All cleaned up by LLView destructor mPanel = NULL; - + // Inventory deletes all observers on shutdown mInventory = NULL; mInventoryObserver = NULL; - + // avatar tracker will delete this for us. mFriendObserver = NULL; @@ -285,13 +350,13 @@ void LLFloaterWorldMap::onClose(bool app_quitting) void LLFloaterWorldMap::onOpen(const LLSD& key) { bool center_on_target = (key.asString() == "center"); - + mIsClosing = FALSE; - + LLWorldMapView* map_panel; map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; map_panel->clearLastClick(); - + { // reset pan on show, so it centers on you again if (!center_on_target) @@ -299,27 +364,27 @@ void LLFloaterWorldMap::onOpen(const LLSD& key) LLWorldMapView::setPan(0, 0, TRUE); } map_panel->updateVisibleBlocks(); - + // Reload items as they may have changed LLWorldMap::getInstance()->reloadItems(); - + // We may already have a bounding box for the regions of the world, // so use that to adjust the view. adjustZoomSliderBounds(); - + // Could be first show //LLFirstUse::useMap(); - + // Start speculative download of landmarks const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id); - + getChild("location")->setFocus( TRUE); gFocusMgr.triggerFocusFlash(); - + buildAvatarIDList(); buildLandmarkIDLists(); - + // If nothing is being tracked, set flag so the user position will be found mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } @@ -356,7 +421,7 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } } - + return LLFloater::handleScrollWheel(x, y, clicks); } @@ -381,7 +446,7 @@ void LLFloaterWorldMap::draw() bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude; getChildView("Go Home")->setEnabled(enable_go_home); - + updateLocation(); LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); @@ -393,7 +458,7 @@ void LLFloaterWorldMap::draw() { getChild("avatar_icon")->setColor( map_track_disabled_color); } - + if (LLTracker::TRACKING_LANDMARK == tracking_status) { getChild("landmark_icon")->setColor( map_track_color); @@ -402,7 +467,7 @@ void LLFloaterWorldMap::draw() { getChild("landmark_icon")->setColor( map_track_disabled_color); } - + if (LLTracker::TRACKING_LOCATION == tracking_status) { getChild("location_icon")->setColor( map_track_color); @@ -422,21 +487,21 @@ void LLFloaterWorldMap::draw() getChild("location_icon")->setColor( map_track_disabled_color); } } - + // check for completion of tracking data if (mWaitingForTracker) { centerOnTarget(TRUE); } - + getChildView("Teleport")->setEnabled((BOOL)tracking_status); -// getChildView("Clear")->setEnabled((BOOL)tracking_status); + // getChildView("Clear")->setEnabled((BOOL)tracking_status); getChildView("Show Destination")->setEnabled((BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); getChildView("copy_slurl")->setEnabled((mSLURL.isValid()) ); - + setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE); - + //RN: snaps to zoom value because interpolation caused jitter in the text rendering if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)getChild("zoom slider")->getValue().asReal()) { @@ -451,7 +516,7 @@ void LLFloaterWorldMap::draw() mCurZoomVal = lerp(mCurZoomVal, (F32)getChild("zoom slider")->getValue().asReal(), interp); F32 map_scale = 256.f*pow(2.f, mCurZoomVal); LLWorldMapView::setScale( map_scale ); - + // Enable/disable checkboxes depending on the zoom level // If above threshold level (i.e. low res) -> Disable all checkboxes // If under threshold level (i.e. high res) -> Enable all checkboxes @@ -477,7 +542,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string& { LLCtrlSelectionInterface *iface = childGetSelectionInterface("friend combo"); if (!iface) return; - + buildAvatarIDList(); if(iface->setCurrentByID(avatar_id) || gAgent.isGodlike()) { @@ -507,7 +572,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) { LLCtrlSelectionInterface *iface = childGetSelectionInterface("landmark combo"); if (!iface) return; - + buildLandmarkIDLists(); BOOL found = FALSE; S32 idx; @@ -519,7 +584,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) break; } } - + if (found && iface->setCurrentByID( landmark_item_id ) ) { LLUUID asset_id = mLandmarkAssetIDList.get( idx ); @@ -528,17 +593,17 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) if (combo) name = combo->getSimple(); mTrackedStatus = LLTracker::TRACKING_LANDMARK; LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID - mLandmarkItemIDList.get( idx ), // itemID - name); // name - + mLandmarkItemIDList.get( idx ), // itemID + name); // name + if( asset_id != sHomeID ) { // start the download process gLandmarkList.getAsset( asset_id); } - + // We have to download both region info and landmark data, so set busy. JC -// getWindow()->incBusyCount(); + // getWindow()->incBusyCount(); } else { @@ -574,10 +639,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) S32 world_y = S32(pos_global.mdV[1] / 256); LLWorldMapMessage::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true); setDefaultBtn(""); - + // clicked on a non-region - turn off coord display enableTeleportCoordsDisplay( false ); - + return; } if (sim_info->isDown()) @@ -588,33 +653,33 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) LLWorldMap::getInstance()->setTrackingInvalid(); LLTracker::stopTracking(NULL); setDefaultBtn(""); - + // clicked on a down region - turn off coord display enableTeleportCoordsDisplay( false ); - + return; } - + std::string sim_name = sim_info->getName(); F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); std::string full_name = llformat("%s (%d, %d, %d)", - sim_name.c_str(), - llround(region_x), - llround(region_y), - llround((F32)pos_global.mdV[VZ])); - + sim_name.c_str(), + llround(region_x), + llround(region_y), + llround((F32)pos_global.mdV[VZ])); + std::string tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; LLTracker::trackLocation(pos_global, full_name, tooltip); LLWorldMap::getInstance()->cancelTracking(); // The floater is taking over the tracking - + LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); updateTeleportCoordsDisplay( coord_pos ); - + // we have a valid region - turn on coord display enableTeleportCoordsDisplay( true ); - + setDefaultBtn("Teleport"); } @@ -631,12 +696,12 @@ void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) { // if we're going to update their value, we should also enable them enableTeleportCoordsDisplay( true ); - + // convert global specified position to a local one F32 region_local_x = (F32)fmod( pos.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_local_y = (F32)fmod( pos.mdV[VY], (F64)REGION_WIDTH_METERS ); F32 region_local_z = (F32)fmod( pos.mdV[VZ], (F64)REGION_WIDTH_METERS ); - + // write in the values childSetValue("teleport_coordinate_x", region_local_x ); childSetValue("teleport_coordinate_y", region_local_y ); @@ -646,16 +711,16 @@ void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) void LLFloaterWorldMap::updateLocation() { bool gotSimName; - + LLTracker::ETrackingStatus status = LLTracker::getTrackingStatus(); - + // These values may get updated by a message, so need to check them every frame // The fields may be changed by the user, so only update them if the data changes LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); if (pos_global.isExactlyZero()) { LLVector3d agentPos = gAgent.getPositionGlobal(); - + // Set to avatar's current postion if nothing is selected if ( status == LLTracker::TRACKING_NOTHING && mSetToUserPosition ) { @@ -665,19 +730,19 @@ void LLFloaterWorldMap::updateLocation() if ( gotSimName ) { mSetToUserPosition = FALSE; - + // Fill out the location field getChild("location")->setValue(agent_sim_name); - + // update the coordinate display with location of avatar in region updateTeleportCoordsDisplay( agentPos ); - + // Figure out where user is // Set the current SLURL mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); } } - + return; // invalid location } std::string sim_name; @@ -699,17 +764,17 @@ void LLFloaterWorldMap::updateLocation() pos_global[2] = 200; } } - + getChild("location")->setValue(sim_name); - + // refresh coordinate display to reflect where user clicked. LLVector3d coord_pos = LLTracker::getTrackedPositionGlobal(); updateTeleportCoordsDisplay( coord_pos ); - + // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) { - mSLURL = LLSLURL(sim_name, pos_global); + mSLURL = LLSLURL(sim_name, pos_global); } else { // Empty SLURL will disable the "Copy SLURL to clipboard" button @@ -736,12 +801,12 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 { // fill in UI based on URL gFloaterWorldMap->getChild("location")->setValue(region_name); - + // Save local coords to highlight position after region global // position is returned. gFloaterWorldMap->mCompletingRegionPos.set( - (F32)x_coord, (F32)y_coord, (F32)z_coord); - + (F32)x_coord, (F32)y_coord, (F32)z_coord); + // pass sim name to combo box gFloaterWorldMap->mCompletingRegionName = region_name; LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name); @@ -813,7 +878,7 @@ void LLFloaterWorldMap::buildAvatarIDList() { LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; - + // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) @@ -821,7 +886,7 @@ void LLFloaterWorldMap::buildAvatarIDList() list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } - + // Get all of the calling cards for avatar that are currently online LLCollectMappableBuddies collector; LLAvatarTracker::instance().applyFunctor(collector); @@ -833,7 +898,7 @@ void LLFloaterWorldMap::buildAvatarIDList() { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } - + list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); list->selectFirstItem(); } @@ -843,7 +908,7 @@ void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) return; - + // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) @@ -851,17 +916,17 @@ void LLFloaterWorldMap::buildLandmarkIDLists() list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } - + mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); - + // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); - + mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); - + LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); @@ -870,20 +935,20 @@ void LLFloaterWorldMap::buildLandmarkIDLists() items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); - + std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); - + list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); - + mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } - + list->selectFirstItem(); } @@ -949,31 +1014,31 @@ void LLFloaterWorldMap::adjustZoomSliderBounds() // Currently (01/26/09), this value allows the whole grid to be visible in a 1024x1024 window. S32 world_width_regions = MAX_VISIBLE_REGIONS; S32 world_height_regions = MAX_VISIBLE_REGIONS; - + // Find how much space we have to display the world LLWorldMapView* map_panel; map_panel = (LLWorldMapView*)mPanel; LLRect view_rect = map_panel->getRect(); - + // View size in pixels S32 view_width = view_rect.getWidth(); S32 view_height = view_rect.getHeight(); - + // Pixels per region to display entire width/height F32 width_pixels_per_region = (F32) view_width / (F32) world_width_regions; F32 height_pixels_per_region = (F32) view_height / (F32) world_height_regions; - + F32 pixels_per_region = llmin(width_pixels_per_region, height_pixels_per_region); - + // Round pixels per region to an even number of slider increments S32 slider_units = llfloor(pixels_per_region / 0.2f); pixels_per_region = slider_units * 0.2f; - + // Make sure the zoom slider can be moved at least a little bit. // Likewise, less than the increment pixels per region is just silly. pixels_per_region = llclamp(pixels_per_region, 1.f, ZOOM_MAX); - + F32 min_power = log(pixels_per_region/256.f)/log(2.f); getChild("zoom slider")->setMinValue(min_power); @@ -997,19 +1062,19 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( ) { return; } - + LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) return; - + LLUUID current_choice = list->getCurrentID(); - + buildLandmarkIDLists(); - + if( current_choice.isNull() || !list->setCurrentByID( current_choice ) ) { LLTracker::stopTracking(NULL); } - + } void LLFloaterWorldMap::onComboTextEntry() @@ -1033,18 +1098,18 @@ void LLFloaterWorldMap::onLandmarkComboCommit() { return; } - + LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) return; - + LLUUID asset_id; LLUUID item_id = list->getCurrentID(); - + LLTracker::stopTracking(NULL); - + //RN: stopTracking() clears current combobox selection, need to reassert it here list->setCurrentByID(item_id); - + if( item_id.isNull() ) { } @@ -1068,7 +1133,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit() trackLandmark( item_id); onShowTargetBtn(); - + // Reset to user postion if nothing is tracked mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } @@ -1080,19 +1145,19 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( ) { return; } - + LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; - + LLUUID current_choice; - + if( LLAvatarTracker::instance().haveTrackingInfo() ) { current_choice = LLAvatarTracker::instance().getAvatarID(); } - + buildAvatarIDList(); - + if( !list->setCurrentByID( current_choice ) || current_choice.isNull() ) { LLTracker::stopTracking(NULL); @@ -1105,10 +1170,10 @@ void LLFloaterWorldMap::onAvatarComboCommit() { return; } - + LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; - + const LLUUID& new_avatar_id = list->getCurrentID(); if (new_avatar_id.notNull()) { @@ -1123,6 +1188,12 @@ void LLFloaterWorldMap::onAvatarComboCommit() mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } } +//prep# +void LLFloaterWorldMap::avatarTrackFromSlapp( const LLUUID& id ) +{ + trackAvatar( id, "av" ); + onShowTargetBtn(); +} void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus ) { @@ -1148,13 +1219,13 @@ void LLFloaterWorldMap::onLocationCommit() { return; } - + clearLocationSelection(FALSE); mCompletingRegionName = ""; mLastRegionName = ""; - + std::string str = getChild("location")->getValue().asString(); - + // Trim any leading and trailing spaces in the search target std::string saved_str = str; LLStringUtil::trim( str ); @@ -1162,7 +1233,7 @@ void LLFloaterWorldMap::onLocationCommit() { // Set the value in the UI if any spaces were removed getChild("location")->setValue(str); } - + LLStringUtil::toLower(str); mCompletingRegionName = str; LLWorldMap::getInstance()->setTrackingCommit(); @@ -1183,13 +1254,13 @@ void LLFloaterWorldMap::onCoordinatesCommit() { return; } - + S32 x_coord = (S32)childGetValue("teleport_coordinate_x").asReal(); S32 y_coord = (S32)childGetValue("teleport_coordinate_y").asReal(); S32 z_coord = (S32)childGetValue("teleport_coordinate_z").asReal(); - + const std::string region_name = childGetValue("location").asString(); - + trackURL( region_name, x_coord, y_coord, z_coord ); } @@ -1225,7 +1296,7 @@ void LLFloaterWorldMap::onCopySLURL() LLSD args; args["SLURL"] = mSLURL.getSLURLString(); - + LLNotificationsUtil::add("CopySLURL", args); } @@ -1246,26 +1317,26 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate) else { // We've got the position finally, so we're no longer busy. JC -// getWindow()->decBusyCount(); + // getWindow()->decBusyCount(); pos_global = LLTracker::getTrackedPositionGlobal() - gAgentCamera.getCameraPositionGlobal(); } } else if(LLWorldMap::getInstance()->isTracking()) { pos_global = LLWorldMap::getInstance()->getTrackedPositionGlobal() - gAgentCamera.getCameraPositionGlobal();; - - - + + + } else { // default behavior = center on agent pos_global.clearVec(); } - + LLWorldMapView::setPan( -llfloor((F32)(pos_global.mdV[VX] * (F64)LLWorldMapView::sMapScale / REGION_WIDTH_METERS)), - -llfloor((F32)(pos_global.mdV[VY] * (F64)LLWorldMapView::sMapScale / REGION_WIDTH_METERS)), - !animate); + -llfloor((F32)(pos_global.mdV[VY] * (F64)LLWorldMapView::sMapScale / REGION_WIDTH_METERS)), + !animate); mWaitingForTracker = FALSE; } @@ -1273,7 +1344,7 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate) void LLFloaterWorldMap::fly() { LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); - + // Start the autopilot and close the floater, // so we can see where we're flying if (!pos_global.isExactlyZero()) @@ -1294,7 +1365,7 @@ void LLFloaterWorldMap::teleport() BOOL teleport_home = FALSE; LLVector3d pos_global; LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); - + LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); if (LLTracker::TRACKING_AVATAR == tracking_status && av_tracker.haveTrackingInfo() ) @@ -1317,10 +1388,10 @@ void LLFloaterWorldMap::teleport() && landmark->getRegionID(region_id)) { LLLandmark::requestRegionHandle( - gMessageSystem, - gAgent.getRegionHost(), - region_id, - NULL); + gMessageSystem, + gAgent.getRegionHost(), + region_id, + NULL); } } } @@ -1332,7 +1403,7 @@ void LLFloaterWorldMap::teleport() { make_ui_sound("UISndInvalidOp"); } - + // Do the teleport, which will also close the floater if (teleport_home) { @@ -1367,7 +1438,7 @@ void LLFloaterWorldMap::teleportToLandmark() { BOOL has_destination = FALSE; LLUUID destination_id; // Null means "home" - + if( LLTracker::getTrackedLandmarkAssetID() == sHomeID ) { has_destination = TRUE; @@ -1388,14 +1459,14 @@ void LLFloaterWorldMap::teleportToLandmark() if(landmark->getRegionID(region_id)) { LLLandmark::requestRegionHandle( - gMessageSystem, - gAgent.getRegionHost(), - region_id, - NULL); + gMessageSystem, + gAgent.getRegionHost(), + region_id, + NULL); } } } - + if( has_destination ) { gAgent.teleportViaLandmark( destination_id ); @@ -1428,12 +1499,12 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) { return; } - + LLScrollListCtrl *list = getChild("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); - + S32 name_length = mCompletingRegionName.length(); - + LLSD match; S32 num_results = 0; @@ -1443,7 +1514,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) LLSimInfo* info = it->second; std::string sim_name_lower = info->getName(); LLStringUtil::toLower(sim_name_lower); - + if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) { if (sim_name_lower == mCompletingRegionName) @@ -1459,12 +1530,12 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) num_results++; } } - + if (found_null_sim) { mCompletingRegionName = ""; } - + // if match found, highlight it and go if (!match.isUndefined()) { @@ -1472,7 +1543,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) getChild("search_results")->setFocus(TRUE); onCommitSearchResult(); } - + // if we found nothing, say "none" if (num_results == 0) { @@ -1486,7 +1557,7 @@ void LLFloaterWorldMap::onCommitSearchResult() { LLCtrlListInterface *list = childGetListInterface("search_results"); if (!list) return; - + LLSD selected_value = list->getSelectedValue(); std::string sim_name = selected_value.asString(); if (sim_name.empty()) @@ -1494,19 +1565,19 @@ void LLFloaterWorldMap::onCommitSearchResult() return; } LLStringUtil::toLower(sim_name); - + std::map::const_iterator it; for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it) { LLSimInfo* info = it->second; - + if (info->isName(sim_name)) { LLVector3d pos_global = info->getGlobalOrigin(); - + const F64 SIM_COORD_DEFAULT = 128.0; LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f); - + // Did this value come from a trackURL() request? if (!mCompletingRegionPos.isExactlyZero()) { @@ -1516,14 +1587,14 @@ void LLFloaterWorldMap::onCommitSearchResult() pos_global.mdV[VX] += (F64)pos_local.mV[VX]; pos_global.mdV[VY] += (F64)pos_local.mV[VY]; pos_global.mdV[VZ] = (F64)pos_local.mV[VZ]; - + getChild("location")->setValue(sim_name); trackLocation(pos_global); setDefaultBtn("Teleport"); break; } } - + onShowTargetBtn(); } @@ -1531,15 +1602,15 @@ void LLFloaterWorldMap::onChangeMaturity() { bool can_access_mature = gAgent.canAccessMature(); bool can_access_adult = gAgent.canAccessAdult(); - + getChildView("events_mature_icon")->setVisible( can_access_mature); getChildView("events_mature_label")->setVisible( can_access_mature); getChildView("events_mature_chk")->setVisible( can_access_mature); - + getChildView("events_adult_icon")->setVisible( can_access_adult); getChildView("events_adult_label")->setVisible( can_access_adult); getChildView("events_adult_chk")->setVisible( can_access_adult); - + // disable mature / adult events. if (!can_access_mature) { diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 6327039b7f..bbed19fc1c 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -107,6 +107,10 @@ public: // teleport to the tracked item, if there is one void teleport(); void onChangeMaturity(); + + //Slapp instigated avatar tracking + void avatarTrackFromSlapp( const LLUUID& id ); + protected: void onGoHome(); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 75a5b14154..cf01792327 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -59,6 +59,7 @@ #include "llcommandhandler.h" #include "llviewermessage.h" #include "llsidepanelappearance.h" +#include "llavataractions.h" ///---------------------------------------------------------------------------- /// Helper class to store special inventory item names and their localized values. @@ -211,6 +212,37 @@ public: }; LLInventoryHandler gInventoryHandler; +//prep# share +class LLShareWithAvatarHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLShareWithAvatarHandler() : LLCommandHandler("sharewithavatar", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE )) + { + return false; + } + + //instigate share with this avatar + LLAvatarActions::share( id ); + return true; + } +}; +LLShareWithAvatarHandler gShareWithAvatar; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- -- cgit v1.2.3 From 53eeee7b70a80e718b8331bde66848fdfbe77355 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Oct 2010 14:41:42 -0400 Subject: support for edit classified slapp --- indra/newview/llpanelpicks.cpp | 37 +++++++++++++++++++++++++++++++++++++ indra/newview/llpanelpicks.h | 2 ++ indra/newview/llpanelprofile.cpp | 11 +++++++++++ 3 files changed, 50 insertions(+) mode change 100644 => 100755 indra/newview/llpanelpicks.h diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index e70c7be728..941bf6e98d 100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -190,6 +190,13 @@ public: else if (mRequestVerb == "edit") { llwarns << "edit in progress" << llendl; + // open the new classified panel on the Me > Picks sidetray + LLSD params; + params["id"] = gAgent.getID(); + params["open_tab_name"] = "panel_picks"; + params["show_tab_panel"] = "edit_classified"; + params["classified_id"] = c_info->classified_id; + LLSideTray::getInstance()->showPanel("panel_me", params); } } @@ -822,6 +829,13 @@ void LLPanelPicks::openClassifiedInfo(const LLSD ¶ms) getProfilePanel()->openPanel(mPanelClassifiedInfo, params); } +void LLPanelPicks::openClassifiedEdit(const LLSD& params) +{ + LLUUID classified_id = params["classified_id"].asUUID();; + llinfos << "opening classified " << classified_id << " for edit" << llendl; + editClassified(classified_id); +} + void LLPanelPicks::showAccordion(const std::string& name, bool show) { LLAccordionCtrlTab* tab = getChild(name); @@ -1024,6 +1038,29 @@ void LLPanelPicks::onPanelClassifiedEdit() { return; } + editClassified(c_item->getClassifiedId()); +} + +void LLPanelPicks::editClassified(const LLUUID& classified_id) +{ + // HACK - find item by classified id. Should be a better way. + std::vector items; + mClassifiedsList->getItems(items); + LLClassifiedItem* c_item = NULL; + for(std::vector::iterator it = items.begin(); it != items.end(); ++it) + { + LLClassifiedItem *test_item = dynamic_cast(*it); + if (test_item && test_item->getClassifiedId() == classified_id) + { + c_item = test_item; + break; + } + } + if (!c_item) + { + llwarns << "item not found for classified_id " << classified_id << llendl; + return; + } LLSD params; params["classified_id"] = c_item->getClassifiedId(); diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h old mode 100644 new mode 100755 index 526ba48dcb..333c112756 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -108,6 +108,7 @@ private: void onPanelClassifiedClose(LLPanelClassifiedInfo* panel); void onPanelPickEdit(); void onPanelClassifiedEdit(); + void editClassified(const LLUUID& classified_id); void onClickMenuEdit(); bool onEnableMenuItem(const LLSD& user_data); @@ -118,6 +119,7 @@ private: void openPickInfo(); void openClassifiedInfo(); void openClassifiedInfo(const LLSD& params); + void openClassifiedEdit(const LLSD& params); friend class LLPanelProfile; void showAccordion(const std::string& name, bool show); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 1268c181ad..0b5975195d 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -205,6 +205,17 @@ void LLPanelProfile::onOpen(const LLSD& key) picks->openClassifiedInfo(params); } } + else if (panel == "edit_classified") + { + LLPanelPicks* picks = dynamic_cast(getTabContainer()[PANEL_PICKS]); + if (picks) + { + LLSD params = key; + params.erase("show_tab_panel"); + params.erase("open_tab_name"); + picks->openClassifiedEdit(params); + } + } } } -- cgit v1.2.3 From 03fd5c02f73467d50a10b62e982ce1dee961d315 Mon Sep 17 00:00:00 2001 From: prep linden Date: Thu, 21 Oct 2010 15:57:06 -0400 Subject: Added support for map tracking slapp, share slapp and a voice call slapp. slapp urls: secondlife:///app/maptrackavatar/lluid secondlife:///app/sharewithavatar/lluid secondlife:///app/voicecallavatar/lluid --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llfloaterworldmap.cpp | 37 +-------------------- indra/newview/llshareavatarhandler.cpp | 59 ++++++++++++++++++++++++++++++++ indra/newview/llviewerinventory.cpp | 30 ----------------- indra/newview/llvoicecallhandler.cpp | 61 ++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 66 deletions(-) create mode 100644 indra/newview/llshareavatarhandler.cpp create mode 100644 indra/newview/llvoicecallhandler.cpp diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1f4302d870..26ba35e093 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -399,6 +399,7 @@ set(viewer_SOURCE_FILES llsecapi.cpp llsechandler_basic.cpp llselectmgr.cpp + llshareavatarhandler.cpp llsidepanelappearance.cpp llsidepanelinventory.cpp llsidepanelinventorysubpanel.cpp @@ -537,6 +538,7 @@ set(viewer_SOURCE_FILES llvoclouds.cpp llvograss.cpp llvoground.cpp + llvoicecallhandler.cpp llvoicechannel.cpp llvoiceclient.cpp llvoicevisualizer.cpp diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index d5ebcfab4c..7c86d38310 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -72,8 +72,6 @@ #include "llweb.h" #include "llslider.h" #include "message.h" -#include "llviewerobjectlist.h" -#include "llvoicechannel.h" #include "llwindow.h" // copyTextToClipboard() //--------------------------------------------------------------------------- @@ -133,7 +131,6 @@ public: }; LLWorldMapHandler gWorldMapHandler; -//prep# // SocialMap handler secondlife:///app/maptrackavatar/id class LLMapTrackAvatarHandler : public LLCommandHandler { @@ -168,38 +165,6 @@ LLMapTrackAvatarHandler gMapTrackAvatar; LLFloaterWorldMap* gFloaterWorldMap = NULL; -//prep# call -class LLSocialCallHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLSocialCallHandler() : LLCommandHandler("socialcallhandler", UNTRUSTED_THROTTLE) - { - } - - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) - { - //Make sure we have some parameters - if (params.size() == 0) - { - return false; - } - - //Get the ID - LLUUID id; - if (!id.set( params[0], FALSE )) - { - return false; - } - - //instigate call with this avatar - LLVoiceClient::getInstance()->callUser( id ); - - return true; - } -}; -LLSocialCallHandler gSocialCallHandler; - class LLMapInventoryObserver : public LLInventoryObserver { public: @@ -1188,7 +1153,7 @@ void LLFloaterWorldMap::onAvatarComboCommit() mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } } -//prep# + void LLFloaterWorldMap::avatarTrackFromSlapp( const LLUUID& id ) { trackAvatar( id, "av" ); diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp new file mode 100644 index 0000000000..568c77d4b2 --- /dev/null +++ b/indra/newview/llshareavatarhandler.cpp @@ -0,0 +1,59 @@ +/** + * @file llshareavatarhandler.cpp + * @brief slapp to handle avatar to avatar voice call. + * + * $LicenseInfo:firstyear=2001&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 "llcommandhandler.h" +#include "llavataractions.h" + +class LLShareWithAvatarHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLShareWithAvatarHandler() : LLCommandHandler("sharewithavatar", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE )) + { + return false; + } + + //instigate share with this avatar + LLAvatarActions::share( id ); + return true; + } +}; +LLShareWithAvatarHandler gShareWithAvatar; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index cf01792327..1907aaea4e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -212,36 +212,6 @@ public: }; LLInventoryHandler gInventoryHandler; -//prep# share -class LLShareWithAvatarHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLShareWithAvatarHandler() : LLCommandHandler("sharewithavatar", UNTRUSTED_THROTTLE) - { - } - - bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) - { - //Make sure we have some parameters - if (params.size() == 0) - { - return false; - } - - //Get the ID - LLUUID id; - if (!id.set( params[0], FALSE )) - { - return false; - } - - //instigate share with this avatar - LLAvatarActions::share( id ); - return true; - } -}; -LLShareWithAvatarHandler gShareWithAvatar; ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp new file mode 100644 index 0000000000..724d48b717 --- /dev/null +++ b/indra/newview/llvoicecallhandler.cpp @@ -0,0 +1,61 @@ + /** + * @file llvoicecallhandler.cpp + * @brief slapp to handle avatar to avatar voice call. + * + * $LicenseInfo:firstyear=2001&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 "llcommandhandler.h" +#include "llavataractions.h" + +class LLVoiceCallAvatarHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLVoiceCallAvatarHandler() : LLCommandHandler("voicecallavatar", UNTRUSTED_THROTTLE) + { + } + + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) + { + //Make sure we have some parameters + if (params.size() == 0) + { + return false; + } + + //Get the ID + LLUUID id; + if (!id.set( params[0], FALSE )) + { + return false; + } + + //instigate call with this avatar + LLAvatarActions::startCall( id ); + return true; + } +}; + +LLVoiceCallAvatarHandler gVoiceCallAvatarHandler; + -- cgit v1.2.3 From abd52cd3f480177a06c5e98732ded4136fcffc46 Mon Sep 17 00:00:00 2001 From: prep linden Date: Thu, 21 Oct 2010 16:08:13 -0400 Subject: Added support for map tracking slapp, share slapp and a voice call slapp. slapp urls: secondlife:///app/maptrackavatar/lluid secondlife:///app/sharewithavatar/lluid secondlife:///app/voicecallavatar/lluid --- indra/newview/CMakeLists.txt | 2 +- indra/newview/llfloaterworldmap.cpp | 2 +- indra/newview/llfloaterworldmap.h | 1 + indra/newview/llshareavatarhandler.cpp | 5 ++--- indra/newview/llvoicecallhandler.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 26ba35e093..69bc82eb65 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -405,7 +405,7 @@ set(viewer_SOURCE_FILES llsidepanelinventorysubpanel.cpp llsidepaneliteminfo.cpp llsidepaneltaskinfo.cpp - llsidetray.cpp + llsidetray.cpp llsidetraypanelcontainer.cpp llsky.cpp llslurl.cpp diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7c86d38310..0c99cc1c8e 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -155,7 +155,7 @@ public: return false; } - LLFloaterWorldMap::getInstance()->avatarTrackFromSlapp( id ); + LLFloaterWorldMap::getInstance()->avatarTrackFromSlapp( id ); LLFloaterReg::showInstance( "world_map", "center" ); return true; diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index bbed19fc1c..5e4768d92b 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -108,6 +108,7 @@ public: void teleport(); void onChangeMaturity(); + //Slapp instigated avatar tracking void avatarTrackFromSlapp( const LLUUID& id ); diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp index 568c77d4b2..517990c06f 100644 --- a/indra/newview/llshareavatarhandler.cpp +++ b/indra/newview/llshareavatarhandler.cpp @@ -1,6 +1,6 @@ /** * @file llshareavatarhandler.cpp - * @brief slapp to handle avatar to avatar voice call. + * @brief slapp to handle sharing with an avatar * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -25,12 +25,11 @@ */ #include "llviewerprecompiledheaders.h" -#include "llcommandhandler.h" #include "llavataractions.h" class LLShareWithAvatarHandler : public LLCommandHandler { -public: +public: // requires trusted browser to trigger LLShareWithAvatarHandler() : LLCommandHandler("sharewithavatar", UNTRUSTED_THROTTLE) { diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index 724d48b717..fe50a05f1c 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -30,7 +30,7 @@ class LLVoiceCallAvatarHandler : public LLCommandHandler { -public: +public: // requires trusted browser to trigger LLVoiceCallAvatarHandler() : LLCommandHandler("voicecallavatar", UNTRUSTED_THROTTLE) { -- cgit v1.2.3 From fca9c0b2f9128ef1c1a3a9d470a66aa95afffada Mon Sep 17 00:00:00 2001 From: prep linden Date: Thu, 21 Oct 2010 16:22:27 -0400 Subject: Added support for map tracking slapp, share slapp and a voice call slapp. slapp urls: secondlife:///app/maptrackavatar/lluid secondlife:///app/sharewithavatar/lluid secondlife:///app/voicecallavatar/lluid --- indra/newview/CMakeLists.txt | 2 +- indra/newview/llfloaterworldmap.cpp | 2 +- indra/newview/llfloaterworldmap.h | 2 +- indra/newview/llshareavatarhandler.cpp | 1 + indra/newview/llvoicecallhandler.cpp | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 69bc82eb65..26ba35e093 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -405,7 +405,7 @@ set(viewer_SOURCE_FILES llsidepanelinventorysubpanel.cpp llsidepaneliteminfo.cpp llsidepaneltaskinfo.cpp - llsidetray.cpp + llsidetray.cpp llsidetraypanelcontainer.cpp llsky.cpp llslurl.cpp diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 0c99cc1c8e..8683f03788 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1154,7 +1154,7 @@ void LLFloaterWorldMap::onAvatarComboCommit() } } -void LLFloaterWorldMap::avatarTrackFromSlapp( const LLUUID& id ) +void LLFloaterWorldMap::avatarTrackFromSlapp( const LLUUID& id ) { trackAvatar( id, "av" ); onShowTargetBtn(); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 5e4768d92b..5ac62e27fc 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -110,7 +110,7 @@ public: //Slapp instigated avatar tracking - void avatarTrackFromSlapp( const LLUUID& id ); + void avatarTrackFromSlapp( const LLUUID& id ); protected: void onGoHome(); diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp index 517990c06f..34194970b8 100644 --- a/indra/newview/llshareavatarhandler.cpp +++ b/indra/newview/llshareavatarhandler.cpp @@ -25,6 +25,7 @@ */ #include "llviewerprecompiledheaders.h" +#include "llcommandhandler.h" #include "llavataractions.h" class LLShareWithAvatarHandler : public LLCommandHandler diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp index fe50a05f1c..274bd75208 100644 --- a/indra/newview/llvoicecallhandler.cpp +++ b/indra/newview/llvoicecallhandler.cpp @@ -25,7 +25,7 @@ */ #include "llviewerprecompiledheaders.h" -#include "llcommandhandler.h" +#include "llcommandhandler.h" #include "llavataractions.h" class LLVoiceCallAvatarHandler : public LLCommandHandler -- cgit v1.2.3 From 7b1dd1c84ea781992532a9aa65029928f32f3f4f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 22 Oct 2010 11:35:58 -0400 Subject: SOCIAL-84 FIX, SOCIAL-85 FIX - new slapps for edit classified, create and edit pick --- indra/newview/llcommandhandler.cpp | 0 indra/newview/llpanelpicks.cpp | 104 ++++++++++++++++++++++++++++++++----- indra/newview/llpanelpicks.h | 2 + indra/newview/llpanelprofile.cpp | 19 +++++++ 4 files changed, 113 insertions(+), 12 deletions(-) mode change 100644 => 100755 indra/newview/llcommandhandler.cpp diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp old mode 100644 new mode 100755 diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 941bf6e98d..9fc31305ca 100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -70,34 +70,99 @@ static const std::string CLASSIFIED_NAME("classified_name"); static LLRegisterPanelClassWrapper t_panel_picks("panel_picks"); -class LLPickHandler : public LLCommandHandler +class LLPickHandler : public LLCommandHandler, + public LLAvatarPropertiesObserver { public: + + std::set mPickIds; + // requires trusted browser to trigger LLPickHandler() : LLCommandHandler("pick", UNTRUSTED_THROTTLE) { } bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { - if (params.size() < 1) return false; - const std::string verb = params[0]; + // handle app/classified/create urls first + if (params.size() == 1 && params[0].asString() == "create") + { + createPick(); + return true; + } - if (verb == "create") + // then handle the general app/pick/{UUID}/{CMD} urls + if (params.size() < 2) { - // Open "create pick" in side tab. + return false; } - else if (verb == "edit") + + // get the ID for the pick_id + LLUUID pick_id; + if (!pick_id.set(params[0], FALSE)) { - // How to identify the pick? - llwarns << "how to identify pick?" << llendl; + return false; + } + + // edit the pick in the side tray. + // need to ask the server for more info first though... + const std::string verb = params[1].asString(); + if (verb == "edit") + { + mPickIds.insert(pick_id); + LLAvatarPropertiesProcessor::getInstance()->addObserver(LLUUID(), this); + LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(gAgent.getID(),pick_id); + return true; } else { llwarns << "unknown verb " << verb << llendl; return false; } - - return true; + } + + void createPick() + { + LLSD params; + params["id"] = gAgent.getID(); + params["open_tab_name"] = "panel_picks"; + params["show_tab_panel"] = "create_pick"; + LLSideTray::getInstance()->showPanel("panel_me", params); + } + + void editPick(LLPickData* pick_info) + { + LLSD params; + params["open_tab_name"] = "panel_picks"; + params["show_tab_panel"] = "edit_pick"; + params["pick_id"] = pick_info->pick_id; + params["avatar_id"] = pick_info->creator_id; + params["snapshot_id"] = pick_info->snapshot_id; + params["pick_name"] = pick_info->name; + params["pick_desc"] = pick_info->desc; + + LLSideTray::getInstance()->showPanel("panel_me", params); + } + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) + { + if (APT_PICK_INFO != type) + { + return; + } + + // is this the pick that we asked for? + LLPickData* pick_info = static_cast(data); + if (!pick_info || mPickIds.find(pick_info->pick_id) == mPickIds.end()) + { + return; + } + + // open the edit side tray for this pick + editPick(pick_info); + + // remove our observer now that we're done + mPickIds.erase(pick_info->pick_id); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(LLUUID(), this); } }; @@ -356,7 +421,10 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) pick_value.insert(CLASSIFIED_ID, c_data.classified_id); pick_value.insert(CLASSIFIED_NAME, c_data.name); - mClassifiedsList->addItem(c_item, pick_value); + if (!findClassifiedById(c_data.classified_id)) + { + mClassifiedsList->addItem(c_item, pick_value); + } c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); @@ -1005,6 +1073,12 @@ void LLPanelPicks::createPickEditPanel() // getProfilePanel()->openPanel(mPanelPickInfo, params); // } +void LLPanelPicks::openPickEdit(const LLSD& params) +{ + createPickEditPanel(); + getProfilePanel()->openPanel(mPanelPickEdit, params); +} + void LLPanelPicks::onPanelPickEdit() { LLSD selected_value = mPicksList->getSelectedValue(); @@ -1041,7 +1115,7 @@ void LLPanelPicks::onPanelClassifiedEdit() editClassified(c_item->getClassifiedId()); } -void LLPanelPicks::editClassified(const LLUUID& classified_id) +LLClassifiedItem *LLPanelPicks::findClassifiedById(const LLUUID& classified_id) { // HACK - find item by classified id. Should be a better way. std::vector items; @@ -1056,6 +1130,12 @@ void LLPanelPicks::editClassified(const LLUUID& classified_id) break; } } + return c_item; +} + +void LLPanelPicks::editClassified(const LLUUID& classified_id) +{ + LLClassifiedItem* c_item = findClassifiedById(classified_id); if (!c_item) { llwarns << "item not found for classified_id " << classified_id << llendl; diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 333c112756..d0c779604e 100755 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -76,6 +76,7 @@ public: // returns the selected pick item LLPickItem* getSelectedPickItem(); LLClassifiedItem* getSelectedClassifiedItem(); + LLClassifiedItem* findClassifiedById(const LLUUID& classified_id); //*NOTE top down approch when panel toggling is done only by // parent panels failed to work (picks related code was in my profile panel) @@ -106,6 +107,7 @@ private: void onPanelPickSave(LLPanel* panel); void onPanelClassifiedSave(LLPanelClassifiedEdit* panel); void onPanelClassifiedClose(LLPanelClassifiedInfo* panel); + void openPickEdit(const LLSD& params); void onPanelPickEdit(); void onPanelClassifiedEdit(); void editClassified(const LLUUID& classified_id); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 0b5975195d..240f651eec 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -216,6 +216,25 @@ void LLPanelProfile::onOpen(const LLSD& key) picks->openClassifiedEdit(params); } } + else if (panel == "create_pick") + { + LLPanelPicks* picks = dynamic_cast(getTabContainer()[PANEL_PICKS]); + if (picks) + { + picks->createNewPick(); + } + } + else if (panel == "edit_pick") + { + LLPanelPicks* picks = dynamic_cast(getTabContainer()[PANEL_PICKS]); + if (picks) + { + LLSD params = key; + params.erase("show_tab_panel"); + params.erase("open_tab_name"); + picks->openPickEdit(params); + } + } } } -- cgit v1.2.3 From d4b055b0860cda675ed0af94ea7e8fc9e64ceb93 Mon Sep 17 00:00:00 2001 From: prep linden Date: Thu, 18 Nov 2010 16:05:35 -0500 Subject: Move include in search results from profile window to preference privacy pane --- indra/newview/llfloaterpreference.cpp | 39 ++++++ indra/newview/llfloaterpreference.h | 11 +- .../skins/default/xui/en/panel_edit_profile.xml | 145 ++++++++++++++++----- .../default/xui/en/panel_preferences_privacy.xml | 9 ++ 4 files changed, 172 insertions(+), 32 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 41f85ae29d..541316efb3 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -307,8 +307,44 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); sSkin = gSavedSettings.getString("SkinCurrent"); + //prep + LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest( gAgent.getID() ); } + +//prep +void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type ) +{ + if ( APT_PROPERTIES == type ) + { + const LLAvatarData* pAvatarData = static_cast( pData ); + storeAvatarProperties( pAvatarData ); + processProfileProperties( pAvatarData ); + } +} +void LLFloaterPreference::storeAvatarProperties( const LLAvatarData* pAvatarData ) +{ + mAvatarProperties.avatar_id = gAgent.getID(); + mAvatarProperties.image_id = pAvatarData->image_id; + mAvatarProperties.fl_image_id = pAvatarData->fl_image_id; + mAvatarProperties.about_text = pAvatarData->about_text; + mAvatarProperties.fl_about_text = pAvatarData->fl_about_text; + mAvatarProperties.profile_url = pAvatarData->profile_url; + mAvatarProperties.allow_publish = pAvatarData->allow_publish; +} +void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData ) +{ + getChild("online_searchresults")->setValue( pAvatarData->allow_publish ); +} + +void LLFloaterPreference::saveAvatarProperties( void ) +{ + mAvatarProperties.allow_publish = getChild("online_searchresults")->getValue(); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties ); +} + + BOOL LLFloaterPreference::postBuild() { gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2)); @@ -456,6 +492,9 @@ void LLFloaterPreference::apply() gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility); } } + + //prep + saveAvatarProperties(); } void LLFloaterPreference::cancel() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index e99731b92e..9601ea1cd7 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -34,6 +34,7 @@ #define LL_LLFLOATERPREFERENCE_H #include "llfloater.h" +#include "llavatarpropertiesprocessor.h" class LLPanelPreference; class LLPanelLCD; @@ -55,7 +56,7 @@ typedef enum // Floater to control preferences (display, audio, bandwidth, general. -class LLFloaterPreference : public LLFloater +class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver { public: LLFloaterPreference(const LLSD& key); @@ -76,6 +77,12 @@ public: // translate user's busy response message according to current locale if message is default, otherwise do nothing static void initBusyResponse(); + + //prep + void processProperties( void* pData, EAvatarProcessorType type ); + void processProfileProperties(const LLAvatarData* pAvatarData ); + void storeAvatarProperties( const LLAvatarData* pAvatarData ); + void saveAvatarProperties( void ); protected: void onBtnOK(); @@ -150,6 +157,8 @@ private: bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; + //prep + LLAvatarData mAvatarProperties; }; class LLPanelPreference : public LLPanel diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 6781a76120..37265d65f1 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -3,7 +3,7 @@ background_visible="true" class="edit_profile_panel" follows="all" - height="535" + height="585" label="Profile Edit" layout="topleft" left="0" @@ -60,7 +60,7 @@ @@ -83,16 +83,110 @@ follows="left|top|right" layout="topleft" top="0" - height="494" + height="537" min_height="300" left="0" width="292"> + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 4d08333dce9c359af6c49fabe1c1372da148bcf4 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 7 Jan 2011 12:37:00 -0500 Subject: Added tag 2.5.0-start for changeset a82e5b1e22c7 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index d7465f4c59..a700aa94ea 100644 --- a/.hgtags +++ b/.hgtags @@ -42,3 +42,4 @@ dc6483491b4af559060bccaef8e9045a303212dd 2.4.0-beta1 3bc1f50a72e117f4d4ad8d555f0c785ea8cc201e 2.4.0-beta1 25bd6007e3d2fc15db9326ed4b18a24a5969a46a 2.4.0-beta2 1ed382c6a08ba3850b6ce9061bc551ddece0ea07 2.4.0-release +a82e5b1e22c7f90e3c7977d146b80588f004ed0d 2.5.0-start -- cgit v1.2.3 From c132d20a7433e2d09e3521a15497f661fcbd18b8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 7 Jan 2011 12:46:55 -0500 Subject: increment minor revision number to make version "2.6.0" --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 356e0f4c0f..7d5afe92dc 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -28,7 +28,7 @@ #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; -const S32 LL_VERSION_MINOR = 5; +const S32 LL_VERSION_MINOR = 6; const S32 LL_VERSION_PATCH = 0; const S32 LL_VERSION_BUILD = 0; -- cgit v1.2.3 From ce5dc4d42b52fad2bb6d7bdf98b7656418061278 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 7 Jan 2011 13:47:50 -0600 Subject: SH-762 Forsyth style vertex buffer optimization for meshes. --- indra/llmath/llvolume.cpp | 727 +++++++++++++++++++++++++++++++++++++--------- indra/llmath/llvolume.h | 71 ++--- 2 files changed, 625 insertions(+), 173 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 8a7b19800c..f41cd1b4e8 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2003,145 +2003,145 @@ BOOL LLVolume::generate() return FALSE; } -void LLVolumeFace::VertexData::init() -{ - if (!mData) - { - mData = (LLVector4a*) malloc(sizeof(LLVector4a)*2); - } -} - -LLVolumeFace::VertexData::VertexData() -{ - mData = NULL; - init(); -} - -LLVolumeFace::VertexData::VertexData(const VertexData& rhs) -{ - mData = NULL; - *this = rhs; -} - -const LLVolumeFace::VertexData& LLVolumeFace::VertexData::operator=(const LLVolumeFace::VertexData& rhs) -{ - if (this != &rhs) - { - init(); - LLVector4a::memcpyNonAliased16((F32*) mData, (F32*) rhs.mData, 2*sizeof(LLVector4a)); - mTexCoord = rhs.mTexCoord; - } - return *this; -} - -LLVolumeFace::VertexData::~VertexData() -{ - free(mData); - mData = NULL; -} - -LLVector4a& LLVolumeFace::VertexData::getPosition() -{ - return mData[POSITION]; -} - -LLVector4a& LLVolumeFace::VertexData::getNormal() -{ - return mData[NORMAL]; -} - -const LLVector4a& LLVolumeFace::VertexData::getPosition() const -{ - return mData[POSITION]; -} - -const LLVector4a& LLVolumeFace::VertexData::getNormal() const -{ - return mData[NORMAL]; -} - - -void LLVolumeFace::VertexData::setPosition(const LLVector4a& pos) -{ - mData[POSITION] = pos; -} - -void LLVolumeFace::VertexData::setNormal(const LLVector4a& norm) -{ - mData[NORMAL] = norm; -} - -bool LLVolumeFace::VertexData::operator<(const LLVolumeFace::VertexData& rhs)const -{ - const F32* lp = this->getPosition().getF32ptr(); - const F32* rp = rhs.getPosition().getF32ptr(); - - if (lp[0] != rp[0]) - { - return lp[0] < rp[0]; - } - - if (rp[1] != lp[1]) - { - return lp[1] < rp[1]; - } - - if (rp[2] != lp[2]) - { - return lp[2] < rp[2]; - } - - lp = getNormal().getF32ptr(); - rp = rhs.getNormal().getF32ptr(); - - if (lp[0] != rp[0]) - { - return lp[0] < rp[0]; - } - - if (rp[1] != lp[1]) - { - return lp[1] < rp[1]; - } - - if (rp[2] != lp[2]) - { - return lp[2] < rp[2]; - } - - if (mTexCoord.mV[0] != rhs.mTexCoord.mV[0]) - { - return mTexCoord.mV[0] < rhs.mTexCoord.mV[0]; - } - - return mTexCoord.mV[1] < rhs.mTexCoord.mV[1]; -} - -bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)const -{ - return mData[POSITION].equals3(rhs.getPosition()) && - mData[NORMAL].equals3(rhs.getNormal()) && - mTexCoord == rhs.mTexCoord; -} - -bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const -{ - bool retval = false; - if (rhs.mData[POSITION].equals3(mData[POSITION]) && rhs.mTexCoord == mTexCoord) - { - if (angle_cutoff > 1.f) - { - retval = (mData[NORMAL].equals3(rhs.mData[NORMAL])); - } - else - { - F32 cur_angle = rhs.mData[NORMAL].dot3(mData[NORMAL]).getF32(); - retval = cur_angle > angle_cutoff; - } - } - - return retval; -} +void LLVolumeFace::VertexData::init() +{ + if (!mData) + { + mData = (LLVector4a*) malloc(sizeof(LLVector4a)*2); + } +} + +LLVolumeFace::VertexData::VertexData() +{ + mData = NULL; + init(); +} + +LLVolumeFace::VertexData::VertexData(const VertexData& rhs) +{ + mData = NULL; + *this = rhs; +} + +const LLVolumeFace::VertexData& LLVolumeFace::VertexData::operator=(const LLVolumeFace::VertexData& rhs) +{ + if (this != &rhs) + { + init(); + LLVector4a::memcpyNonAliased16((F32*) mData, (F32*) rhs.mData, 2*sizeof(LLVector4a)); + mTexCoord = rhs.mTexCoord; + } + return *this; +} + +LLVolumeFace::VertexData::~VertexData() +{ + free(mData); + mData = NULL; +} + +LLVector4a& LLVolumeFace::VertexData::getPosition() +{ + return mData[POSITION]; +} + +LLVector4a& LLVolumeFace::VertexData::getNormal() +{ + return mData[NORMAL]; +} + +const LLVector4a& LLVolumeFace::VertexData::getPosition() const +{ + return mData[POSITION]; +} + +const LLVector4a& LLVolumeFace::VertexData::getNormal() const +{ + return mData[NORMAL]; +} + + +void LLVolumeFace::VertexData::setPosition(const LLVector4a& pos) +{ + mData[POSITION] = pos; +} + +void LLVolumeFace::VertexData::setNormal(const LLVector4a& norm) +{ + mData[NORMAL] = norm; +} + +bool LLVolumeFace::VertexData::operator<(const LLVolumeFace::VertexData& rhs)const +{ + const F32* lp = this->getPosition().getF32ptr(); + const F32* rp = rhs.getPosition().getF32ptr(); + + if (lp[0] != rp[0]) + { + return lp[0] < rp[0]; + } + + if (rp[1] != lp[1]) + { + return lp[1] < rp[1]; + } + + if (rp[2] != lp[2]) + { + return lp[2] < rp[2]; + } + + lp = getNormal().getF32ptr(); + rp = rhs.getNormal().getF32ptr(); + + if (lp[0] != rp[0]) + { + return lp[0] < rp[0]; + } + + if (rp[1] != lp[1]) + { + return lp[1] < rp[1]; + } + + if (rp[2] != lp[2]) + { + return lp[2] < rp[2]; + } + + if (mTexCoord.mV[0] != rhs.mTexCoord.mV[0]) + { + return mTexCoord.mV[0] < rhs.mTexCoord.mV[0]; + } + + return mTexCoord.mV[1] < rhs.mTexCoord.mV[1]; +} + +bool LLVolumeFace::VertexData::operator==(const LLVolumeFace::VertexData& rhs)const +{ + return mData[POSITION].equals3(rhs.getPosition()) && + mData[NORMAL].equals3(rhs.getNormal()) && + mTexCoord == rhs.mTexCoord; +} + +bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs, F32 angle_cutoff) const +{ + bool retval = false; + if (rhs.mData[POSITION].equals3(mData[POSITION]) && rhs.mTexCoord == mTexCoord) + { + if (angle_cutoff > 1.f) + { + retval = (mData[NORMAL].equals3(rhs.mData[NORMAL])); + } + else + { + F32 cur_angle = rhs.mData[NORMAL].dot3(mData[NORMAL]).getF32(); + retval = cur_angle > angle_cutoff; + } + } + + return retval; +} BOOL LLVolume::createVolumeFacesFromFile(const std::string& file_name) { @@ -2429,6 +2429,9 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } mSculptLevel = 0; // success! + + cacheOptimize(); + return true; } @@ -2590,6 +2593,15 @@ void LLVolume::copyVolumeFaces(const LLVolume* volume) mIsTetrahedron = FALSE; } +void LLVolume::cacheOptimize() +{ + for (S32 i = 0; i < mVolumeFaces.size(); ++i) + { + mVolumeFaces[i].cacheOptimize(); + } +} + + S32 LLVolume::getNumFaces() const { U8 sculpt_type = (mParams.getSculptType() & LL_SCULPT_TYPE_MASK); @@ -5481,6 +5493,443 @@ void LLVolumeFace::optimize(F32 angle_cutoff) swapData(new_face); } +class LLVCacheTriangleData; + +class LLVCacheVertexData +{ +public: + S32 mIdx; + S32 mCacheTag; + F32 mScore; + U32 mActiveTriangles; + std::vector mTriangles; + + LLVCacheVertexData() + { + mCacheTag = -1; + mScore = 0.f; + mActiveTriangles = 0; + mIdx = -1; + } +}; + +class LLVCacheTriangleData +{ +public: + bool mActive; + F32 mScore; + LLVCacheVertexData* mVertex[3]; + + LLVCacheTriangleData() + { + mActive = true; + mScore = 0.f; + mVertex[0] = mVertex[1] = mVertex[2] = NULL; + } + + void complete() + { + mActive = false; + for (S32 i = 0; i < 3; ++i) + { + if (mVertex[i]) + { + llassert_always(mVertex[i]->mActiveTriangles > 0); + mVertex[i]->mActiveTriangles--; + } + } + } + + bool operator<(const LLVCacheTriangleData& rhs) const + { //highest score first + return rhs.mScore < mScore; + } +}; + +const F32 FindVertexScore_CacheDecayPower = 1.5f; +const F32 FindVertexScore_LastTriScore = 0.75f; +const F32 FindVertexScore_ValenceBoostScale = 2.0f; +const F32 FindVertexScore_ValenceBoostPower = 0.5f; +const U32 MaxSizeVertexCache = 32; + +F32 find_vertex_score(LLVCacheVertexData& data) +{ + if (data.mActiveTriangles == 0) + { //no triangle references this vertex + return -1.f; + } + + F32 score = 0.f; + + S32 cache_idx = data.mCacheTag; + + if (cache_idx < 0) + { + //not in cache + } + else + { + if (cache_idx < 3) + { //vertex was in the last triangle + score = FindVertexScore_LastTriScore; + } + else + { //more points for being higher in the cache + F32 scaler = 1.f/(MaxSizeVertexCache-3); + score = 1.f-((cache_idx-3)*scaler); + score = powf(score, FindVertexScore_CacheDecayPower); + } + } + + //bonus points for having low valence + F32 valence_boost = powf(data.mActiveTriangles, -FindVertexScore_ValenceBoostPower); + score += FindVertexScore_ValenceBoostScale * valence_boost; + + return score; +} + +class LLVCacheFIFO +{ +public: + LLVCacheVertexData* mCache[MaxSizeVertexCache]; + U32 mMisses; + + LLVCacheFIFO() + { + mMisses = 0; + for (U32 i = 0; i < MaxSizeVertexCache; ++i) + { + mCache[i] = NULL; + } + } + + void addVertex(LLVCacheVertexData* data) + { + if (data->mCacheTag == -1) + { + mMisses++; + + S32 end = MaxSizeVertexCache-1; + + if (mCache[end]) + { + mCache[end]->mCacheTag = -1; + } + + for (S32 i = end; i > 0; --i) + { + mCache[i] = mCache[i-1]; + if (mCache[i]) + { + mCache[i]->mCacheTag = i; + } + } + + mCache[0] = data; + data->mCacheTag = 0; + } + } +}; + +class LLVCacheLRU +{ +public: + LLVCacheVertexData* mCache[MaxSizeVertexCache+3]; + + LLVCacheTriangleData* mBestTriangle; + + U32 mMisses; + + LLVCacheLRU() + { + for (U32 i = 0; i < MaxSizeVertexCache+3; ++i) + { + mCache[i] = NULL; + } + + mBestTriangle = NULL; + mMisses = 0; + } + + void addVertex(LLVCacheVertexData* data) + { + S32 end = MaxSizeVertexCache+2; + if (data->mCacheTag != -1) + { //just moving a vertex to the front of the cache + end = data->mCacheTag; + } + else + { + mMisses++; + if (mCache[end]) + { //adding a new vertex, vertex at end of cache falls off + mCache[end]->mCacheTag = -1; + } + } + + for (S32 i = end; i > 0; --i) + { //adjust cache pointers and tags + mCache[i] = mCache[i-1]; + + if (mCache[i]) + { + mCache[i]->mCacheTag = i; + } + } + + mCache[0] = data; + mCache[0]->mCacheTag = 0; + } + + void addTriangle(LLVCacheTriangleData* data) + { + addVertex(data->mVertex[0]); + addVertex(data->mVertex[1]); + addVertex(data->mVertex[2]); + } + + void updateScores() + { + for (U32 i = MaxSizeVertexCache; i < MaxSizeVertexCache+3; ++i) + { //trailing 3 vertices aren't actually in the cache for scoring purposes + if (mCache[i]) + { + mCache[i]->mCacheTag = -1; + } + } + + for (U32 i = 0; i < MaxSizeVertexCache; ++i) + { //update scores of vertices in cache + if (mCache[i]) + { + mCache[i]->mScore = find_vertex_score(*(mCache[i])); + llassert_always(mCache[i]->mCacheTag == i); + } + } + + mBestTriangle = NULL; + //update triangle scores + for (U32 i = 0; i < MaxSizeVertexCache+3; ++i) + { + if (mCache[i]) + { + for (U32 j = 0; j < mCache[i]->mTriangles.size(); ++j) + { + LLVCacheTriangleData* tri = mCache[i]->mTriangles[j]; + if (tri->mActive) + { + tri->mScore = tri->mVertex[0]->mScore; + tri->mScore += tri->mVertex[1]->mScore; + tri->mScore += tri->mVertex[2]->mScore; + + if (!mBestTriangle || mBestTriangle->mScore < tri->mScore) + { + mBestTriangle = tri; + } + } + } + } + } + + //knock trailing 3 vertices off the cache + for (U32 i = MaxSizeVertexCache; i < MaxSizeVertexCache+3; ++i) + { + if (mCache[i]) + { + llassert_always(mCache[i]->mCacheTag == -1); + mCache[i] = NULL; + } + } + } +}; + + +void LLVolumeFace::cacheOptimize() +{ //optimize for vertex cache according to Forsyth method: + // http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html + + LLVCacheLRU cache; + + //mapping of vertices to triangles and indices + std::vector vertex_data; + + //mapping of triangles do vertices + std::vector triangle_data; + + triangle_data.resize(mNumIndices/3); + vertex_data.resize(mNumVertices); + + for (U32 i = 0; i < mNumIndices; i++) + { //populate vertex data and triangle data arrays + U16 idx = mIndices[i]; + U16 tri_idx = i/3; + + vertex_data[idx].mTriangles.push_back(&(triangle_data[tri_idx])); + vertex_data[idx].mIdx = idx; + triangle_data[tri_idx].mVertex[i%3] = &(vertex_data[idx]); + } + + /*F32 pre_acmr = 1.f; + //measure cache misses from before rebuild + { + LLVCacheFIFO test_cache; + for (U32 i = 0; i < mNumIndices; ++i) + { + test_cache.addVertex(&vertex_data[mIndices[i]]); + } + + for (U32 i = 0; i < mNumVertices; i++) + { + vertex_data[i].mCacheTag = -1; + } + + pre_acmr = (F32) test_cache.mMisses/(mNumIndices/3); + }*/ + + for (U32 i = 0; i < mNumVertices; i++) + { //initialize score values (no cache -- might try a fifo cache here) + vertex_data[i].mScore = find_vertex_score(vertex_data[i]); + vertex_data[i].mActiveTriangles = vertex_data[i].mTriangles.size(); + + for (U32 j = 0; j < vertex_data[i].mTriangles.size(); ++j) + { + vertex_data[i].mTriangles[j]->mScore += vertex_data[i].mScore; + } + } + + //sort triangle data by score + std::sort(triangle_data.begin(), triangle_data.end()); + + std::vector new_indices; + + LLVCacheTriangleData* tri; + + //prime pump by adding first triangle to cache; + tri = &(triangle_data[0]); + cache.addTriangle(tri); + new_indices.push_back(tri->mVertex[0]->mIdx); + new_indices.push_back(tri->mVertex[1]->mIdx); + new_indices.push_back(tri->mVertex[2]->mIdx); + tri->complete(); + + U32 breaks = 0; + for (U32 i = 1; i < mNumIndices/3; ++i) + { + cache.updateScores(); + tri = cache.mBestTriangle; + if (!tri) + { + breaks++; + for (U32 j = 0; j < triangle_data.size(); ++j) + { + if (triangle_data[j].mActive) + { + tri = &(triangle_data[j]); + break; + } + } + } + + cache.addTriangle(tri); + new_indices.push_back(tri->mVertex[0]->mIdx); + new_indices.push_back(tri->mVertex[1]->mIdx); + new_indices.push_back(tri->mVertex[2]->mIdx); + tri->complete(); + } + + for (U32 i = 0; i < mNumIndices; ++i) + { + mIndices[i] = new_indices[i]; + } + + /*F32 post_acmr = 1.f; + //measure cache misses from after rebuild + { + LLVCacheFIFO test_cache; + for (U32 i = 0; i < mNumVertices; i++) + { + vertex_data[i].mCacheTag = -1; + } + + for (U32 i = 0; i < mNumIndices; ++i) + { + test_cache.addVertex(&vertex_data[mIndices[i]]); + } + + post_acmr = (F32) test_cache.mMisses/(mNumIndices/3); + }*/ + + //optimize for pre-TnL cache + + //allocate space for new buffer + S32 num_verts = mNumVertices; + LLVector4a* pos = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + LLVector4a* norm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; + LLVector2* tc = (LLVector2*) malloc(size); + + LLVector4a* wght = NULL; + if (mWeights) + { + wght = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + } + + LLVector4a* binorm = NULL; + if (mBinormals) + { + binorm = (LLVector4a*) malloc(sizeof(LLVector4a)*num_verts); + } + + //allocate mapping of old indices to new indices + std::vector new_idx; + new_idx.resize(mNumVertices, -1); + + S32 cur_idx = 0; + for (U32 i = 0; i < mNumIndices; ++i) + { + U16 idx = mIndices[i]; + if (new_idx[idx] == -1) + { //this vertex hasn't been added yet + new_idx[idx] = cur_idx; + + //copy vertex data + pos[cur_idx] = mPositions[idx]; + norm[cur_idx] = mNormals[idx]; + tc[cur_idx] = mTexCoords[idx]; + if (mWeights) + { + wght[cur_idx] = mWeights[idx]; + } + if (mBinormals) + { + binorm[cur_idx] = mBinormals[idx]; + } + + cur_idx++; + } + } + + for (U32 i = 0; i < mNumIndices; ++i) + { + mIndices[i] = new_idx[mIndices[i]]; + } + + free(mPositions); + free(mNormals); + free(mTexCoords); + free(mWeights); + free(mBinormals); + + mPositions = pos; + mNormals = norm; + mTexCoords = tc; + mWeights = wght; + mBinormals = binorm; + + //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); + //llinfos << result << llendl; + +} void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVector4a& size) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index e2d6ce4b69..32ac531306 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -792,39 +792,39 @@ public: class LLVolumeFace { public: - class VertexData - { - enum - { - POSITION = 0, - NORMAL = 1 - }; - - private: - void init(); - public: - VertexData(); - VertexData(const VertexData& rhs); - const VertexData& operator=(const VertexData& rhs); - - ~VertexData(); - LLVector4a& getPosition(); - LLVector4a& getNormal(); - const LLVector4a& getPosition() const; - const LLVector4a& getNormal() const; - void setPosition(const LLVector4a& pos); - void setNormal(const LLVector4a& norm); - - - LLVector2 mTexCoord; - - bool operator<(const VertexData& rhs) const; - bool operator==(const VertexData& rhs) const; - bool compareNormal(const VertexData& rhs, F32 angle_cutoff) const; - - private: - LLVector4a* mData; - }; + class VertexData + { + enum + { + POSITION = 0, + NORMAL = 1 + }; + + private: + void init(); + public: + VertexData(); + VertexData(const VertexData& rhs); + const VertexData& operator=(const VertexData& rhs); + + ~VertexData(); + LLVector4a& getPosition(); + LLVector4a& getNormal(); + const LLVector4a& getPosition() const; + const LLVector4a& getNormal() const; + void setPosition(const LLVector4a& pos); + void setNormal(const LLVector4a& norm); + + + LLVector2 mTexCoord; + + bool operator<(const VertexData& rhs) const; + bool operator==(const VertexData& rhs) const; + bool compareNormal(const VertexData& rhs, F32 angle_cutoff) const; + + private: + LLVector4a* mData; + }; LLVolumeFace(); LLVolumeFace(const LLVolumeFace& src); @@ -870,6 +870,8 @@ public: }; void optimize(F32 angle_cutoff = 2.f); + void cacheOptimize(); + void createOctree(F32 scaler = 0.25f, const LLVector4a& center = LLVector4a(0,0,0), const LLVector4a& size = LLVector4a(0.5f,0.5f,0.5f)); enum @@ -1027,12 +1029,13 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLVolume *volumep); // HACK to bypass Windoze confusion over // conversion if *(LLVolume*) to LLVolume& const LLVolumeFace &getVolumeFace(const S32 f) const {return mVolumeFaces[f];} // DO NOT DELETE VOLUME WHILE USING THIS REFERENCE, OR HOLD A POINTER TO THIS VOLUMEFACE - + U32 mFaceMask; // bit array of which faces exist in this volume LLVector3 mLODScaleBias; // vector for biasing LOD based on scale void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level); void copyVolumeFaces(const LLVolume* volume); + void cacheOptimize(); private: void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type); -- cgit v1.2.3 From b4c62e1a17957743ce88ada9f30f5e21cfba37d1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 7 Jan 2011 13:48:02 -0600 Subject: Clean up some xml errors from settings.xml --- indra/newview/app_settings/settings.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a7e7e913c2..4dcef07cbe 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7694,7 +7694,6 @@ Value 0.01 - RenderShadowBiasError Comment @@ -8952,7 +8951,7 @@ Type F32 Value - 0.125f + 0.125 MeshThreadCount @@ -11923,7 +11922,7 @@ Type F32 Value - 3.0 + 3.0 InterpolationPhaseOut @@ -11934,7 +11933,7 @@ Type F32 Value - 1.0 + 1.0 VerboseLogs -- cgit v1.2.3 From 8cfea0bab14afc29887de4b61350e6268b793622 Mon Sep 17 00:00:00 2001 From: Coaldust Numbers Date: Fri, 7 Jan 2011 15:08:42 -0500 Subject: VWR-1095 fix for problems with uploads following bulk upload failure de minimus contribution accepted without CA - Oz Linden --- doc/contributions.txt | 2 ++ indra/newview/llassetuploadresponders.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 3b14ce5125..9266ae3c5b 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -219,6 +219,8 @@ Catherine Pfeffer Celierra Darling VWR-1274 VWR-6975 +Coaldust Numbers + VWR-1095 Cron Stardust VWR-10579 Cypren Christenson diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index f12bc16d4b..dd5bc74b2a 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -126,6 +126,7 @@ void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason) break; } LLUploadDialog::modalUploadFinished(); + LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails } //virtual -- cgit v1.2.3 From 727a0e6fd454e3ec26c544d37f77e7346cc7d930 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 7 Jan 2011 15:20:48 -0500 Subject: expose << operator for LLMD5 objects in LL_COMMON_API --- indra/llcommon/llmd5.cpp | 0 indra/llcommon/llmd5.h | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 indra/llcommon/llmd5.cpp mode change 100644 => 100755 indra/llcommon/llmd5.h diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp old mode 100644 new mode 100755 diff --git a/indra/llcommon/llmd5.h b/indra/llcommon/llmd5.h old mode 100644 new mode 100755 index c8acbbe591..1526e6ac3c --- a/indra/llcommon/llmd5.h +++ b/indra/llcommon/llmd5.h @@ -103,7 +103,7 @@ public: void raw_digest(unsigned char *array) const; // provide 16-byte array for binary data void hex_digest(char *string) const; // provide 33-byte array for ascii-hex string - friend std::ostream& operator<< (std::ostream&, LLMD5 context); + friend LL_COMMON_API std::ostream& operator<< (std::ostream&, LLMD5 context); private: -- cgit v1.2.3 From 6e671281a26089d7cf947236162afc8013d25ec8 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 7 Jan 2011 17:16:28 -0500 Subject: SH-759 FIXED Various crashes in model floater after you open file picker then cancel Took out erroneous logic for handling when a file picker is canceled. Reviewed by Davep. --- indra/newview/llfloatermodelpreview.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index c0b5b7cfa6..f57d524b46 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -379,7 +379,8 @@ LLFloaterModelPreview::~LLFloaterModelPreview() { sInstance = NULL; - if ( mModelPreview->mModelLoader->mResetJoints ) + const LLModelLoader *model_loader = mModelPreview->mModelLoader; + if (model_loader && model_loader->mResetJoints) { gAgentAvatarp->resetJointPositions(); } @@ -2373,11 +2374,9 @@ void LLModelPreview::loadModel(std::string filename, S32 lod) LLMutexLock lock(this); - if (mModelLoader) - { - delete mModelLoader; - mModelLoader = NULL; - } + // This triggers if you bring up the file picker and then hit CANCEL. + // Just use the previous model (if any) and ignore that you brought up + // the file picker. if (filename.empty()) { @@ -2386,12 +2385,17 @@ void LLModelPreview::loadModel(std::string filename, S32 lod) // this is the initial file picking. Close the whole floater // if we don't have a base model to show for high LOD. mFMP->closeFloater(false); + mLoading = false; } - - mLoading = false; return; } + if (mModelLoader) + { + delete mModelLoader; + mModelLoader = NULL; + } + mLODFile[lod] = filename; if (lod == LLModel::LOD_HIGH) -- cgit v1.2.3 From e8423f150ffdd965da5b90ee625a8afc1519626f Mon Sep 17 00:00:00 2001 From: prep linden Date: Mon, 10 Jan 2011 11:04:13 -0500 Subject: Added support for parsing a matrix sids translation elements for joints --- indra/newview/llfloatermodelpreview.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index c0b5b7cfa6..57b648769d 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1789,7 +1789,25 @@ void LLModelLoader::processJointNode( domNode* pNode, std::maptypeID() != domTranslate::ID() ) { - llwarns<< "The found element is not a translate node" <( jointResolver.getElement() ); + if ( pMatrix ) + { + //llinfos<<"A matrix SID was however found!"<getValue(); + for ( int i = 0; i < 4; i++ ) + { + for( int j = 0; j < 4; j++ ) + { + workingTransform.mMatrix[i][j] = domArray[i + j*4]; + } + } + } + else + { + llwarns<< "The found element is not translate or matrix node - most likely a corrupt export!" <