summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorSergei Litovchuk <slitovchuk@productengine.com>2009-11-03 19:13:36 +0200
committerSergei Litovchuk <slitovchuk@productengine.com>2009-11-03 19:13:36 +0200
commited40da679530329fce0e7505dc90a898a10d7d86 (patch)
tree59e790ba858f6a99fcf8629feea85a582244a0f1 /indra
parent5ea6474aebb7f81ce797de1449863bac1543fb03 (diff)
Implemented sub-task EXT-1452 '"places" title should not be on this
panel': - Made LLPlaceInfo a base class for two derived LLPlaceProfile and LLLandmarkInfo classes each representing a separate panel with its own XUI layout. - Fixed broken title change for Place Profile and Landmark cases. --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp437
-rw-r--r--indra/newview/llpanellandmarkinfo.h85
-rw-r--r--indra/newview/llpanelplaceinfo.cpp931
-rw-r--r--indra/newview/llpanelplaceinfo.h146
-rw-r--r--indra/newview/llpanelplaceprofile.cpp541
-rw-r--r--indra/newview/llpanelplaceprofile.h114
-rw-r--r--indra/newview/llpanelplaces.cpp227
-rw-r--r--indra/newview/llpanelplaces.h11
-rw-r--r--indra/newview/llviewermessage.cpp6
-rw-r--r--indra/newview/skins/default/xui/en/panel_landmark_info.xml257
-rw-r--r--indra/newview/skins/default/xui/en/panel_place_profile.xml979
-rw-r--r--indra/newview/skins/default/xui/en/panel_places.xml18
13 files changed, 2647 insertions, 1109 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0133d2222d..be736c57c8 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -316,6 +316,7 @@ set(viewer_SOURCE_FILES
llpanelinventory.cpp
llpanelland.cpp
llpanellandaudio.cpp
+ llpanellandmarkinfo.cpp
llpanellandmarks.cpp
llpanellandmedia.cpp
llpanellogin.cpp
@@ -334,6 +335,7 @@ set(viewer_SOURCE_FILES
llpanelpicks.cpp
llpanelplace.cpp
llpanelplaceinfo.cpp
+ llpanelplaceprofile.cpp
llpanelplaces.cpp
llpanelplacestab.cpp
llpanelprimmediacontrols.cpp
@@ -794,6 +796,7 @@ set(viewer_HEADER_FILES
llpanelinventory.h
llpanelland.h
llpanellandaudio.h
+ llpanellandmarkinfo.h
llpanellandmarks.h
llpanellandmedia.h
llpanellogin.h
@@ -812,6 +815,7 @@ set(viewer_HEADER_FILES
llpanelpicks.h
llpanelplace.h
llpanelplaceinfo.h
+ llpanelplaceprofile.h
llpanelplaces.h
llpanelplacestab.h
llpanelprimmediacontrols.h
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
new file mode 100644
index 0000000000..1152ca6873
--- /dev/null
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -0,0 +1,437 @@
+/**
+ * @file llpanellandmarkinfo.cpp
+ * @brief Displays landmark info in Side Tray.
+ *
+ * $LicenseInfo:firstyear=2009&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 "llpanellandmarkinfo.h"
+
+#include "llinventory.h"
+
+#include "llcombobox.h"
+#include "lllineeditor.h"
+#include "lltextbox.h"
+#include "lltexteditor.h"
+#include "lltrans.h"
+
+#include "llagent.h"
+#include "llagentui.h"
+#include "llinventorymodel.h"
+#include "lllandmarkactions.h"
+#include "llviewerinventory.h"
+#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+//----------------------------------------------------------------------------
+// Aux types and methods
+//----------------------------------------------------------------------------
+
+typedef std::pair<LLUUID, std::string> folder_pair_t;
+
+static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right);
+static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats);
+
+static LLRegisterPanelClassWrapper<LLPanelLandmarkInfo> t_landmark_info("panel_landmark_info");
+
+LLPanelLandmarkInfo::LLPanelLandmarkInfo()
+: LLPanelPlaceInfo()
+{}
+
+// virtual
+LLPanelLandmarkInfo::~LLPanelLandmarkInfo()
+{}
+
+// virtual
+BOOL LLPanelLandmarkInfo::postBuild()
+{
+ LLPanelPlaceInfo::postBuild();
+
+ mOwner = getChild<LLTextBox>("owner");
+ mCreator = getChild<LLTextBox>("creator");
+ mCreated = getChild<LLTextBox>("created");
+
+ mTitleEditor = getChild<LLLineEditor>("title_editor");
+ mNotesEditor = getChild<LLTextEditor>("notes_editor");
+ mFolderCombo = getChild<LLComboBox>("folder_combo");
+
+ return TRUE;
+}
+
+// virtual
+void LLPanelLandmarkInfo::resetLocation()
+{
+ LLPanelPlaceInfo::resetLocation();
+
+ std::string not_available = getString("not_available");
+ mCreator->setText(not_available);
+ mOwner->setText(not_available);
+ mCreated->setText(not_available);
+ mTitleEditor->setText(LLStringUtil::null);
+ mNotesEditor->setText(LLStringUtil::null);
+}
+
+// virtual
+void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type)
+{
+ LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel");
+
+ bool is_info_type_create_landmark = type == CREATE_LANDMARK;
+ bool is_info_type_landmark = type == LANDMARK;
+
+ landmark_info_panel->setVisible(is_info_type_landmark);
+
+ getChild<LLTextBox>("folder_label")->setVisible(is_info_type_create_landmark);
+ mFolderCombo->setVisible(is_info_type_create_landmark);
+
+ switch(type)
+ {
+ case CREATE_LANDMARK:
+ mCurrentTitle = getString("title_create_landmark");
+
+ mTitleEditor->setEnabled(TRUE);
+ mNotesEditor->setEnabled(TRUE);
+ break;
+
+ case LANDMARK:
+ default:
+ mCurrentTitle = getString("title_landmark");
+
+ mTitleEditor->setEnabled(FALSE);
+ mNotesEditor->setEnabled(FALSE);
+ break;
+ }
+
+ populateFoldersList();
+
+ LLPanelPlaceInfo::setInfoType(type);
+}
+
+// virtual
+void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data)
+{
+ LLPanelPlaceInfo::processParcelInfo(parcel_data);
+
+ // 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);
+ }
+
+ mMaturityRatingText->setValue(rating);
+
+ S32 region_x;
+ S32 region_y;
+ S32 region_z;
+
+ // 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);
+ }
+ else
+ {
+ region_x = llround(mPosRegion.mV[VX]);
+ region_y = llround(mPosRegion.mV[VY]);
+ region_z = llround(mPosRegion.mV[VZ]);
+ }
+
+ if (mInfoType == CREATE_LANDMARK)
+ {
+ if (parcel_data.name.empty())
+ {
+ mTitleEditor->setText(llformat("%s (%d, %d, %d)",
+ parcel_data.sim_name.c_str(), region_x, region_y, region_z));
+ }
+ else
+ {
+ mTitleEditor->setText(parcel_data.name);
+ }
+
+ std::string desc;
+ LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent());
+ mNotesEditor->setText(desc);
+
+ if (!LLLandmarkActions::landmarkAlreadyExists())
+ {
+ createLandmark(mFolderCombo->getValue().asUUID());
+ }
+ }
+}
+
+void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem)
+{
+ if (!pItem)
+ return;
+
+ if(!gCacheName)
+ return;
+
+ const LLPermissions& perm = pItem->getPermissions();
+
+ //////////////////
+ // CREATOR NAME //
+ //////////////////
+ if (pItem->getCreatorUUID().notNull())
+ {
+ std::string name;
+ LLUUID creator_id = pItem->getCreatorUUID();
+ if (!gCacheName->getFullName(creator_id, name))
+ {
+ gCacheName->get(creator_id, FALSE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3));
+ }
+ mCreator->setText(name);
+ }
+ else
+ {
+ mCreator->setText(getString("unknown"));
+ }
+
+ ////////////////
+ // OWNER NAME //
+ ////////////////
+ if(perm.isOwned())
+ {
+ std::string name;
+ if (perm.isGroupOwned())
+ {
+ LLUUID group_id = perm.getGroup();
+ if (!gCacheName->getGroupName(group_id, name))
+ {
+ gCacheName->get(group_id, TRUE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
+ }
+ }
+ else
+ {
+ LLUUID owner_id = perm.getOwner();
+ if (!gCacheName->getFullName(owner_id, name))
+ {
+ gCacheName->get(owner_id, FALSE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
+ }
+ }
+ mOwner->setText(name);
+ }
+ else
+ {
+ mOwner->setText(getString("public"));
+ }
+
+ //////////////////
+ // ACQUIRE DATE //
+ //////////////////
+ time_t time_utc = pItem->getCreationDate();
+ if (0 == time_utc)
+ {
+ mCreated->setText(getString("unknown"));
+ }
+ else
+ {
+ std::string timeStr = getString("acquired_date");
+ LLSD substitution;
+ substitution["datetime"] = (S32) time_utc;
+ LLStringUtil::format (timeStr, substitution);
+ mCreated->setText(timeStr);
+ }
+
+ mTitleEditor->setText(pItem->getName());
+ mNotesEditor->setText(pItem->getDescription());
+}
+
+void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled)
+{
+ // If switching to edit mode while creating landmark
+ // the "Create Landmark" title remains.
+ if (enabled && mInfoType != CREATE_LANDMARK)
+ {
+ mTitle->setText(getString("title_edit_landmark"));
+ }
+ else
+ {
+ mTitle->setText(mCurrentTitle);
+ }
+
+ if (mNotesEditor->getReadOnly() == (enabled == TRUE))
+ {
+ mTitleEditor->setEnabled(enabled);
+ mNotesEditor->setReadOnly(!enabled);
+ mFolderCombo->setVisible(enabled);
+ getChild<LLTextBox>("folder_label")->setVisible(enabled);
+
+ // HACK: To change the text color in a text editor
+ // when it was enabled/disabled we set the text once again.
+ mNotesEditor->setText(mNotesEditor->getText());
+ }
+}
+
+const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const
+{
+ return mTitleEditor->getText();
+}
+
+const std::string LLPanelLandmarkInfo::getLandmarkNotes() const
+{
+ return mNotesEditor->getText();
+}
+
+const LLUUID LLPanelLandmarkInfo::getLandmarkFolder() const
+{
+ return mFolderCombo->getValue().asUUID();
+}
+
+BOOL LLPanelLandmarkInfo::setLandmarkFolder(const LLUUID& id)
+{
+ return mFolderCombo->setCurrentByID(id);
+}
+
+void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id)
+{
+ std::string name = mTitleEditor->getText();
+ std::string desc = mNotesEditor->getText();
+
+ LLStringUtil::trim(name);
+ LLStringUtil::trim(desc);
+
+ // If typed name is empty use the parcel name instead.
+ if (name.empty())
+ {
+ name = mParcelName->getText();
+
+ // If no parcel exists use the region name instead.
+ if (name.empty())
+ {
+ name = mRegionName->getText();
+ }
+ }
+
+ LLStringUtil::replaceChar(desc, '\n', ' ');
+ // If no folder chosen use the "Landmarks" folder.
+ LLLandmarkActions::createLandmarkHere(name, desc,
+ folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK));
+}
+
+// static
+std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat)
+{
+ std::string name = cat->getName();
+ LLUUID parent_id;
+
+ // translate category name, if it's right below the root
+ // FIXME: it can throw notification about non existent string in strings.xml
+ if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
+ {
+ LLTrans::findString(name, "InvFolder " + name);
+ }
+
+ // we don't want "My Inventory" to appear in the name
+ while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
+ {
+ cat = gInventory.getCategory(parent_id);
+ name = cat->getName() + "/" + name;
+ }
+
+ return name;
+}
+
+void LLPanelLandmarkInfo::populateFoldersList()
+{
+ // Collect all folders that can contain landmarks.
+ LLInventoryModel::cat_array_t cats;
+ collectLandmarkFolders(cats);
+
+ mFolderCombo->removeall();
+
+ // Put the "Landmarks" folder first in list.
+ LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id);
+ if (!cat)
+ {
+ llwarns << "Cannot find the landmarks folder" << llendl;
+ }
+ std::string cat_full_name = getFullFolderName(cat);
+ mFolderCombo->add(cat_full_name, cat->getUUID());
+
+ typedef std::vector<folder_pair_t> folder_vec_t;
+ folder_vec_t folders;
+ // Sort the folders by their full name.
+ for (S32 i = 0; i < cats.count(); i++)
+ {
+ cat = cats.get(i);
+ cat_full_name = getFullFolderName(cat);
+ folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name));
+ }
+ sort(folders.begin(), folders.end(), cmp_folders);
+
+ // Finally, populate the combobox.
+ for (folder_vec_t::const_iterator it = folders.begin(); it != folders.end(); it++)
+ mFolderCombo->add(it->second, LLSD(it->first));
+}
+
+static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right)
+{
+ return left.second < right.second;
+}
+
+static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
+{
+ LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
+
+ // Add descendent folders of the "Landmarks" category.
+ LLInventoryModel::item_array_t items; // unused
+ LLIsType is_category(LLAssetType::AT_CATEGORY);
+ gInventory.collectDescendentsIf(
+ landmarks_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ is_category);
+
+ // Add the "My Favorites" category.
+ LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE);
+ LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
+ if (!favorites_cat)
+ {
+ llwarns << "Cannot find the favorites folder" << llendl;
+ }
+ else
+ {
+ cats.put(favorites_cat);
+ }
+}
diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h
new file mode 100644
index 0000000000..03377986b3
--- /dev/null
+++ b/indra/newview/llpanellandmarkinfo.h
@@ -0,0 +1,85 @@
+/**
+ * @file llpanellandmarkinfo.h
+ * @brief Displays landmark info in Side Tray.
+ *
+ * $LicenseInfo:firstyear=2009&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_LLPANELLANDMARKINFO_H
+#define LL_LLPANELLANDMARKINFO_H
+
+#include "llpanelplaceinfo.h"
+
+class LLComboBox;
+class LLLineEditor;
+class LLTextEditor;
+
+class LLPanelLandmarkInfo : public LLPanelPlaceInfo
+{
+public:
+ LLPanelLandmarkInfo();
+ /*virtual*/ ~LLPanelLandmarkInfo();
+
+ /*virtual*/ BOOL postBuild();
+
+ /*virtual*/ void resetLocation();
+
+ /*virtual*/ void setInfoType(INFO_TYPE type);
+
+ /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
+
+ // Displays landmark owner, creator and creation date info.
+ void displayItemInfo(const LLInventoryItem* pItem);
+
+ void toggleLandmarkEditMode(BOOL enabled);
+
+ const std::string& getLandmarkTitle() const;
+ const std::string getLandmarkNotes() const;
+ const LLUUID getLandmarkFolder() const;
+
+ // Select current landmark folder in combobox.
+ BOOL setLandmarkFolder(const LLUUID& id);
+
+ // Create a landmark for the current location
+ // in a folder specified by folder_id.
+ void createLandmark(const LLUUID& folder_id);
+
+ static std::string getFullFolderName(const LLViewerInventoryCategory* cat);
+
+private:
+ void populateFoldersList();
+
+ LLTextBox* mOwner;
+ LLTextBox* mCreator;
+ LLTextBox* mCreated;
+ LLLineEditor* mTitleEditor;
+ LLTextEditor* mNotesEditor;
+ LLComboBox* mFolderCombo;
+};
+
+#endif // LL_LLPANELLANDMARKINFO_H
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 34644cfe42..2c5f4b5afa 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -1,6 +1,6 @@
/**
* @file llpanelplaceinfo.cpp
- * @brief Displays place information in Side Tray.
+ * @brief Base class for place information in Side Tray.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
@@ -39,66 +39,34 @@
#include "llsecondlifeurls.h"
#include "llinventory.h"
-#include "llparcel.h"
-#include "llqueryflags.h"
+#include "llsdutil_math.h"
-#include "llbutton.h"
-#include "llcombobox.h"
-#include "lliconctrl.h"
#include "llscrollcontainer.h"
#include "lltextbox.h"
-#include "lltrans.h"
-#include "llaccordionctrl.h"
-#include "llaccordionctrltab.h"
#include "llagent.h"
-#include "llagentui.h"
-#include "llappviewer.h"
#include "llavatarpropertiesprocessor.h"
-#include "llcallbacklist.h"
#include "llexpandabletextbox.h"
#include "llfloaterworldmap.h"
-#include "llfloaterbuycurrency.h"
#include "llinventorymodel.h"
-#include "lllandmarkactions.h"
#include "llpanelpick.h"
#include "lltexturectrl.h"
-#include "llstatusbar.h"
#include "llviewerinventory.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
-#include "llviewercontrol.h"
#include "llviewertexteditor.h"
#include "llworldmap.h"
-#include "llsdutil_math.h"
-
-//----------------------------------------------------------------------------
-// Aux types and methods
-//----------------------------------------------------------------------------
-
-typedef std::pair<LLUUID, std::string> folder_pair_t;
-
-static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right);
-static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats);
-
-static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_place_info("panel_place_info");
LLPanelPlaceInfo::LLPanelPlaceInfo()
: LLPanel(),
mParcelID(),
mRequestedID(),
mPosRegion(),
- mLandmarkID(),
- mMinHeight(0),
- mScrollingPanel(NULL),
- mInfoPanel(NULL),
- mMediaPanel(NULL),
- mForSalePanel(NULL),
- mYouAreHerePanel(NULL),
- mSelectedParcelID(-1)
+ mMinHeight(0)
{}
+//virtual
LLPanelPlaceInfo::~LLPanelPlaceInfo()
{
if (mParcelID.notNull())
@@ -107,220 +75,41 @@ LLPanelPlaceInfo::~LLPanelPlaceInfo()
}
}
+//virtual
BOOL LLPanelPlaceInfo::postBuild()
{
- mTitle = getChild<LLTextBox>("panel_title");
+ mTitle = getChild<LLTextBox>("title");
mCurrentTitle = mTitle->getText();
- mForSalePanel = getChild<LLPanel>("for_sale_panel");
- mYouAreHerePanel = getChild<LLPanel>("here_panel");
- gIdleCallbacks.addFunction(&LLPanelPlaceInfo::updateYouAreHereBanner, this);
-
- //Icon value should contain sale price of last selected parcel.
- mForSalePanel->getChild<LLIconCtrl>("icon_for_sale")->
- setMouseDownCallback(boost::bind(&LLPanelPlaceInfo::onForSaleBannerClick, this));
-
mSnapshotCtrl = getChild<LLTextureCtrl>("logo");
mRegionName = getChild<LLTextBox>("region_title");
mParcelName = getChild<LLTextBox>("parcel_title");
mDescEditor = getChild<LLExpandableTextBox>("description");
mMaturityRatingText = getChild<LLTextBox>("maturity_value");
- mParcelOwner = getChild<LLTextBox>("owner_value");
- mLastVisited = getChild<LLTextBox>("last_visited_value");
-
- mRatingText = getChild<LLTextBox>("rating_value");
- mVoiceText = getChild<LLTextBox>("voice_value");
- mFlyText = getChild<LLTextBox>("fly_value");
- mPushText = getChild<LLTextBox>("push_value");
- mBuildText = getChild<LLTextBox>("build_value");
- mScriptsText = getChild<LLTextBox>("scripts_value");
- mDamageText = getChild<LLTextBox>("damage_value");
-
- mRegionNameText = getChild<LLTextBox>("region_name");
- mRegionTypeText = getChild<LLTextBox>("region_type");
- mRegionRatingText = getChild<LLTextBox>("region_rating");
- mRegionOwnerText = getChild<LLTextBox>("region_owner");
- mRegionGroupText = getChild<LLTextBox>("region_group");
-
- mEstateNameText = getChild<LLTextBox>("estate_name");
- mEstateRatingText = getChild<LLTextBox>("estate_rating");
- mEstateOwnerText = getChild<LLTextBox>("estate_owner");
- mCovenantText = getChild<LLTextEditor>("covenant");
-
- mSalesPriceText = getChild<LLTextBox>("sales_price");
- mAreaText = getChild<LLTextBox>("area");
- mTrafficText = getChild<LLTextBox>("traffic");
- mPrimitivesText = getChild<LLTextBox>("primitives");
- mParcelScriptsText = getChild<LLTextBox>("parcel_scripts");
- mTerraformLimitsText = getChild<LLTextBox>("terraform_limits");
- mSubdivideText = getChild<LLTextEditor>("subdivide");
- mResaleText = getChild<LLTextEditor>("resale");
- mSaleToText = getChild<LLTextBox>("sale_to");
- mOwner = getChild<LLTextBox>("owner");
- mCreator = getChild<LLTextBox>("creator");
- mCreated = getChild<LLTextBox>("created");
-
- mTitleEditor = getChild<LLLineEditor>("title_editor");
- mNotesEditor = getChild<LLTextEditor>("notes_editor");
- mFolderCombo = getChild<LLComboBox>("folder_combo");
-
- LLScrollContainer* scroll_container = getChild<LLScrollContainer>("scroll_container");
+ LLScrollContainer* scroll_container = getChild<LLScrollContainer>("place_scroll");
scroll_container->setBorderVisible(FALSE);
mMinHeight = scroll_container->getScrolledViewRect().getHeight();
- mScrollingPanel = getChild<LLPanel>("scrolling_panel");
- mInfoPanel = getChild<LLPanel>("info_panel");
- mMediaPanel = getChild<LLMediaPanel>("media_panel");
- if (!mMediaPanel)
- return FALSE;
-
return TRUE;
}
-void LLPanelPlaceInfo::displayItemInfo(const LLInventoryItem* pItem)
-{
- if (!pItem)
- return;
-
- mLandmarkID = pItem->getUUID();
-
- if(!gCacheName)
- return;
-
- const LLPermissions& perm = pItem->getPermissions();
-
- //////////////////
- // CREATOR NAME //
- //////////////////
- if (pItem->getCreatorUUID().notNull())
- {
- std::string name;
- LLUUID creator_id = pItem->getCreatorUUID();
- if (!gCacheName->getFullName(creator_id, name))
- {
- gCacheName->get(creator_id, FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mCreator, _2, _3));
- }
- mCreator->setText(name);
- }
- else
- {
- mCreator->setText(getString("unknown"));
- }
-
- ////////////////
- // OWNER NAME //
- ////////////////
- if(perm.isOwned())
- {
- std::string name;
- if (perm.isGroupOwned())
- {
- LLUUID group_id = perm.getGroup();
- if (!gCacheName->getGroupName(group_id, name))
- {
- gCacheName->get(group_id, TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mOwner, _2, _3));
- }
- }
- else
- {
- LLUUID owner_id = perm.getOwner();
- if (!gCacheName->getFullName(owner_id, name))
- {
- gCacheName->get(owner_id, FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mOwner, _2, _3));
- }
- }
- mOwner->setText(name);
- }
- else
- {
- mOwner->setText(getString("public"));
- }
-
- //////////////////
- // ACQUIRE DATE //
- //////////////////
- time_t time_utc = pItem->getCreationDate();
- if (0 == time_utc)
- {
- mCreated->setText(getString("unknown"));
- }
- else
- {
- std::string timeStr = getString("acquired_date");
- LLSD substitution;
- substitution["datetime"] = (S32) time_utc;
- LLStringUtil::format (timeStr, substitution);
- mCreated->setText(timeStr);
- }
-
- mTitleEditor->setText(pItem->getName());
- mNotesEditor->setText(pItem->getDescription());
-}
-
-void LLPanelPlaceInfo::nameUpdatedCallback(
- LLTextBox* text,
- const std::string& first,
- const std::string& last)
-{
- text->setText(first + " " + last);
-}
-
+//virtual
void LLPanelPlaceInfo::resetLocation()
{
mParcelID.setNull();
mRequestedID.setNull();
- mLandmarkID.setNull();
mPosRegion.clearVec();
- mForSalePanel->setVisible(FALSE);
- mYouAreHerePanel->setVisible(FALSE);
+
std::string not_available = getString("not_available");
mMaturityRatingText->setValue(not_available);
- mParcelOwner->setValue(not_available);
- mLastVisited->setValue(not_available);
mRegionName->setText(not_available);
mParcelName->setText(not_available);
mDescEditor->setText(not_available);
- mCreator->setText(not_available);
- mOwner->setText(not_available);
- mCreated->setText(not_available);
- mTitleEditor->setText(LLStringUtil::null);
- mNotesEditor->setText(LLStringUtil::null);
+
mSnapshotCtrl->setImageAssetID(LLUUID::null);
mSnapshotCtrl->setFallbackImageName("default_land_picture.j2c");
-
- mRatingText->setText(not_available);
- mVoiceText->setText(not_available);
- mFlyText->setText(not_available);
- mPushText->setText(not_available);
- mBuildText->setText(not_available);
- mParcelScriptsText->setText(not_available);
- mDamageText->setText(not_available);
-
- mRegionNameText->setValue(not_available);
- mRegionTypeText->setValue(not_available);
- mRegionRatingText->setValue(not_available);
- mRegionOwnerText->setValue(not_available);
- mRegionGroupText->setValue(not_available);
-
- mEstateNameText->setValue(not_available);
- mEstateRatingText->setValue(not_available);
- mEstateOwnerText->setValue(not_available);
- mCovenantText->setValue(not_available);
-
- mSalesPriceText->setValue(not_available);
- mAreaText->setValue(not_available);
- mTrafficText->setValue(not_available);
- mPrimitivesText->setValue(not_available);
- mParcelScriptsText->setValue(not_available);
- mTerraformLimitsText->setValue(not_available);
- mSubdivideText->setValue(not_available);
- mResaleText->setValue(not_available);
- mSaleToText->setValue(not_available);
}
//virtual
@@ -330,108 +119,55 @@ void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id)
sendParcelInfoRequest();
}
+//virtual
void LLPanelPlaceInfo::setInfoType(INFO_TYPE type)
{
- LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel");
- LLPanel* landmark_edit_panel = getChild<LLPanel>("landmark_edit_panel");
-
- bool is_info_type_agent = type == AGENT;
- bool is_info_type_create_landmark = type == CREATE_LANDMARK;
- bool is_info_type_landmark = type == LANDMARK;
- bool is_info_type_teleport_history = type == TELEPORT_HISTORY;
-
- getChild<LLTextBox>("maturity_label")->setVisible(!is_info_type_agent);
- mMaturityRatingText->setVisible(!is_info_type_agent);
-
- getChild<LLTextBox>("owner_label")->setVisible(is_info_type_agent);
- mParcelOwner->setVisible(is_info_type_agent);
-
- getChild<LLTextBox>("last_visited_label")->setVisible(is_info_type_teleport_history);
- mLastVisited->setVisible(is_info_type_teleport_history);
-
- landmark_info_panel->setVisible(is_info_type_landmark);
- landmark_edit_panel->setVisible(is_info_type_landmark || is_info_type_create_landmark);
-
- getChild<LLTextBox>("folder_lable")->setVisible(is_info_type_create_landmark);
- mFolderCombo->setVisible(is_info_type_create_landmark);
-
- getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent);
-
- switch(type)
- {
- case CREATE_LANDMARK:
- mCurrentTitle = getString("title_create_landmark");
-
- mTitleEditor->setEnabled(TRUE);
- mNotesEditor->setEnabled(TRUE);
-
- populateFoldersList();
- break;
-
- case AGENT:
- case PLACE:
- mCurrentTitle = getString("title_place");
-
- if (!isMediaPanelVisible())
- {
- mTitle->setText(mCurrentTitle);
- }
- break;
-
- case LANDMARK:
- mCurrentTitle = getString("title_landmark");
-
- mTitleEditor->setEnabled(FALSE);
- mNotesEditor->setEnabled(FALSE);
-
- populateFoldersList();
- break;
-
- case TELEPORT_HISTORY:
- mCurrentTitle = getString("title_teleport_history");
- break;
- }
-
- if (type != AGENT)
- toggleMediaPanel(FALSE);
+ mTitle->setText(mCurrentTitle);
mInfoType = type;
}
-BOOL LLPanelPlaceInfo::isMediaPanelVisible()
+void LLPanelPlaceInfo::sendParcelInfoRequest()
{
- if (!mMediaPanel)
- return FALSE;
+ if (mParcelID != mRequestedID)
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this);
+ LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID);
- return mMediaPanel->getVisible();
+ mRequestedID = mParcelID;
+ }
}
-void LLPanelPlaceInfo::toggleMediaPanel(BOOL visible)
+void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
+ const LLVector3d& pos_global)
{
- if (!mMediaPanel)
- return;
+ LLViewerRegion* region = gAgent.getRegion();
+ if (!region)
+ return;
+
+ mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
+ (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
+ (F32)pos_global.mdV[VZ]);
- if (visible)
+ LLSD body;
+ std::string url = region->getCapability("RemoteParcelRequest");
+ if (!url.empty())
{
- mTitle->setText(getString("title_media"));
+ body["location"] = ll_sd_from_vector3(mPosRegion);
+ 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
{
- mTitle->setText(mCurrentTitle);
- }
-
- mInfoPanel->setVisible(!visible);
- mMediaPanel->setVisible(visible);
-}
-
-void LLPanelPlaceInfo::sendParcelInfoRequest()
-{
- if (mParcelID != mRequestedID)
- {
- LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this);
- LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID);
-
- mRequestedID = mParcelID;
+ mDescEditor->setText(getString("server_update_text"));
}
}
@@ -473,27 +209,6 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data)
mDescEditor->setText(parcel_data.desc);
}
- // 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);
- }
-
- mMaturityRatingText->setValue(rating);
- mRatingText->setValue(rating);
-
- //update for_sale banner, here we should use DFQ_FOR_SALE instead of PF_FOR_SALE
- //because we deal with remote parcel response format
- bool is_for_sale = (parcel_data.flags & DFQ_FOR_SALE) &&
- mInfoType == AGENT ? TRUE : FALSE;
- mForSalePanel->setVisible(is_for_sale);
-
S32 region_x;
S32 region_y;
S32 region_z;
@@ -521,408 +236,25 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data)
{
mParcelName->setText(getString("not_available"));
}
-
- if (mInfoType == CREATE_LANDMARK)
- {
- if (parcel_data.name.empty())
- {
- mTitleEditor->setText(llformat("%s (%d, %d, %d)",
- parcel_data.sim_name.c_str(), region_x, region_y, region_z));
- }
- else
- {
- mTitleEditor->setText(parcel_data.name);
- }
-
- // FIXME: Creating landmark works only for current agent location.
- std::string desc;
- LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent());
- mNotesEditor->setText(desc);
-
- if (!LLLandmarkActions::landmarkAlreadyExists())
- {
- createLandmark(mFolderCombo->getValue().asUUID());
- }
- }
}
-void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
- const LLVector3d& pos_global)
+// virtual
+void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility)
{
- LLViewerRegion* region = gAgent.getRegion();
- if (!region)
- return;
-
- mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
- (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
- (F32)pos_global.mdV[VZ]);
-
- LLSD body;
- std::string url = region->getCapability("RemoteParcelRequest");
- if (!url.empty())
- {
- body["location"] = ll_sd_from_vector3(mPosRegion);
- 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"));
- }
-}
+ LLPanel::handleVisibilityChange(new_visibility);
-void LLPanelPlaceInfo::displaySelectedParcelInfo(LLParcel* parcel,
- LLViewerRegion* region,
- const LLVector3d& pos_global,
- bool is_current_parcel)
-{
- if (!region || !parcel)
+ LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
+ if (!parcel_mgr)
return;
- // send EstateCovenantInfo message
- LLMessageSystem *msg = gMessageSystem;
- msg->newMessage("EstateCovenantRequest");
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
- msg->sendReliable(region->getHost());
-
- LLParcelData parcel_data;
-
- // HACK: Converting sim access flags to the format
- // returned by remote parcel response.
- switch(region->getSimAccess())
- {
- case SIM_ACCESS_MATURE:
- parcel_data.flags = 0x1;
- break;
-
- case SIM_ACCESS_ADULT:
- parcel_data.flags = 0x2;
- break;
-
- default:
- parcel_data.flags = 0;
- }
- parcel_data.desc = parcel->getDesc();
- parcel_data.name = parcel->getName();
- parcel_data.sim_name = region->getName();
- parcel_data.snapshot_id = parcel->getSnapshotID();
- mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
- (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
- (F32)pos_global.mdV[VZ]);
- parcel_data.global_x = pos_global.mdV[VX];
- parcel_data.global_y = pos_global.mdV[VY];
- parcel_data.global_z = pos_global.mdV[VZ];
-
- std::string on = getString("on");
- std::string off = getString("off");
-
- // Processing parcel characteristics
- if (parcel->getParcelFlagAllowVoice())
- {
- mVoiceText->setText(on);
- }
- else
- {
- mVoiceText->setText(off);
- }
-
- if (!region->getBlockFly() && parcel->getAllowFly())
- {
- mFlyText->setText(on);
- }
- else
- {
- mFlyText->setText(off);
- }
-
- if (region->getRestrictPushObject() || parcel->getRestrictPushObject())
- {
- mPushText->setText(off);
- }
- else
- {
- mPushText->setText(on);
- }
-
- if (parcel->getAllowModify())
- {
- mBuildText->setText(on);
- }
- else
- {
- mBuildText->setText(off);
- }
-
- if((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) ||
- (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) ||
- !parcel->getAllowOtherScripts())
- {
- mScriptsText->setText(off);
- }
- else
- {
- mScriptsText->setText(on);
- }
-
- if (region->getAllowDamage() || parcel->getAllowDamage())
- {
- mDamageText->setText(on);
- }
- else
- {
- mDamageText->setText(off);
- }
-
- mRegionNameText->setText(region->getName());
- mRegionTypeText->setText(region->getSimProductName());
- mRegionRatingText->setText(region->getSimAccessString());
-
- // Determine parcel owner
- if (parcel->isPublic())
- {
- mParcelOwner->setText(getString("public"));
- mRegionOwnerText->setText(getString("public"));
- }
- else
- {
- if (parcel->getIsGroupOwned())
- {
- mRegionOwnerText->setText(getString("group_owned_text"));
-
- if(!parcel->getGroupID().isNull())
- {
- // FIXME: Using parcel group as region group.
- gCacheName->get(parcel->getGroupID(), TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mRegionGroupText, _2, _3));
-
- gCacheName->get(parcel->getGroupID(), TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mParcelOwner, _2, _3));
- }
- else
- {
- std::string owner = getString("none_text");
- mRegionGroupText->setText(owner);
- mParcelOwner->setText(owner);
- }
- }
- else
- {
- // Figure out the owner's name
- gCacheName->get(parcel->getOwnerID(), FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mParcelOwner, _2, _3));
- gCacheName->get(region->getOwner(), FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mRegionOwnerText, _2, _3));
- }
-
- if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus())
- {
- mRegionOwnerText->setText(mRegionOwnerText->getText() + getString("sale_pending_text"));
- }
- }
-
- mEstateRatingText->setText(region->getSimAccessString());
-
- S32 area;
- S32 claim_price;
- S32 rent_price;
- F32 dwell;
- BOOL for_sale = parcel->getForSale();
- LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
- &claim_price,
- &rent_price,
- &for_sale,
- &dwell);
- if (for_sale)
- {
- // Adding "For Sale" flag in remote parcel response format.
- parcel_data.flags |= DFQ_FOR_SALE;
-
- const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();
- if(auth_buyer_id.notNull())
- {
- gCacheName->get(auth_buyer_id, TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, this, mSaleToText, _2, _3));
-
- // Show sales info to a specific person or a group he belongs to.
- if (auth_buyer_id != gAgent.getID() && !gAgent.isInGroup(auth_buyer_id))
- {
- for_sale = FALSE;
- }
- }
- else
- {
- mSaleToText->setText(getString("anyone"));
- }
-
- const U8* sign = (U8*)getString("price_text").c_str();
- const U8* sqm = (U8*)getString("area_text").c_str();
-
- mSalesPriceText->setText(llformat("%s%d ", sign, parcel->getSalePrice()));
- mAreaText->setText(llformat("%d %s", area, sqm));
- mTrafficText->setText(llformat("%.0f", dwell));
-
- // Can't have more than region max tasks, regardless of parcel
- // object bonus factor.
- S32 primitives = llmin(llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
- (S32)region->getMaxTasks());
-
- const U8* available = (U8*)getString("available").c_str();
- const U8* allocated = (U8*)getString("allocated").c_str();
-
- mPrimitivesText->setText(llformat("%d %s, %d %s", primitives, available, parcel->getPrimCount(), allocated));
-
- if (parcel->getAllowOtherScripts())
- {
- mParcelScriptsText->setText(getString("all_residents_text"));
- }
- else if (parcel->getAllowGroupScripts())
- {
- mParcelScriptsText->setText(getString("group_text"));
- }
- else
- {
- mParcelScriptsText->setText(off);
- }
-
- mTerraformLimitsText->setText(parcel->getAllowTerraform() ? on : off);
-
- if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
- {
- mSubdivideText->setText(getString("can_change"));
- }
- else
- {
- mSubdivideText->setText(getString("can_not_change"));
- }
- if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
- {
- mResaleText->setText(getString("can_not_resell"));
- }
- else
- {
- mResaleText->setText(getString("can_resell"));
- }
- }
-
- mSelectedParcelID = parcel->getLocalID();
- mLastSelectedRegionID = region->getRegionID();
- processParcelInfo(parcel_data);
-
- mYouAreHerePanel->setVisible(is_current_parcel);
- getChild<LLAccordionCtrlTab>("sales_tab")->setVisible(for_sale);
-}
-
-void LLPanelPlaceInfo::updateEstateName(const std::string& name)
-{
- mEstateNameText->setText(name);
-}
-
-void LLPanelPlaceInfo::updateEstateOwnerName(const std::string& name)
-{
- mEstateOwnerText->setText(name);
-}
-
-void LLPanelPlaceInfo::updateCovenantText(const std::string &text)
-{
- mCovenantText->setText(text);
-}
-
-void LLPanelPlaceInfo::updateLastVisitedText(const LLDate &date)
-{
- if (date.isNull())
- {
- mLastVisited->setText(getString("unknown"));
- }
- else
- {
- std::string timeStr = getString("acquired_date");
- LLSD substitution;
- substitution["datetime"] = (S32) date.secondsSinceEpoch();
- LLStringUtil::format (timeStr, substitution);
- mLastVisited->setText(timeStr);
- }
-}
-
-void LLPanelPlaceInfo::toggleLandmarkEditMode(BOOL enabled)
-{
- // If switching to edit mode while creating landmark
- // the "Create Landmark" title remains.
- if (enabled && mInfoType != CREATE_LANDMARK)
- {
- mTitle->setText(getString("title_edit_landmark"));
- }
- else
- {
- mTitle->setText(mCurrentTitle);
- }
-
- if (mNotesEditor->getReadOnly() == (enabled == TRUE))
- {
- mTitleEditor->setEnabled(enabled);
- mNotesEditor->setReadOnly(!enabled);
- mFolderCombo->setVisible(enabled);
- getChild<LLTextBox>("folder_lable")->setVisible(enabled);
-
- // HACK: To change the text color in a text editor
- // when it was enabled/disabled we set the text once again.
- mNotesEditor->setText(mNotesEditor->getText());
- }
-}
-
-const std::string& LLPanelPlaceInfo::getLandmarkTitle() const
-{
- return mTitleEditor->getText();
-}
-
-const std::string LLPanelPlaceInfo::getLandmarkNotes() const
-{
- return mNotesEditor->getText();
-}
-
-const LLUUID LLPanelPlaceInfo::getLandmarkFolder() const
-{
- return mFolderCombo->getValue().asUUID();
-}
-
-BOOL LLPanelPlaceInfo::setLandmarkFolder(const LLUUID& id)
-{
- return mFolderCombo->setCurrentByID(id);
-}
-
-void LLPanelPlaceInfo::createLandmark(const LLUUID& folder_id)
-{
- std::string name = mTitleEditor->getText();
- std::string desc = mNotesEditor->getText();
-
- LLStringUtil::trim(name);
- LLStringUtil::trim(desc);
-
- // If typed name is empty use the parcel name instead.
- if (name.empty())
+ // Remove land selection when panel hides.
+ if (!new_visibility)
{
- name = mParcelName->getText();
-
- // If no parcel exists use the region name instead.
- if (name.empty())
+ if (!parcel_mgr->selectionEmpty())
{
- name = mRegionName->getText();
+ parcel_mgr->deselectLand();
}
}
-
- LLStringUtil::replaceChar(desc, '\n', ' ');
- // If no folder chosen use the "Landmarks" folder.
- LLLandmarkActions::createLandmarkHere(name, desc,
- folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK));
}
void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel)
@@ -942,159 +274,10 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit*
pick_panel->setPickData(&data);
}
-// virtual
-void LLPanelPlaceInfo::handleVisibilityChange (BOOL new_visibility)
-{
- LLPanel::handleVisibilityChange(new_visibility);
-
- LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
- if (!parcel_mgr)
- return;
-
- // Remove land selection when panel hides.
- if (!new_visibility)
- {
- if (!parcel_mgr->selectionEmpty())
- {
- parcel_mgr->deselectLand();
- }
- }
-}
-
-void LLPanelPlaceInfo::populateFoldersList()
+// static
+void LLPanelPlaceInfo::nameUpdatedCallback(LLTextBox* text,
+ const std::string& first,
+ const std::string& last)
{
- // Collect all folders that can contain landmarks.
- LLInventoryModel::cat_array_t cats;
- collectLandmarkFolders(cats);
-
- mFolderCombo->removeall();
-
- // Put the "Landmarks" folder first in list.
- LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
- const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id);
- if (!cat)
- {
- llwarns << "Cannot find the landmarks folder" << llendl;
- }
- std::string cat_full_name = getFullFolderName(cat);
- mFolderCombo->add(cat_full_name, cat->getUUID());
-
- typedef std::vector<folder_pair_t> folder_vec_t;
- folder_vec_t folders;
- // Sort the folders by their full name.
- for (S32 i = 0; i < cats.count(); i++)
- {
- cat = cats.get(i);
- cat_full_name = getFullFolderName(cat);
- folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name));
- }
- sort(folders.begin(), folders.end(), cmp_folders);
-
- // Finally, populate the combobox.
- for (folder_vec_t::const_iterator it = folders.begin(); it != folders.end(); it++)
- mFolderCombo->add(it->second, LLSD(it->first));
-}
-
-//static
-void LLPanelPlaceInfo::updateYouAreHereBanner(void* userdata)
-{
- //YouAreHere Banner should be displayed only for selected places,
- // If you want to display it for landmark or teleport history item, you should check by mParcelId
-
- LLPanelPlaceInfo* self = static_cast<LLPanelPlaceInfo*>(userdata);
- if(!self->getVisible())
- return;
- if(!gDisconnected)
- {
- static F32 radius = gSavedSettings.getF32("YouAreHereDistance");
-
- BOOL display_banner = gAgent.getRegion()->getRegionID() == self->mLastSelectedRegionID &&
- LLAgentUI::checkAgentDistance(self->mPosRegion, radius);
-
- self->mYouAreHerePanel->setVisible(display_banner);
- }
-}
-
-void LLPanelPlaceInfo::onForSaleBannerClick()
-{
- LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance();
- LLParcelSelectionHandle hParcel = mgr->getFloatingParcelSelection();
- LLViewerRegion* selected_region = mgr->getSelectionRegion();
- if(!hParcel.isNull() && selected_region)
- {
- if(hParcel->getParcel()->getLocalID() == mSelectedParcelID &&
- mLastSelectedRegionID ==selected_region->getRegionID())
- {
- if(hParcel->getParcel()->getSalePrice() - gStatusBar->getBalance() > 0)
- {
- LLFloaterBuyCurrency::buyCurrency("Buying selected land ", hParcel->getParcel()->getSalePrice());
- }
- else
- {
- LLViewerParcelMgr::getInstance()->startBuyLand();
- }
- }
- else
- {
- LL_WARNS("Places") << "User is trying to buy remote parcel.Operation is not supported"<< LL_ENDL;
- }
-
- }
-
-
-}
-
-/*static*/
-std::string LLPanelPlaceInfo::getFullFolderName(const LLViewerInventoryCategory* cat)
-{
- std::string name = cat->getName();
- LLUUID parent_id;
-
- // translate category name, if it's right below the root
- // FIXME: it can throw notification about non existent string in strings.xml
- if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
- {
- LLTrans::findString(name, "InvFolder " + name);
- }
-
- // we don't want "My Inventory" to appear in the name
- while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
- {
- cat = gInventory.getCategory(parent_id);
- name = cat->getName() + "/" + name;
- }
-
- return name;
-}
-
-static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right)
-{
- return left.second < right.second;
-}
-
-static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
-{
- LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
-
- // Add descendent folders of the "Landmarks" category.
- LLInventoryModel::item_array_t items; // unused
- LLIsType is_category(LLAssetType::AT_CATEGORY);
- gInventory.collectDescendentsIf(
- landmarks_id,
- cats,
- items,
- LLInventoryModel::EXCLUDE_TRASH,
- is_category);
-
- // Add the "My Favorites" category.
- LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE);
- LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
- if (!favorites_cat)
- {
- llwarns << "Cannot find the favorites folder" << llendl;
- }
- else
- {
- cats.put(favorites_cat);
- }
+ text->setText(first + " " + last);
}
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index 07a2434d59..c9e1347542 100644
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -1,6 +1,6 @@
/**
* @file llpanelplaceinfo.h
- * @brief Displays place information in Side Tray.
+ * @brief Base class for place information in Side Tray.
*
* $LicenseInfo:firstyear=2009&license=viewergpl$
*
@@ -38,19 +38,13 @@
#include "v3dmath.h"
#include "lluuid.h"
-#include "llpanelmedia.h"
#include "llremoteparcelrequest.h"
-class LLButton;
-class LLComboBox;
class LLExpandableTextBox;
class LLInventoryItem;
-class LLLineEditor;
class LLPanelPickEdit;
class LLParcel;
-class LLIconCtrl;
class LLTextBox;
-class LLTextEditor;
class LLTextureCtrl;
class LLViewerRegion;
class LLViewerInventoryCategory;
@@ -74,30 +68,18 @@ public:
// Ignore all old location information, useful if you are
// recycling an existing dialog and need to clear it.
- void resetLocation();
+ virtual void resetLocation();
// Sends a request for data about the given parcel, which will
// only update the location if there is none already available.
/*virtual*/ void setParcelID(const LLUUID& parcel_id);
- // Depending on how the panel was triggered
- // (from landmark or current location, or other)
+ // Depending on how the panel was triggered
+ // (from landmark or current location, or other)
// sets a corresponding title and contents.
- void setInfoType(INFO_TYPE type);
-
- // Create a landmark for the current location
- // in a folder specified by folder_id.
- void createLandmark(const LLUUID& folder_id);
-
- // Create a pick for the location specified
- // by global_pos.
- void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel);
-
- BOOL isMediaPanelVisible();
- void toggleMediaPanel(BOOL visible);
- void displayItemInfo(const LLInventoryItem* pItem);
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+ virtual void setInfoType(INFO_TYPE type);
+ // Requests remote parcel info by parcel ID.
void sendParcelInfoRequest();
// Displays information about a remote parcel.
@@ -105,109 +87,37 @@ public:
void displayParcelInfo(const LLUUID& region_id,
const LLVector3d& pos_global);
- // Displays information about the currently selected parcel
- // without sending a request to the server.
- // If is_current_parcel true shows "You Are Here" banner.
- void displaySelectedParcelInfo(LLParcel* parcel,
- LLViewerRegion* region,
- const LLVector3d& pos_global,
- bool is_current_parcel);
-
- void updateEstateName(const std::string& name);
- void updateEstateOwnerName(const std::string& name);
- void updateCovenantText(const std::string &text);
- void updateLastVisitedText(const LLDate &date);
-
- void nameUpdatedCallback(LLTextBox* text,
- const std::string& first,
- const std::string& last);
-
- void toggleLandmarkEditMode(BOOL enabled);
-
- const std::string& getLandmarkTitle() const;
- const std::string getLandmarkNotes() const;
- const LLUUID getLandmarkFolder() const;
-
- // Select current landmark folder in combobox.
- BOOL setLandmarkFolder(const LLUUID& id);
+ /*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
+
/*virtual*/ void handleVisibilityChange (BOOL new_visibility);
-
- static std::string getFullFolderName(const LLViewerInventoryCategory* cat);
-private:
+ // Create a pick for the location specified
+ // by global_pos.
+ void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel);
- void populateFoldersList();
- static void updateYouAreHereBanner(void*);// added to gIdleCallbacks
- void onForSaleBannerClick();
+protected:
+ static void nameUpdatedCallback(LLTextBox* text,
+ const std::string& first,
+ const std::string& last);
/**
* mParcelID is valid only for remote places, in other cases it's null. See resetLocation()
*/
- LLUUID mParcelID;
- LLUUID mRequestedID;
- LLUUID mLandmarkID;
- LLVector3 mPosRegion;
- std::string mCurrentTitle;
- S32 mMinHeight;
- INFO_TYPE mInfoType;
-
- /**
- * Hold last displayed parcel. Needs for YouAreHere banner.
- */
- S32 mSelectedParcelID;
- LLUUID mLastSelectedRegionID;
-
- LLTextBox* mTitle;
- LLPanel* mForSalePanel;
- LLPanel* mYouAreHerePanel;
- LLTextureCtrl* mSnapshotCtrl;
- LLTextBox* mRegionName;
- LLTextBox* mParcelName;
- LLExpandableTextBox*mDescEditor;
- LLTextBox* mMaturityRatingText;
- LLTextBox* mParcelOwner;
- LLTextBox* mLastVisited;
-
- LLTextBox* mRatingText;
- LLTextBox* mVoiceText;
- LLTextBox* mFlyText;
- LLTextBox* mPushText;
- LLTextBox* mBuildText;
- LLTextBox* mScriptsText;
- LLTextBox* mDamageText;
-
- LLTextBox* mRegionNameText;
- LLTextBox* mRegionTypeText;
- LLTextBox* mRegionRatingText;
- LLTextBox* mRegionOwnerText;
- LLTextBox* mRegionGroupText;
-
- LLTextBox* mEstateNameText;
- LLTextBox* mEstateRatingText;
- LLTextBox* mEstateOwnerText;
- LLTextEditor* mCovenantText;
-
- LLTextBox* mSalesPriceText;
- LLTextBox* mAreaText;
- LLTextBox* mTrafficText;
- LLTextBox* mPrimitivesText;
- LLTextBox* mParcelScriptsText;
- LLTextBox* mTerraformLimitsText;
- LLTextEditor* mSubdivideText;
- LLTextEditor* mResaleText;
- LLTextBox* mSaleToText;
-
- LLTextBox* mOwner;
- LLTextBox* mCreator;
- LLTextBox* mCreated;
- LLLineEditor* mTitleEditor;
- LLTextEditor* mNotesEditor;
- LLComboBox* mFolderCombo;
- LLPanel* mScrollingPanel;
- LLPanel* mInfoPanel;
- LLMediaPanel* mMediaPanel;
+ LLUUID mParcelID;
+ LLUUID mRequestedID;
+ LLVector3 mPosRegion;
+ std::string mCurrentTitle;
+ S32 mMinHeight;
+ INFO_TYPE mInfoType;
+
+ LLTextBox* mTitle;
+ LLTextureCtrl* mSnapshotCtrl;
+ LLTextBox* mRegionName;
+ LLTextBox* mParcelName;
+ LLExpandableTextBox* mDescEditor;
+ LLTextBox* mMaturityRatingText;
};
#endif // LL_LLPANELPLACEINFO_H
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
new file mode 100644
index 0000000000..9ba72fe6cf
--- /dev/null
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -0,0 +1,541 @@
+/**
+ * @file llpanelplaceprofile.cpp
+ * @brief Displays place profile in Side Tray.
+ *
+ * $LicenseInfo:firstyear=2009&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 "llpanelplaceprofile.h"
+
+#include "llparcel.h"
+
+#include "llqueryflags.h"
+
+#include "lliconctrl.h"
+#include "lllineeditor.h"
+#include "lltextbox.h"
+#include "lltexteditor.h"
+
+#include "llaccordionctrl.h"
+#include "llaccordionctrltab.h"
+#include "llagent.h"
+#include "llagentui.h"
+#include "llappviewer.h"
+#include "llcallbacklist.h"
+#include "llfloaterbuycurrency.h"
+#include "llstatusbar.h"
+#include "llviewercontrol.h"
+#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+static LLRegisterPanelClassWrapper<LLPanelPlaceProfile> t_place_profile("panel_place_profile");
+
+LLPanelPlaceProfile::LLPanelPlaceProfile()
+: LLPanelPlaceInfo(),
+ mForSalePanel(NULL),
+ mYouAreHerePanel(NULL),
+ mSelectedParcelID(-1)
+{}
+
+// virtual
+LLPanelPlaceProfile::~LLPanelPlaceProfile()
+{}
+
+// virtual
+BOOL LLPanelPlaceProfile::postBuild()
+{
+ LLPanelPlaceInfo::postBuild();
+
+ mForSalePanel = getChild<LLPanel>("for_sale_panel");
+ mYouAreHerePanel = getChild<LLPanel>("here_panel");
+ gIdleCallbacks.addFunction(&LLPanelPlaceProfile::updateYouAreHereBanner, this);
+
+ //Icon value should contain sale price of last selected parcel.
+ mForSalePanel->getChild<LLIconCtrl>("icon_for_sale")->
+ setMouseDownCallback(boost::bind(&LLPanelPlaceProfile::onForSaleBannerClick, this));
+
+ mParcelOwner = getChild<LLTextBox>("owner_value");
+ mLastVisited = getChild<LLTextBox>("last_visited_value");
+
+ mRatingText = getChild<LLTextBox>("rating_value");
+ mVoiceText = getChild<LLTextBox>("voice_value");
+ mFlyText = getChild<LLTextBox>("fly_value");
+ mPushText = getChild<LLTextBox>("push_value");
+ mBuildText = getChild<LLTextBox>("build_value");
+ mScriptsText = getChild<LLTextBox>("scripts_value");
+ mDamageText = getChild<LLTextBox>("damage_value");
+
+ mRegionNameText = getChild<LLTextBox>("region_name");
+ mRegionTypeText = getChild<LLTextBox>("region_type");
+ mRegionRatingText = getChild<LLTextBox>("region_rating");
+ mRegionOwnerText = getChild<LLTextBox>("region_owner");
+ mRegionGroupText = getChild<LLTextBox>("region_group");
+
+ mEstateNameText = getChild<LLTextBox>("estate_name");
+ mEstateRatingText = getChild<LLTextBox>("estate_rating");
+ mEstateOwnerText = getChild<LLTextBox>("estate_owner");
+ mCovenantText = getChild<LLTextEditor>("covenant");
+
+ mSalesPriceText = getChild<LLTextBox>("sales_price");
+ mAreaText = getChild<LLTextBox>("area");
+ mTrafficText = getChild<LLTextBox>("traffic");
+ mPrimitivesText = getChild<LLTextBox>("primitives");
+ mParcelScriptsText = getChild<LLTextBox>("parcel_scripts");
+ mTerraformLimitsText = getChild<LLTextBox>("terraform_limits");
+ mSubdivideText = getChild<LLTextEditor>("subdivide");
+ mResaleText = getChild<LLTextEditor>("resale");
+ mSaleToText = getChild<LLTextBox>("sale_to");
+
+ return TRUE;
+}
+
+// virtual
+void LLPanelPlaceProfile::resetLocation()
+{
+ LLPanelPlaceInfo::resetLocation();
+
+ mForSalePanel->setVisible(FALSE);
+ mYouAreHerePanel->setVisible(FALSE);
+
+ std::string not_available = getString("not_available");
+ mParcelOwner->setValue(not_available);
+ mLastVisited->setValue(not_available);
+
+ mRatingText->setText(not_available);
+ mVoiceText->setText(not_available);
+ mFlyText->setText(not_available);
+ mPushText->setText(not_available);
+ mBuildText->setText(not_available);
+ mParcelScriptsText->setText(not_available);
+ mDamageText->setText(not_available);
+
+ mRegionNameText->setValue(not_available);
+ mRegionTypeText->setValue(not_available);
+ mRegionRatingText->setValue(not_available);
+ mRegionOwnerText->setValue(not_available);
+ mRegionGroupText->setValue(not_available);
+
+ mEstateNameText->setValue(not_available);
+ mEstateRatingText->setValue(not_available);
+ mEstateOwnerText->setValue(not_available);
+ mCovenantText->setValue(not_available);
+
+ mSalesPriceText->setValue(not_available);
+ mAreaText->setValue(not_available);
+ mTrafficText->setValue(not_available);
+ mPrimitivesText->setValue(not_available);
+ mParcelScriptsText->setValue(not_available);
+ mTerraformLimitsText->setValue(not_available);
+ mSubdivideText->setValue(not_available);
+ mResaleText->setValue(not_available);
+ mSaleToText->setValue(not_available);
+}
+
+// virtual
+void LLPanelPlaceProfile::setInfoType(INFO_TYPE type)
+{
+ bool is_info_type_agent = type == AGENT;
+ bool is_info_type_teleport_history = type == TELEPORT_HISTORY;
+
+ getChild<LLTextBox>("maturity_label")->setVisible(!is_info_type_agent);
+ mMaturityRatingText->setVisible(!is_info_type_agent);
+
+ getChild<LLTextBox>("owner_label")->setVisible(is_info_type_agent);
+ mParcelOwner->setVisible(is_info_type_agent);
+
+ getChild<LLTextBox>("last_visited_label")->setVisible(is_info_type_teleport_history);
+ mLastVisited->setVisible(is_info_type_teleport_history);
+
+ getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent);
+
+ switch(type)
+ {
+ case AGENT:
+ case PLACE:
+ default:
+ mCurrentTitle = getString("title_place");
+ break;
+
+ case TELEPORT_HISTORY:
+ mCurrentTitle = getString("title_teleport_history");
+ break;
+ }
+
+ LLPanelPlaceInfo::setInfoType(type);
+}
+
+// virtual
+void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data)
+{
+ LLPanelPlaceInfo::processParcelInfo(parcel_data);
+
+ // 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);
+ }
+
+ mMaturityRatingText->setValue(rating);
+ mRatingText->setValue(rating);
+
+ //update for_sale banner, here we should use DFQ_FOR_SALE instead of PF_FOR_SALE
+ //because we deal with remote parcel response format
+ bool is_for_sale = (parcel_data.flags & DFQ_FOR_SALE) &&
+ mInfoType == AGENT ? TRUE : FALSE;
+ mForSalePanel->setVisible(is_for_sale);
+}
+
+void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
+ LLViewerRegion* region,
+ const LLVector3d& pos_global,
+ bool is_current_parcel)
+{
+ if (!region || !parcel)
+ return;
+
+ // send EstateCovenantInfo message
+ LLMessageSystem *msg = gMessageSystem;
+ msg->newMessage("EstateCovenantRequest");
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
+ msg->sendReliable(region->getHost());
+
+ LLParcelData parcel_data;
+
+ // HACK: Converting sim access flags to the format
+ // returned by remote parcel response.
+ switch(region->getSimAccess())
+ {
+ case SIM_ACCESS_MATURE:
+ parcel_data.flags = 0x1;
+ break;
+
+ case SIM_ACCESS_ADULT:
+ parcel_data.flags = 0x2;
+ break;
+
+ default:
+ parcel_data.flags = 0;
+ }
+ parcel_data.desc = parcel->getDesc();
+ parcel_data.name = parcel->getName();
+ parcel_data.sim_name = region->getName();
+ parcel_data.snapshot_id = parcel->getSnapshotID();
+ mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS),
+ (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS),
+ (F32)pos_global.mdV[VZ]);
+ parcel_data.global_x = pos_global.mdV[VX];
+ parcel_data.global_y = pos_global.mdV[VY];
+ parcel_data.global_z = pos_global.mdV[VZ];
+
+ std::string on = getString("on");
+ std::string off = getString("off");
+
+ // Processing parcel characteristics
+ if (parcel->getParcelFlagAllowVoice())
+ {
+ mVoiceText->setText(on);
+ }
+ else
+ {
+ mVoiceText->setText(off);
+ }
+
+ if (!region->getBlockFly() && parcel->getAllowFly())
+ {
+ mFlyText->setText(on);
+ }
+ else
+ {
+ mFlyText->setText(off);
+ }
+
+ if (region->getRestrictPushObject() || parcel->getRestrictPushObject())
+ {
+ mPushText->setText(off);
+ }
+ else
+ {
+ mPushText->setText(on);
+ }
+
+ if (parcel->getAllowModify())
+ {
+ mBuildText->setText(on);
+ }
+ else
+ {
+ mBuildText->setText(off);
+ }
+
+ if((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS) ||
+ (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) ||
+ !parcel->getAllowOtherScripts())
+ {
+ mScriptsText->setText(off);
+ }
+ else
+ {
+ mScriptsText->setText(on);
+ }
+
+ if (region->getAllowDamage() || parcel->getAllowDamage())
+ {
+ mDamageText->setText(on);
+ }
+ else
+ {
+ mDamageText->setText(off);
+ }
+
+ mRegionNameText->setText(region->getName());
+ mRegionTypeText->setText(region->getSimProductName());
+ mRegionRatingText->setText(region->getSimAccessString());
+
+ // Determine parcel owner
+ if (parcel->isPublic())
+ {
+ mParcelOwner->setText(getString("public"));
+ mRegionOwnerText->setText(getString("public"));
+ }
+ else
+ {
+ if (parcel->getIsGroupOwned())
+ {
+ mRegionOwnerText->setText(getString("group_owned_text"));
+
+ if(!parcel->getGroupID().isNull())
+ {
+ // FIXME: Using parcel group as region group.
+ gCacheName->get(parcel->getGroupID(), TRUE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionGroupText, _2, _3));
+
+ gCacheName->get(parcel->getGroupID(), TRUE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3));
+ }
+ else
+ {
+ std::string owner = getString("none_text");
+ mRegionGroupText->setText(owner);
+ mParcelOwner->setText(owner);
+ }
+ }
+ else
+ {
+ // Figure out the owner's name
+ gCacheName->get(parcel->getOwnerID(), FALSE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3));
+ gCacheName->get(region->getOwner(), FALSE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionOwnerText, _2, _3));
+ }
+
+ if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus())
+ {
+ mRegionOwnerText->setText(mRegionOwnerText->getText() + getString("sale_pending_text"));
+ }
+ }
+
+ mEstateRatingText->setText(region->getSimAccessString());
+
+ S32 area;
+ S32 claim_price;
+ S32 rent_price;
+ F32 dwell;
+ BOOL for_sale = parcel->getForSale();
+ LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
+ &claim_price,
+ &rent_price,
+ &for_sale,
+ &dwell);
+ if (for_sale)
+ {
+ // Adding "For Sale" flag in remote parcel response format.
+ parcel_data.flags |= DFQ_FOR_SALE;
+
+ const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();
+ if(auth_buyer_id.notNull())
+ {
+ gCacheName->get(auth_buyer_id, TRUE,
+ boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mSaleToText, _2, _3));
+
+ // Show sales info to a specific person or a group he belongs to.
+ if (auth_buyer_id != gAgent.getID() && !gAgent.isInGroup(auth_buyer_id))
+ {
+ for_sale = FALSE;
+ }
+ }
+ else
+ {
+ mSaleToText->setText(getString("anyone"));
+ }
+
+ const U8* sign = (U8*)getString("price_text").c_str();
+ const U8* sqm = (U8*)getString("area_text").c_str();
+
+ mSalesPriceText->setText(llformat("%s%d ", sign, parcel->getSalePrice()));
+ mAreaText->setText(llformat("%d %s", area, sqm));
+ mTrafficText->setText(llformat("%.0f", dwell));
+
+ // Can't have more than region max tasks, regardless of parcel
+ // object bonus factor.
+ S32 primitives = llmin(llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
+ (S32)region->getMaxTasks());
+
+ const U8* available = (U8*)getString("available").c_str();
+ const U8* allocated = (U8*)getString("allocated").c_str();
+
+ mPrimitivesText->setText(llformat("%d %s, %d %s", primitives, available, parcel->getPrimCount(), allocated));
+
+ if (parcel->getAllowOtherScripts())
+ {
+ mParcelScriptsText->setText(getString("all_residents_text"));
+ }
+ else if (parcel->getAllowGroupScripts())
+ {
+ mParcelScriptsText->setText(getString("group_text"));
+ }
+ else
+ {
+ mParcelScriptsText->setText(off);
+ }
+
+ mTerraformLimitsText->setText(parcel->getAllowTerraform() ? on : off);
+
+ if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
+ {
+ mSubdivideText->setText(getString("can_change"));
+ }
+ else
+ {
+ mSubdivideText->setText(getString("can_not_change"));
+ }
+ if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
+ {
+ mResaleText->setText(getString("can_not_resell"));
+ }
+ else
+ {
+ mResaleText->setText(getString("can_resell"));
+ }
+ }
+
+ mSelectedParcelID = parcel->getLocalID();
+ mLastSelectedRegionID = region->getRegionID();
+ processParcelInfo(parcel_data);
+
+ mYouAreHerePanel->setVisible(is_current_parcel);
+ getChild<LLAccordionCtrlTab>("sales_tab")->setVisible(for_sale);
+}
+
+void LLPanelPlaceProfile::updateEstateName(const std::string& name)
+{
+ mEstateNameText->setText(name);
+}
+
+void LLPanelPlaceProfile::updateEstateOwnerName(const std::string& name)
+{
+ mEstateOwnerText->setText(name);
+}
+
+void LLPanelPlaceProfile::updateCovenantText(const std::string &text)
+{
+ mCovenantText->setText(text);
+}
+
+void LLPanelPlaceProfile::updateLastVisitedText(const LLDate &date)
+{
+ if (date.isNull())
+ {
+ mLastVisited->setText(getString("unknown"));
+ }
+ else
+ {
+ std::string timeStr = getString("acquired_date");
+ LLSD substitution;
+ substitution["datetime"] = (S32) date.secondsSinceEpoch();
+ LLStringUtil::format (timeStr, substitution);
+ mLastVisited->setText(timeStr);
+ }
+}
+
+void LLPanelPlaceProfile::onForSaleBannerClick()
+{
+ LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance();
+ LLParcelSelectionHandle hParcel = mgr->getFloatingParcelSelection();
+ LLViewerRegion* selected_region = mgr->getSelectionRegion();
+ if(!hParcel.isNull() && selected_region)
+ {
+ if(hParcel->getParcel()->getLocalID() == mSelectedParcelID &&
+ mLastSelectedRegionID ==selected_region->getRegionID())
+ {
+ if(hParcel->getParcel()->getSalePrice() - gStatusBar->getBalance() > 0)
+ {
+ LLFloaterBuyCurrency::buyCurrency("Buying selected land ", hParcel->getParcel()->getSalePrice());
+ }
+ else
+ {
+ LLViewerParcelMgr::getInstance()->startBuyLand();
+ }
+ }
+ else
+ {
+ LL_WARNS("Places") << "User is trying to buy remote parcel.Operation is not supported"<< LL_ENDL;
+ }
+
+ }
+}
+
+// static
+void LLPanelPlaceProfile::updateYouAreHereBanner(void* userdata)
+{
+ //YouAreHere Banner should be displayed only for selected places,
+ // If you want to display it for landmark or teleport history item, you should check by mParcelId
+
+ LLPanelPlaceProfile* self = static_cast<LLPanelPlaceProfile*>(userdata);
+ if(!self->getVisible())
+ return;
+
+ if(!gDisconnected)
+ {
+ static F32 radius = gSavedSettings.getF32("YouAreHereDistance");
+
+ BOOL display_banner = gAgent.getRegion()->getRegionID() == self->mLastSelectedRegionID &&
+ LLAgentUI::checkAgentDistance(self->mPosRegion, radius);
+
+ self->mYouAreHerePanel->setVisible(display_banner);
+ }
+}
diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h
new file mode 100644
index 0000000000..d8e4bcb6bd
--- /dev/null
+++ b/indra/newview/llpanelplaceprofile.h
@@ -0,0 +1,114 @@
+/**
+ * @file llpanelplaceprofile.h
+ * @brief Displays place profile in Side Tray.
+ *
+ * $LicenseInfo:firstyear=2009&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_LLPANELPLACEPROFILE_H
+#define LL_LLPANELPLACEPROFILE_H
+
+#include "llpanelplaceinfo.h"
+
+class LLTextEditor;
+
+class LLPanelPlaceProfile : public LLPanelPlaceInfo
+{
+public:
+ LLPanelPlaceProfile();
+ /*virtual*/ ~LLPanelPlaceProfile();
+
+ /*virtual*/ BOOL postBuild();
+
+ /*virtual*/ void resetLocation();
+
+ /*virtual*/ void setInfoType(INFO_TYPE type);
+
+ /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
+
+ // Displays information about the currently selected parcel
+ // without sending a request to the server.
+ // If is_current_parcel true shows "You Are Here" banner.
+ void displaySelectedParcelInfo(LLParcel* parcel,
+ LLViewerRegion* region,
+ const LLVector3d& pos_global,
+ bool is_current_parcel);
+
+ void updateEstateName(const std::string& name);
+ void updateEstateOwnerName(const std::string& name);
+ void updateCovenantText(const std::string &text);
+ void updateLastVisitedText(const LLDate &date);
+
+private:
+ void onForSaleBannerClick();
+
+ static void updateYouAreHereBanner(void*);// added to gIdleCallbacks
+
+ /**
+ * Holds last displayed parcel. Needed for YouAreHere banner.
+ */
+ S32 mSelectedParcelID;
+ LLUUID mLastSelectedRegionID;
+
+ LLPanel* mForSalePanel;
+ LLPanel* mYouAreHerePanel;
+
+ LLTextBox* mParcelOwner;
+ LLTextBox* mLastVisited;
+
+ LLTextBox* mRatingText;
+ LLTextBox* mVoiceText;
+ LLTextBox* mFlyText;
+ LLTextBox* mPushText;
+ LLTextBox* mBuildText;
+ LLTextBox* mScriptsText;
+ LLTextBox* mDamageText;
+
+ LLTextBox* mRegionNameText;
+ LLTextBox* mRegionTypeText;
+ LLTextBox* mRegionRatingText;
+ LLTextBox* mRegionOwnerText;
+ LLTextBox* mRegionGroupText;
+
+ LLTextBox* mEstateNameText;
+ LLTextBox* mEstateRatingText;
+ LLTextBox* mEstateOwnerText;
+ LLTextEditor* mCovenantText;
+
+ LLTextBox* mSalesPriceText;
+ LLTextBox* mAreaText;
+ LLTextBox* mTrafficText;
+ LLTextBox* mPrimitivesText;
+ LLTextBox* mParcelScriptsText;
+ LLTextBox* mTerraformLimitsText;
+ LLTextEditor* mSubdivideText;
+ LLTextEditor* mResaleText;
+ LLTextBox* mSaleToText;
+};
+
+#endif // LL_LLPANELPLACEPROFILE_H
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index b2e9110e96..42e4a6e40b 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -57,9 +57,10 @@
#include "llinventorymodel.h"
#include "lllandmarkactions.h"
#include "lllandmarklist.h"
-#include "llpanelplaceinfo.h"
+#include "llpanellandmarkinfo.h"
#include "llpanellandmarks.h"
#include "llpanelpick.h"
+#include "llpanelplaceprofile.h"
#include "llpanelteleporthistory.h"
#include "llteleporthistorystorage.h"
#include "lltoggleablemenu.h"
@@ -121,7 +122,8 @@ LLPanelPlaces::LLPanelPlaces()
mFilterSubString(LLStringUtil::null),
mActivePanel(NULL),
mFilterEditor(NULL),
- mPlaceInfo(NULL),
+ mPlaceProfile(NULL),
+ mLandmarkInfo(NULL),
mPickPanel(NULL),
mItem(NULL),
mPlaceMenu(NULL),
@@ -135,7 +137,7 @@ LLPanelPlaces::LLPanelPlaces()
gInventory.addObserver(mInventoryObserver);
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
- boost::bind(&LLPanelPlaces::onAgentParcelChange, this));
+ boost::bind(&LLPanelPlaces::updateVerbs, this));
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
}
@@ -206,25 +208,32 @@ BOOL LLPanelPlaces::postBuild()
mFilterEditor->setCommitCallback(boost::bind(&LLPanelPlaces::onFilterEdit, this, _2, false));
}
- mPlaceInfo = getChild<LLPanelPlaceInfo>("panel_place_info");
+ mPlaceProfile = getChild<LLPanelPlaceProfile>("panel_place_profile");
+ mLandmarkInfo = getChild<LLPanelLandmarkInfo>("panel_landmark_info");
+ if (!mPlaceProfile || !mLandmarkInfo)
+ return FALSE;
- LLButton* back_btn = mPlaceInfo->getChild<LLButton>("back_btn");
+ LLButton* back_btn = mPlaceProfile->getChild<LLButton>("back_btn");
back_btn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this));
- LLLineEditor* title_editor = mPlaceInfo->getChild<LLLineEditor>("title_editor");
+ back_btn = mLandmarkInfo->getChild<LLButton>("back_btn");
+ back_btn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this));
+
+ LLLineEditor* title_editor = mLandmarkInfo->getChild<LLLineEditor>("title_editor");
title_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this), NULL);
- LLTextEditor* notes_editor = mPlaceInfo->getChild<LLTextEditor>("notes_editor");
+ LLTextEditor* notes_editor = mLandmarkInfo->getChild<LLTextEditor>("notes_editor");
notes_editor->setKeystrokeCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this));
- LLComboBox* folder_combo = mPlaceInfo->getChild<LLComboBox>("folder_combo");
+ LLComboBox* folder_combo = mLandmarkInfo->getChild<LLComboBox>("folder_combo");
folder_combo->setSelectionCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this));
+
return TRUE;
}
void LLPanelPlaces::onOpen(const LLSD& key)
{
- if(mPlaceInfo == NULL || key.size() == 0)
+ if(!mPlaceProfile || !mLandmarkInfo || key.size() == 0)
return;
mFilterEditor->clear();
@@ -239,11 +248,11 @@ void LLPanelPlaces::onOpen(const LLSD& key)
if (mPlaceInfoType == AGENT_INFO_TYPE)
{
- mPlaceInfo->setInfoType(LLPanelPlaceInfo::AGENT);
+ mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
}
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
{
- mPlaceInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK);
+ mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK);
if (key.has("x") && key.has("y") && key.has("z"))
{
@@ -256,11 +265,11 @@ void LLPanelPlaces::onOpen(const LLSD& key)
mPosGlobal = gAgent.getPositionGlobal();
}
- mPlaceInfo->displayParcelInfo(LLUUID(), mPosGlobal);
+ mLandmarkInfo->displayParcelInfo(LLUUID(), mPosGlobal);
}
else if (mPlaceInfoType == LANDMARK_INFO_TYPE)
{
- mPlaceInfo->setInfoType(LLPanelPlaceInfo::LANDMARK);
+ mLandmarkInfo->setInfoType(LLPanelPlaceInfo::LANDMARK);
LLInventoryItem* item = gInventory.getItem(key["id"].asUUID());
if (!item)
@@ -270,17 +279,12 @@ void LLPanelPlaces::onOpen(const LLSD& key)
}
else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE)
{
- if (mPlaceInfo->isMediaPanelVisible())
- {
- toggleMediaPanel();
- }
-
mPosGlobal = LLVector3d(key["x"].asReal(),
key["y"].asReal(),
key["z"].asReal());
- mPlaceInfo->setInfoType(LLPanelPlaceInfo::PLACE);
- mPlaceInfo->displayParcelInfo(LLUUID(), mPosGlobal);
+ mPlaceProfile->setInfoType(LLPanelPlaceInfo::PLACE);
+ mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}
else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
{
@@ -291,9 +295,9 @@ void LLPanelPlaces::onOpen(const LLSD& key)
mPosGlobal = hist_items[index].mGlobalPos;
- mPlaceInfo->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY);
- mPlaceInfo->updateLastVisitedText(hist_items[index].mDate);
- mPlaceInfo->displayParcelInfo(LLUUID(), mPosGlobal);
+ mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY);
+ mPlaceProfile->updateLastVisitedText(hist_items[index].mDate);
+ mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal);
}
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
@@ -321,7 +325,7 @@ void LLPanelPlaces::onOpen(const LLSD& key)
void LLPanelPlaces::setItem(LLInventoryItem* item)
{
- if (!mPlaceInfo || !item)
+ if (!mLandmarkInfo || !item)
return;
mItem = item;
@@ -351,19 +355,19 @@ void LLPanelPlaces::setItem(LLInventoryItem* item)
if (is_landmark_editable)
{
- if(!mPlaceInfo->setLandmarkFolder(mItem->getParentUUID()) && !mItem->getParentUUID().isNull())
+ if(!mLandmarkInfo->setLandmarkFolder(mItem->getParentUUID()) && !mItem->getParentUUID().isNull())
{
const LLViewerInventoryCategory* cat = gInventory.getCategory(mItem->getParentUUID());
- if(cat)
+ if (cat)
{
- std::string cat_fullname = LLPanelPlaceInfo::getFullFolderName(cat);
- LLComboBox* folderList = mPlaceInfo->getChild<LLComboBox>("folder_combo");
- folderList->add(cat_fullname, cat->getUUID(),ADD_TOP);
+ std::string cat_fullname = LLPanelLandmarkInfo::getFullFolderName(cat);
+ LLComboBox* folderList = mLandmarkInfo->getChild<LLComboBox>("folder_combo");
+ folderList->add(cat_fullname, cat->getUUID(), ADD_TOP);
}
}
}
- mPlaceInfo->displayItemInfo(mItem);
+ mLandmarkInfo->displayItemInfo(mItem);
LLLandmark* lm = gLandmarkList.getAsset(mItem->getAssetUUID(),
boost::bind(&LLPanelPlaces::onLandmarkLoaded, this, _1));
@@ -375,13 +379,13 @@ void LLPanelPlaces::setItem(LLInventoryItem* item)
void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark)
{
- if (!mPlaceInfo)
+ if (!mLandmarkInfo)
return;
LLUUID region_id;
landmark->getRegionID(region_id);
landmark->getGlobalPos(mPosGlobal);
- mPlaceInfo->displayParcelInfo(region_id, mPosGlobal);
+ mLandmarkInfo->displayParcelInfo(region_id, mPosGlobal);
}
void LLPanelPlaces::onFilterEdit(const std::string& search_string, bool force_filter)
@@ -418,10 +422,8 @@ void LLPanelPlaces::onShareButtonClicked()
void LLPanelPlaces::onTeleportButtonClicked()
{
- if (!mPlaceInfo)
- return;
-
- if (mPlaceInfo->getVisible())
+ LLPanelPlaceInfo* panel = getCurrentInfoPanel();
+ if (panel && panel->getVisible())
{
if (mPlaceInfoType == LANDMARK_INFO_TYPE)
{
@@ -450,10 +452,8 @@ void LLPanelPlaces::onTeleportButtonClicked()
void LLPanelPlaces::onShowOnMapButtonClicked()
{
- if (!mPlaceInfo)
- return;
-
- if (mPlaceInfo->getVisible())
+ LLPanelPlaceInfo* panel = getCurrentInfoPanel();
+ if (panel && panel->getVisible())
{
LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
if(!worldmap_instance)
@@ -496,31 +496,31 @@ void LLPanelPlaces::onShowOnMapButtonClicked()
void LLPanelPlaces::onEditButtonClicked()
{
- if (!mPlaceInfo || isLandmarkEditModeOn)
+ if (!mLandmarkInfo || isLandmarkEditModeOn)
return;
isLandmarkEditModeOn = true;
- mPlaceInfo->toggleLandmarkEditMode(TRUE);
+ mLandmarkInfo->toggleLandmarkEditMode(TRUE);
updateVerbs();
}
void LLPanelPlaces::onSaveButtonClicked()
{
- if (!mPlaceInfo || mItem.isNull())
+ if (!mLandmarkInfo || mItem.isNull())
return;
- std::string current_title_value = mPlaceInfo->getLandmarkTitle();
+ std::string current_title_value = mLandmarkInfo->getLandmarkTitle();
std::string item_title_value = mItem->getName();
- std::string current_notes_value = mPlaceInfo->getLandmarkNotes();
+ std::string current_notes_value = mLandmarkInfo->getLandmarkNotes();
std::string item_notes_value = mItem->getDescription();
LLStringUtil::trim(current_title_value);
LLStringUtil::trim(current_notes_value);
LLUUID item_id = mItem->getUUID();
- LLUUID folder_id = mPlaceInfo->getLandmarkFolder();
+ LLUUID folder_id = mLandmarkInfo->getLandmarkFolder();
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(mItem);
@@ -553,7 +553,7 @@ void LLPanelPlaces::onSaveButtonClicked()
void LLPanelPlaces::onCancelButtonClicked()
{
- if (!mPlaceInfo)
+ if (!mLandmarkInfo)
return;
if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
@@ -562,13 +562,13 @@ void LLPanelPlaces::onCancelButtonClicked()
}
else
{
- mPlaceInfo->toggleLandmarkEditMode(FALSE);
+ mLandmarkInfo->toggleLandmarkEditMode(FALSE);
isLandmarkEditModeOn = false;
updateVerbs();
// Reload the landmark properties.
- mPlaceInfo->displayItemInfo(mItem);
+ mLandmarkInfo->displayItemInfo(mItem);
}
}
@@ -652,9 +652,6 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param)
}
else if (item == "pick")
{
- if (!mPlaceInfo)
- return;
-
if (mPickPanel == NULL)
{
mPickPanel = LLPanelPickEdit::create();
@@ -667,7 +664,12 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param)
togglePickPanel(TRUE);
mPickPanel->onOpen(LLSD());
- mPlaceInfo->createPick(mPosGlobal, mPickPanel);
+
+ LLPanelPlaceInfo* panel = getCurrentInfoPanel();
+ if (panel)
+ {
+ panel->createPick(mPosGlobal, mPickPanel);
+ }
LLRect rect = getRect();
mPickPanel->reshape(rect.getWidth(), rect.getHeight());
@@ -694,39 +696,16 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param)
void LLPanelPlaces::onBackButtonClicked()
{
- if (!mPlaceInfo)
- return;
-
- if (mPlaceInfo->isMediaPanelVisible())
- {
- toggleMediaPanel();
- }
- else
- {
- togglePlaceInfoPanel(FALSE);
+ togglePlaceInfoPanel(FALSE);
- // Resetting mPlaceInfoType when Place Info panel is closed.
- mPlaceInfoType = LLStringUtil::null;
+ // Resetting mPlaceInfoType when Place Info panel is closed.
+ mPlaceInfoType = LLStringUtil::null;
- isLandmarkEditModeOn = false;
- }
+ isLandmarkEditModeOn = false;
updateVerbs();
}
-void LLPanelPlaces::toggleMediaPanel()
-{
- if (!mPlaceInfo)
- return;
-
- mPlaceInfo->toggleMediaPanel(!mPlaceInfo->isMediaPanelVisible());
-
- // Refresh the current place info because
- // the media panel controls can't refer to
- // the remote parcel media.
- onOpen(LLSD().insert("type", AGENT_INFO_TYPE));
-}
-
void LLPanelPlaces::togglePickPanel(BOOL visible)
{
setAllChildrenVisible(this, !visible);
@@ -737,26 +716,50 @@ void LLPanelPlaces::togglePickPanel(BOOL visible)
void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
{
- if (!mPlaceInfo)
+ if (!mPlaceProfile || !mLandmarkInfo)
return;
- mPlaceInfo->setVisible(visible);
mFilterEditor->setVisible(!visible);
mTabContainer->setVisible(!visible);
- if (visible)
+ if (mPlaceInfoType == AGENT_INFO_TYPE ||
+ mPlaceInfoType == REMOTE_PLACE_INFO_TYPE ||
+ mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
{
- mPlaceInfo->resetLocation();
+ mPlaceProfile->setVisible(visible);
- LLRect rect = getRect();
- LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
- mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight());
+ if (visible)
+ {
+ mPlaceProfile->resetLocation();
+
+ LLRect rect = getRect();
+ LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
+ mPlaceProfile->reshape(new_rect.getWidth(), new_rect.getHeight());
+
+ mLandmarkInfo->setVisible(FALSE);
+ }
+ }
+ else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
+ mPlaceInfoType == LANDMARK_INFO_TYPE)
+ {
+ mLandmarkInfo->setVisible(visible);
+
+ if (visible)
+ {
+ mLandmarkInfo->resetLocation();
+
+ LLRect rect = getRect();
+ LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom);
+ mLandmarkInfo->reshape(new_rect.getWidth(), new_rect.getHeight());
+
+ mPlaceProfile->setVisible(FALSE);
+ }
}
}
void LLPanelPlaces::changedParcelSelection()
{
- if (!mPlaceInfo)
+ if (!mPlaceProfile)
return;
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
@@ -782,8 +785,8 @@ void LLPanelPlaces::changedParcelSelection()
}
}
- mPlaceInfo->resetLocation();
- mPlaceInfo->displaySelectedParcelInfo(parcel, region, mPosGlobal, is_current_parcel);
+ mPlaceProfile->resetLocation();
+ mPlaceProfile->displaySelectedParcelInfo(parcel, region, mPosGlobal, is_current_parcel);
updateVerbs();
}
@@ -830,30 +833,22 @@ void LLPanelPlaces::changedInventory(U32 mask)
gInventory.removeObserver(mInventoryObserver);
}
-void LLPanelPlaces::onAgentParcelChange()
+void LLPanelPlaces::updateVerbs()
{
- if (!mPlaceInfo)
- return;
+ bool is_place_info_visible;
- if (mPlaceInfo->isMediaPanelVisible())
+ LLPanelPlaceInfo* panel = getCurrentInfoPanel();
+ if (panel)
{
- onOpen(LLSD().insert("type", AGENT_INFO_TYPE));
+ is_place_info_visible = panel->getVisible();
}
else
{
- updateVerbs();
+ is_place_info_visible = false;
}
-}
-void LLPanelPlaces::updateVerbs()
-{
- if (!mPlaceInfo)
- return;
-
- bool is_place_info_visible = mPlaceInfo->getVisible();
bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE;
bool is_create_landmark_visible = mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE;
- bool is_media_panel_visible = mPlaceInfo->isMediaPanelVisible();
mTeleportBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn);
mShowOnMapBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn);
@@ -864,7 +859,7 @@ void LLPanelPlaces::updateVerbs()
mCancelBtn->setVisible(isLandmarkEditModeOn);
mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn);
- mOverflowBtn->setEnabled(is_place_info_visible && !is_media_panel_visible && !is_create_landmark_visible);
+ mOverflowBtn->setEnabled(is_place_info_visible && !is_create_landmark_visible);
if (is_place_info_visible)
{
@@ -872,16 +867,13 @@ void LLPanelPlaces::updateVerbs()
{
// We don't need to teleport to the current location
// so check if the location is not within the current parcel.
- mTeleportBtn->setEnabled(!is_media_panel_visible &&
- !mPosGlobal.isExactlyZero() &&
+ mTeleportBtn->setEnabled(!mPosGlobal.isExactlyZero() &&
!LLViewerParcelMgr::getInstance()->inAgentParcel(mPosGlobal));
}
else if (mPlaceInfoType == LANDMARK_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE)
{
mTeleportBtn->setEnabled(TRUE);
}
-
- mShowOnMapBtn->setEnabled(!is_media_panel_visible);
}
else
{
@@ -890,6 +882,23 @@ void LLPanelPlaces::updateVerbs()
}
}
+LLPanelPlaceInfo* LLPanelPlaces::getCurrentInfoPanel()
+{
+ if (mPlaceInfoType == AGENT_INFO_TYPE ||
+ mPlaceInfoType == REMOTE_PLACE_INFO_TYPE ||
+ mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
+ {
+ return mPlaceProfile;
+ }
+ else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
+ mPlaceInfoType == LANDMARK_INFO_TYPE)
+ {
+ return mLandmarkInfo;
+ }
+
+ return NULL;
+}
+
static bool is_agent_in_selected_parcel(LLParcel* parcel)
{
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h
index e2d281dd84..39eb5261db 100644
--- a/indra/newview/llpanelplaces.h
+++ b/indra/newview/llpanelplaces.h
@@ -37,6 +37,10 @@
class LLInventoryItem;
class LLFilterEditor;
class LLLandmark;
+
+class LLPanelLandmarkInfo;
+class LLPanelPlaceProfile;
+
class LLPanelPickEdit;
class LLPanelPlaceInfo;
class LLPanelPlacesTab;
@@ -85,13 +89,16 @@ private:
void togglePickPanel(BOOL visible);
void togglePlaceInfoPanel(BOOL visible);
- void onAgentParcelChange();
void updateVerbs();
+ LLPanelPlaceInfo* getCurrentInfoPanel();
+
LLFilterEditor* mFilterEditor;
LLPanelPlacesTab* mActivePanel;
LLTabContainer* mTabContainer;
- LLPanelPlaceInfo* mPlaceInfo;
+ LLPanelPlaceProfile* mPlaceProfile;
+ LLPanelLandmarkInfo* mLandmarkInfo;
+
LLPanelPickEdit* mPickPanel;
LLToggleableMenu* mPlaceMenu;
LLToggleableMenu* mLandmarkMenu;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5fd762ab3d..caa668836d 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -139,7 +139,7 @@
#include "llgroupactions.h"
#include "llagentui.h"
#include "llpanelblockedlist.h"
-#include "llpanelplaceinfo.h"
+#include "llpanelplaceprofile.h"
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string/split.hpp>
@@ -5548,7 +5548,7 @@ void process_covenant_reply(LLMessageSystem* msg, void**)
LLPanelLandCovenant::updateEstateOwnerName(owner_name);
LLFloaterBuyLand::updateEstateOwnerName(owner_name);
- LLPanelPlaceInfo* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceInfo>("panel_place_info");
+ LLPanelPlaceProfile* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceProfile>("panel_place_profile");
if (panel)
{
panel->updateEstateName(estate_name);
@@ -5682,7 +5682,7 @@ void onCovenantLoadComplete(LLVFS *vfs,
LLPanelLandCovenant::updateCovenantText(covenant_text);
LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid);
- LLPanelPlaceInfo* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceInfo>("panel_place_info");
+ LLPanelPlaceProfile* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceProfile>("panel_place_profile");
if (panel)
{
panel->updateCovenantText(covenant_text);
diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
new file mode 100644
index 0000000000..03ba7f7c81
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ background_visible="true"
+ follows="all"
+ height="570"
+ layout="topleft"
+ left="0"
+ min_height="350"
+ name="landmark_info"
+ top="20"
+ width="330">
+ <string
+ name="title_create_landmark"
+ value="Create Landmark" />
+ <string
+ name="title_edit_landmark"
+ value="Edit Landmark" />
+ <string
+ name="title_landmark"
+ value="Landmark" />
+ <string
+ name="not_available"
+ value="(N\A)" />
+ <string
+ name="unknown"
+ value="(unknown)" />
+ <string
+ name="public"
+ value="(public)" />
+ <string
+ name="server_update_text">
+ Place information not available without server update.
+ </string>
+ <string
+ name="server_error_text">
+ Information about this location is unavailable at this time, please try again later.
+ </string>
+ <string
+ name="server_forbidden_text">
+ Information about this location is unavailable due to access restrictions. Please check your permissions with the parcel owner.
+ </string>
+ <string
+ name="acquired_date">
+ [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
+ </string>
+ <button
+ follows="top|right"
+ height="23"
+ image_overlay="BackArrow_Off"
+ layout="topleft"
+ left="10"
+ name="back_btn"
+ picture_style="true"
+ tab_stop="false"
+ top="0"
+ width="23" />
+ <text
+ follows="top|left|right"
+ font="SansSerifHugeBold"
+ height="26"
+ layout="topleft"
+ left_pad="10"
+ name="title"
+ text_color="white"
+ top="0"
+ use_ellipses="true"
+ value="Place Profile"
+ width="275" />
+ <scroll_container
+ color="DkGray2"
+ follows="all"
+ height="533"
+ layout="topleft"
+ left="10"
+ name="place_scroll"
+ opaque="true"
+ top_pad="5"
+ width="313">
+ <panel
+ bg_alpha_color="DkGray2"
+ follows="all"
+ height="533"
+ layout="topleft"
+ left="0"
+ min_height="300"
+ name="scrolling_panel"
+ top="0"
+ width="313">
+ <texture_picker
+ enabled="false"
+ follows="top|left"
+ height="190"
+ layout="topleft"
+ left="10"
+ name="logo"
+ top="10"
+ width="290" />
+ <text
+ follows="left|top|right"
+ font="SansSerifLarge"
+ height="14"
+ layout="topleft"
+ left="10"
+ name="region_title"
+ text_color="white"
+ top_pad="5"
+ use_ellipses="true"
+ value="SampleRegion"
+ width="290" />
+ <text
+ follows="left|top|right"
+ height="14"
+ layout="topleft"
+ left="10"
+ name="parcel_title"
+ top_pad="4"
+ use_ellipses="true"
+ value="SampleParcel, Name Long (145, 228, 26)"
+ width="285" />
+ <expandable_text
+ follows="left|top|right"
+ height="50"
+ layout="topleft"
+ left="5"
+ name="description"
+ top_pad="10"
+ value="Du waltz die spritz"
+ width="300" />
+ <panel
+ follows="left|top|right"
+ height="55"
+ layout="topleft"
+ left="10"
+ name="landmark_info_panel"
+ top_pad="10"
+ width="290">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="owner_label"
+ top_pad="10"
+ value="Owner:"
+ width="90" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="70"
+ name="owner"
+ top_delta="0"
+ width="200" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="creator_label"
+ value="Creator:"
+ width="90" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="70"
+ name="creator"
+ top_delta="0"
+ width="200" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="created_label"
+ value="Created:"
+ width="50" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="70"
+ name="created"
+ top_delta="0"
+ width="200" />
+ </panel>
+ <panel
+ follows="left|top|right"
+ height="210"
+ layout="topleft"
+ left="10"
+ name="landmark_edit_panel"
+ width="290">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="title_label"
+ top_pad="10"
+ value="Title:"
+ width="290" />
+ <line_editor
+ background_image_disabled="task_panel_background.png"
+ follows="left|top|right"
+ height="22"
+ layout="topleft"
+ left="0"
+ max_length="63"
+ name="title_editor"
+ prevalidate_callback="ascii"
+ text_readonly_color="white"
+ top_pad="5"
+ width="290" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="notes_label"
+ top_pad="10"
+ value="My notes:"
+ width="290" />
+ <text_editor
+ bg_readonly_color="DkGray2"
+ follows="all"
+ height="70"
+ layout="topleft"
+ left="0"
+ max_length="127"
+ name="notes_editor"
+ read_only="true"
+ text_readonly_color="white"
+ top_pad="5"
+ width="290"
+ wrap="true" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="folder_label"
+ top_pad="15"
+ value="Landmark location:"
+ width="290" />
+ <combo_box
+ follows="bottom|left|right"
+ height="20"
+ layout="topleft"
+ left="0"
+ name="folder_combo"
+ top_pad="5"
+ width="200" />
+ </panel>
+ </panel>
+ </scroll_container>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml
new file mode 100644
index 0000000000..7e073f064d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml
@@ -0,0 +1,979 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ background_visible="true"
+ follows="all"
+ height="570"
+ layout="topleft"
+ left="0"
+ min_height="350"
+ name="place_profile"
+ top="20"
+ width="330">
+ <string
+ name="on"
+ value="On" />
+ <string
+ name="off"
+ value="Off" />
+ <string
+ name="anyone"
+ value="Anyone" />
+ <string
+ name="available"
+ value="available" />
+ <string
+ name="allocated"
+ value="allocated" />
+ <string
+ name="title_place"
+ value="Place Profile" />
+ <string
+ name="title_teleport_history"
+ value="Teleport History Location" />
+ <string
+ name="not_available"
+ value="(N\A)" />
+ <string
+ name="unknown"
+ value="(unknown)" />
+ <string
+ name="public"
+ value="(public)" />
+ <string
+ name="none_text"
+ value="(none)" />
+ <string
+ name="sale_pending_text"
+ value="(Sale Pending)" />
+ <string
+ name="group_owned_text"
+ value="(Group Owned)" />
+ <string
+ name="price_text"
+ value="L$" />
+ <string
+ name="area_text"
+ value="m²" />
+ <string
+ name="all_residents_text"
+ value="All Residents" />
+ <string
+ name="group_text"
+ value="Group" />
+ <string
+ name="can_resell">
+ Purchased land in this region may be resold.
+ </string>
+ <string
+ name="can_not_resell">
+ Purchased land in this region may not be resold.
+ </string>
+ <string
+ name="can_change">
+ Purchased land in this region may be joined or subdivided.
+ </string>
+ <string
+ name="can_not_change">
+ Purchased land in this region may not be joined or subdivided.
+ </string>
+ <string
+ name="server_update_text">
+ Place information not available without server update.
+ </string>
+ <string
+ name="server_error_text">
+ Information about this location is unavailable at this time, please try again later.
+ </string>
+ <string
+ name="server_forbidden_text">
+ Information about this location is unavailable due to access restrictions. Please check your permissions with the parcel owner.
+ </string>
+ <string
+ name="acquired_date">
+ [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
+ </string>
+ <button
+ follows="top|right"
+ height="23"
+ image_overlay="BackArrow_Off"
+ layout="topleft"
+ left="10"
+ name="back_btn"
+ picture_style="true"
+ tab_stop="false"
+ top="0"
+ width="23" />
+ <text
+ follows="top|left|right"
+ font="SansSerifHugeBold"
+ height="26"
+ layout="topleft"
+ left_pad="10"
+ name="title"
+ text_color="white"
+ top="0"
+ use_ellipses="true"
+ value="Place Profile"
+ width="275" />
+ <scroll_container
+ color="DkGray2"
+ follows="all"
+ height="533"
+ layout="topleft"
+ left="10"
+ name="place_scroll"
+ opaque="true"
+ top_pad="5"
+ width="313">
+ <panel
+ bg_alpha_color="DkGray2"
+ follows="all"
+ height="533"
+ layout="topleft"
+ left="0"
+ min_height="300"
+ name="scrolling_panel"
+ top="0"
+ value="&gt;"
+ width="313">
+ <texture_picker
+ enabled="false"
+ follows="top|left"
+ height="190"
+ layout="topleft"
+ left="10"
+ name="logo"
+ top="10"
+ width="290" />
+ <layout_stack
+ border_size="0"
+ clip="false"
+ follows="all"
+ height="50"
+ layout="topleft"
+ mouse_opaque="false"
+ name="panel_stack"
+ orientation="horizontal"
+ top_pad="-65"
+ width="100">
+ <layout_panel
+ follows="left|right"
+ height="50"
+ layout="topleft"
+ left="0"
+ min_height="50"
+ min_width="50"
+ mouse_opaque="false"
+ name="here_panel"
+ top="0"
+ user_resize="false"
+ width="60">
+ <icon
+ follows="top|left"
+ height="50"
+ image_name="YouAreHere_Badge"
+ layout="topleft"
+ left="0"
+ name="icon_you_are_here"
+ top="0"
+ width="50" />
+ </layout_panel>
+ <layout_panel
+ follows="left|right"
+ height="60"
+ layout="topleft"
+ min_height="50"
+ min_width="60"
+ mouse_opaque="false"
+ name="for_sale_panel"
+ top="0"
+ user_resize="false"
+ width="60">
+ <icon
+ follows="top|left"
+ height="50"
+ image_name="ForSale_Badge"
+ layout="topleft"
+ left="10"
+ name="icon_for_sale"
+ top="0"
+ width="50" />
+ </layout_panel>
+ </layout_stack>
+ <text
+ follows="left|top|right"
+ font="SansSerifLarge"
+ height="14"
+ layout="topleft"
+ left="10"
+ name="region_title"
+ text_color="white"
+ top_pad="5"
+ use_ellipses="true"
+ value="SampleRegion"
+ width="290" />
+ <!-- <icon
+ follows="top|right"
+ height="16"
+ image_name="Icon_For_Sale"
+ layout="topleft"
+ left="3"
+ mouse_opaque="true"
+ name="icon_for_sale"
+ width="16" />-->
+ <text
+ follows="left|top|right"
+ height="14"
+ layout="topleft"
+ left="10"
+ name="parcel_title"
+ top_pad="4"
+ use_ellipses="true"
+ value="SampleParcel, Name Long (145, 228, 26)"
+ width="285" />
+ <expandable_text
+ follows="left|top|right"
+ height="50"
+ layout="topleft"
+ left="5"
+ name="description"
+ top_pad="10"
+ value="Du waltz die spritz"
+ width="300" />
+ <text
+ follows="left|top"
+ height="14"
+ layout="topleft"
+ left="10"
+ name="owner_label"
+ text_color="White"
+ top_pad="0"
+ value="Owner:"
+ width="90" />
+ <!--TODO: HOOK THIS NAME UP WITH AN INSPECTOR -->
+ <text
+ follows="left|top|right"
+ height="14"
+ layout="topleft"
+ left_pad="1"
+ name="owner_value"
+ top_delta="0"
+ value="Alex Superduperlongenamenton"
+ width="205" />
+ <accordion
+ follows="all"
+ height="230"
+ layout="topleft"
+ left="0"
+ name="advanced_info_accordion"
+ top_pad="10"
+ width="313">
+ <accordion_tab
+ layout="topleft"
+ name="parcel_characteristics_tab"
+ title="Parcel">
+ <scroll_container
+ color="DkGray2"
+ follows="all"
+ height="132"
+ layout="topleft"
+ left="0"
+ name="parcel_scroll"
+ opaque="true"
+ top="0"
+ width="290">
+ <panel
+ follows="all"
+ height="165"
+ layout="topleft"
+ left="0"
+ top="0"
+ width="275">
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_M"
+ layout="topleft"
+ left="20"
+ name="icon_M"
+ top="0"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_R"
+ layout="topleft"
+ left="20"
+ name="icon_R"
+ top="0"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_PG"
+ layout="topleft"
+ left="20"
+ name="icon_PG"
+ top="0"
+ visible="false"
+ width="18" />
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="8"
+ name="rating_label"
+ value="Rating:"
+ width="80" />
+ <text
+ follows="right|top"
+ height="16"
+ layout="topleft"
+ left_pad="0"
+ name="rating_value"
+ top_delta="0"
+ value="Mature"
+ width="120" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Voice"
+ layout="topleft"
+ left="20"
+ name="icon_Voice"
+ top_pad="5"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_VoiceNo"
+ layout="topleft"
+ left="20"
+ name="icon_VoiceNo"
+ top_delta="0"
+ visible="false"
+ width="22" />
+ <text
+ follows="left|top"
+ height="18"
+ layout="topleft"
+ left_pad="8"
+ name="voice_label"
+ top_delta="0"
+ value="Voice:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="18"
+ layout="topleft"
+ left_pad="0"
+ name="voice_value"
+ top_delta="0"
+ value="On"
+ width="60" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Fly"
+ layout="topleft"
+ left="20"
+ name="icon_Fly"
+ top_pad="3"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_FlyNo"
+ layout="topleft"
+ left="20"
+ name="icon_FlyNo"
+ top_delta="0"
+ visible="false"
+ width="22" />
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="8"
+ name="fly_label"
+ value="Fly:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="16"
+ layout="topleft"
+ left_pad="0"
+ name="fly_value"
+ top_delta="0"
+ value="On"
+ width="60" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Push"
+ layout="topleft"
+ left="20"
+ name="icon_Push"
+ top_pad="3"
+ visible="false"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_PushNo"
+ layout="topleft"
+ left="20"
+ name="icon_PushNo"
+ top_delta="0"
+ width="22" />
+ <text
+ follows="left|top"
+ height="14"
+ layout="topleft"
+ left_pad="8"
+ name="push_label"
+ value="Push:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="14"
+ layout="topleft"
+ left_pad="0"
+ name="push_value"
+ top_delta="0"
+ value="Off"
+ width="60" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Build"
+ layout="topleft"
+ left="20"
+ name="icon_Build"
+ top_pad="3"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_BuildNo"
+ layout="topleft"
+ left="20"
+ name="icon_BuildNo"
+ top_delta="0"
+ visible="false" />
+ <text
+ follows="left|top"
+ height="14"
+ layout="topleft"
+ left_pad="8"
+ name="build_label"
+ value="Build:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="15"
+ layout="topleft"
+ left_pad="0"
+ name="build_value"
+ top_delta="0"
+ value="On"
+ width="60" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Scripts"
+ layout="topleft"
+ left="20"
+ name="icon_Scripts"
+ top_pad="3"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_ScriptsNo"
+ layout="topleft"
+ left="20"
+ name="icon_ScriptsNo"
+ top_delta="0"
+ visible="false" />
+ <text
+ follows="left|top"
+ height="14"
+ layout="topleft"
+ left_pad="8"
+ name="scripts_label"
+ value="Scripts:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="14"
+ layout="topleft"
+ left_pad="0"
+ name="scripts_value"
+ top_delta="0"
+ value="On"
+ width="60" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_Damage"
+ layout="topleft"
+ left="20"
+ name="icon_Damage"
+ top_pad="7"
+ visible="false"
+ width="22" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="parcel_drk_DamageNo"
+ layout="topleft"
+ left="20"
+ name="icon_DamageNo"
+ top_delta="0" />
+ <text
+ follows="left|top"
+ height="14"
+ layout="topleft"
+ left_pad="8"
+ name="damage_label"
+ value="Damage:"
+ width="76" />
+ <text
+ follows="right|top"
+ height="14"
+ layout="topleft"
+ left_pad="0"
+ name="damage_value"
+ top_delta="0"
+ value="Off"
+ width="60" />
+ <button
+ follows="bottom|right"
+ height="19"
+ label="About Land"
+ layout="topleft"
+ name="about_land_btn"
+ right="-5"
+ tab_stop="false"
+ top="138"
+ width="90">
+ <click_callback
+ function="ShowFloater"
+ parameter="about_land" />
+ </button>
+ </panel>
+ </scroll_container>
+ </accordion_tab>
+ <accordion_tab
+ expanded="false"
+ layout="topleft"
+ name="region_information_tab"
+ title="Region">
+ <panel
+ follows="all"
+ height="125"
+ layout="topleft"
+ left="0"
+ top="0"
+ width="290">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="region_name_label"
+ top_pad="5"
+ value="Region:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="0"
+ name="region_name"
+ top_delta="0"
+ value="Mooseland"
+ width="195" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="region_type_label"
+ top_pad="5"
+ value="Type:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="0"
+ name="region_type"
+ top_delta="0"
+ value="Moose"
+ width="195" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="region_rating_label"
+ top_pad="7"
+ value="Rating:"
+ width="80" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_M"
+ layout="topleft"
+ left_pad="0"
+ name="icon_M"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_R"
+ layout="topleft"
+ left_delta="0"
+ name="icon_R"
+ top_delta="0"
+ visible="false"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="parcel_drk_PG"
+ layout="topleft"
+ left_delta="0"
+ name="icon_PG"
+ top_delta="0"
+ visible="false"
+ width="18" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="10"
+ name="region_rating"
+ value="Explicit"
+ width="100" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="region_owner_label"
+ top_pad="5"
+ value="Owner:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="0"
+ name="region_owner"
+ top_delta="0"
+ value="moose Van Moose"
+ width="195" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="region_group_label"
+ top_pad="5"
+ value="Group:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="0"
+ name="region_group"
+ top_delta="0"
+ use_ellipses="true"
+ width="195">
+ The Mighty Moose of mooseville soundvillemoose
+ </text>
+ <button
+ follows="bottom|right"
+ height="19"
+ label="Region/Estate"
+ layout="topleft"
+ name="region_info_btn"
+ right="-5"
+ tab_stop="false"
+ width="105">
+ <click_callback
+ function="ShowFloater"
+ parameter="region_info" />
+ </button>
+ </panel>
+ </accordion_tab>
+ <accordion_tab
+ expanded="false"
+ layout="topleft"
+ name="estate_information_tab"
+ title="Estate">
+ <panel
+ follows="all"
+ height="189"
+ layout="topleft"
+ left="0"
+ top="0"
+ width="290">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="estate_name_label"
+ top_pad="5"
+ value="Estate:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="90"
+ name="estate_name"
+ top_delta="0"
+ width="160" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="estate_rating_label"
+ top_pad="5"
+ value="Rating:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="90"
+ name="estate_rating"
+ top_delta="0"
+ width="160" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="estate_owner_label"
+ top_pad="5"
+ value="Owner:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="90"
+ name="estate_owner"
+ top_delta="0"
+ width="160" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="covenant_label"
+ top_pad="5"
+ value="Covenant:"
+ width="220" />
+ <text_editor
+ bg_focus_color="DkGray2"
+ bg_readonly_color="DkGray2"
+ follows="left|top|right"
+ handle_edit_keys_directly="true"
+ height="90"
+ layout="topleft"
+ left="10"
+ max_length="65535"
+ name="covenant"
+ read_only="true"
+ top_pad="0"
+ width="280" />
+ </panel>
+ </accordion_tab>
+ <accordion_tab
+ expanded="false"
+ layout="topleft"
+ name="sales_tab"
+ title="For Sale">
+ <panel
+ follows="all"
+ height="300"
+ layout="topleft"
+ left="0"
+ top="0"
+ width="290">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="sales_price_label"
+ top_pad="5"
+ value="Price:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="sales_price"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="area_label"
+ top_pad="5"
+ value="Area:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="area"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="traffic_label"
+ top_pad="5"
+ value="Traffic:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="traffic"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="primitives_label"
+ top_pad="5"
+ value="Primitives:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="primitives"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="parcel_scripts_label"
+ top_pad="5"
+ value="Scripts:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="parcel_scripts"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="terraform_limits_label"
+ top_pad="5"
+ value="Terraform limits:"
+ width="100" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="110"
+ name="terraform_limits"
+ top_delta="0"
+ width="140" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="subdivide_label"
+ top_pad="5"
+ value="Subdivide/Join ability:"
+ width="220" />
+ <text_editor
+ bg_focus_color="DkGray2"
+ bg_readonly_color="DkGray2"
+ follows="left|top|right"
+ height="45"
+ layout="topleft"
+ left="10"
+ max_length="65535"
+ name="subdivide"
+ read_only="true"
+ top_pad="5"
+ width="245" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="resale_label"
+ top_pad="5"
+ value="ReSale ability:"
+ width="80" />
+ <text_editor
+ bg_focus_color="DkGray2"
+ bg_readonly_color="DkGray2"
+ follows="left|top|right"
+ height="45"
+ layout="topleft"
+ left="10"
+ max_length="65535"
+ name="resale"
+ read_only="true"
+ top_pad="5"
+ width="245" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="sale_to_label"
+ top_pad="5"
+ value="For sale to:"
+ width="80" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left="90"
+ name="sale_to"
+ top_delta="0"
+ width="160" />
+ </panel>
+ </accordion_tab>
+ </accordion>
+ </panel>
+ </scroll_container>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index 5aa53ab46b..87ac5be74a 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -40,14 +40,26 @@ background_visible="true"
top_pad="10"
width="313" />
<panel
- class="panel_place_info"
- filename="panel_place_info.xml"
+ class="panel_place_profile"
+ filename="panel_place_profile.xml"
follows="all"
height="533"
layout="topleft"
left="0"
help_topic="places_info_tab"
- name="panel_place_info"
+ name="panel_place_profile"
+ top="5"
+ visible="false"
+ width="313" />
+ <panel
+ class="panel_landmark_info"
+ filename="panel_landmark_info.xml"
+ follows="all"
+ height="533"
+ layout="topleft"
+ left="0"
+ help_topic="places_info_tab"
+ name="panel_landmark_info"
top="5"
visible="false"
width="313" />