diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-07-19 13:23:19 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-07-19 13:23:19 +0100 |
commit | cc90425fed9ade362c9d842db2c72ea021d0bd40 (patch) | |
tree | 8504a16dfc803ba8673737076a46d7fc5d15c981 /indra/newview | |
parent | f1c9e56e93329b532a11ff5522dd3bcc5f7bbae1 (diff) |
Bury the dead code day: Removed LLFloaterParcelInfo, LLFloaterURLDisplay and LLPanelPlace
Moved LLParcelHandler from now defunct llfloaterparcel.cpp to llpanelplaces.cpp
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/newview/llfloaterparcel.cpp | 128 | ||||
-rw-r--r-- | indra/newview/llfloaterparcel.h | 59 | ||||
-rw-r--r-- | indra/newview/llfloaterurldisplay.cpp | 109 | ||||
-rw-r--r-- | indra/newview/llfloaterurldisplay.h | 64 | ||||
-rw-r--r-- | indra/newview/llpanelplace.cpp | 424 | ||||
-rw-r--r-- | indra/newview/llpanelplace.h | 120 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llremoteparcelrequest.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llurldispatcher.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 4 |
12 files changed, 37 insertions, 936 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4e87dd9225..64bcf12b06 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -190,7 +190,6 @@ set(viewer_SOURCE_FILES llfloaternamedesc.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp - llfloaterparcel.cpp llfloaterpay.cpp llfloaterperms.cpp llfloaterpostcard.cpp @@ -212,7 +211,6 @@ set(viewer_SOURCE_FILES llfloatertopobjects.cpp llfloatertos.cpp llfloateruipreview.cpp - llfloaterurldisplay.cpp llfloaterurlentry.cpp llfloatervoicedevicesettings.cpp llfloatervoiceeffect.cpp @@ -349,7 +347,6 @@ set(viewer_SOURCE_FILES llpanelpermissions.cpp llpanelpick.cpp llpanelpicks.cpp - llpanelplace.cpp llpanelplaceinfo.cpp llpanelplaceprofile.cpp llpanelplaces.cpp @@ -717,7 +714,6 @@ set(viewer_HEADER_FILES llfloaternamedesc.h llfloaternotificationsconsole.h llfloateropenobject.h - llfloaterparcel.h llfloaterpay.h llfloaterperms.h llfloaterpostcard.h @@ -739,7 +735,6 @@ set(viewer_HEADER_FILES llfloatertopobjects.h llfloatertos.h llfloateruipreview.h - llfloaterurldisplay.h llfloaterurlentry.h llfloatervoicedevicesettings.h llfloatervoiceeffect.h @@ -872,7 +867,6 @@ set(viewer_HEADER_FILES llpanelpermissions.h llpanelpick.h llpanelpicks.h - llpanelplace.h llpanelplaceinfo.h llpanelplaceprofile.h llpanelplaces.h diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp deleted file mode 100644 index e2be784116..0000000000 --- a/indra/newview/llfloaterparcel.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @file llfloaterparcel.cpp - * @brief LLFloaterParcel class implementation - * Parcel information as shown in a floating window from secondlife:// command - * handler. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$ - */ -#include "llviewerprecompiledheaders.h" - -#include "llfloaterparcel.h" - -#include "llfloaterreg.h" - -// viewer project includes -#include "llcommandhandler.h" -#include "llpanelplace.h" -#include "llsidetray.h" - -// linden library includes -#include "lluuid.h" -#include "lluictrlfactory.h" - -//----------------------------------------------------------------------------- -// Globals -//----------------------------------------------------------------------------- - -class LLParcelHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } - bool handle(const LLSD& params, const LLSD& query_map, - LLMediaCtrl* web) - { - if (params.size() < 2) - { - return false; - } - LLUUID parcel_id; - if (!parcel_id.set(params[0], FALSE)) - { - return false; - } - if (params[1].asString() == "about") - { - if (parcel_id.notNull()) - { - LLSD key; - key["type"] = "remote_place"; - key["id"] = parcel_id; - LLSideTray::getInstance()->showPanel("panel_places", key); - return true; - } - } - return false; - } -}; -LLParcelHandler gParcelHandler; - -//----------------------------------------------------------------------------- -// Member functions -//----------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -void* LLFloaterParcelInfo::createPanelPlace(void* data) -{ - LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; - self->mPanelParcelp = new LLPanelPlace(); // allow edit self - LLUICtrlFactory::getInstance()->buildPanel(self->mPanelParcelp, "panel_place.xml"); - return self->mPanelParcelp; -} - -//---------------------------------------------------------------------------- - - -LLFloaterParcelInfo::LLFloaterParcelInfo(const LLSD& parcel_id) -: LLFloater(parcel_id), - mParcelID( parcel_id.asUUID() ), - mPanelParcelp(NULL) -{ - mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); -// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); -} - -// virtual -LLFloaterParcelInfo::~LLFloaterParcelInfo() -{ - -} - -BOOL LLFloaterParcelInfo::postBuild() -{ - if (mPanelParcelp) - { - mPanelParcelp->setParcelID(mParcelID); - } - center(); - return LLFloater::postBuild(); -} - - diff --git a/indra/newview/llfloaterparcel.h b/indra/newview/llfloaterparcel.h deleted file mode 100644 index 386acb3fd5..0000000000 --- a/indra/newview/llfloaterparcel.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file llfloaterparcel.h - * @brief Parcel information as shown in a floating window from a sl-url. - * Just a wrapper for LLPanelPlace, shared with the Find directory. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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_FLOATERPARCELINFO_H -#define LL_FLOATERPARCELINFO_H - -#include "llfloater.h" - -class LLPanelPlace; - -class LLFloaterParcelInfo -: public LLFloater -{ -public: - static void* createPanelPlace(void* data); - - LLFloaterParcelInfo( const LLSD& parcel_id ); - /*virtual*/ ~LLFloaterParcelInfo(); - - /*virtual*/ BOOL postBuild(); - - void displayParcelInfo(const LLUUID& parcel_id); - -private: - LLUUID mParcelID; // for which parcel is this window? - LLPanelPlace* mPanelParcelp; -}; - - -#endif diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp deleted file mode 100644 index 4b67cbb308..0000000000 --- a/indra/newview/llfloaterurldisplay.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @file llfloaterurldisplay.h - * @brief Probably should be called LLFloaterTeleport, or LLFloaterLandmark - * as it gives you a preview of a potential teleport location. - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llregionhandle.h" -#include "v3dmath.h" - -#include "llfloaterurldisplay.h" - -#include "llpanelplace.h" -#include "lluictrlfactory.h" - -//////////////////////////////////////////////////////////////////////////// -// LLFloaterURLDisplay - - -LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) - : LLFloater(sd) -{ - mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); -// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml"); - - // If positioned at 0,0 the teleport button is behind the toolbar. - LLRect r = getRect(); - if (r.mBottom == 0 && r.mLeft == 0) - { - // first use, center it - center(); - } - else - { - gFloaterView->adjustToFitScreen(this, 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) -{ // Set the name and also clear description - mPlacePanel->resetName(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(); - LLUICtrlFactory::getInstance()->buildPanel(self->mPlacePanel, "panel_place.xml"); - - return self->mPlacePanel; -} diff --git a/indra/newview/llfloaterurldisplay.h b/indra/newview/llfloaterurldisplay.h deleted file mode 100644 index 22f5a95ad0..0000000000 --- a/indra/newview/llfloaterurldisplay.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file llfloaterurldisplay.h - * @brief LLFloaterURLDisplay class implementation - * - * $LicenseInfo:firstyear=2006&license=viewergpl$ - * - * Copyright (c) 2006-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 -{ - friend class LLFloaterReg; -public: - - 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: - LLFloaterURLDisplay(const LLSD& sd); - virtual ~LLFloaterURLDisplay(); - - LLVector3 mRegionPosition; - U64 mRegionHandle; - LLPanelPlace* mPlacePanel; -}; - -#endif // LL_LLFLOATERURLDISPLAY_H diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp deleted file mode 100644 index 1446088c4f..0000000000 --- a/indra/newview/llpanelplace.cpp +++ /dev/null @@ -1,424 +0,0 @@ -/** - * @file llpanelplace.cpp - * @brief Display of a place in the Find directory. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llpanelplace.h" - -#include "llviewercontrol.h" -#include "llqueryflags.h" -#include "llui.h" -#include "llsecondlifeurls.h" -#include "llfloater.h" -#include "llfloaterreg.h" -#include "llregionhandle.h" - -#include "llagent.h" -#include "llviewerwindow.h" -#include "llbutton.h" -#include "llfloaterworldmap.h" -#include "lllineeditor.h" -#include "llnotificationsutil.h" -#include "lluiconstants.h" -#include "lltextbox.h" -#include "lltexteditor.h" -#include "lltexturectrl.h" -#include "lltrans.h" -#include "llworldmap.h" -#include "llviewerregion.h" -#include "llvoavatarself.h" -#include "lluictrlfactory.h" -//#include "llviewermenu.h" // create_landmark() -#include "llweb.h" -#include "llsdutil.h" -#include "llsdutil_math.h" - -LLPanelPlace::LLPanelPlace() -: LLPanel(), - mParcelID(), - mRequestedID(), - mRegionID(), - mPosGlobal(), - mPosRegion(), - mAuctionID(0), - mLandmarkAssetID() -{} - -LLPanelPlace::~LLPanelPlace() -{ - if (mParcelID.notNull()) - { - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); - } -} - -BOOL LLPanelPlace::postBuild() -{ - // Since this is only used in the directory browser, always - // disable the snapshot control. Otherwise clicking on it will - // open a texture picker. - mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setEnabled(FALSE); - - mNameEditor = getChild<LLTextBox>("name_editor"); - // Text boxes appear to have a " " in them by default. This breaks the - // emptiness test for filling in data from the network. Slam to empty. - mNameEditor->setText( LLStringUtil::null ); - - mDescEditor = getChild<LLTextEditor>("desc_editor"); - - mInfoEditor = getChild<LLTextBox>("info_editor"); - mLandTypeEditor = getChild<LLTextBox>("land_type_display"); - - mLocationDisplay = getChild<LLTextBox>("location_editor"); - - mTeleportBtn = getChild<LLButton>( "teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport, this); - - mMapBtn = getChild<LLButton>( "map_btn"); - mMapBtn->setClickedCallback(onClickMap, this); - - //mLandmarkBtn = getChild<LLButton>( "landmark_btn"); - //mLandmarkBtn->setClickedCallback(onClickLandmark, this); - - mAuctionBtn = getChild<LLButton>( "auction_btn"); - mAuctionBtn->setClickedCallback(onClickAuction, this); - - // 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) -{ - if (pItem) - { - mNameEditor->setText(pItem->getName()); - mDescEditor->setText(pItem->getDescription()); - } -} - -// Use this for search directory clicks, because we are totally -// recycling the panel and don't need to use what's there. -// -// For SLURL clicks, don't call this, because we need to cache -// the location info from the user. -void LLPanelPlace::resetLocation() -{ - mParcelID.setNull(); - mRequestedID.setNull(); - mRegionID.setNull(); - mLandmarkAssetID.setNull(); - mPosGlobal.clearVec(); - mPosRegion.clearVec(); - mAuctionID = 0; - mNameEditor->setText( LLStringUtil::null ); - mDescEditor->setText( LLStringUtil::null ); - mInfoEditor->setText( LLStringUtil::null ); - mLandTypeEditor->setText( LLStringUtil::null ); - mLocationDisplay->setText( LLStringUtil::null ); -} - - -// Set the name and clear other bits of info. Used for SLURL clicks -void LLPanelPlace::resetName(const std::string& name) -{ - setName(name); - if(mDescEditor) - { - mDescEditor->setText( LLStringUtil::null ); - } - if(mNameEditor) - { - llinfos << "Clearing place name" << llendl; - mNameEditor->setText( LLStringUtil::null ); - } - if(mInfoEditor) - { - mInfoEditor->setText( LLStringUtil::null ); - } - if(mLandTypeEditor) - { - mLandTypeEditor->setText( LLStringUtil::null ); - } -} - -//virtual -void LLPanelPlace::setParcelID(const LLUUID& parcel_id) -{ - mParcelID = parcel_id; - sendParcelInfoRequest(); -} - -void LLPanelPlace::setSnapshot(const LLUUID& snapshot_id) -{ - mSnapshotCtrl->setImageAssetID(snapshot_id); -} - -void LLPanelPlace::setLocationString(const std::string& location) -{ - mLocationDisplay->setText(location); -} - -void LLPanelPlace::setLandTypeString(const std::string& land_type) -{ - mLandTypeEditor->setText(land_type); -} - -void LLPanelPlace::sendParcelInfoRequest() -{ - if (mParcelID != mRequestedID) - { - LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); - LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); - - mRequestedID = mParcelID; - } -} - -//virtual -void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason) -{ - // We only really handle 404 and 499 errors - std::string error_text; - if(status == 404) - { - error_text = getString("server_error_text"); - } - else if(status == 499) - { - error_text = getString("server_forbidden_text"); - } - mDescEditor->setText(error_text); -} - -//virtual -void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data) -{ - mAuctionID = parcel_data.auction_id; - - if(parcel_data.snapshot_id.notNull()) - { - mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); - } - - if( !parcel_data.name.empty() - && mNameEditor && mNameEditor->getText().empty()) - { - mNameEditor->setText(parcel_data.name); - } - - if( !parcel_data.desc.empty() - && mDescEditor && mDescEditor->getText().empty()) - { - mDescEditor->setText(parcel_data.desc); - } - - std::string info_text; - LLUIString traffic = getString("traffic_text"); - traffic.setArg("[TRAFFIC]", llformat("%d ", (int)parcel_data.dwell)); - info_text = traffic; - LLUIString area = getString("area_text"); - area.setArg("[AREA]", llformat("%d", parcel_data.actual_area)); - info_text += area; - if (parcel_data.flags & DFQ_FOR_SALE) - { - LLUIString forsale = getString("forsale_text"); - forsale.setArg("[PRICE]", llformat("%d", parcel_data.sale_price)); - info_text += forsale; - } - if (parcel_data.auction_id != 0) - { - LLUIString auction = getString("auction_text"); - auction.setArg("[ID]", llformat("%010d ", parcel_data.auction_id)); - info_text += auction; - } - if (mInfoEditor) - { - mInfoEditor->setText(info_text); - } - - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (parcel_data.flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (parcel_data.flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } - - // Just use given region position for display - S32 region_x = llround(mPosRegion.mV[0]); - S32 region_y = llround(mPosRegion.mV[1]); - S32 region_z = llround(mPosRegion.mV[2]); - - // If the region position is zero, grab position from the global - if(mPosRegion.isExactlyZero()) - { - region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; - region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; - region_z = llround(parcel_data.global_z); - } - - if(mPosGlobal.isExactlyZero()) - { - mPosGlobal.setVec(parcel_data.global_x, parcel_data.global_y, parcel_data.global_z); - } - - std::string location = llformat("%s %d, %d, %d (%s)", - parcel_data.sim_name.c_str(), region_x, region_y, region_z, rating.c_str()); - if (mLocationDisplay) - { - mLocationDisplay->setText(location); - } - - BOOL show_auction = (parcel_data.auction_id > 0); - mAuctionBtn->setVisible(show_auction); -} - - -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(getObserverHandle())); - } - else - { - mDescEditor->setText(getString("server_update_text")); - } - mSnapshotCtrl->setImageAssetID(LLUUID::null); -} - -// static -void LLPanelPlace::onClickTeleport(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - - LLView* parent_viewp = self->getParent(); - LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp); - if (parent_floaterp) - { - parent_floaterp->closeFloater(); - } - // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); - parent_viewp->setVisible(false); - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - if(self->mLandmarkAssetID.notNull() && worldmap_instance) - { - gAgent.teleportViaLandmark(self->mLandmarkAssetID); - worldmap_instance->trackLandmark(self->mLandmarkAssetID); - - } - else if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) - { - gAgent.teleportViaLocation(self->mPosGlobal); - worldmap_instance->trackLocation(self->mPosGlobal); - } -} - -// static -void LLPanelPlace::onClickMap(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - - if (!self->mPosGlobal.isExactlyZero() && worldmap_instance) - { - worldmap_instance->trackLocation(self->mPosGlobal); - LLFloaterReg::showInstance("world_map", "center"); - } -} - -// static -/* -void LLPanelPlace::onClickLandmark(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); -} -*/ - - -// static -void LLPanelPlace::onClickAuction(void* data) -{ - LLPanelPlace* self = (LLPanelPlace*)data; - LLSD args; - args["AUCTION_ID"] = self->mAuctionID; - - LLNotificationsUtil::add("GoToAuctionPage", args); -} -/* -// static -bool LLPanelPlace::callbackAuctionWebPage(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) - { - std::string url; - url = LLNotifications::instance().getGlobalString("AUCTION_URL") + llformat("%010d", response["auction_id"].asInteger()); - - llinfos << "Loading auction page " << url << llendl; - - LLWeb::loadURL(url); - } - return false; -} -*/ - diff --git a/indra/newview/llpanelplace.h b/indra/newview/llpanelplace.h deleted file mode 100644 index f90a1b0567..0000000000 --- a/indra/newview/llpanelplace.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @file llpanelplace.h - * @brief Display of a place in the Find directory. - * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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_LLPANELPLACE_H -#define LL_LLPANELPLACE_H - -#include "llpanel.h" - -#include "v3dmath.h" -#include "lluuid.h" - -#include "llremoteparcelrequest.h" - -class LLButton; -class LLTextBox; -class LLLineEditor; -class LLTextEditor; -class LLTextureCtrl; -class LLMessageSystem; -class LLInventoryItem; - -class LLPanelPlace : public LLPanel, LLRemoteParcelInfoObserver -{ -public: - LLPanelPlace(); - /*virtual*/ ~LLPanelPlace(); - - /*virtual*/ BOOL postBuild(); - - void resetLocation(); - // Ignore all old location information, useful if you are - // recycling an existing dialog and need to clear it. - - /*virtual*/ void setParcelID(const LLUUID& parcel_id); - // Sends a request for data about the given parcel, which will - // only update the location if there is none already available. - - void displayItemInfo(const LLInventoryItem* pItem); - void setRegionID(const LLUUID& region_id) { mRegionID = region_id; } - void setSnapshot(const LLUUID& snapshot_id); - void setLocationString(const std::string& location); - void setLandTypeString(const std::string& land_type); - /*virtual*/ void setErrorStatus(U32 status, const std::string& reason); - void resetName(const std::string& name); - - void sendParcelInfoRequest(); - void displayParcelInfo(const LLVector3& pos_region, - const LLUUID& landmark_asset_id, - const LLUUID& region_id, - const LLVector3d& pos_global); - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - - LLTextureCtrl *getSnapshotCtrl() const { return mSnapshotCtrl; } - -protected: - static void onClickTeleport(void* data); - static void onClickMap(void* data); - //static void onClickLandmark(void* data); - static void onClickAuction(void* data); - - // Go to auction web page if user clicked OK - static bool callbackAuctionWebPage(const LLSD& notification, const LLSD& response); - -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; - - LLTextBox* mNameEditor; - LLTextEditor* mDescEditor; - LLTextBox* mInfoEditor; - LLTextBox* mLandTypeEditor; - LLTextBox* mLocationDisplay; //not calling it "editor" because it isn't - - LLButton* mTeleportBtn; - LLButton* mMapBtn; - //LLButton* mLandmarkBtn; - LLButton* mAuctionBtn; -}; - -#endif // LL_LLPANELPLACE_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 705b196ef1..07adb18902 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -54,6 +54,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llavatarpropertiesprocessor.h" +#include "llcommandhandler.h" #include "llfloaterworldmap.h" #include "llinventorybridge.h" #include "llinventoryobserver.h" @@ -66,6 +67,7 @@ #include "llpanelplaceprofile.h" #include "llpanelteleporthistory.h" #include "llremoteparcelrequest.h" +#include "llsidetray.h" #include "llteleporthistorystorage.h" #include "lltoggleablemenu.h" #include "llviewerinventory.h" @@ -75,6 +77,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" +// Constants static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250; static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; @@ -83,6 +86,40 @@ static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; +// Support for secondlife:///app/parcel/{UUID}/about SLapps +class LLParcelHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLParcelHandler() : LLCommandHandler("parcel", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 2) + { + return false; + } + LLUUID parcel_id; + if (!parcel_id.set(params[0], FALSE)) + { + return false; + } + if (params[1].asString() == "about") + { + if (parcel_id.notNull()) + { + LLSD key; + key["type"] = "remote_place"; + key["id"] = parcel_id; + LLSideTray::getInstance()->showPanel("panel_places", key); + return true; + } + } + return false; + } +}; +LLParcelHandler gParcelHandler; + // Helper functions static bool is_agent_in_selected_parcel(LLParcel* parcel); static void onSLURLBuilt(std::string& slurl); diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 95e3dd6d78..c28c041d0c 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -36,7 +36,6 @@ #include "message.h" -#include "llpanelplace.h" #include "llpanel.h" #include "llhttpclient.h" #include "llsdserialize.h" diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e9efc49e27..1ee73034f6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -128,7 +128,6 @@ #include "llfloaterevent.h" #include "llpanelclassified.h" #include "llpanelpick.h" -#include "llpanelplace.h" #include "llpanelgrouplandmoney.h" #include "llpanelgroupnotices.h" #include "llpreview.h" diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index cbaa7248a2..ad7969681b 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -37,7 +37,6 @@ #include "llcommandhandler.h" #include "llfloaterhelpbrowser.h" #include "llfloaterreg.h" -#include "llfloaterurldisplay.h" #include "llfloaterworldmap.h" #include "llpanellogin.h" #include "llregionhandle.h" @@ -182,10 +181,6 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, bool right_mouse) return true; } - // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. - //LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD()); - //if(slurl_displayp) slurl_displayp->setName(region_name); - // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, @@ -251,21 +246,6 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& key["z"] = global_pos.mdV[VZ]; LLSideTray::getInstance()->showPanel("panel_places", key); - - // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. - -// // display informational floater, allow user to click teleport btn -// LLFloaterURLDisplay* slurl_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD()); -// if(slurl_displayp) -// { -// 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); -// } } } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index efe59744bc..0e3ffe1411 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -81,7 +81,6 @@ #include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" #include "llfloaterpay.h" -#include "llfloaterparcel.h" #include "llfloaterperms.h" #include "llfloaterpostcard.h" #include "llfloaterpostprocess.h" @@ -101,7 +100,6 @@ #include "llfloatertos.h" #include "llfloatertopobjects.h" #include "llfloateruipreview.h" -#include "llfloaterurldisplay.h" #include "llfloatervoicedevicesettings.h" #include "llfloatervoiceeffect.h" #include "llfloaterwater.h" @@ -202,14 +200,12 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>); - LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>); LLFloaterPayUtil::registerFloater(); LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostcard>); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>); LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>); LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPerms>); - LLFloaterReg::add("preview_url", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterURLDisplay>); LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>); LLFloaterReg::add("pref_voicedevicesettings", "floater_device_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterVoiceDeviceSettings>); LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewAnim>, "preview"); |