diff options
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/llpanelclassified.cpp | 1057 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.h | 166 | ||||
-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 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_classified.xml | 138 |
15 files changed, 45 insertions, 2289 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/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 7f027d299b..af6214385b 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -38,53 +38,34 @@ #include "llpanelclassified.h" -#include "lldir.h" #include "lldispatcher.h" #include "llfloaterreg.h" #include "llhttpclient.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llparcel.h" -#include "lltabcontainer.h" -#include "message.h" #include "llagent.h" -#include "llavataractions.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" #include "llclassifiedflags.h" #include "llclassifiedstatsresponder.h" #include "llcommandhandler.h" // for classified HTML detail page click tracking -#include "llviewercontrol.h" +#include "lliconctrl.h" #include "lllineeditor.h" -#include "lltextbox.h" #include "llcombobox.h" #include "lltexturectrl.h" #include "lltexteditor.h" -#include "lluiconstants.h" -#include "llurldispatcher.h" // for classified HTML detail click teleports -#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" -#include "llviewerwindow.h" -#include "llworldmap.h" #include "llfloaterworldmap.h" #include "llviewergenericmessage.h" // send_generic_message #include "llviewerregion.h" -#include "llviewerwindow.h" // for window width, height -#include "llappviewer.h" // abortQuit() #include "lltrans.h" #include "llscrollcontainer.h" #include "llstatusbar.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ -const S32 MATURE_UNDEFINED = -1; -const S32 MATURE_CONTENT = 1; -const S32 PG_CONTENT = 2; -const S32 DECLINE_TO_STATE = 0; //static -std::list<LLPanelClassified*> LLPanelClassified::sAllPanels; -std::list<LLPanelClassifiedInfo*> LLPanelClassifiedInfo::sAllPanels; +LLPanelClassifiedInfo::panel_list_t LLPanelClassifiedInfo::sAllPanels; // "classifiedclickthrough" // strings[0] = classified_id @@ -131,1040 +112,6 @@ public: } }; - -/* Re-expose this if we need to have classified ad HTML detail - pages. JC - -// We need to count classified teleport clicks from the search HTML detail pages, -// so we need have a teleport that also sends a click count message. -class LLClassifiedTeleportHandler : public LLCommandHandler -{ -public: - // don't allow from external browsers because it moves you immediately - LLClassifiedTeleportHandler() : LLCommandHandler("classifiedteleport", UNTRUSTED_BLOCK) { } - - bool handle(const LLSD& tokens, const LLSD& queryMap) - { - // Need at least classified id and region name, so 2 params - if (tokens.size() < 2) return false; - LLUUID classified_id = tokens[0].asUUID(); - if (classified_id.isNull()) return false; - // *HACK: construct a SLURL to do the teleport - std::string url("secondlife:///app/teleport/"); - // skip the uuid we took off above, rebuild URL - // separated by slashes. - for (S32 i = 1; i < tokens.size(); ++i) - { - url += tokens[i].asString(); - url += "/"; - } - llinfos << "classified teleport to " << url << llendl; - // *TODO: separately track old search, sidebar, and new search - // Right now detail HTML pages count as new search. - const bool from_search = true; - LLPanelClassified::sendClassifiedClickMessage(classified_id, "teleport", from_search); - // Invoke teleport - LLMediaCtrl* web = NULL; - const bool trusted_browser = true; - return LLURLDispatcher::dispatch(url, web, trusted_browser); - } -}; -// Creating the object registers with the dispatcher. -LLClassifiedTeleportHandler gClassifiedTeleportHandler; -*/ - -LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) -: LLPanel(), - mInFinder(in_finder), - mFromSearch(from_search), - mDirty(false), - mForceClose(false), - mLocationChanged(false), - mClassifiedID(), - mCreatorID(), - mPriceForListing(0), - mDataRequested(FALSE), - mPaidFor(FALSE), - mPosGlobal(), - mSnapshotCtrl(NULL), - mNameEditor(NULL), - mDescEditor(NULL), - mLocationEditor(NULL), - mCategoryCombo(NULL), - mMatureCombo(NULL), - mAutoRenewCheck(NULL), - mUpdateBtn(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), - mProfileBtn(NULL), - mInfoText(NULL), - mSetBtn(NULL), - mClickThroughText(NULL), - mTeleportClicksOld(0), - mMapClicksOld(0), - mProfileClicksOld(0), - mTeleportClicksNew(0), - mMapClicksNew(0), - mProfileClicksNew(0) - -{ - sAllPanels.push_back(this); - - std::string classified_def_file; - if (mInFinder) - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_classified.xml"); - } - else - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_classified.xml"); - } - - // Register dispatcher - gGenericDispatcher.addHandler("classifiedclickthrough", - &sClassifiedClickThrough); -} - - -LLPanelClassified::~LLPanelClassified() -{ - sAllPanels.remove(this); -} - - -void LLPanelClassified::reset() -{ - mClassifiedID.setNull(); - mCreatorID.setNull(); - mParcelID.setNull(); - - // Don't request data, this isn't valid - mDataRequested = TRUE; - - mDirty = false; - mPaidFor = FALSE; - - mPosGlobal.clearVec(); - - clearCtrls(); - resetDirty(); -} - - -BOOL LLPanelClassified::postBuild() -{ - mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny, this); - mSnapshotSize = mSnapshotCtrl->getRect(); - - mNameEditor = getChild<LLLineEditor>("given_name_editor"); - mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); - mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mNameEditor->setCommitCallback(onCommitAny, this); - mNameEditor->setPrevalidate( LLTextValidate::validateASCII ); - - mDescEditor = getChild<LLTextEditor>("desc_editor"); - mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mDescEditor->setCommitCallback(onCommitAny, this); - - mLocationEditor = getChild<LLLineEditor>("location_editor"); - - mSetBtn = getChild<LLButton>( "set_location_btn"); - mSetBtn->setClickedCallback(onClickSet, this); - - mTeleportBtn = getChild<LLButton>( "classified_teleport_btn"); - mTeleportBtn->setClickedCallback(onClickTeleport, this); - - mMapBtn = getChild<LLButton>( "classified_map_btn"); - mMapBtn->setClickedCallback(onClickMap, this); - - if(mInFinder) - { - mProfileBtn = getChild<LLButton>( "classified_profile_btn"); - mProfileBtn->setClickedCallback(onClickProfile, this); - } - - mCategoryCombo = getChild<LLComboBox>( "classified_category_combo"); - LLClassifiedInfo::cat_map::iterator iter; - for (iter = LLClassifiedInfo::sCategories.begin(); - iter != LLClassifiedInfo::sCategories.end(); - iter++) - { - mCategoryCombo->add(LLTrans::getString(iter->second), (void *)((intptr_t)iter->first), ADD_BOTTOM); - } - mCategoryCombo->setCurrentByIndex(0); - mCategoryCombo->setCommitCallback(onCommitAny, this); - - mMatureCombo = getChild<LLComboBox>( "classified_mature_check"); - mMatureCombo->setCurrentByIndex(0); - mMatureCombo->setCommitCallback(onCommitAny, this); - if (gAgent.wantsPGOnly()) - { - // Teens don't get to set mature flag. JC - mMatureCombo->setVisible(FALSE); - mMatureCombo->setCurrentByIndex(PG_CONTENT); - } - - if (!mInFinder) - { - mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check"); - mAutoRenewCheck->setCommitCallback(onCommitAny, this); - } - - mUpdateBtn = getChild<LLButton>("classified_update_btn"); - mUpdateBtn->setClickedCallback(onClickUpdate, this); - - if (!mInFinder) - { - mClickThroughText = getChild<LLTextBox>("click_through_text"); - } - - resetDirty(); - return TRUE; -} - -BOOL LLPanelClassified::titleIsValid() -{ - // Disallow leading spaces, punctuation, etc. that screw up - // sort order. - const std::string& name = mNameEditor->getText(); - if (name.empty()) - { - LLNotificationsUtil::add("BlankClassifiedName"); - return FALSE; - } - if (!isalnum(name[0])) - { - LLNotificationsUtil::add("ClassifiedMustBeAlphanumeric"); - return FALSE; - } - - return TRUE; -} - -void LLPanelClassified::apply() -{ - // Apply is used for automatically saving results, so only - // do that if there is a difference, and this is a save not create. - if (checkDirty() && mPaidFor) - { - sendClassifiedInfoUpdate(); - } -} - -bool LLPanelClassified::saveCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - switch(option) - { - case 0: // Save - sendClassifiedInfoUpdate(); - // fall through to close - - case 1: // Don't Save - { - mForceClose = true; - // Close containing floater - LLFloater* parent_floater = gFloaterView->getParentFloater(this); - if (parent_floater) - { - parent_floater->closeFloater(); - } - } - break; - - case 2: // Cancel - default: - LLAppViewer::instance()->abortQuit(); - break; - } - return false; -} - - -BOOL LLPanelClassified::canClose() -{ - if (mForceClose || !checkDirty()) - return TRUE; - - LLSD args; - args["NAME"] = mNameEditor->getText(); - LLNotificationsUtil::add("ClassifiedSave", args, LLSD(), boost::bind(&LLPanelClassified::saveCallback, this, _1, _2)); - return FALSE; -} - -// Fill in some reasonable defaults for a new classified. -void LLPanelClassified::initNewClassified() -{ - // TODO: Don't generate this on the client. - mClassifiedID.generate(); - - mCreatorID = gAgent.getID(); - - mPosGlobal = gAgent.getPositionGlobal(); - - mPaidFor = FALSE; - - // Try to fill in the current parcel - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) - { - mNameEditor->setText(parcel->getName()); - //mDescEditor->setText(parcel->getDesc()); - mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); - //mPriceEditor->setText("0"); - mCategoryCombo->setCurrentByIndex(0); - } - - mUpdateBtn->setLabel(getString("publish_txt")); - - // simulate clicking the "location" button - LLPanelClassified::onClickSet(this); -} - - -void LLPanelClassified::setClassifiedID(const LLUUID& id) -{ - mClassifiedID = id; -} - -//static -void LLPanelClassified::setClickThrough(const LLUUID& classified_id, - S32 teleport, - S32 map, - S32 profile, - bool from_new_table) -{ - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelClassified* self = *iter; - // For top picks, must match pick id - if (self->mClassifiedID != classified_id) - { - continue; - } - - // We need to check to see if the data came from the new stat_table - // or the old classified table. We also need to cache the data from - // the two separate sources so as to display the aggregate totals. - - if (from_new_table) - { - self->mTeleportClicksNew = teleport; - self->mMapClicksNew = map; - self->mProfileClicksNew = profile; - } - else - { - self->mTeleportClicksOld = teleport; - self->mMapClicksOld = map; - self->mProfileClicksOld = profile; - } - - if (self->mClickThroughText) - { - LLStringUtil::format_map_t args; - args["[TELEPORT]"] = llformat ("%d", self->mTeleportClicksNew + self->mTeleportClicksOld); - args["[MAP]"] = llformat ("%d", self->mMapClicksNew + self->mMapClicksOld); - args["[PROFILE]"] = llformat ("%d", self->mProfileClicksNew + self->mProfileClicksOld); - std::string msg = LLTrans::getString ("ClassifiedClicksTxt", args); - self->mClickThroughText->setText(msg); - } - } -} - -// Schedules the panel to request data -// from the server next time it is drawn. -void LLPanelClassified::markForServerRequest() -{ - mDataRequested = FALSE; -} - - -std::string LLPanelClassified::getClassifiedName() -{ - return mNameEditor->getText(); -} - - -void LLPanelClassified::sendClassifiedInfoRequest() -{ - LLMessageSystem *msg = gMessageSystem; - - if (mClassifiedID != mRequestedID) - { - msg->newMessageFast(_PREHASH_ClassifiedInfoRequest); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); - gAgent.sendReliableMessage(); - - 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(mClassifiedID)); - } - } -} - - -void LLPanelClassified::sendClassifiedInfoUpdate() -{ - // If we don't have a classified id yet, we'll need to generate one, - // otherwise we'll keep overwriting classified_id 00000 in the database. - if (mClassifiedID.isNull()) - { - // TODO: Don't do this on the client. - mClassifiedID.generate(); - } - - LLMessageSystem* msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_ClassifiedInfoUpdate); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_Data); - msg->addUUIDFast(_PREHASH_ClassifiedID, mClassifiedID); - // TODO: fix this - U32 category = mCategoryCombo->getCurrentIndex() + 1; - msg->addU32Fast(_PREHASH_Category, category); - msg->addStringFast(_PREHASH_Name, mNameEditor->getText()); - msg->addStringFast(_PREHASH_Desc, mDescEditor->getText()); - - // fills in on simulator if null - msg->addUUIDFast(_PREHASH_ParcelID, mParcelID); - // fills in on simulator if null - msg->addU32Fast(_PREHASH_ParentEstate, 0); - msg->addUUIDFast(_PREHASH_SnapshotID, mSnapshotCtrl->getImageAssetID()); - msg->addVector3dFast(_PREHASH_PosGlobal, mPosGlobal); - BOOL mature = mMatureCombo->getCurrentIndex() == MATURE_CONTENT; - BOOL auto_renew = FALSE; - if (mAutoRenewCheck) - { - auto_renew = mAutoRenewCheck->get(); - } - // These flags doesn't matter here. - const bool adult_enabled = false; - const bool is_pg = false; - U8 flags = pack_classified_flags_request(auto_renew, is_pg, mature, adult_enabled); - msg->addU8Fast(_PREHASH_ClassifiedFlags, flags); - msg->addS32("PriceForListing", mPriceForListing); - gAgent.sendReliableMessage(); - - mDirty = false; -} - - -//static -void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **) -{ - lldebugs << "processClassifiedInfoReply()" << llendl; - // Extract the agent id and verify the message is for this - // client. - LLUUID agent_id; - msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); - if (agent_id != gAgent.getID()) - { - llwarns << "Agent ID mismatch in processClassifiedInfoReply" - << llendl; - return; - } - - LLUUID classified_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_ClassifiedID, classified_id); - - LLUUID creator_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_CreatorID, creator_id); - - LLUUID parcel_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); - - std::string name; - msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name); - - std::string desc; - msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, desc); - - LLUUID snapshot_id; - msg->getUUIDFast(_PREHASH_Data, _PREHASH_SnapshotID, snapshot_id); - - // "Location text" is actually the original - // name that owner gave the parcel, and the location. - std::string location_text; - - msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, location_text); - if (!location_text.empty()) - { - location_text.append(", "); - } - - std::string sim_name; - msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, sim_name); - - LLVector3d pos_global; - msg->getVector3dFast(_PREHASH_Data, _PREHASH_PosGlobal, pos_global); - - S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)pos_global.mdV[VZ]); - - std::string buffer = llformat("%s (%d, %d, %d)", sim_name.c_str(), region_x, region_y, region_z); - location_text.append(buffer); - - U8 flags; - msg->getU8Fast(_PREHASH_Data, _PREHASH_ClassifiedFlags, flags); - //BOOL enabled = is_cf_enabled(flags); - bool mature = is_cf_mature(flags); - bool auto_renew = is_cf_auto_renew(flags); - - U32 date = 0; - msg->getU32Fast(_PREHASH_Data, _PREHASH_CreationDate, date); - time_t tim = date; - - // future use - U32 expiration_date = 0; - msg->getU32("Data", "ExpirationDate", expiration_date); - - U32 category = 0; - msg->getU32Fast(_PREHASH_Data, _PREHASH_Category, category); - - S32 price_for_listing = 0; - msg->getS32("Data", "PriceForListing", price_for_listing); - - // Look up the panel to fill in - for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) - { - LLPanelClassified* self = *iter; - // For top picks, must match pick id - if (self->mClassifiedID != classified_id) - { - continue; - } - - // Found the panel, now fill in the information - self->mClassifiedID = classified_id; - self->mCreatorID = creator_id; - self->mParcelID = parcel_id; - self->mPriceForListing = price_for_listing; - self->mSimName.assign(sim_name); - self->mPosGlobal = pos_global; - - // Update UI controls - self->mNameEditor->setText(name); - self->mDescEditor->setText(desc); - self->mSnapshotCtrl->setImageAssetID(snapshot_id); - self->mLocationEditor->setText(location_text); - self->mLocationChanged = false; - - self->mCategoryCombo->setCurrentByIndex(category - 1); - if(mature) - { - self->mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - } - else - { - self->mMatureCombo->setCurrentByIndex(PG_CONTENT); - } - if (self->mAutoRenewCheck) - { - self->mAutoRenewCheck->set(auto_renew); - } - - std::string dateStr = self->getString("dateStr"); - LLSD substitution; - substitution["datetime"] = (S32) tim; - LLStringUtil::format (dateStr, substitution); - - LLStringUtil::format_map_t string_args; - string_args["[DATE]"] = dateStr; - string_args["[AMT]"] = llformat("%d", price_for_listing); - self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); - - // If we got data from the database, we know the listing is paid for. - self->mPaidFor = TRUE; - - self->mUpdateBtn->setLabel(self->getString("update_txt")); - - self->resetDirty(); - - // I don't know if a second call is deliberate or a bad merge, so I'm leaving it here. - self->resetDirty(); - } -} - -void LLPanelClassified::draw() -{ - refresh(); - - LLPanel::draw(); -} - - -void LLPanelClassified::refresh() -{ - if (!mDataRequested) - { - sendClassifiedInfoRequest(); - } - - // Check for god mode - BOOL godlike = gAgent.isGodlike(); - BOOL is_self = (gAgent.getID() == mCreatorID); - - // Set button visibility/enablement appropriately - if (mInFinder) - { - - // End user doesn't ned to see price twice, or date posted. - - mSnapshotCtrl->setEnabled(godlike); - if(godlike) - { - //make it smaller, so text is more legible - mSnapshotCtrl->setOrigin(20, 175); - mSnapshotCtrl->reshape(300, 200); - } - else - { - mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom); - mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight()); - //normal - } - mNameEditor->setEnabled(godlike); - mDescEditor->setEnabled(godlike); - mCategoryCombo->setEnabled(godlike); - mCategoryCombo->setVisible(godlike); - - mMatureCombo->setEnabled(godlike); - mMatureCombo->setVisible(godlike); - - // Jesse (who is the only one who uses this, as far as we can tell - // Says that he does not want a set location button - he has used it - // accidently in the past. - mSetBtn->setVisible(FALSE); - mSetBtn->setEnabled(FALSE); - - mUpdateBtn->setEnabled(godlike); - mUpdateBtn->setVisible(godlike); - } - else - { - mSnapshotCtrl->setEnabled(is_self); - mNameEditor->setEnabled(is_self); - mDescEditor->setEnabled(is_self); - //mPriceEditor->setEnabled(is_self); - mCategoryCombo->setEnabled(is_self); - mMatureCombo->setEnabled(is_self); - - if( is_self ) - { - if( mMatureCombo->getCurrentIndex() == 0 ) - { - // It's a new panel. - // PG regions should have PG classifieds. AO should have mature. - - setDefaultAccessCombo(); - } - } - - if (mAutoRenewCheck) - { - mAutoRenewCheck->setEnabled(is_self); - mAutoRenewCheck->setVisible(is_self); - } - - mClickThroughText->setEnabled(is_self); - mClickThroughText->setVisible(is_self); - - mSetBtn->setVisible(is_self); - mSetBtn->setEnabled(is_self); - - mUpdateBtn->setEnabled(is_self && checkDirty()); - mUpdateBtn->setVisible(is_self); - } -} - -// static -void LLPanelClassified::onClickUpdate(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - if(self == NULL) return; - - // Disallow leading spaces, punctuation, etc. that screw up - // sort order. - if ( ! self->titleIsValid() ) - { - return; - }; - - // If user has not set mature, do not allow publish - if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) - { - // Tell user about it - LLNotificationsUtil::add("SetClassifiedMature", - LLSD(), - LLSD(), - boost::bind(&LLPanelClassified::confirmMature, self, _1, _2)); - return; - } - - // Mature content flag is set, proceed - self->gotMature(); -} - -// Callback from a dialog indicating response to mature notification -bool LLPanelClassified::confirmMature(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // 0 == Yes - // 1 == No - // 2 == Cancel - switch(option) - { - case 0: - mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - break; - case 1: - mMatureCombo->setCurrentByIndex(PG_CONTENT); - break; - default: - return false; - } - - // If we got here it means they set a valid value - gotMature(); - return false; -} - -// Called after we have determined whether this classified has -// mature content or not. -void LLPanelClassified::gotMature() -{ - // if already paid for, just do the update - if (mPaidFor) - { - LLNotification::Params params("PublishClassified"); - params.functor.function(boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); - LLNotifications::instance().forceResponse(params, 0); - } - else - { - // Ask the user how much they want to pay - LLFloaterPriceForListing::show( callbackGotPriceForListing, this ); - } -} - -// static -void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - // Only do something if user hits publish - if (option != 0) return; - - S32 price_for_listing = strtol(text.c_str(), NULL, 10); - if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) - { - LLSD args; - std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); - args["MIN_PRICE"] = price_text; - - LLNotificationsUtil::add("MinClassifiedPrice", args); - return; - } - - // price is acceptable, put it in the dialog for later read by - // update send - self->mPriceForListing = price_for_listing; - - LLSD args; - args["AMOUNT"] = llformat("%d", price_for_listing); - LLNotificationsUtil::add("PublishClassified", args, LLSD(), - boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); -} - -void LLPanelClassified::resetDirty() -{ - // Tell all the widgets to reset their dirty state since the ad was just saved - if (mSnapshotCtrl) - mSnapshotCtrl->resetDirty(); - if (mNameEditor) - mNameEditor->resetDirty(); - if (mDescEditor) - mDescEditor->resetDirty(); - if (mLocationEditor) - mLocationEditor->resetDirty(); - mLocationChanged = false; - if (mCategoryCombo) - mCategoryCombo->resetDirty(); - if (mMatureCombo) - mMatureCombo->resetDirty(); - if (mAutoRenewCheck) - mAutoRenewCheck->resetDirty(); -} - -// invoked from callbackConfirmPublish -bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - // Option 0 = publish - if (option != 0) return false; - - sendClassifiedInfoUpdate(); - - // Big hack - assume that top picks are always in a browser, - // and non-finder-classifieds are always in a tab container. - if (! mInFinder) - { - LLTabContainer* tab = (LLTabContainer*)getParent(); - tab->setCurrentTabName(mNameEditor->getText()); - } - - resetDirty(); - return false; -} - - -// static -void LLPanelClassified::onClickTeleport(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - - if (!self->mPosGlobal.isExactlyZero()&&worldmap_instance) - { - gAgent.teleportViaLocation(self->mPosGlobal); - worldmap_instance->trackLocation(self->mPosGlobal); - self->sendClassifiedClickMessage("teleport"); - } -} - - -// static -void LLPanelClassified::onClickMap(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); - if(worldmap_instance) - { - worldmap_instance->trackLocation(self->mPosGlobal); - LLFloaterReg::showInstance("world_map", "center"); - } - self->sendClassifiedClickMessage("map"); -} - -// static -void LLPanelClassified::onClickProfile(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - LLAvatarActions::showProfile(self->mCreatorID); - self->sendClassifiedClickMessage("profile"); -} - -// static -/* -void LLPanelClassified::onClickLandmark(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); -} -*/ - -// static -void LLPanelClassified::onClickSet(void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - - // Save location for later. - self->mPosGlobal = gAgent.getPositionGlobal(); - - std::string location_text; - std::string regionName = LLTrans::getString("ClassifiedUpdateAfterPublish"); - LLViewerRegion* pRegion = gAgent.getRegion(); - if (pRegion) - { - regionName = pRegion->getName(); - } - location_text.assign(regionName); - location_text.append(", "); - - S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); - - location_text.append(self->mSimName); - location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - - self->mLocationEditor->setText(location_text); - self->mLocationChanged = true; - - self->setDefaultAccessCombo(); - - // Set this to null so it updates on the next save. - self->mParcelID.setNull(); - - onCommitAny(NULL, data); -} - - -BOOL LLPanelClassified::checkDirty() -{ - mDirty = FALSE; - if ( mSnapshotCtrl ) mDirty |= mSnapshotCtrl->isDirty(); - if ( mNameEditor ) mDirty |= mNameEditor->isDirty(); - if ( mDescEditor ) mDirty |= mDescEditor->isDirty(); - if ( mLocationEditor ) mDirty |= mLocationEditor->isDirty(); - if ( mLocationChanged ) mDirty |= TRUE; - if ( mCategoryCombo ) mDirty |= mCategoryCombo->isDirty(); - if ( mMatureCombo ) mDirty |= mMatureCombo->isDirty(); - if ( mAutoRenewCheck ) mDirty |= mAutoRenewCheck->isDirty(); - - return mDirty; -} - -// static -void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - if (self) - { - self->checkDirty(); - } -} - -// static -void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data) -{ - // allow the data to be saved - onCommitAny((LLUICtrl*)ctrl, data); -} - - -void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) -{ - // You're allowed to click on your own ads to reassure yourself - // that the system is working. - LLSD body; - body["type"] = type; - body["from_search"] = mFromSearch; - body["classified_id"] = mClassifiedID; - body["parcel_id"] = mParcelID; - body["dest_pos_global"] = mPosGlobal.getValue(); - body["region_name"] = mSimName; - - std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); - llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl; - LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); -} - -//////////////////////////////////////////////////////////////////////////////////////////// - -LLFloaterPriceForListing::LLFloaterPriceForListing() -: LLFloater(LLSD()), - mCallback(NULL), - mUserData(NULL) -{ } - -//virtual -LLFloaterPriceForListing::~LLFloaterPriceForListing() -{ } - -//virtual -BOOL LLFloaterPriceForListing::postBuild() -{ - LLLineEditor* edit = getChild<LLLineEditor>("price_edit"); - if (edit) - { - edit->setPrevalidate(LLTextValidate::validateNonNegativeS32); - std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); - edit->setText(min_price); - edit->selectAll(); - edit->setFocus(TRUE); - } - - childSetAction("set_price_btn", onClickSetPrice, this); - - childSetAction("cancel_btn", onClickCancel, this); - - setDefaultBtn("set_price_btn"); - return TRUE; -} - -//static -void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata) -{ - LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml", NULL); - self->center(); - - self->mCallback = callback; - self->mUserData = userdata; -} - -//static -void LLFloaterPriceForListing::onClickSetPrice(void* data) -{ - buttonCore(0, data); -} - -//static -void LLFloaterPriceForListing::onClickCancel(void* data) -{ - buttonCore(1, data); -} - -//static -void LLFloaterPriceForListing::buttonCore(S32 button, void* data) -{ - LLFloaterPriceForListing* self = (LLFloaterPriceForListing*)data; - - if (self->mCallback) - { - std::string text = self->childGetText("price_edit"); - self->mCallback(button, text, self->mUserData); - self->closeFloater(); - } -} - -void LLPanelClassified::setDefaultAccessCombo() -{ - // PG regions should have PG classifieds. AO should have mature. - - LLViewerRegion *regionp = gAgent.getRegion(); - - switch( regionp->getSimAccess() ) - { - case SIM_ACCESS_PG: - mMatureCombo->setCurrentByIndex(PG_CONTENT); - break; - case SIM_ACCESS_ADULT: - mMatureCombo->setCurrentByIndex(MATURE_CONTENT); - break; - default: - // You are free to move about the cabin. - break; - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index eaf652ca06..7d2b1ae571 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -33,174 +33,20 @@ // Display of a classified used both for the global view in the // Find directory, and also for each individual user's classified in their // profile. - #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H #include "llavatarpropertiesprocessor.h" -#include "llpanel.h" #include "llclassifiedinfo.h" -#include "v3dmath.h" -#include "lluuid.h" #include "llfloater.h" -//#include "llrect.h" - -class LLButton; -class LLCheckBoxCtrl; -class LLComboBox; -class LLIconCtrl; -class LLLineEditor; -class LLTextBox; -class LLTextEditor; +#include "llpanel.h" +#include "llrect.h" +#include "lluuid.h" +#include "v3dmath.h" + +class LLScrollContainer; class LLTextureCtrl; class LLUICtrl; -class LLMessageSystem; -class LLScrollContainer; - -// *TODO deprecated, should be removed. -// New class implemented in ticket EXT-2095 -class LLPanelClassified : public LLPanel -{ -public: - LLPanelClassified(bool in_finder, bool from_search); - /*virtual*/ ~LLPanelClassified(); - - void reset(); - - /*virtual*/ BOOL postBuild(); - - /*virtual*/ void draw(); - - /*virtual*/ void refresh(); - - void apply(); - - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); - - // Setup a new classified, including creating an id, giving a sane - // initial position, etc. - 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, bool from_new_table); - - // check that the title is valid (E.G. starts with a number or letter) - BOOL titleIsValid(); - - // Schedules the panel to request data - // from the server next time it is drawn. - void markForServerRequest(); - - std::string getClassifiedName(); - const LLUUID& getClassifiedID() const { return mClassifiedID; } - - void sendClassifiedInfoRequest(); - void sendClassifiedInfoUpdate(); - void resetDirty(); - - static void processClassifiedInfoReply(LLMessageSystem* msg, void**); - - // Confirmation dialogs flow in this order - bool confirmMature(const LLSD& notification, const LLSD& response); - void gotMature(); - static void callbackGotPriceForListing(S32 option, std::string text, void* data); - bool confirmPublish(const LLSD& notification, const LLSD& response); - - void sendClassifiedClickMessage(const std::string& type); - -protected: - bool saveCallback(const LLSD& notification, const LLSD& response); - - static void onClickUpdate(void* data); - static void onClickTeleport(void* data); - static void onClickMap(void* data); - static void onClickProfile(void* data); - static void onClickSet(void* data); - - static void focusReceived(LLFocusableElement* ctrl, void* data); - static void onCommitAny(LLUICtrl* ctrl, void* data); - - void setDefaultAccessCombo(); // Default AO and PG regions to proper classified access - - BOOL checkDirty(); // Update and return mDirty - -protected: - bool mInFinder; - bool mFromSearch; // from web-based "All" search sidebar - BOOL mDirty; - bool mForceClose; - bool mLocationChanged; - LLUUID mClassifiedID; - LLUUID mRequestedID; - LLUUID mCreatorID; - LLUUID mParcelID; - S32 mPriceForListing; - - // Needed for stat tracking - S32 mTeleportClicksOld; - S32 mMapClicksOld; - S32 mProfileClicksOld; - S32 mTeleportClicksNew; - S32 mMapClicksNew; - S32 mProfileClicksNew; - - // Data will be requested on first draw - BOOL mDataRequested; - - // For avatar panel classifieds only, has the user been charged - // yet for this classified? That is, have they saved once? - BOOL mPaidFor; - - std::string mSimName; - LLVector3d mPosGlobal; - - // Values the user may change - LLTextureCtrl* mSnapshotCtrl; - LLLineEditor* mNameEditor; - LLTextEditor* mDescEditor; - LLLineEditor* mLocationEditor; - LLComboBox* mCategoryCombo; - LLComboBox* mMatureCombo; - LLCheckBoxCtrl* mAutoRenewCheck; - - LLButton* mUpdateBtn; - LLButton* mTeleportBtn; - LLButton* mMapBtn; - LLButton* mProfileBtn; - - LLTextBox* mInfoText; - LLButton* mSetBtn; - LLTextBox* mClickThroughText; - - LLRect mSnapshotSize; - typedef std::list<LLPanelClassified*> panel_list_t; - static panel_list_t sAllPanels; -}; - - -class LLFloaterPriceForListing -: public LLFloater -{ -public: - LLFloaterPriceForListing(); - virtual ~LLFloaterPriceForListing(); - virtual BOOL postBuild(); - - static void show( void (*callback)(S32 option, std::string value, void* userdata), void* userdata ); - -private: - static void onClickSetPrice(void*); - static void onClickCancel(void*); - static void buttonCore(S32 button, void* data); - -private: - void (*mCallback)(S32 option, std::string, void*); - void* mUserData; -}; class LLPublishClassifiedFloater : public LLFloater { 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"); diff --git a/indra/newview/skins/default/xui/en/panel_classified.xml b/indra/newview/skins/default/xui/en/panel_classified.xml deleted file mode 100644 index c8293d3663..0000000000 --- a/indra/newview/skins/default/xui/en/panel_classified.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - follows="bottom|left" - height="490" - label="Classified" - layout="topleft" - left="330" - name="Classified" - top="490" - width="450"> - <panel.string - name="ad_placed_paid"> - Ad placed: [DATE], Paid L$[AMT] for listing. - </panel.string> - <panel.string - name="update_txt"> - Update - </panel.string> - <panel.string - name="publish_txt"> - Publish... - </panel.string> - <panel.string - name="dateStr"> - [mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt] - </panel.string> - <texture_picker - follows="left|top" - height="300" - layout="topleft" - left="20" - name="snapshot_ctrl" - top="15" - width="400" /> - <line_editor - enabled="false" - follows="left|top" - font="SansSerif" - height="20" - layout="topleft" - left_delta="0" - name="given_name_editor" - tool_tip="Name must begin with a letter or number, not punctuation" - top_delta="288" - width="400" /> - <text_editor - enabled="false" - follows="left|top" - height="90" - layout="topleft" - left="20" - max_length="1023" - name="desc_editor" - width="400" - word_wrap="true" /> - <line_editor - enabled="false" - follows="left|top" - font="SansSerif" - height="20" - layout="topleft" - left="20" - name="location_editor" - tool_tip="Set the location for this classified to your current position" - width="400" /> - <button - follows="left|top" - height="20" - label="Set" - layout="topleft" - left_delta="360" - name="set_location_btn" - top_delta="0" - width="60" /> - <button - follows="left|top" - height="20" - label="Teleport" - layout="topleft" - left="20" - name="classified_teleport_btn" - top="449" - width="100" /> - <button - follows="left|top" - height="20" - label="Map" - layout="topleft" - left_pad="5" - name="classified_map_btn" - top_delta="0" - width="100" /> - <button - follows="left|top" - height="20" - label="Profile" - layout="topleft" - left_pad="5" - name="classified_profile_btn" - top_delta="0" - width="100" /> - <combo_box - height="20" - layout="topleft" - left="30" - name="classified_mature_check" - top="48" - width="130"> - <combo_box.item - label="- Select one -" - name="select_mature" - value="Select" /> - <combo_box.item - label="Moderate Content" - name="mature" - value="Mature" /> - <combo_box.item - label="General Content" - name="pg" - value="PG" /> - </combo_box> - <combo_box - bottom="45" - height="18" - layout="topleft" - left="20" - name="classified_category_combo" - right="150" /> - <button - follows="left|top" - height="20" - label="Update" - layout="topleft" - left="30" - name="classified_update_btn" - top="70" - width="70" /> -</panel> |