diff options
author | Josh Bell <josh@lindenlab.com> | 2007-11-01 22:02:35 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-11-01 22:02:35 +0000 |
commit | 7afa8058aae0d5363cc19c7df1e6d2d7ec3bf7ac (patch) | |
tree | 52f41bda3e57a58e968421212a8a48eead6f653d /indra/newview | |
parent | 833e8d5c2a1dd48fd89b8b438dbe56572697bb76 (diff) |
svn merge -r 72652:72881 svn+ssh://svn.lindenlab.com/svn/linden/branches/sl-search-11 --> release
QAR-11: pair-reviewed the merge w/ Sam.
Diffstat (limited to 'indra/newview')
48 files changed, 1403 insertions, 253 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d825704bfc..fb411315ae 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -903,6 +903,7 @@ BOOL LLAgent::canManageEstate() const { return mRegionp && mRegionp->canManageEstate(); } + //----------------------------------------------------------------------------- // sendMessage() //----------------------------------------------------------------------------- @@ -4709,6 +4710,22 @@ U8 LLAgent::getGodLevel() const #endif } +bool LLAgent::isTeen() const +{ + return mAccess < SIM_ACCESS_MATURE; +} + +void LLAgent::setTeen(bool teen) +{ + if (teen) + { + mAccess = SIM_ACCESS_PG; + } + else + { + mAccess = SIM_ACCESS_MATURE; + } +} void LLAgent::buildFullname(std::string& name) const { @@ -5628,7 +5645,7 @@ void LLAgent::teleportRequest( } // Landmark ID = LLUUID::null means teleport home -void LLAgent::teleportViaLandmark(const LLUUID& landmark_id) +void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { LLViewerRegion *regionp = getRegion(); if(regionp && teleportCore()) @@ -5638,7 +5655,7 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_id) msg->nextBlockFast(_PREHASH_Info); msg->addUUIDFast(_PREHASH_AgentID, getID()); msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - msg->addUUIDFast(_PREHASH_LandmarkID, landmark_id); + msg->addUUIDFast(_PREHASH_LandmarkID, landmark_asset_id); sendReliableMessage(); } } @@ -6851,7 +6868,7 @@ void LLAgent::removeWearable( EWearableType type ) { LLWearable* old_wearable = mWearableEntry[ type ].mWearable; - if ( (gAgent.mAccess < SIM_ACCESS_MATURE) + if ( (gAgent.isTeen()) && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) { // Can't take off underclothing in simple UI mode or on PG accounts @@ -6986,8 +7003,8 @@ void LLAgent::setWearableOutfit( wearables_to_remove[WT_SOCKS] = remove; wearables_to_remove[WT_JACKET] = remove; wearables_to_remove[WT_GLOVES] = remove; - wearables_to_remove[WT_UNDERSHIRT] = (gAgent.mAccess >= SIM_ACCESS_MATURE) & remove; - wearables_to_remove[WT_UNDERPANTS] = (gAgent.mAccess >= SIM_ACCESS_MATURE) & remove; + wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove; + wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove; wearables_to_remove[WT_SKIRT] = remove; S32 count = wearables.count(); @@ -7225,7 +7242,7 @@ void LLAgent::userRemoveWearable( void* userdata ) EWearableType type = (EWearableType)(intptr_t)userdata; if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& - //!((gAgent.mAccess >= SIM_ACCESS_MATURE) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) + //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { gAgent.removeWearable( type ); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 5b6c3c0a1d..ad0606aea2 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -239,6 +239,8 @@ public: BOOL isGodlike() const; U8 getGodLevel() const; + bool isTeen() const; + void setTeen(bool teen); BOOL isGroupTitleHidden() const { return mHideGroupTitle; } BOOL isGroupMember() const { return !mGroupID.isNull(); } // This is only used for building titles! const LLUUID &getGroupID() const { return mGroupID; } @@ -666,8 +668,6 @@ public: F32 mDrawDistance; - // Access or "maturity" level - U8 mAccess; // SIM_ACCESS_MATURE or SIM_ACCESS_PG U64 mGroupPowers; BOOL mHideGroupTitle; char mGroupTitle[DB_GROUP_TITLE_BUF_SIZE]; /*Flawfinder: ignore*/ // honorific, like "Sir" @@ -703,6 +703,8 @@ public: static std::map<LLString, LLString> sTeleportProgressMessages; private: + // Access or "maturity" level + U8 mAccess; // SIM_ACCESS_MATURE or SIM_ACCESS_PG ETeleportState mTeleportState; LLString mTeleportMessage; diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp new file mode 100644 index 0000000000..3a31074ed0 --- /dev/null +++ b/indra/newview/llclassifiedstatsresponder.cpp @@ -0,0 +1,57 @@ +/** + * @file llparcelrequest.cpp + * @brief Implementation of the LLParcelRequest class. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llclassifiedstatsresponder.h" + +#include "llpanelclassified.h" +#include "llpanel.h" +#include "llhttpclient.h" +#include "llsdserialize.h" +#include "llviewerregion.h" +#include "llview.h" +#include "message.h" + +LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLViewHandle classified_panel_handle) +: mClassifiedPanelHandle(classified_panel_handle) +{ +} +/*virtual*/ +void LLClassifiedStatsResponder::result(const LLSD& content) +{ + LLUUID classified_id = content["classified_id"]; + S32 teleport = content["teleport_clicks"].asInteger(); + S32 map = content["map_clicks"].asInteger(); + S32 profile = content["profile_clicks"].asInteger(); + S32 search_teleport = content["search_teleport_clicks"].asInteger(); + S32 search_map = content["search_map_clicks"].asInteger(); + S32 search_profile = content["search_profile_clicks"].asInteger(); + + std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", + teleport + search_teleport, + map + search_map, + profile + search_profile); + + LLPanelClassified* classified_panelp = (LLPanelClassified*)LLPanel::getPanelByHandle(mClassifiedPanelHandle); + + if(classified_panelp) + { + classified_panelp->setClickThroughText(msg); + } + +} + +/*virtual*/ +void LLClassifiedStatsResponder::error(U32 status, const std::string& reason) +{ + llinfos << "LLClassifiedStatsResponder::error(" + << status << ": " << reason << ")" << llendl; +} + diff --git a/indra/newview/llclassifiedstatsresponder.h b/indra/newview/llclassifiedstatsresponder.h new file mode 100644 index 0000000000..25ae67141c --- /dev/null +++ b/indra/newview/llclassifiedstatsresponder.h @@ -0,0 +1,28 @@ +/** + * @file llclassifiedstatsrequest.h + * @brief Responder class for classified stats request. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_LLCLASSIFIEDSTATSRESPONDER_H +#define LL_LLCLASSIFIEDSTATSRESPONDER_H + +#include "llhttpclient.h" +#include "llview.h" + +class LLClassifiedStatsResponder : public LLHTTPClient::Responder +{ +public: + LLClassifiedStatsResponder(LLViewHandle classified_panel_handle); + //If we get back a normal response, handle it here + virtual void result(const LLSD& content); + //If we get back an error (not found, etc...), handle it here + virtual void error(U32 status, const std::string& reason); + +protected: + LLViewHandle mClassifiedPanelHandle; +}; + +#endif // LL_LLCLASSIFIEDSTATSRESPONDER_H diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp new file mode 100644 index 0000000000..2b9d011e90 --- /dev/null +++ b/indra/newview/llfloaterevent.cpp @@ -0,0 +1,107 @@ +/** + * @file llfloaterevent.cpp + * @brief LLFloaterEventInfo class implementation + * + * Event information as shown in a floating window from secondlife:// command + * handler. + * + * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterevent.h" + +// viewer project includes +#include "llcommandhandler.h" +#include "llpanelevent.h" +#include "llvieweruictrlfactory.h" + +// linden library includes +#include "lluuid.h" + +//////////////////////////////////////////////////////////////////////////// +// LLFloaterEventInfo + +//----------------------------------------------------------------------------- +// Globals +//----------------------------------------------------------------------------- + +LLMap< U32, LLFloaterEventInfo* > gEventInfoInstances; + +class LLEventHandler : public LLCommandHandler +{ +public: + LLEventHandler() : LLCommandHandler("event") { } + bool handle(const std::vector<std::string>& tokens) + { + if (tokens.size() < 2) + { + return false; + } + U32 event_id = atoi(tokens[0].c_str()); + if (tokens[1] == "about") + { + LLFloaterEventInfo::show(event_id); + return true; + } + return false; + } +}; +LLEventHandler gEventHandler; + +LLFloaterEventInfo::LLFloaterEventInfo(const std::string& name, const U32 event_id) +: LLFloater(name), + mEventID( event_id ) +{ + + mFactoryMap["event_details_panel"] = LLCallbackMap(LLFloaterEventInfo::createEventDetail, this); + gUICtrlFactory->buildFloater(this, "floater_preview_event.xml", &getFactoryMap()); + gEventInfoInstances.addData(event_id, this); +} + +LLFloaterEventInfo::~LLFloaterEventInfo() +{ + // child views automatically deleted + gEventInfoInstances.removeData(mEventID); +} + +void LLFloaterEventInfo::displayEventInfo(const U32 event_id) +{ + mPanelEventp->setEventID(event_id); + this->setFrontmost(true); +} + +// static +void* LLFloaterEventInfo::createEventDetail(void* userdata) +{ + LLFloaterEventInfo *self = (LLFloaterEventInfo*)userdata; + self->mPanelEventp = new LLPanelEvent(); + gUICtrlFactory->buildPanel(self->mPanelEventp, "panel_event.xml"); + + return self->mPanelEventp; +} + +// static +LLFloaterEventInfo* LLFloaterEventInfo::show(const U32 event_id) +{ + LLFloaterEventInfo *floater; + if (gEventInfoInstances.checkData(event_id)) + { + // ...bring that window to front + floater = gEventInfoInstances.getData(event_id); + floater->open(); /*Flawfinder: ignore*/ + floater->setFrontmost(true); + } + else + { + floater = new LLFloaterEventInfo("eventinfo", event_id ); + floater->center(); + floater->open(); /*Flawfinder: ignore*/ + floater->displayEventInfo(event_id); + floater->setFrontmost(true); + } + + return floater; +} diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h new file mode 100644 index 0000000000..436b2a9f75 --- /dev/null +++ b/indra/newview/llfloaterevent.h @@ -0,0 +1,39 @@ +/** + * @file llfloaterevent.h + * @brief LLFloaterEvent class implementation + * + * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +/** +* Event information as shown in a floating window from a secondlife:// url. +* Just a wrapper for LLPanelEvent. +*/ + +#ifndef LL_LLFLOATEREVENT_H +#define LL_LLFLOATEREVENT_H + +#include "llfloater.h" + +class LLPanelEvent; + +class LLFloaterEventInfo : public LLFloater +{ +public: + LLFloaterEventInfo(const std::string& name, const U32 event_id ); + /*virtual*/ ~LLFloaterEventInfo(); + + void displayEventInfo(const U32 event_id); + + static LLFloaterEventInfo* show(const U32 event_id); + + static void* createEventDetail(void* userdata); + +private: + U32 mEventID; // for which event is this window? + LLPanelEvent* mPanelEventp; + +}; + +#endif // LL_LLFLOATEREVENT_H diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 43c39aa3ea..283b3f45fa 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -355,7 +355,6 @@ BOOL LLPanelLandGeneral::postBuild() childSetPrevalidate("Name", LLLineEditor::prevalidatePrintableNotPipe); childSetUserData("Name", this); - mEditDesc = LLUICtrlFactory::getTextEditorByName(this, "Description"); mEditDesc->setCommitOnFocusLost(TRUE); mEditDesc->setCommitCallback(onCommitAny); @@ -1865,13 +1864,11 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mLocationText(NULL), mSetBtn(NULL), mClearBtn(NULL), - mAllowPublishCtrl(NULL), mMatureCtrl(NULL), mPushRestrictionCtrl(NULL), mPublishHelpButton(NULL), mParcel(parcel) { - } @@ -1932,7 +1929,7 @@ BOOL LLPanelLandOptions::postBuild() mPublishHelpButton->setClickedCallback(onClickPublishHelp, this); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { // Disable these buttons if they are PG (Teen) users mPublishHelpButton->setVisible(FALSE); @@ -2147,7 +2144,7 @@ void LLPanelLandOptions::refresh() mMatureCtrl->setEnabled( can_change_identity ); mPublishHelpButton->setEnabled( can_change_identity ); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { // Disable these buttons if they are PG (Teen) users mPublishHelpButton->setVisible(FALSE); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 9eb9172b60..d8b7ecfe88 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -42,17 +42,18 @@ typedef std::set<LLUUID, lluuid_less> uuid_list_t; const F32 CACHE_REFRESH_TIME = 2.5f; -class LLTextBox; +class LLButton; class LLCheckBoxCtrl; class LLRadioGroup; class LLComboBox; -class LLButton; class LLNameListCtrl; class LLSpinCtrl; class LLLineEditor; class LLRadioGroup; class LLParcelSelectionObserver; class LLTabContainer; +class LLTextBox; +class LLTextEditor; class LLTextureCtrl; class LLViewerTextEditor; class LLParcelSelection; @@ -347,7 +348,6 @@ protected: LLButton* mSetBtn; LLButton* mClearBtn; - LLCheckBoxCtrl *mAllowPublishCtrl; LLCheckBoxCtrl *mMatureCtrl; LLCheckBoxCtrl *mPushRestrictionCtrl; LLButton *mPublishHelpButton; diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 952c56af1b..a158000da5 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -57,7 +57,7 @@ #include "llspinctrl.h" #include "llstatgraph.h" #include "llstatusbar.h" -#include "lltextbox.h" +//#include "lltextbox.h" #include "llui.h" #include "llviewermenu.h" #include "llviewerparceloverlay.h" diff --git a/indra/newview/llfloatermap.h b/indra/newview/llfloatermap.h index 24f7b9fa05..369ac32039 100644 --- a/indra/newview/llfloatermap.h +++ b/indra/newview/llfloatermap.h @@ -35,11 +35,6 @@ #include "llfloater.h" class LLNetMap; -class LLSliderCtrl; -class LLStatGraph; -class LLTextBox; -class LLUICtrl; -class LLViewerImage; // // Classes diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp new file mode 100644 index 0000000000..61b7176153 --- /dev/null +++ b/indra/newview/llfloaterparcel.cpp @@ -0,0 +1,120 @@ +/** + * @file llfloaterparcel.cpp + * @brief LLFloaterParcel class implementation + * Parcel information as shown in a floating window from secondlife:// command + * handler. + * + * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * $License$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llfloaterparcel.h" + +// viewer project includes +#include "llcommandhandler.h" +#include "llpanelplace.h" +#include "llvieweruictrlfactory.h" + +// linden library includes +#include "lluuid.h" + +//----------------------------------------------------------------------------- +// Globals +//----------------------------------------------------------------------------- + +LLMap< const LLUUID, LLFloaterParcelInfo* > gPlaceInfoInstances; + +class LLParcelHandler : public LLCommandHandler +{ +public: + LLParcelHandler() : LLCommandHandler("parcel") { } + bool handle(const std::vector<std::string>& params) + { + if (params.size() < 2) + { + return false; + } + LLUUID parcel_id; + if (!parcel_id.set(params[0], FALSE)) + { + return false; + } + if (params[1] == "about") + { + LLFloaterParcelInfo::show(parcel_id); + return true; + } + return false; + } +}; +LLParcelHandler gParcelHandler; + +//----------------------------------------------------------------------------- +// Member functions +//----------------------------------------------------------------------------- + +//---------------------------------------------------------------------------- + +void* LLFloaterParcelInfo::createPanelPlace(void* data) +{ + LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; + self->mPanelParcelp = new LLPanelPlace(); // allow edit self + gUICtrlFactory->buildPanel(self->mPanelParcelp, "panel_place.xml"); + return self->mPanelParcelp; +} + +//---------------------------------------------------------------------------- + + +LLFloaterParcelInfo::LLFloaterParcelInfo(const std::string& name, const LLUUID &parcel_id) +: LLFloater(name), + mParcelID( parcel_id ) +{ + mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); + gUICtrlFactory->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + gPlaceInfoInstances.addData(parcel_id, this); +} + +// virtual +LLFloaterParcelInfo::~LLFloaterParcelInfo() +{ + // child views automatically deleted + gPlaceInfoInstances.removeData(mParcelID); + +} + +void LLFloaterParcelInfo::displayParcelInfo(const LLUUID& parcel_id) +{ + mPanelParcelp->setParcelID(parcel_id); +} + +// static +LLFloaterParcelInfo* LLFloaterParcelInfo::show(const LLUUID &parcel_id) +{ + if (parcel_id.isNull()) + { + return NULL; + } + + LLFloaterParcelInfo *floater; + if (gPlaceInfoInstances.checkData(parcel_id)) + { + // ...bring that window to front + floater = gPlaceInfoInstances.getData(parcel_id); + floater->open(); /*Flawfinder: ignore*/ + floater->setFrontmost(true); + } + else + { + floater = new LLFloaterParcelInfo("parcelinfo", parcel_id ); + floater->center(); + floater->open(); /*Flawfinder: ignore*/ + floater->displayParcelInfo(parcel_id); + floater->setFrontmost(true); + } + + return floater; +} + + diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llfloaterparcel.h new file mode 100644 index 0000000000..f829d30a9e --- /dev/null +++ b/indra/newview/llfloaterparcel.h @@ -0,0 +1,40 @@ +/** + * @file llfloaterparcelinfo.h + * @brief LLFloaterParcelInfo class definition + * + * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +/** + * Parcel information as shown in a floating window from a sl-url. + * Just a wrapper for LLPanelPlace, shared with the Find directory. + */ + +#ifndef LL_FLOATERPARCELINFO_H +#define LL_FLOATERPARCELINFO_H + +#include "llfloater.h" + +class LLPanelPlace; + +class LLFloaterParcelInfo +: public LLFloater +{ +public: + static void* createPanelPlace(void* data); + + LLFloaterParcelInfo(const std::string& name, const LLUUID &parcel_id ); + /*virtual*/ ~LLFloaterParcelInfo(); + + void displayParcelInfo(const LLUUID& parcel_id); + + static LLFloaterParcelInfo* show(const LLUUID& parcel_id); + +private: + LLUUID mParcelID; // for which parcel is this window? + LLPanelPlace* mPanelParcelp; +}; + + +#endif diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 8dcdb99a69..cab9d37cf7 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -116,7 +116,7 @@ BOOL LLFloaterPostcard::postBuild() childDisable("from_form"); childSetAction("publish_help_btn", onClickPublishHelp, this); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { // Disable these buttons if they are PG (Teen) users childDisable("allow_publish_check"); diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp new file mode 100644 index 0000000000..741cfb02b8 --- /dev/null +++ b/indra/newview/llfloaterurldisplay.cpp @@ -0,0 +1,71 @@ +/** + * @file llpreviewlandmark.cpp + * @brief LLFloaterURLDisplayList class implementation + * + * Copyright (c) 2002-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterurldisplay.h" + +#include "llpanelplace.h" +#include "llvieweruictrlfactory.h" + +#include "v3dmath.h" + +//////////////////////////////////////////////////////////////////////////// +// LLFloaterURLDisplay + + +LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) +{ + mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); + gUICtrlFactory->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + this->setVisible(false); +} + +LLFloaterURLDisplay::~LLFloaterURLDisplay() +{ +} + +void LLFloaterURLDisplay::displayParcelInfo(U64 region_handle, const LLVector3& pos_local) +{ + mRegionHandle = region_handle; + mRegionPosition = pos_local; + LLVector3d pos_global = from_region_handle(region_handle); + pos_global += (LLVector3d)pos_local; + + LLUUID region_id; // don't know this + LLUUID landmark_asset_id; // don't know this either + mPlacePanel->displayParcelInfo(pos_local, landmark_asset_id, region_id, pos_global); + + this->setVisible(true); + this->setFrontmost(true); +} + +void LLFloaterURLDisplay::setSnapshotDisplay(const LLUUID& snapshot_id) +{ + mPlacePanel->setSnapshot(snapshot_id); +} + +void LLFloaterURLDisplay::setName(const std::string& name) +{ + mPlacePanel->setName(name); +} + +void LLFloaterURLDisplay::setLocationString(const std::string& name) +{ + mPlacePanel->setLocationString(name); +} + +// static +void* LLFloaterURLDisplay::createPlaceDetail(void* userdata) +{ + LLFloaterURLDisplay *self = (LLFloaterURLDisplay*)userdata; + self->mPlacePanel = new LLPanelPlace(); + gUICtrlFactory->buildPanel(self->mPlacePanel, "panel_place.xml"); + + return self->mPlacePanel; +} diff --git a/indra/newview/llfloaterurldisplay.h b/indra/newview/llfloaterurldisplay.h new file mode 100644 index 0000000000..5ee447391f --- /dev/null +++ b/indra/newview/llfloaterurldisplay.h @@ -0,0 +1,61 @@ +/** + * @file llfloaterurldisplay.h + * @brief LLFloaterURLDisplay class implementation + * + * $LicenseInfo:firstyear=2006&license=viewergpl$ + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERURLDISPLAY_H +#define LL_LLFLOATERURLDISPLAY_H + +#include "llfloater.h" +#include "v3math.h" + +class LLPanelPlace; +class LLSD; +class LLUUID; + +class LLFloaterURLDisplay : public LLFloater, public LLUISingleton<LLFloaterURLDisplay> +{ +public: + LLFloaterURLDisplay(const LLSD& sd); + virtual ~LLFloaterURLDisplay(); + + void displayParcelInfo(U64 region_handle, const LLVector3& pos); + void setSnapshotDisplay(const LLUUID& snapshot_id); + void setName(const std::string& name); + void setLocationString(const std::string& name); + + static void* createPlaceDetail(void* userdata); + +private: + LLVector3 mRegionPosition; + U64 mRegionHandle; + LLPanelPlace* mPlacePanel; +}; + +#endif // LL_LLFLOATERURLDISPLAY_H diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index bdb7f09e22..b411bb293f 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -236,7 +236,7 @@ BOOL LLFloaterWorldMap::postBuild() childSetKeystrokeCallback("location", (void (*)(LLLineEditor*,void*))updateSearchEnabled, NULL); childSetCommitCallback("search_results", onCommitSearchResult, this); - childSetDoubleClickCallback("search_results", onTeleportBtn); + childSetDoubleClickCallback("search_results", onClickTeleportBtn); childSetCommitCallback("spin x", onCommitLocation, this); childSetCommitCallback("spin y", onCommitLocation, this); childSetCommitCallback("spin z", onCommitLocation, this); @@ -252,7 +252,7 @@ BOOL LLFloaterWorldMap::postBuild() childSetAction("Go Home", onGoHome, this); - childSetAction("Teleport", onTeleportBtn, this); + childSetAction("Teleport", onClickTeleportBtn, this); childSetAction("Show Destination", onShowTargetBtn, this); childSetAction("Show My Location", onShowAgentBtn, this); @@ -264,7 +264,7 @@ BOOL LLFloaterWorldMap::postBuild() setDefaultBtn(NULL); - if ( gAgent.mAccess <= SIM_ACCESS_PG ) + if ( gAgent.isTeen() ) { // Hide Mature Events controls childHide("events_mature_icon"); @@ -1288,7 +1288,7 @@ void LLFloaterWorldMap::onShowAgentBtn(void* data) } // static -void LLFloaterWorldMap::onTeleportBtn(void* data) +void LLFloaterWorldMap::onClickTeleportBtn(void* data) { LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; self->teleport(); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 1757f866d8..b98bbbbe44 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -108,6 +108,9 @@ public: // Catch changes in the sim list void updateSims(bool found_null_sim); + // teleport to the tracked item, if there is one + void teleport(); + protected: static void onPanBtn( void* userdata ); @@ -123,7 +126,7 @@ protected: static void onClearBtn(void*); static void onFlyBtn(void*); - static void onTeleportBtn(void*); + static void onClickTeleportBtn(void*); static void onShowTargetBtn(void*); static void onShowAgentBtn(void*); static void onCopySLURL(void*); @@ -136,9 +139,6 @@ protected: // fly to the tracked item, if there is one void fly(); - // teleport to the tracked item, if there is one - void teleport(); - void buildLandmarkIDLists(); static void onGoToLandmarkDialog(S32 option,void* userdata); void flyToLandmark(); diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index a68b937093..c6a27103a8 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1736,7 +1736,7 @@ bool LLFolderViewFolder::isTrash() { if (mAmTrash == LLFolderViewFolder::UNKNOWN) { - mAmTrash = mListener->getUUID() == gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH) ? LLFolderViewFolder::TRASH : LLFolderViewFolder::NOT_TRASH; + mAmTrash = mListener->getUUID() == gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH, false) ? LLFolderViewFolder::TRASH : LLFolderViewFolder::NOT_TRASH; } return mAmTrash == LLFolderViewFolder::TRASH; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 505364f98c..f777e09813 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1845,7 +1845,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if(isAgentInventory()) // do not allow creating in library { // only mature accounts can create undershirts/underwear - /*if (gAgent.mAccess >= SIM_ACCESS_MATURE) + /*if (!gAgent.isTeen()) { sub_menu->append(new LLMenuItemCallGL("New Undershirt", &createNewUndershirt, @@ -2524,6 +2524,14 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod } } } + if ("about" == action) + { + LLViewerInventoryItem* item = getItem(); + if(item) + { + open_landmark(item, LLString(" ") + getPrefix() + item->getName(), FALSE); + } + } else LLItemBridge::performAction(folder, model, action); } @@ -2555,12 +2563,35 @@ void open_landmark(LLViewerInventoryItem* inv_item, } } +static void open_landmark_callback(S32 option, void* data) +{ + LLUUID* asset_idp = (LLUUID*)data; + if (option == 0) + { + // HACK: This is to demonstrate teleport on double click for landmarks + gAgent.teleportViaLandmark( *asset_idp ); + + // we now automatically track the landmark you're teleporting to + // because you'll probably arrive at a telehub instead + if( gFloaterWorldMap ) + { + gFloaterWorldMap->trackLandmark( *asset_idp ); + } + } + delete asset_idp; +} + void LLLandmarkBridge::openItem() { LLViewerInventoryItem* item = getItem(); if( item ) { - open_landmark(item, LLString(" ") + getPrefix() + item->getName(), FALSE); + // Opening (double-clicking) a landmark immediately teleports, + // but warns you the first time. + // open_landmark(item, LLString(" ") + getPrefix() + item->getName(), FALSE); + LLUUID* asset_idp = new LLUUID(item->getAssetUUID()); + LLAlertDialog::showXml("TeleportFromLandmark", + open_landmark_callback, (void*)asset_idp); } } @@ -4463,7 +4494,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, EWearableType type = wearable->getType(); if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& - //!((gAgent.mAccess >= SIM_ACCESS_MATURE) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) + //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { gAgent.removeWearable( type ); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index aa90538e40..4e54e78430 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -290,12 +290,16 @@ void LLInventoryModel::getDirectDescendentsOf(const LLUUID& cat_id, // specifies 'type' as what it defaults to containing. The category is // not necessarily only for that type. *NOTE: This will create a new // inventory category on the fly if one does not exist. -LLUUID LLInventoryModel::findCategoryUUIDForType(LLAssetType::EType t) +LLUUID LLInventoryModel::findCategoryUUIDForType(LLAssetType::EType t, bool create_folder) { LLUUID rv = findCatUUID(t); - if(rv.isNull() && isInventoryUsable()) + if(rv.isNull() && isInventoryUsable() && create_folder) { - rv = createNewCategory(rv, t, NULL); + LLUUID root_id = gAgent.getInventoryRootID(); + if(root_id.notNull()) + { + rv = createNewCategory(root_id, t, NULL); + } } return rv; } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index e321f1fcc8..b560aea8b2 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -237,7 +237,10 @@ public: // category is not necessarily only for that type. *NOTE: This // will create a new inventory category on the fly if one does not // exist. - LLUUID findCategoryUUIDForType(LLAssetType::EType preferred_type); + + // SDK: Added flag to specify whether the folder should be created if not found. This fixes the horrible + // multiple trash can bug. + LLUUID findCategoryUUIDForType(LLAssetType::EType preferred_type, bool create_folder = true); // Call this method when it's time to update everyone on a new // state, by default, the inventory model will not update diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index d8131c27d7..bcdb6c63f4 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -42,6 +42,7 @@ #include "llfocusmgr.h" #include "llimview.h" #include "llmediaengine.h" +#include "llmediaremotectrl.h" #include "llpanelaudiovolume.h" #include "llparcel.h" #include "lltextbox.h" @@ -124,7 +125,7 @@ LLOverlayBar::LLOverlayBar(const std::string& name, const LLRect& rect) setMouseOpaque(FALSE); setIsChrome(TRUE); - isBuilt = FALSE; + mBuilt = false; LLCallbackMap::map_t factory_map; factory_map["master_volume"] = LLCallbackMap(LLOverlayBar::createMasterRemote, this); @@ -141,7 +142,7 @@ LLOverlayBar::LLOverlayBar(const std::string& name, const LLRect& rect) childSetAction("Stand Up",onClickStandUp,this); mIsFocusRoot = TRUE; - isBuilt = true; + mBuilt = true; // make overlay bar conform to window size setRect(rect); @@ -168,7 +169,7 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) { LLView::reshape(width, height, called_from_parent); - if (isBuilt) + if (mBuilt) { layoutButtons(); } diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h index d8b9ba1451..229346340a 100644 --- a/indra/newview/lloverlaybar.h +++ b/indra/newview/lloverlaybar.h @@ -33,13 +33,13 @@ #define LL_LLOVERLAYBAR_H #include "llpanel.h" -#include "llmediaremotectrl.h" // "Constants" loaded from settings.xml at start time extern S32 STATUS_BAR_HEIGHT; class LLButton; class LLLineEditor; +class LLMediaRemoteCtrl; class LLMessageSystem; class LLTextBox; class LLTextEditor; @@ -102,7 +102,7 @@ protected: LLMediaRemoteCtrl* mMusicRemote; LLMediaRemoteCtrl* mMediaRemote; LLVoiceRemoteCtrl* mVoiceRemote; - BOOL isBuilt; + bool mBuilt; // dialog constructed yet? enum { STOPPED=0, PLAYING=1, PAUSED=2 }; BOOL mMediaState; BOOL mMusicState; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 0c3edf1242..13e6478dcb 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -47,9 +47,11 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llclassifiedflags.h" +#include "llclassifiedstatsresponder.h" #include "llviewercontrol.h" #include "lllineeditor.h" #include "llfloateravatarinfo.h" +#include "llfloaterclassified.h" #include "lltabcontainervertical.h" #include "lltextbox.h" #include "llcombobox.h" @@ -62,6 +64,7 @@ #include "llworldmap.h" #include "llfloaterworldmap.h" #include "llviewergenericmessage.h" // send_generic_message +#include "llviewerregion.h" #include "llviewerwindow.h" // for window width, height #include "viewer.h" // app_abort_quit() @@ -98,9 +101,10 @@ static LLDispatchClassifiedClickThrough sClassifiedClickThrough; //static std::list<LLPanelClassified*> LLPanelClassified::sAllPanels; -LLPanelClassified::LLPanelClassified(BOOL in_finder) +LLPanelClassified::LLPanelClassified(BOOL in_finder, bool from_search) : LLPanel("Classified Panel"), mInFinder(in_finder), + mFromSearch(from_search), mDirty(false), mForceClose(false), mLocationChanged(false), @@ -225,7 +229,7 @@ BOOL LLPanelClassified::postBuild() mMatureCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "classified_mature_check"); mMatureCheck->setCommitCallback(onCommitAny); mMatureCheck->setCallbackUserData(this); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { // Teens don't get to set mature flag. JC mMatureCheck->setVisible(FALSE); @@ -364,7 +368,11 @@ void LLPanelClassified::setClassifiedID(const LLUUID& id) mClassifiedID = id; } - +void LLPanelClassified::setClickThroughText(const std::string& text) +{ + if(mClickThroughText) + this->mClickThroughText->setText(text); +} //static void LLPanelClassified::setClickThrough(const LLUUID& classified_id, S32 teleport, @@ -380,6 +388,16 @@ void LLPanelClassified::setClickThrough(const LLUUID& classified_id, continue; } + // We need to see if we should use the new stat table or the old. + // If the SearchStatRequest capability exists, then the data will come + // from the new table. + std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); + + if (!url.empty()) + { + return; + } + if (self->mClickThroughText) { std::string msg = llformat("Clicks: %d teleport, %d map, %d profile", @@ -421,6 +439,18 @@ void LLPanelClassified::sendClassifiedInfoRequest() mDataRequested = TRUE; mRequestedID = mClassifiedID; + + // While we're at it let's get the stats from the new table if that + // capability exists. + std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); + LLSD body; + body["classified_id"] = mClassifiedID; + + if (!url.empty()) + { + llinfos << "Classified stat request via capability" << llendl; + LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle())); + } } } @@ -894,6 +924,19 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type) strings.push_back(type); LLUUID no_invoice; send_generic_message("classifiedclick", strings, no_invoice); + + // New classified click-through handling + LLSD body; + body["type"] = type; + body["from_search"] = mFromSearch; + body["classified_id"] = mClassifiedID; + std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); + + if (!url.empty()) + { + llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; + LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); + } } //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 56c2fbda31..6ebac4c98a 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -57,7 +57,7 @@ class LLMessageSystem; class LLPanelClassified : public LLPanel { public: - LLPanelClassified(BOOL in_finder); + LLPanelClassified(BOOL in_finder, bool from_search = false); /*virtual*/ ~LLPanelClassified(); void reset(); @@ -79,6 +79,7 @@ public: void initNewClassified(); void setClassifiedID(const LLUUID& id); + void setClickThroughText(const std::string& text); static void setClickThrough(const LLUUID& classified_id, S32 teleport, S32 map, S32 profile); @@ -118,6 +119,7 @@ protected: protected: BOOL mInFinder; + bool mFromSearch; BOOL mDirty; bool mForceClose; bool mLocationChanged; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index ba0895def1..dfb9bbb175 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -161,7 +161,7 @@ BOOL LLPanelGroupGeneral::postBuild() { mCtrlMature->setCommitCallback(onCommitAny); mCtrlMature->setCallbackUserData(this); - mCtrlMature->setVisible( gAgent.mAccess > SIM_ACCESS_PG ); + mCtrlMature->setVisible( !gAgent.isTeen() ); } mCtrlOpenEnrollment = (LLCheckBoxCtrl*) getChildByName("open_enrollement", recurse); @@ -478,7 +478,7 @@ bool LLPanelGroupGeneral::apply(LLString& mesg) if (mInsignia) gdatap->mInsigniaID = mInsignia->getImageAssetID(); if (mCtrlMature) { - if (gAgent.mAccess > SIM_ACCESS_PG) + if (!gAgent.isTeen()) { gdatap->mMaturePublish = mCtrlMature->get(); } @@ -641,7 +641,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlMature->set(gdatap->mMaturePublish); mCtrlMature->setEnabled(mAllowEdit && can_change_ident); - mCtrlMature->setVisible( gAgent.mAccess > SIM_ACCESS_PG ); + mCtrlMature->setVisible( !gAgent.isTeen() ); } if (mCtrlOpenEnrollment) { diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 2176fdc7c9..48dcd69a4d 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -38,6 +38,8 @@ #include "message.h" #include "llui.h" #include "llsecondlifeurls.h" +#include "llremoteparcelrequest.h" +#include "llfloater.h" #include "llagent.h" #include "llviewerwindow.h" @@ -53,6 +55,7 @@ #include "llvieweruictrlfactory.h" //#include "llviewermenu.h" // create_landmark() #include "llweb.h" +#include "llsdutil.h" //static std::list<LLPanelPlace*> LLPanelPlace::sAllPanels; @@ -60,8 +63,12 @@ std::list<LLPanelPlace*> LLPanelPlace::sAllPanels; LLPanelPlace::LLPanelPlace() : LLPanel("Places Panel"), mParcelID(), + mRequestedID(), + mRegionID(), mPosGlobal(), - mAuctionID(0) + mPosRegion(), + mAuctionID(0), + mLandmarkAssetID() { sAllPanels.push_back(this); } @@ -81,13 +88,13 @@ BOOL LLPanelPlace::postBuild() mSnapshotCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); mSnapshotCtrl->setEnabled(FALSE); - mNameEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "name_editor"); + mNameEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "name_editor"); mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); - mInfoEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "info_editor"); + mInfoEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "info_editor"); - mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor"); + mLocationEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "location_editor"); mTeleportBtn = LLViewerUICtrlFactory::getButtonByName(this, "teleport_btn"); mTeleportBtn->setClickedCallback(onClickTeleport); @@ -108,16 +115,38 @@ BOOL LLPanelPlace::postBuild() // Default to no auction button. We'll show it if we get an auction id mAuctionBtn->setVisible(FALSE); + // Temporary text to explain why the description panel is blank. + // mDescEditor->setText("Parcel information not available without server update"); + return TRUE; } - +void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem) +{ + mNameEditor->setText(pItem->getName()); + mDescEditor->setText(pItem->getDescription()); +} void LLPanelPlace::setParcelID(const LLUUID& parcel_id) { mParcelID = parcel_id; + sendParcelInfoRequest(); } +void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) +{ + mSnapshotCtrl->setImageAssetID(snapshot_id); +} + +void LLPanelPlace::setName(const std::string& name) +{ + mNameEditor->setText(name); +} + +void LLPanelPlace::setLocationString(const std::string& location) +{ + mLocationEditor->setText(location); +} void LLPanelPlace::sendParcelInfoRequest() { @@ -136,6 +165,20 @@ void LLPanelPlace::sendParcelInfoRequest() } } +void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) +{ + // We only really handle 404 and 499 errors + LLString error_text; + if(status == 404) + { + error_text = childGetText("server_error_text"); + } + else if(status == 499) + { + error_text = childGetText("server_forbidden_text"); + } + mDescEditor->setText(error_text); +} //static void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) @@ -184,40 +227,46 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) msg->getS32 ("Data", "SalePrice", sale_price); msg->getS32 ("Data", "AuctionID", auction_id); - self->mPosGlobal.setVec(global_x, global_y, global_z); self->mAuctionID = auction_id; - self->mSnapshotCtrl->setImageAssetID(snapshot_id); + if(snapshot_id.notNull()) + { + self->mSnapshotCtrl->setImageAssetID(snapshot_id); + } - self->mNameEditor->setText(LLString(name)); + // Only assign the name and description if they are not empty and there is not a + // value present (passed in from a landmark, e.g.) + std::string name_str(name); + std::string desc_str(desc); - self->mDescEditor->setText(LLString(desc)); + if(! name_str.empty() && ! self->mNameEditor->getText().empty()) + self->mNameEditor->setText(name_str); + + if(! desc_str.empty() && ! self->mDescEditor->getText().empty()) + self->mDescEditor->setText(desc_str); LLString info_text; LLUIString traffic = self->childGetText("traffic_text"); - traffic.setArg("[TRAFFIC]", llformat("%.0f", dwell)); + traffic.setArg("[TRAFFIC]", llformat("%d ", (int)dwell)); info_text = traffic; LLUIString area = self->childGetText("area_text"); - traffic.setArg("[AREA]", llformat("%d", actual_area)); + area.setArg("[AREA]", llformat("%d ", actual_area)); info_text += area; if (flags & DFQ_FOR_SALE) { LLUIString forsale = self->childGetText("forsale_text"); - traffic.setArg("[PRICE]", llformat("%d", sale_price)); + forsale.setArg("[PRICE]", llformat("%d ", sale_price)); info_text += forsale; } if (auction_id != 0) { LLUIString auction = self->childGetText("auction_text"); - auction.setArg("[ID]", llformat("%010d", auction_id)); + auction.setArg("[ID]", llformat("%010d ", auction_id)); info_text += auction; } self->mInfoEditor->setText(info_text); - S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; - S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; - S32 region_z = llround(global_z); // HACK: Flag 0x1 == mature region, otherwise assume PG const char* rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); @@ -226,8 +275,13 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); } - LLString location = llformat("%s %d, %d, %d (%s)", - sim_name, region_x, region_y, region_z, rating); + // Just use given region position for display + S32 region_x = llround(self->mPosRegion.mV[0]); + S32 region_y = llround(self->mPosRegion.mV[1]); + S32 region_z = llround(self->mPosRegion.mV[2]); + + LLString location = llformat("%s %d, %d, %d (%s)", + sim_name, region_x, region_y, region_z, rating); self->mLocationEditor->setText(location); BOOL show_auction = (auction_id > 0); @@ -236,12 +290,58 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) } +void LLPanelPlace::displayParcelInfo(const LLVector3& pos_region, + const LLUUID& landmark_asset_id, + const LLUUID& region_id, + const LLVector3d& pos_global) +{ + LLSD body; + mPosRegion = pos_region; + mPosGlobal = pos_global; + mLandmarkAssetID = landmark_asset_id; + std::string url = gAgent.getRegion()->getCapability("RemoteParcelRequest"); + if (!url.empty()) + { + body["location"] = ll_sd_from_vector3(pos_region); + if (!region_id.isNull()) + { + body["region_id"] = region_id; + } + if (!pos_global.isExactlyZero()) + { + U64 region_handle = to_region_handle(pos_global); + body["region_handle"] = ll_sd_from_U64(region_handle); + } + LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(this->getHandle())); + } + else + { + mDescEditor->setText(childGetText("server_update_text")); + } + mSnapshotCtrl->setImageAssetID(LLUUID::null); +} + + // static void LLPanelPlace::onClickTeleport(void* data) { LLPanelPlace* self = (LLPanelPlace*)data; - if (!self->mPosGlobal.isExactlyZero()) + LLView* parent_viewp = self->getParent(); + if (parent_viewp->getWidgetType() == WIDGET_TYPE_FLOATER) + { + LLFloater* parent_floaterp = (LLFloater*)parent_viewp; + parent_floaterp->close(); + } + // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); + parent_viewp->setVisible(false); + if(self->mLandmarkAssetID.notNull()) + { + gAgent.teleportViaLandmark(self->mLandmarkAssetID); + gFloaterWorldMap->trackLandmark(self->mLandmarkAssetID); + + } + else if (!self->mPosGlobal.isExactlyZero()) { gAgent.teleportViaLocation(self->mPosGlobal); gFloaterWorldMap->trackLocation(self->mPosGlobal); @@ -252,6 +352,12 @@ void LLPanelPlace::onClickTeleport(void* data) void LLPanelPlace::onClickMap(void* data) { LLPanelPlace* self = (LLPanelPlace*)data; + LLView* parent_viewp = self->getParent(); + if (parent_viewp->getWidgetType() == WIDGET_TYPE_FLOATER) + { + LLFloater* parent_floaterp = (LLFloater*)parent_viewp; + parent_floaterp->close(); + } if (!self->mPosGlobal.isExactlyZero()) { diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h index 81a2a63117..8f56eda729 100644 --- a/indra/newview/llpanelplace.h +++ b/indra/newview/llpanelplace.h @@ -43,6 +43,7 @@ class LLLineEditor; class LLTextEditor; class LLTextureCtrl; class LLMessageSystem; +class LLInventoryItem; class LLPanelPlace : public LLPanel { @@ -52,11 +53,19 @@ public: /*virtual*/ BOOL postBuild(); - + void displayItemInfo(const LLInventoryItem* pItem); void setParcelID(const LLUUID& parcel_id); + void setRegionID(const LLUUID& region_id) { mRegionID = region_id; } + void setSnapshot(const LLUUID& snapshot_id); + void setName(const std::string& name); + void setLocationString(const std::string& location); + void setErrorStatus(U32 status, const std::string& reason); void sendParcelInfoRequest(); - + void displayParcelInfo(const LLVector3& pos_region, + const LLUUID& landmark_asset_id, + const LLUUID& region_id, + const LLVector3d& pos_global); static void processParcelInfoReply(LLMessageSystem* msg, void**); protected: @@ -71,16 +80,22 @@ protected: protected: LLUUID mParcelID; LLUUID mRequestedID; + LLUUID mRegionID; + LLUUID mLandmarkAssetID; + // Absolute position of the location for teleport, may not + // be available (hence zero) LLVector3d mPosGlobal; + // Region-local position for teleport, always available. + LLVector3 mPosRegion; // Zero if this is not an auction S32 mAuctionID; LLTextureCtrl* mSnapshotCtrl; - LLLineEditor* mNameEditor; + LLTextBox* mNameEditor; LLTextEditor* mDescEditor; - LLLineEditor* mInfoEditor; - LLLineEditor* mLocationEditor; + LLTextBox* mInfoEditor; + LLTextBox* mLocationEditor; LLButton* mTeleportBtn; LLButton* mMapBtn; diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp new file mode 100644 index 0000000000..f9e6c61272 --- /dev/null +++ b/indra/newview/llremoteparcelrequest.cpp @@ -0,0 +1,53 @@ +/** + * @file llparcelrequest.cpp + * @brief Implementation of the LLParcelRequest class. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llagent.h" +#include "llremoteparcelrequest.h" + +#include "llpanelplace.h" +#include "llpanel.h" +#include "llhttpclient.h" +#include "llsdserialize.h" +#include "llviewerregion.h" +#include "llview.h" +#include "message.h" + +LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLViewHandle place_panel_handle) +{ + mPlacePanelHandle = place_panel_handle; +} +/*virtual*/ +void LLRemoteParcelRequestResponder::result(const LLSD& content) +{ + LLUUID parcel_id = content["parcel_id"]; + + LLPanelPlace* place_panelp = (LLPanelPlace*)LLPanel::getPanelByHandle(mPlacePanelHandle); + + if(place_panelp) + { + place_panelp->setParcelID(parcel_id); + } + +} + +/*virtual*/ +void LLRemoteParcelRequestResponder::error(U32 status, const std::string& reason) +{ + llinfos << "LLRemoteParcelRequest::error(" + << status << ": " << reason << ")" << llendl; + LLPanelPlace* place_panelp = (LLPanelPlace*)LLPanel::getPanelByHandle(mPlacePanelHandle); + + if(place_panelp) + { + place_panelp->setErrorStatus(status, reason); + } + +} + diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h new file mode 100644 index 0000000000..5ab8338e35 --- /dev/null +++ b/indra/newview/llremoteparcelrequest.h @@ -0,0 +1,28 @@ +/** + * @file lleventpoll.h + * @brief LLEvDescription of the LLEventPoll class. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_LLREMOTEPARCELREQUEST_H +#define LL_LLREMOTEPARCELREQUEST_H + +#include "llhttpclient.h" +#include "llview.h" + +class LLRemoteParcelRequestResponder : public LLHTTPClient::Responder +{ +public: + LLRemoteParcelRequestResponder(LLViewHandle place_panel_handle); + //If we get back a normal response, handle it here + virtual void result(const LLSD& content); + //If we get back an error (not found, etc...), handle it here + virtual void error(U32 status, const std::string& reason); + +protected: + LLViewHandle mPlacePanelHandle; +}; + +#endif // LL_LLREMOTEPARCELREQUEST_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a84590f4df..dad8046e50 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -817,7 +817,7 @@ BOOL idle_startup() if (LLURLSimString::parse()) { // a startup URL was specified - agent_location_id = START_LOCATION_ID_TELEHUB; + agent_location_id = START_LOCATION_ID_URL; // doesn't really matter what location_which is, since // agent_start_look_at will be overwritten when the @@ -1243,11 +1243,11 @@ BOOL idle_startup() text = gUserAuthp->getResponse("agent_access"); if(text && (text[0] == 'M')) { - gAgent.mAccess = SIM_ACCESS_MATURE; + gAgent.setTeen(false); } else { - gAgent.mAccess = SIM_ACCESS_PG; + gAgent.setTeen(true); } text = gUserAuthp->getResponse("start_location"); @@ -1505,6 +1505,7 @@ BOOL idle_startup() LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); regionp->setSeedCapability(first_sim_seed_cap); + llinfos << "Waiting for seed grant ...." << llendl; // Set agent's initial region to be the one we just created. gAgent.setRegion(regionp); @@ -1523,7 +1524,6 @@ BOOL idle_startup() //--------------------------------------------------------------------- if(STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { - llinfos << "Waiting for seed grant ...." << llendl; return do_normal_idle; } @@ -1714,30 +1714,36 @@ BOOL idle_startup() } #if LL_QUICKTIME_ENABLED // windows only right now but will be ported to mac - if (gUseQuickTime - && !gQuickTimeInitialized) + if (gUseQuickTime) { - // initialize quicktime libraries (fails gracefully if quicktime not installed ($QUICKTIME) - llinfos << "Initializing QuickTime...." << llendl; - set_startup_status(0.57f, "Initializing QuickTime...", gAgent.mMOTD.c_str()); - display_startup(); - #if LL_WINDOWS - // Only necessary/available on Windows. - if ( InitializeQTML ( 0L ) != noErr ) - { - // quicktime init failed - turn off media engine support - LLMediaEngine::getInstance ()->setAvailable ( FALSE ); - llinfos << "...not found - unable to initialize." << llendl; - set_startup_status(0.57f, "QuickTime not found - unable to initialize.", gAgent.mMOTD.c_str()); - } - else - { - llinfos << ".. initialized successfully." << llendl; - set_startup_status(0.57f, "QuickTime initialized successfully.", gAgent.mMOTD.c_str()); - }; - #endif - EnterMovies (); - gQuickTimeInitialized = true; + if(!gQuickTimeInitialized) + { + // initialize quicktime libraries (fails gracefully if quicktime not installed ($QUICKTIME) + llinfos << "Initializing QuickTime...." << llendl; + set_startup_status(0.57f, "Initializing QuickTime...", gAgent.mMOTD.c_str()); + display_startup(); + #if LL_WINDOWS + // Only necessary/available on Windows. + if ( InitializeQTML ( 0L ) != noErr ) + { + // quicktime init failed - turn off media engine support + LLMediaEngine::getInstance ()->setAvailable ( FALSE ); + llinfos << "...not found - unable to initialize." << llendl; + set_startup_status(0.57f, "QuickTime not found - unable to initialize.", gAgent.mMOTD.c_str()); + } + else + { + llinfos << ".. initialized successfully." << llendl; + set_startup_status(0.57f, "QuickTime initialized successfully.", gAgent.mMOTD.c_str()); + }; + #endif + EnterMovies (); + gQuickTimeInitialized = true; + } + } + else + { + LLMediaEngine::getInstance()->setAvailable( FALSE ); } #endif @@ -2316,6 +2322,7 @@ BOOL idle_startup() #if 0 // sjb: enable for auto-enabling timer display gDebugView->mFastTimerView->setVisible(TRUE); #endif + return do_normal_idle; } @@ -3623,6 +3630,7 @@ void release_start_screen() gStartImageGL = NULL; } + // static void LLStartUp::setStartupState( S32 state ) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index df9b370dc4..8c50eca9af 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -48,6 +48,7 @@ #include "llviewercontrol.h" #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" +#include "llfloaterdirectory.h" // to spawn search #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" @@ -150,53 +151,6 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) mTextHealth = LLUICtrlFactory::getTextBoxByName( this, "HealthText" ); mTextTime = LLUICtrlFactory::getTextBoxByName( this, "TimeText" ); - S32 x = mRect.getWidth() - 2; - S32 y = 0; - LLRect r; - r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); - mSGBandwidth = new LLStatGraph("BandwidthGraph", r); - mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); - mSGBandwidth->setStat(&gViewerStats->mKBitStat); - LLString text = childGetText("bandwidth_tooltip") + " "; - LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven - mSGBandwidth->setLabel(bandwidth_tooltip.getString().c_str()); - mSGBandwidth->setUnits("kbps"); - mSGBandwidth->setPrecision(0); - addChild(mSGBandwidth); - x -= SIM_STAT_WIDTH + 2; - - r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); - mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); - mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); - mSGPacketLoss->setStat(&gViewerStats->mPacketsLostPercentStat); - text = childGetText("packet_loss_tooltip") + " "; - LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven - mSGPacketLoss->setLabel(packet_loss_tooltip.getString().c_str()); - mSGPacketLoss->setUnits("%"); - mSGPacketLoss->setMin(0.f); - mSGPacketLoss->setMax(5.f); - mSGPacketLoss->setThreshold(0, 0.5f); - mSGPacketLoss->setThreshold(1, 1.f); - mSGPacketLoss->setThreshold(2, 3.f); - mSGPacketLoss->setPrecision(1); - mSGPacketLoss->mPerSec = FALSE; - addChild(mSGPacketLoss); - -} - -LLStatusBar::~LLStatusBar() -{ - delete mBalanceTimer; - mBalanceTimer = NULL; - - delete mHealthTimer; - mHealthTimer = NULL; - - // LLView destructor cleans up children -} - -BOOL LLStatusBar::postBuild() -{ childSetAction("scriptout", onClickScriptDebug, this); childSetAction("health", onClickHealth, this); childSetAction("fly", onClickFly, this); @@ -207,17 +161,31 @@ BOOL LLStatusBar::postBuild() childSetAction("restrictpush", onClickPush, this ); childSetAction("status_voice", onClickVoice, this ); + childSetCommitCallback("search_editor", onCommitSearch, this); + childSetAction("search_btn", onClickSearch, this); + childSetActionTextbox("ParcelNameText", onClickParcelInfo ); childSetActionTextbox("BalanceText", onClickBalance ); +} + +LLStatusBar::~LLStatusBar() +{ + delete mBalanceTimer; + mBalanceTimer = NULL; + + delete mHealthTimer; + mHealthTimer = NULL; - return TRUE; + // LLView destructor cleans up children } +//virtual EWidgetType LLStatusBar::getWidgetType() const { return WIDGET_TYPE_STATUS_BAR; } +//virtual LLString LLStatusBar::getWidgetTag() const { return LL_STATUS_BAR_TAG; @@ -245,13 +213,6 @@ void LLStatusBar::draw() // Per-frame updates of visibility void LLStatusBar::refresh() { - F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f; - mSGBandwidth->setMin(0.f); - mSGBandwidth->setMax(bwtotal*1.25f); - mSGBandwidth->setThreshold(0, bwtotal*0.75f); - mSGBandwidth->setThreshold(1, bwtotal); - mSGBandwidth->setThreshold(2, bwtotal); - // *TODO: Localize / translate time // Get current UTC time, adjusted for the user's clock @@ -562,9 +523,9 @@ void LLStatusBar::setVisibleForMouselook(bool visible) { mTextBalance->setVisible(visible); mTextTime->setVisible(visible); - mSGBandwidth->setVisible(visible); - mSGPacketLoss->setVisible(visible); childSetVisible("buycurrency", visible); + childSetVisible("search_editor", visible); + childSetVisible("search_btn", visible); setBackgroundVisible(visible); } @@ -580,8 +541,9 @@ void LLStatusBar::creditBalance(S32 credit) void LLStatusBar::setBalance(S32 balance) { - LLString balance_str; - gResMgr->getMonetaryString( balance_str, balance ); + LLString money_str = gResMgr->getMonetaryString( balance ); + LLString balance_str = "L$"; + balance_str += money_str; mTextBalance->setText( balance_str ); if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) @@ -805,6 +767,21 @@ void LLStatusBar::setupDate() } } +// static +void LLStatusBar::onCommitSearch(LLUICtrl*, void* data) +{ + // committing is the same as clicking "search" + onClickSearch(data); +} + +// static +void LLStatusBar::onClickSearch(void* data) +{ + LLStatusBar* self = (LLStatusBar*)data; + LLString search_text = self->childGetText("search_editor"); + LLFloaterDirectory::showFindAll(search_text); +} + BOOL can_afford_transaction(S32 cost) { return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost))); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index e588519eb4..88a97ba71a 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -71,14 +71,12 @@ class LLStatusBar { public: LLStatusBar(const std::string& name, const LLRect& rect ); - ~LLStatusBar(); - virtual BOOL postBuild(); + /*virtual*/ ~LLStatusBar(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; + /*virtual*/ EWidgetType getWidgetType() const; + /*virtual*/ LLString getWidgetTag() const; - // OVERRIDES - virtual void draw(); + /*virtual*/ void draw(); // MANIPULATORS void setBalance(S32 balance); @@ -104,20 +102,20 @@ public: S32 getSquareMetersLeft() const; cLLRegionDetails mRegionDetails; -protected: +private: // simple method to setup the part that holds the date void setupDate(); -protected: + static void onCommitSearch(LLUICtrl*, void* data); + static void onClickSearch(void* data); + +private: LLTextBox *mTextBalance; LLTextBox *mTextHealth; LLTextBox *mTextTime; LLTextBox* mTextParcelName; - LLStatGraph *mSGBandwidth; - LLStatGraph *mSGPacketLoss; - LLButton *mBtnBuyCurrency; S32 mBalance; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 55692d1962..166209d582 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -605,7 +605,7 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) { if (object->isAvatar()) { - LLFloaterAvatarInfo::showFromAvatar(object); + LLFloaterAvatarInfo::showFromAvatar(object->getID()); } else { diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 73442069ff..5b8583d211 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -35,11 +35,10 @@ // viewer includes #include "llagent.h" // teleportViaLocation() #include "llcommandhandler.h" -// *FIX: code in merge sl-search-8 -//#include "llfloaterurldisplay.h" +#include "llfloaterurldisplay.h" #include "llfloaterdirectory.h" #include "llfloaterhtmlhelp.h" -#include "llfloaterworldmap.h" +//#include "llfloaterworldmap.h" #include "llpanellogin.h" #include "llstartup.h" // gStartupState #include "llurlsimstring.h" @@ -88,11 +87,10 @@ private: // handles secondlife://Ahern/123/45/67/ // Returns true if handled. -// *FIX: code in merge sl-search-8 -// static void regionHandleCallback(U64 handle, const std::string& url, -// const LLUUID& snapshot_id, bool teleport); -// // Called by LLWorldMap when a region name has been resolved to a -// // location in-world, used by places-panel display. + static void regionHandleCallback(U64 handle, const std::string& url, + const LLUUID& snapshot_id, bool teleport); + // Called by LLWorldMap when a region name has been resolved to a + // location in-world, used by places-panel display. static bool matchPrefix(const std::string& url, const std::string& prefix); @@ -196,7 +194,9 @@ bool LLURLDispatcherImpl::dispatchApp(const std::string& url, BOOL right_mouse) std::map<std::string, std::string> args; args["[SLURL]"] = url; gViewerWindow->alertXml("BadURL", args); - return false; + // This was a SLURL with a /app prefix, and we "handled" it by displaying an error dialog, + // so return true. It doesn't need to be parsed any further. + return true; } // static @@ -226,13 +226,52 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, BOOL right_mous S32 y = 128; S32 z = 0; LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); - if (gFloaterWorldMap) + + LLFloaterURLDisplay* url_displayp = LLFloaterURLDisplay::getInstance(LLSD()); + url_displayp->setName(region_name); + + // Request a region handle by name + gWorldMap->sendNamedRegionRequest(region_name, + LLURLDispatcherImpl::regionHandleCallback, + url, + false); // don't teleport + return true; +} + +/*static*/ +void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) +{ + std::string sim_string = stripProtocol(url); + std::string region_name; + S32 x = 128; + S32 y = 128; + S32 z = 0; + LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); + + LLVector3 local_pos; + local_pos.mV[VX] = (F32)x; + local_pos.mV[VY] = (F32)y; + local_pos.mV[VZ] = (F32)z; + + if (teleport) { - llinfos << "Opening map to " << region_name << llendl; - gFloaterWorldMap->trackURL( region_name.c_str(), x, y, z ); - LLFloaterWorldMap::show(NULL, TRUE); + LLVector3d global_pos = from_region_handle(region_handle); + global_pos += LLVector3d(local_pos); + gAgent.teleportViaLocation(global_pos); + } + else + { + // display informational floater, allow user to click teleport btn + LLFloaterURLDisplay* url_displayp = LLFloaterURLDisplay::getInstance(LLSD()); + + url_displayp->displayParcelInfo(region_handle, local_pos); + if(snapshot_id.notNull()) + { + url_displayp->setSnapshotDisplay(snapshot_id); + } + std::string locationString = llformat("%s %d, %d, %d", region_name.c_str(), x, y, z); + url_displayp->setLocationString(locationString); } - return true; } // static @@ -266,38 +305,36 @@ std::string LLURLDispatcherImpl::stripProtocol(const std::string& url) return stripped; } -// *FIX: code in merge sl-search-8 -// -////--------------------------------------------------------------------------- -//// Teleportation links are handled here because they are tightly coupled -//// to URL parsing and sim-fragment parsing -//class LLTeleportHandler : public LLCommandHandler -//{ -//public: -// LLTeleportHandler() : LLCommandHandler("teleport") { } -// bool handle(const std::vector<std::string>& tokens) -// { -// // construct a "normal" SLURL, resolve the region to -// // a global position, and teleport to it -// if (tokens.size() < 1) return false; -// -// // Region names may be %20 escaped. -// std::string region_name = LLURLSimString::unescapeRegionName(tokens[0]); -// -// // build secondlife://De%20Haro/123/45/67 for use in callback -// std::string url = SLURL_SECONDLIFE_PREFIX; -// for (size_t i = 0; i < tokens.size(); ++i) -// { -// url += tokens[i] + "/"; -// } -// gWorldMap->sendNamedRegionRequest(region_name, -// LLURLDispatcherImpl::regionHandleCallback, -// url, -// true); // teleport -// return true; -// } -//}; -//LLTeleportHandler gTeleportHandler; +//--------------------------------------------------------------------------- +// Teleportation links are handled here because they are tightly coupled +// to URL parsing and sim-fragment parsing +class LLTeleportHandler : public LLCommandHandler +{ +public: + LLTeleportHandler() : LLCommandHandler("teleport") { } + bool handle(const std::vector<std::string>& tokens) + { + // construct a "normal" SLURL, resolve the region to + // a global position, and teleport to it + if (tokens.size() < 1) return false; + + // Region names may be %20 escaped. + std::string region_name = LLURLSimString::unescapeRegionName(tokens[0]); + + // build secondlife://De%20Haro/123/45/67 for use in callback + std::string url = SLURL_SECONDLIFE_PREFIX; + for (size_t i = 0; i < tokens.size(); ++i) + { + url += tokens[i] + "/"; + } + gWorldMap->sendNamedRegionRequest(region_name, + LLURLDispatcherImpl::regionHandleCallback, + url, + true); // teleport + return true; + } +}; +LLTeleportHandler gTeleportHandler; //--------------------------------------------------------------------------- @@ -323,4 +360,3 @@ bool LLURLDispatcher::dispatchRightClick(const std::string& url) { return LLURLDispatcherImpl::dispatchRightClick(url); } - diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index b4dc093f6a..24b8105916 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -240,6 +240,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) LLImageGL::updateStats(gFrameTimeSeconds); LLVOAvatar::sRenderName = gSavedSettings.getS32("RenderName"); + LLVOAvatar::sRenderGroupTitles = gSavedSettings.getBOOL("RenderGroupTitleAll"); gPipeline.mBackfaceCull = TRUE; gFrameCount++; if (gFocusMgr.getAppHasFocus()) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 28c504910b..d344f687d4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -138,6 +138,7 @@ #include "llinventoryview.h" #include "llkeyboard.h" #include "llpanellogin.h" +#include "llfloaterlandmark.h" #include "llmenucommands.h" #include "llmenugl.h" #include "llmorphview.h" @@ -196,6 +197,9 @@ #include "lltexlayer.h" +void init_landmark_menu(LLMenuGL* menu); +void clear_landmark_menu(LLMenuGL* menu); + void init_client_menu(LLMenuGL* menu); void init_server_menu(LLMenuGL* menu); @@ -244,6 +248,7 @@ LLPieMenu *gPieAttachment = NULL; LLPieMenu *gPieLand = NULL; // local constants +const LLString LANDMARK_MENU_NAME("Landmarks"); const LLString CLIENT_MENU_NAME("Client"); const LLString SERVER_MENU_NAME("Server"); @@ -273,6 +278,7 @@ LLPieMenu* gDetachPieMenu = NULL; LLPieMenu* gDetachScreenPieMenu = NULL; LLPieMenu* gDetachBodyPartPieMenus[8]; +LLMenuGL* gLandmarkMenu = NULL; LLMenuItemCallGL* gAFKMenu = NULL; LLMenuItemCallGL* gBusyMenu = NULL; @@ -334,6 +340,9 @@ void handle_audio_status_2(void*); void handle_audio_status_3(void*); void handle_audio_status_4(void*); #endif +void manage_landmarks(void*); +void create_new_landmark(void*); +void landmark_menu_action(void*); void reload_ui(void*); void handle_agent_stop_moving(void*); void print_packets_lost(void*); @@ -362,6 +371,7 @@ void toggle_show_xui_names(void *); BOOL check_show_xui_names(void *); // Debug UI +void handle_web_search_demo(void*); void handle_slurl_test(void*); void handle_save_to_xml(void*); void handle_load_from_xml(void*); @@ -483,6 +493,54 @@ BOOL enable_have_card(void*); BOOL enable_detach(void*); BOOL enable_region_owner(void*); +class LLLandmarkObserver : public LLInventoryObserver +{ +public: + LLLandmarkObserver(); + virtual ~LLLandmarkObserver(); + + virtual void changed(U32 mask) + { + // JAMESDEBUG disabled for now - slows down client or causes crashes + // in inventory code. + // + // Also, this may not be faster than just rebuilding the menu each time. + // I believe gInventory.getObject() is not fast. + // + //const std::set<LLUUID>& changed_ids = gInventory.getChangedIDs(); + //std::set<LLUUID>::const_iterator id_it; + //BOOL need_to_rebuild_menu = FALSE; + //for(id_it = changed_ids.begin(); id_it != changed_ids.end(); ++id_it) + //{ + // LLInventoryObject* objectp = gInventory.getObject(*id_it); + // if (objectp && (objectp->getType() == LLAssetType::AT_LANDMARK || objectp->getType() == LLAssetType::AT_CATEGORY)) + // { + // need_to_rebuild_menu = TRUE; + // } + //} + //if (need_to_rebuild_menu) + //{ + // init_landmark_menu(gLandmarkMenu); + //} + } +}; + +// For debugging only, I think the inventory observer doesn't get +// called if the inventory is loaded from cache. +void build_landmark_menu(void*) +{ + init_landmark_menu(gLandmarkMenu); +} + +LLLandmarkObserver::LLLandmarkObserver() +{ + gInventory.addObserver(this); +} + +LLLandmarkObserver::~LLLandmarkObserver() +{ + gInventory.removeObserver(this); +} class LLMenuParcelObserver : public LLParcelObserver { @@ -493,6 +551,7 @@ public: }; static LLMenuParcelObserver* gMenuParcelObserver = NULL; +static LLLandmarkObserver* gLandmarkObserver = NULL; LLMenuParcelObserver::LLMenuParcelObserver() { @@ -584,7 +643,7 @@ void init_menus() gDetachScreenPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Detach HUD", true); gDetachPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Detach", true); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { gMenuHolder->getChildByName("Self Underpants", TRUE)->setVisible(FALSE); gMenuHolder->getChildByName("Self Undershirt", TRUE)->setVisible(FALSE); @@ -648,7 +707,7 @@ void init_menus() gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); - if (gAgent.mAccess < SIM_ACCESS_MATURE) + if (gAgent.isTeen()) { gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE); gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE); @@ -656,6 +715,18 @@ void init_menus() // TomY TODO convert these two LLMenuGL*menu; + + // JAMESDEBUG - Maybe we don't want a global landmark menu + /* + menu = new LLMenuGL(LANDMARK_MENU_NAME); + // Defer init_landmark_menu() until inventory observer reports that we actually + // have inventory. Otherwise findCategoryByUUID() will create an empty + // Landmarks folder in inventory. JC + gMenuBarView->appendMenu( menu ); + menu->updateParent(LLMenuGL::sMenuContainer); + gLandmarkMenu = menu; + */ + menu = new LLMenuGL(CLIENT_MENU_NAME); init_client_menu(menu); gMenuBarView->appendMenu( menu ); @@ -671,12 +742,74 @@ void init_menus() // Let land based option enable when parcel changes gMenuParcelObserver = new LLMenuParcelObserver(); + // Let landmarks menu update when landmarks are added/removed + gLandmarkObserver = new LLLandmarkObserver(); + // // Debug menu visiblity // show_debug_menus(); } +void init_landmark_menu(LLMenuGL* menu) +{ + if (!menu) return; + + // clear existing menu, as we might be rebuilding as result of inventory update + clear_landmark_menu(menu); + + menu->append(new LLMenuItemCallGL("Organize Landmarks", + &manage_landmarks, NULL)); + menu->append(new LLMenuItemCallGL("New Landmark...", + &create_new_landmark, NULL)); + menu->appendSeparator(); + + // now collect all landmarks in inventory and build menu... + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK), cats, items); + if(items) + { + S32 count = items->count(); + for(S32 i = 0; i < count; ++i) + { + LLInventoryItem* item = items->get(i); + LLString landmark_name = item->getName(); + LLUUID* landmark_id_ptr = new LLUUID( item->getUUID() ); + LLMenuItemCallGL* menu_item = + new LLMenuItemCallGL(landmark_name, landmark_menu_action, + NULL, NULL, landmark_id_ptr); + menu->append(menu_item); + } + } +} + +void clear_landmark_menu(LLMenuGL* menu) +{ + if (!menu) return; + + // We store the UUIDs of the landmark inventory items in the userdata + // field of the menus. Therefore when we clean up the menu we need to + // delete that data. + const LLView::child_list_t* child_list = menu->getChildList(); + LLView::child_list_const_iter_t it = child_list->begin(); + for ( ; it != child_list->end(); ++it) + { + LLView* view = *it; + if (view->getWidgetType() == WIDGET_TYPE_MENU_ITEM_CALL) + { + LLMenuItemCallGL* menu_item = (LLMenuItemCallGL*)view; + if (menu_item->getMenuCallback() == landmark_menu_action) + { + void* user_data = menu_item->getUserData(); + delete (LLUUID*)user_data; + } + } + } + + menu->empty(); +} + void init_client_menu(LLMenuGL* menu) { LLMenuGL* sub_menu = NULL; @@ -1010,7 +1143,7 @@ void init_debug_ui_menu(LLMenuGL* menu) menu->append(new LLMenuItemCallGL( "Dump VolumeMgr", &dump_volume_mgr, NULL, NULL)); menu->append(new LLMenuItemCallGL( "Print Selected Object Info", &print_object_info, NULL, NULL, 'P', MASK_CONTROL|MASK_SHIFT )); menu->append(new LLMenuItemCallGL( "Print Agent Info", &print_agent_nvpairs, NULL, NULL, 'P', MASK_SHIFT )); - menu->append(new LLMenuItemCallGL( "Print Texture Memory Stats", &output_statistics, NULL, NULL, 'M', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); + menu->append(new LLMenuItemCallGL( "Texture Memory Stats", &output_statistics, NULL, NULL, 'M', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); menu->append(new LLMenuItemCheckGL("Double-Click Auto-Pilot", menu_toggle_control, NULL, menu_check_control, (void*)"DoubleClickAutoPilot")); @@ -1456,9 +1589,14 @@ static std::vector<LLPointer<view_listener_t> > sMenus; //----------------------------------------------------------------------------- void cleanup_menus() { + clear_landmark_menu(gLandmarkMenu); + delete gMenuParcelObserver; gMenuParcelObserver = NULL; + delete gLandmarkObserver; + gLandmarkObserver = NULL; + delete gPieSelf; gPieSelf = NULL; @@ -2860,6 +2998,60 @@ void handle_audio_status_4(void*) } #endif +void manage_landmarks(void*) +{ + LLFloaterLandmark::showInstance(1); +} + +void create_new_landmark(void*) +{ + // Note this is temporary cut and paste of legacy functionality. + // TODO: Make this spawn a floater allowing user customize before creating the inventory object + + LLViewerRegion* agent_region = gAgent.getRegion(); + if(!agent_region) + { + llwarns << "No agent region" << llendl; + return; + } + LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + if (!agent_parcel) + { + llwarns << "No agent parcel" << llendl; + return; + } + if (!agent_parcel->getAllowLandmark() + && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) + { + gViewerWindow->alertXml("CannotCreateLandmarkNotOwner"); + return; + } + + LLUUID folder_id; + folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + std::string pos_string; + gAgent.buildLocationString(pos_string); + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, LLTransactionID::tnull, + pos_string, pos_string, // name, desc + LLAssetType::AT_LANDMARK, + LLInventoryType::IT_LANDMARK, + NOT_WEARABLE, PERM_ALL, + NULL); +} + +void landmark_menu_action(void* userdata) +{ + LLUUID item_id = *(LLUUID*)userdata; + + LLViewerInventoryItem* itemp = gInventory.getItem(item_id); + if (itemp) + { + open_landmark(itemp, itemp->getName(), FALSE); + } +} + void reload_ui(void *) { gUICtrlFactory->rebuild(); @@ -5160,7 +5352,7 @@ class LLShowFloater : public view_listener_t else if (floater_name == "help f1") { #if LL_LIBXUL_ENABLED - gViewerHtmlHelp.show(); + gViewerHtmlHelp.show( gSavedSettings.getString("HelpHomeURL") ); #endif } else if (floater_name == "help in-world") @@ -5363,7 +5555,7 @@ class LLShowAgentProfile : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(agent_id); if (avatar) { - LLFloaterAvatarInfo::showFromAvatar(avatar); + LLFloaterAvatarInfo::show(agent_id); } return true; } @@ -6080,18 +6272,11 @@ void handle_test_female(void*) void handle_toggle_pg(void*) { - if (gAgent.mAccess < SIM_ACCESS_MATURE) - { - gAgent.mAccess = SIM_ACCESS_MATURE; - } - else - { - gAgent.mAccess = SIM_ACCESS_PG; - } + gAgent.setTeen( !gAgent.isTeen() ); LLFloaterWorldMap::reloadIcons(NULL); - llinfos << "Access set to " << (S32)gAgent.mAccess << llendl; + llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl; } void handle_dump_attachments(void*) diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index f0e8132990..d5fc9fa381 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -51,7 +51,7 @@ #include "llfirstuse.h" #include "llfloaterbuyland.h" #include "llfloatergroups.h" -#include "llfloaterhtml.h" +//#include "llfloaterhtml.h" #include "llfloatersellland.h" #include "llfloatertools.h" #include "llnotify.h" diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index dd5dba7de5..5e17ff0a57 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1345,30 +1345,35 @@ void LLViewerRegion::setSeedCapability(const std::string& url) setCapability("Seed", url); LLSD capabilityNames = LLSD::emptyArray(); + capabilityNames.append("ChatSessionRequest"); + capabilityNames.append("CopyInventoryFromNotecard"); + capabilityNames.append("DispatchRegionInfo"); + capabilityNames.append("EventQueueGet"); capabilityNames.append("MapLayer"); capabilityNames.append("MapLayerGod"); capabilityNames.append("NewFileAgentInventory"); - capabilityNames.append("EventQueueGet"); + capabilityNames.append("ParcelGodReserveForNewbie"); + capabilityNames.append("ParcelVoiceInfoRequest"); + capabilityNames.append("ProvisionVoiceAccountRequest"); + capabilityNames.append("RemoteParcelRequest"); + capabilityNames.append("RequestTextureDownload"); + capabilityNames.append("SearchStatRequest"); + capabilityNames.append("SearchStatTracking"); + capabilityNames.append("SendPostcard"); + capabilityNames.append("SendUserReport"); + capabilityNames.append("SendUserReportWithScreenshot"); + capabilityNames.append("ServerReleaseNotes"); capabilityNames.append("UpdateGestureAgentInventory"); capabilityNames.append("UpdateNotecardAgentInventory"); capabilityNames.append("UpdateScriptAgentInventory"); capabilityNames.append("UpdateGestureTaskInventory"); capabilityNames.append("UpdateNotecardTaskInventory"); capabilityNames.append("UpdateScriptTaskInventory"); - capabilityNames.append("SendPostcard"); capabilityNames.append("ViewerStartAuction"); - capabilityNames.append("ParcelGodReserveForNewbie"); - capabilityNames.append("SendUserReport"); - capabilityNames.append("SendUserReportWithScreenshot"); - capabilityNames.append("RequestTextureDownload"); capabilityNames.append("UntrustedSimulatorMessage"); - capabilityNames.append("ParcelVoiceInfoRequest"); - capabilityNames.append("ChatSessionRequest"); capabilityNames.append("ViewerStats"); - capabilityNames.append("ProvisionVoiceAccountRequest"); - capabilityNames.append("ServerReleaseNotes"); - capabilityNames.append("CopyInventoryFromNotecard"); - capabilityNames.append("DispatchRegionInfo"); + // Please add new capabilities alphabetically to reduce + // merge conflicts. llinfos << "posting to seed " << url << llendl; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 2c382cba67..1e75e421a1 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -53,8 +53,10 @@ #include "llviewerimagelist.h" #include "llviewerwindow.h" #include "llviewerinventory.h" +#include "llvieweruictrlfactory.h" #include "llnotecard.h" #include "llmemorystream.h" +#include "llmenugl.h" extern BOOL gPacificDaylightTime; @@ -567,6 +569,18 @@ LLViewerTextEditor::LLViewerTextEditor(const LLString& name, { mEmbeddedItemList = new LLEmbeddedItems(this); mInventoryCallback->setEditor(this); + + // Build the right click menu + // make the popup menu available + + LLMenuGL* menu = gUICtrlFactory->buildMenu("menu_slurl.xml", this); + if (!menu) + { + menu = new LLMenuGL(""); + } + menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); + // menu->setVisible(FALSE); + mPopupMenuHandle = menu->mViewHandle; } LLViewerTextEditor::~LLViewerTextEditor() @@ -732,6 +746,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) } // assume we're starting a drag select mIsSelecting = TRUE; + } else { @@ -941,6 +956,42 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + + + BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; + + if(! handled) + { + LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); + if( cur_segment ) + { + if(cur_segment->getStyle().isLink()) + { + handled = TRUE; + mHTML = cur_segment->getStyle().getLinkHREF(); + } + } + } + LLMenuGL* menu = (LLMenuGL*)LLView::getViewByHandle(mPopupMenuHandle); + if(handled && menu && mParseHTML && mHTML.length() > 0) + { + menu->setVisible(TRUE); + menu->arrange(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, menu, x, y); + mHTML = ""; + } + else + { + if(menu && menu->getVisible()) + { + menu->setVisible(FALSE); + } + } + return handled; +} BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index e05a61c3a3..1ec173a5d1 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -63,6 +63,7 @@ public: // mousehandler overrides virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); @@ -128,6 +129,8 @@ protected: LLUUID mNotecardInventoryID; LLPointer<LLEmbeddedNotecardOpener> mInventoryCallback; + + LLViewHandle mPopupMenuHandle; }; #endif // LL_VIEWERTEXTEDITOR_H diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 49abf130ac..7aaf9c0652 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -32,9 +32,15 @@ #include "llviewerprecompiledheaders.h" #include "llviewerwindow.h" + +// system library includes +#include <stdio.h> +#include <iostream> +#include <fstream> + #include "llviewquery.h" #include "llxmltree.h" -#include "llviewercamera.h" +//#include "llviewercamera.h" //#include "imdebug.h" #include "llvoiceclient.h" // for push-to-talk button handling @@ -1823,6 +1829,8 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) adjust_rect_top_left("FloaterGestureRect", window); adjust_rect_top_right("FloaterMapRect", window); + + adjust_rect_top_right("FloaterLagMeter", window); adjust_rect_top_right("FloaterLagMeter", window); @@ -2925,6 +2933,10 @@ BOOL LLViewerWindow::handlePerFrameHover() { gFloaterTools->setVisible(FALSE); } + // In the future we may wish to hide the tools menu unless you + // are building. JC + //gMenuBarView->setItemVisible("Tools", gFloaterTools->getVisible()); + //gMenuBarView->arrange(); } if (gToolBar) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 41873c7b03..4905ff82b9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -271,6 +271,7 @@ LLUUID LLVOAvatar::sStepSounds[LL_MCODE_END] = }; S32 LLVOAvatar::sRenderName = RENDER_NAME_ALWAYS; +BOOL LLVOAvatar::sRenderGroupTitles = TRUE; S32 LLVOAvatar::sNumVisibleChatBubbles = 0; BOOL LLVOAvatar::sDebugInvisible = FALSE; BOOL LLVOAvatar::sShowAttachmentPoints = FALSE; @@ -2704,7 +2705,15 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) || is_appearance != mNameAppearance) { char line[MAX_STRING]; /* Flawfinder: ignore */ - if (title && title->getString() && title->getString()[0] != '\0') + if (!sRenderGroupTitles) + { + // If all group titles are turned off, stack first name + // on a line above last name + strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ + line[MAX_STRING -1] = '\0'; + strcat(line, "\n"); + } + else if (title && title->getString() && title->getString()[0] != '\0') { strncpy(line, title->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ line[MAX_STRING -1] = '\0'; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 18f69a02ec..7ef9aee873 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -831,6 +831,7 @@ public: static LLUUID sStepSoundOnLand; static S32 sRenderName; + static BOOL sRenderGroupTitles; static S32 sNumVisibleChatBubbles; static BOOL sDebugInvisible; static BOOL sShowAttachmentPoints; diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index f908cd2593..7ee4869153 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -36,7 +36,7 @@ #include "llwindow.h" -#include "llfloaterhtml.h" +//#include "llfloaterhtml.h" #include "llviewercontrol.h" // static diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 16a8be7bc7..6ba10ea0a9 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -106,7 +106,11 @@ LLWorldMap::LLWorldMap() : mNeighborMap(NULL), mTelehubCoverageMap(NULL), mNeighborMapWidth(0), - mNeighborMapHeight(0) + mNeighborMapHeight(0), + mSLURLRegionName(), + mSLURL(), + mSLURLCallback(0), + mSLURLTeleport(false) { for (S32 map=0; map<MAP_SIM_IMAGE_TYPES; ++map) { @@ -398,6 +402,19 @@ void LLWorldMap::sendNamedRegionRequest(std::string region_name) msg->addStringFast(_PREHASH_Name, region_name); gAgent.sendReliableMessage(); } +// public +void LLWorldMap::sendNamedRegionRequest(std::string region_name, + url_callback_t callback, + const std::string& callback_url, + bool teleport) // immediately teleport when result returned +{ + mSLURLRegionName = region_name; + mSLURL = callback_url; + mSLURLCallback = callback; + mSLURLTeleport = teleport; + + sendNamedRegionRequest(region_name); +} // public void LLWorldMap::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) @@ -532,6 +549,8 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) U32 x_meters = x_regions * REGION_WIDTH_UNITS; U32 y_meters = y_regions * REGION_WIDTH_UNITS; + U64 handle = to_region_handle(x_meters, y_meters); + if (access == 255) { // This region doesn't exist @@ -547,13 +566,23 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) found_null_sim = true; } + else if(gWorldMap->mSLURLCallback != NULL) + { + // Server returns definitive capitalization, SLURL might + // not have that. + if (!stricmp(gWorldMap->mSLURLRegionName.c_str(), name)) + { + gWorldMap->mSLURLCallback(handle, gWorldMap->mSLURL, image_id, gWorldMap->mSLURLTeleport); + gWorldMap->mSLURLCallback = NULL; + gWorldMap->mSLURLRegionName.clear(); + } + } else { adjust = gWorldMap->extendAABB(x_meters, y_meters, x_meters+REGION_WIDTH_UNITS, y_meters+REGION_WIDTH_UNITS) || adjust; - U64 handle = to_region_handle(x_meters, y_meters); // llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl; @@ -614,6 +643,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) } } } + if(adjust) gFloaterWorldMap->adjustZoomSliderBounds(); gFloaterWorldMap->updateSims(found_null_sim); } diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 5b2b97792e..b0c6f352b0 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -113,6 +113,8 @@ struct LLWorldMapLayer class LLWorldMap { public: + typedef void(*url_callback_t)(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport); + LLWorldMap(); ~LLWorldMap(); @@ -147,6 +149,10 @@ public: void sendMapLayerRequest(); void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false); void sendNamedRegionRequest(std::string region_name); + void sendNamedRegionRequest(std::string region_name, + url_callback_t callback, + const std::string& callback_url, + bool teleport); void sendItemRequest(U32 type, U64 handle = 0); static void processMapLayerReply(LLMessageSystem*, void**); @@ -208,6 +214,12 @@ public: private: LLTimer mRequestTimer; + + // search for named region for url processing + std::string mSLURLRegionName; + std::string mSLURL; + url_callback_t mSLURLCallback; + bool mSLURLTeleport; }; extern LLWorldMap* gWorldMap; diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 08d8aade87..188591d1f9 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -621,7 +621,9 @@ void LLWorldMapView::draw() } // If this is mature, and you are not, draw a line across it - if (info->mAccess != SIM_ACCESS_DOWN && info->mAccess > gAgent.mAccess) + if (info->mAccess != SIM_ACCESS_DOWN + && info->mAccess > SIM_ACCESS_PG + && gAgent.isTeen()) { glBlendFunc(GL_DST_ALPHA, GL_ZERO); |