diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 13 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llavataractions.cpp | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llcommandhandler.cpp | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llfloaterpreference.cpp | 57 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llfloaterworldmap.cpp | 368 | ||||
-rw-r--r-- | indra/newview/llfloaterworldmap.h | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llpanelpicks.cpp | 194 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llpanelpicks.h | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llpanelprofile.cpp | 61 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llpanelprofile.h | 2 | ||||
-rw-r--r-- | indra/newview/llshareavatarhandler.cpp | 59 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoicecallhandler.cpp | 61 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_profile.xml | 11 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_privacy.xml | 9 |
17 files changed, 680 insertions, 195 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7975b181d3..1db532787a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -405,6 +405,7 @@ set(viewer_SOURCE_FILES llsecapi.cpp llsechandler_basic.cpp llselectmgr.cpp + llshareavatarhandler.cpp llsidepanelappearance.cpp llsidepanelinventory.cpp llsidepanelinventorysubpanel.cpp @@ -546,6 +547,7 @@ set(viewer_SOURCE_FILES llvoclouds.cpp llvograss.cpp llvoground.cpp + llvoicecallhandler.cpp llvoicechannel.cpp llvoiceclient.cpp llvoicevisualizer.cpp diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 199ee6822f..10c8904b6a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2612,7 +2612,7 @@ <key>Value</key> <string>http://www.secondlife.com</string> </map> - <key>DisableCameraConstraints</key> + <key>DisableCameraConstraints</key> <map> <key>Comment</key> <string>Disable the normal bounds put on the camera by avatar position</string> @@ -3932,6 +3932,17 @@ <key>Value</key> <string>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]</string> </map> + <key>WebProfileURL</key> + <map> + <key>Comment</key> + <string>URL for Web Profiles</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>http://profiles.secondlife.local/[AGENT_NAME]</string> + </map> <key>HighResSnapshot</key> <map> <key>Comment</key> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 066b4d8bc3..aea7f00222 100644..100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -56,9 +56,11 @@ #include "llmutelist.h" #include "llnotificationsutil.h" // for LLNotificationsUtil #include "llpaneloutfitedit.h" +#include "llpanelprofile.h" #include "llrecentpeople.h" #include "llsidetray.h" #include "lltrans.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" // for handle_lure #include "llviewerregion.h" @@ -306,6 +308,20 @@ void LLAvatarActions::showProfile(const LLUUID& id) params["id"] = id; params["open_tab_name"] = "panel_profile"; + // PROFILES: open in webkit window + std::string full_name; + if (gCacheName->getFullName(id,full_name)) + { + std::string agent_name = LLCacheName::buildUsername(full_name); + llinfos << "opening web profile for " << agent_name << llendl; + std::string url = getProfileURL(agent_name); + LLWeb::loadURLInternal(url); + } + else + { + llwarns << "no name info for agent id " << id << llendl; + } +#if 0 //Show own profile if(gAgent.getID() == id) { @@ -316,6 +332,7 @@ void LLAvatarActions::showProfile(const LLUUID& id) { LLSideTray::getInstance()->showPanel("panel_profile_view", params); } +#endif } } diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 360ba080ac..360ba080ac 100644..100755 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 338b6555ff..2d2e66f6d4 100644..100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -286,6 +286,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mLanguageChanged(false), mDoubleClickActionDirty(false) { + //Build Floater is now Called from LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); static bool registered_dialog = false; @@ -322,16 +323,61 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.MaturitySettings", boost::bind(&LLFloaterPreference::onChangeMaturity, this)); mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); + + sSkin = gSavedSettings.getString("SkinCurrent"); + mCommitCallbackRegistrar.add("Pref.CommitDoubleClickChekbox", boost::bind(&LLFloaterPreference::onDoubleClickCheckBox, this, _1)); mCommitCallbackRegistrar.add("Pref.CommitRadioDoubleClick", boost::bind(&LLFloaterPreference::onDoubleClickRadio, this)); - sSkin = gSavedSettings.getString("SkinCurrent"); - gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); + + LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); +} + +void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type ) +{ + if ( APT_PROPERTIES == type ) + { + const LLAvatarData* pAvatarData = static_cast<const LLAvatarData*>( pData ); + if( pAvatarData && gAgent.getID() == pAvatarData->avatar_id ) + { + 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.flags = pAvatarData->flags; + mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH; +} + +void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData ) +{ + getChild<LLUICtrl>("online_searchresults")->setValue( (bool)(pAvatarData->flags & AVATAR_ALLOW_PUBLISH) ); +} + +void LLFloaterPreference::saveAvatarProperties( void ) +{ + mAvatarProperties.allow_publish = getChild<LLUICtrl>("online_searchresults")->getValue(); + if ( mAvatarProperties.allow_publish ) + { + mAvatarProperties.flags |= AVATAR_ALLOW_PUBLISH; + } + + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties ); +} + + BOOL LLFloaterPreference::postBuild() { gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMFloater::processChatHistoryStyleUpdate, _2)); @@ -415,6 +461,8 @@ void LLFloaterPreference::saveSettings() void LLFloaterPreference::apply() { + LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); if (sSkin != gSavedSettings.getString("SkinCurrent")) { @@ -486,6 +534,8 @@ void LLFloaterPreference::apply() } } + saveAvatarProperties(); + if (mDoubleClickActionDirty) { updateDoubleClickSettings(); @@ -527,6 +577,7 @@ void LLFloaterPreference::cancel() void LLFloaterPreference::onOpen(const LLSD& key) { + // this variable and if that follows it are used to properly handle busy mode response message static bool initialized = FALSE; // if user is logged in and we haven't initialized busy_response yet, do it @@ -553,7 +604,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) (gAgent.isMature() || gAgent.isGodlike()); LLComboBox* maturity_combo = getChild<LLComboBox>("maturity_desired_combobox"); - + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest( gAgent.getID() ); if (can_choose_maturity) { // if they're not adult or a god, they shouldn't see the adult selection, so delete it diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 0f51189853..165de9f42d 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); @@ -77,6 +78,11 @@ public: // translate user's busy response message according to current locale if message is default, otherwise do nothing static void initBusyResponse(); + void processProperties( void* pData, EAvatarProcessorType type ); + void processProfileProperties(const LLAvatarData* pAvatarData ); + void storeAvatarProperties( const LLAvatarData* pAvatarData ); + void saveAvatarProperties( void ); + protected: void onBtnOK(); void onBtnCancel(); @@ -164,6 +170,8 @@ private: bool mOriginalHideOnlineStatus; std::string mDirectoryVisibility; + + LLAvatarData mAvatarProperties; }; class LLPanelPreference : public LLPanel diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index ba0eb8a711..017cd2fc49 100644..100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -72,7 +72,6 @@ #include "llweb.h" #include "llslider.h" #include "message.h" - #include "llwindow.h" // copyTextToClipboard() //--------------------------------------------------------------------------- @@ -106,8 +105,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,21 +116,52 @@ 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; +// 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; @@ -142,7 +172,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 +214,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 +240,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 +253,32 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { mPanel = getChild<LLPanel>("objects_mapview"); - + LLComboBox *avatar_combo = getChild<LLComboBox>("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<LLSearchEditor>("location"); location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1)); location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this)); getChild<LLScrollListCtrl>("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); - + LLComboBox *landmark_combo = getChild<LLComboBox>( "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<LLUICtrl>("zoom slider")->setValue(LLWorldMapView::sMapScale); - + setDefaultBtn(NULL); - + mZoomTimer.stop(); - + onChangeMaturity(); - + return TRUE; } @@ -257,11 +287,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 +315,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 +329,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<LLUICtrl>("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 +386,7 @@ BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } } - + return LLFloater::handleScrollWheel(x, y, clicks); } @@ -381,7 +411,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 +423,7 @@ void LLFloaterWorldMap::draw() { getChild<LLUICtrl>("avatar_icon")->setColor( map_track_disabled_color); } - + if (LLTracker::TRACKING_LANDMARK == tracking_status) { getChild<LLUICtrl>("landmark_icon")->setColor( map_track_color); @@ -402,7 +432,7 @@ void LLFloaterWorldMap::draw() { getChild<LLUICtrl>("landmark_icon")->setColor( map_track_disabled_color); } - + if (LLTracker::TRACKING_LOCATION == tracking_status) { getChild<LLUICtrl>("location_icon")->setColor( map_track_color); @@ -422,21 +452,21 @@ void LLFloaterWorldMap::draw() getChild<LLUICtrl>("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<LLUICtrl>("zoom slider")->getValue().asReal()) { @@ -451,7 +481,7 @@ void LLFloaterWorldMap::draw() mCurZoomVal = lerp(mCurZoomVal, (F32)getChild<LLUICtrl>("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 +507,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 +537,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 +549,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 +558,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 +604,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 +618,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,7 +661,7 @@ 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 ); @@ -646,16 +676,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 +695,19 @@ void LLFloaterWorldMap::updateLocation() if ( gotSimName ) { mSetToUserPosition = FALSE; - + // Fill out the location field getChild<LLUICtrl>("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 +729,17 @@ void LLFloaterWorldMap::updateLocation() pos_global[2] = 200; } } - + getChild<LLUICtrl>("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 +766,12 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 { // fill in UI based on URL gFloaterWorldMap->getChild<LLUICtrl>("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 +843,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 +851,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 +863,7 @@ void LLFloaterWorldMap::buildAvatarIDList() { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } - + list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); list->selectFirstItem(); } @@ -843,7 +873,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 +881,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 +900,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 +979,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<LLSlider>("zoom slider")->setMinValue(min_power); @@ -997,19 +1027,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 +1063,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 +1098,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit() trackLandmark( item_id); onShowTargetBtn(); - + // Reset to user postion if nothing is tracked mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } @@ -1080,19 +1110,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 +1135,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()) { @@ -1124,6 +1154,12 @@ void LLFloaterWorldMap::onAvatarComboCommit() } } +void LLFloaterWorldMap::avatarTrackFromSlapp( const LLUUID& id ) +{ + trackAvatar( id, "av" ); + onShowTargetBtn(); +} + void LLFloaterWorldMap::onLocationFocusChanged( LLFocusableElement* focus ) { updateSearchEnabled(); @@ -1148,13 +1184,13 @@ void LLFloaterWorldMap::onLocationCommit() { return; } - + clearLocationSelection(FALSE); mCompletingRegionName = ""; mLastRegionName = ""; - + std::string str = getChild<LLUICtrl>("location")->getValue().asString(); - + // Trim any leading and trailing spaces in the search target std::string saved_str = str; LLStringUtil::trim( str ); @@ -1162,7 +1198,7 @@ void LLFloaterWorldMap::onLocationCommit() { // Set the value in the UI if any spaces were removed getChild<LLUICtrl>("location")->setValue(str); } - + LLStringUtil::toLower(str); mCompletingRegionName = str; LLWorldMap::getInstance()->setTrackingCommit(); @@ -1183,13 +1219,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 +1261,7 @@ void LLFloaterWorldMap::onCopySLURL() LLSD args; args["SLURL"] = mSLURL.getSLURLString(); - + LLNotificationsUtil::add("CopySLURL", args); } @@ -1246,26 +1282,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 +1309,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 +1330,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 +1353,10 @@ void LLFloaterWorldMap::teleport() && landmark->getRegionID(region_id)) { LLLandmark::requestRegionHandle( - gMessageSystem, - gAgent.getRegionHost(), - region_id, - NULL); + gMessageSystem, + gAgent.getRegionHost(), + region_id, + NULL); } } } @@ -1332,7 +1368,7 @@ void LLFloaterWorldMap::teleport() { make_ui_sound("UISndInvalidOp"); } - + // Do the teleport, which will also close the floater if (teleport_home) { @@ -1367,7 +1403,7 @@ void LLFloaterWorldMap::teleportToLandmark() { BOOL has_destination = FALSE; LLUUID destination_id; // Null means "home" - + if( LLTracker::getTrackedLandmarkAssetID() == sHomeID ) { has_destination = TRUE; @@ -1388,14 +1424,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 +1464,12 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) { return; } - + LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); - + S32 name_length = mCompletingRegionName.length(); - + LLSD match; S32 num_results = 0; @@ -1443,7 +1479,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 +1495,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 +1508,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) getChild<LLUICtrl>("search_results")->setFocus(TRUE); onCommitSearchResult(); } - + // if we found nothing, say "none" if (num_results == 0) { @@ -1486,7 +1522,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 +1530,19 @@ void LLFloaterWorldMap::onCommitSearchResult() return; } LLStringUtil::toLower(sim_name); - + std::map<U64, LLSimInfo*>::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 +1552,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<LLUICtrl>("location")->setValue(sim_name); trackLocation(pos_global); setDefaultBtn("Teleport"); break; } } - + onShowTargetBtn(); } @@ -1531,15 +1567,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 1628a421ec..783d9f4819 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -106,6 +106,11 @@ 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/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 15e826ac2c..597ecc0589 100644..100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -70,6 +70,104 @@ static const std::string CLASSIFIED_NAME("classified_name"); static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks("panel_picks"); +class LLPickHandler : public LLCommandHandler, + public LLAvatarPropertiesObserver +{ +public: + + std::set<LLUUID> mPickIds; + + // requires trusted browser to trigger + LLPickHandler() : LLCommandHandler("pick", UNTRUSTED_THROTTLE) { } + + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + // handle app/classified/create urls first + if (params.size() == 1 && params[0].asString() == "create") + { + createPick(); + return true; + } + + // then handle the general app/pick/{UUID}/{CMD} urls + if (params.size() < 2) + { + return false; + } + + // get the ID for the pick_id + LLUUID pick_id; + if (!pick_id.set(params[0], FALSE)) + { + 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; + } + } + + 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<LLPickData*>(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); + } +}; + +LLPickHandler gPickHandler; + class LLClassifiedHandler : public LLCommandHandler, public LLAvatarPropertiesObserver @@ -80,6 +178,8 @@ public: std::set<LLUUID> mClassifiedIds; + std::string mRequestVerb; + bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { // handle app/classified/create urls first @@ -107,6 +207,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 +237,32 @@ 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; + // 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); + } } /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) @@ -299,7 +422,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)); @@ -776,6 +902,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<LLAccordionCtrlTab>(name); @@ -945,6 +1078,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(); @@ -978,6 +1117,35 @@ void LLPanelPicks::onPanelClassifiedEdit() { return; } + editClassified(c_item->getClassifiedId()); +} + +LLClassifiedItem *LLPanelPicks::findClassifiedById(const LLUUID& classified_id) +{ + // HACK - find item by classified id. Should be a better way. + std::vector<LLPanel*> items; + mClassifiedsList->getItems(items); + LLClassifiedItem* c_item = NULL; + for(std::vector<LLPanel*>::iterator it = items.begin(); it != items.end(); ++it) + { + LLClassifiedItem *test_item = dynamic_cast<LLClassifiedItem*>(*it); + if (test_item && test_item->getClassifiedId() == classified_id) + { + c_item = test_item; + 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; + return; + } LLSD params; params["classified_id"] = c_item->getClassifiedId(); diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index a02ed81bb0..29db110523 100644..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,8 +107,10 @@ 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); void onClickMenuEdit(); bool onEnableMenuItem(const LLSD& user_data); @@ -118,6 +121,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 b035d7d473..170e8e9846 100644..100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -33,10 +33,41 @@ #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"; +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: + // 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 = getProfileURL(agent_name); + LLWeb::loadURLInternal(url); + + return true; + } +}; +LLProfileHandler gProfileHandler; + class LLAgentHandler : public LLCommandHandler { public: @@ -281,6 +312,36 @@ void LLPanelProfile::onOpen(const LLSD& key) picks->openClassifiedInfo(params); } } + else if (panel == "edit_classified") + { + LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]); + if (picks) + { + LLSD params = key; + params.erase("show_tab_panel"); + params.erase("open_tab_name"); + picks->openClassifiedEdit(params); + } + } + else if (panel == "create_pick") + { + LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]); + if (picks) + { + picks->createNewPick(); + } + } + else if (panel == "edit_pick") + { + LLPanelPicks* picks = dynamic_cast<LLPanelPicks *>(getTabContainer()[PANEL_PICKS]); + if (picks) + { + LLSD params = key; + params.erase("show_tab_panel"); + params.erase("open_tab_name"); + picks->openPickEdit(params); + } + } } } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 0a572e6f25..fca359f51e 100644..100755 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -32,6 +32,8 @@ class LLTabContainer; +std::string getProfileURL(const std::string& agent_name); + /** * Base class for Profile View and My Profile. */ diff --git a/indra/newview/llshareavatarhandler.cpp b/indra/newview/llshareavatarhandler.cpp new file mode 100644 index 0000000000..34194970b8 --- /dev/null +++ b/indra/newview/llshareavatarhandler.cpp @@ -0,0 +1,59 @@ +/** + * @file llshareavatarhandler.cpp + * @brief slapp to handle sharing with an avatar + * + * $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 7dbaa4cf92..70696dc762 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,7 @@ public: }; LLInventoryHandler gInventoryHandler; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp new file mode 100644 index 0000000000..274bd75208 --- /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; + 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 90dbddaff7..37265d65f1 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -328,17 +328,6 @@ name="homepage_edit" width="272"> </line_editor> - <check_box - follows="left|top" - font="SansSerifSmall" - label="Show me in Search results" - layout="topleft" - left="8" - name="show_in_search_checkbox" - height="15" - label_text.text_color="white" - top_pad="12" - width="100" /> <text follows="left|top" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 626122c0b0..16becbfe2a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -42,6 +42,15 @@ </text> <check_box height="16" + enabled="true" + label="Show me in Search results" + layout="topleft" + left="30" + name="online_searchresults" + top_pad="20" + width="350" /> + <check_box + height="16" enabled="false" label="Only friends and groups know I'm online" layout="topleft" |