summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-30 22:06:59 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-05-31 01:47:30 +0300
commit4ffc6c3fde17de5e18370139274bbd44b1b61a23 (patch)
treec018f52d5750547316324325a14c64c8c9242089
parentd4a799a1a8ce11a808c97d73c03f16d3b3e41597 (diff)
SL-15312 Tweaks and fixes
- Allowed resizing text fields for classifieds in profiles - Fixed mislabeled floater from picks to classifieds - Fixed classified floater's title - Added support to see multiple classifieds - Removed obsolete panels - Fixed pick requests for various menus - Fixed pick creation from landmarks - Improved online status handling - Updated headers in files
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llavatarpropertiesprocessor.cpp27
-rw-r--r--indra/newview/llfloaterclassified.cpp71
-rw-r--r--indra/newview/llfloaterclassified.h45
-rw-r--r--indra/newview/llfloaterprofile.cpp9
-rw-r--r--indra/newview/llfloaterprofile.h6
-rw-r--r--indra/newview/llpanelavatar.h11
-rw-r--r--indra/newview/llpanellandmarks.cpp52
-rw-r--r--indra/newview/llpanellandmarks.h2
-rw-r--r--indra/newview/llpanelpick.cpp620
-rw-r--r--indra/newview/llpanelpick.h264
-rw-r--r--indra/newview/llpanelplaceinfo.cpp12
-rw-r--r--indra/newview/llpanelplaceinfo.h3
-rw-r--r--indra/newview/llpanelplaces.cpp42
-rw-r--r--indra/newview/llpanelplaces.h6
-rw-r--r--indra/newview/llpanelprofile.cpp40
-rw-r--r--indra/newview/llpanelprofile.h9
-rw-r--r--indra/newview/llpanelprofileclassifieds.cpp15
-rw-r--r--indra/newview/llpanelprofileclassifieds.h4
-rw-r--r--indra/newview/llpanelprofilepicks.cpp55
-rw-r--r--indra/newview/llpanelprofilepicks.h7
-rw-r--r--indra/newview/llremoteparcelrequest.cpp7
-rw-r--r--indra/newview/llstartup.cpp2
-rw-r--r--indra/newview/llviewerfloaterreg.cpp3
-rw-r--r--indra/newview/llviewerregion.cpp52
-rw-r--r--indra/newview/skins/default/xui/en/floater_classified.xml (renamed from indra/newview/skins/default/xui/en/floater_picks.xml)5
-rw-r--r--indra/newview/skins/default/xui/en/panel_edit_classified.xml354
-rw-r--r--indra/newview/skins/default/xui/en/panel_edit_pick.xml239
-rw-r--r--indra/newview/skins/default/xui/en/panel_pick_info.xml190
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_classified.xml10
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_classifieds.xml2
31 files changed, 299 insertions, 1869 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ea71e19ff8..04dd971dee 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -234,6 +234,7 @@ set(viewer_SOURCE_FILES
llfloatercamera.cpp
llfloatercamerapresets.cpp
llfloaterchatvoicevolume.cpp
+ llfloaterclassified.cpp
llfloatercolorpicker.cpp
llfloaterconversationlog.cpp
llfloaterconversationpreview.cpp
@@ -486,7 +487,6 @@ set(viewer_SOURCE_FILES
llpanelpeople.cpp
llpanelpeoplemenus.cpp
llpanelpermissions.cpp
- llpanelpick.cpp
llpanelplaceinfo.cpp
llpanelplaceprofile.cpp
llpanelplaces.cpp
@@ -872,6 +872,7 @@ set(viewer_HEADER_FILES
llfloatercamerapresets.h
llfloatercamera.h
llfloaterchatvoicevolume.h
+ llfloaterclassified.h
llfloatercolorpicker.h
llfloaterconversationlog.h
llfloaterconversationpreview.h
@@ -1117,7 +1118,6 @@ set(viewer_HEADER_FILES
llpanelpeople.h
llpanelpeoplemenus.h
llpanelpermissions.h
- llpanelpick.h
llpanelplaceinfo.h
llpanelplaceprofile.h
llpanelplaces.h
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index 4b37c00967..dd0d06a8c8 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -116,22 +116,15 @@ void LLAvatarPropertiesProcessor::sendRequest(const LLUUID& avatar_id, EAvatarPr
return;
}
- // Cap is not ready for global use
- //std::string cap = gAgent.getRegionCapability("AgentProfile");
std::string cap;
switch (type)
{
case APT_PROPERTIES:
- if (cap.empty())
- {
- // indicate we're going to make a request
- sendAvatarPropertiesRequestMessage(avatar_id);
- }
- else
- {
- initAgentProfileCapRequest(avatar_id, cap);
- }
+ // indicate we're going to make a request
+ sendAvatarPropertiesRequestMessage(avatar_id);
+ // can use getRegionCapability("AgentProfile"), but it is heavy
+ // initAgentProfileCapRequest(avatar_id, cap);
break;
case APT_PICKS:
case APT_GROUPS:
@@ -193,17 +186,7 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avat
void LLAvatarPropertiesProcessor::sendAvatarPicksRequest(const LLUUID& avatar_id)
{
- std::string cap = gAgent.getRegionCapability("AgentProfile");
-
- if (!cap.empty())
- {
- // AgentProfile capability covers picks
- sendAvatarPropertiesRequest(avatar_id);
- }
- else
- {
- sendGenericRequest(avatar_id, APT_PICKS, "avatarpicksrequest");
- }
+ sendGenericRequest(avatar_id, APT_PICKS, "avatarpicksrequest");
}
void LLAvatarPropertiesProcessor::sendAvatarNotesRequest(const LLUUID& avatar_id)
diff --git a/indra/newview/llfloaterclassified.cpp b/indra/newview/llfloaterclassified.cpp
new file mode 100644
index 0000000000..58b81153a4
--- /dev/null
+++ b/indra/newview/llfloaterclassified.cpp
@@ -0,0 +1,71 @@
+/**
+ * @file llfloaterclassified.cpp
+ * @brief Avatar profile floater.
+ *
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2022, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterclassified.h"
+
+LLFloaterClassified::LLFloaterClassified(const LLSD& key)
+ : LLFloater(key)
+{
+}
+
+LLFloaterClassified::~LLFloaterClassified()
+{
+}
+
+void LLFloaterClassified::onOpen(const LLSD& key)
+{
+ LLPanel* panel = findChild<LLPanel>("main_panel", true);
+ if (panel)
+ {
+ panel->onOpen(key);
+ }
+ if (key.has("classified_name"))
+ {
+ setTitle(key["classified_name"].asString());
+ }
+ LLFloater::onOpen(key);
+}
+
+BOOL LLFloaterClassified::postBuild()
+{
+ return TRUE;
+}
+
+
+bool LLFloaterClassified::matchesKey(const LLSD& key)
+{
+ bool is_mkey_valid = mKey.has("classified_id");
+ bool is_key_valid = key.has("classified_id");
+ if (is_mkey_valid && is_key_valid)
+ {
+ return key["classified_id"].asUUID() == mKey["classified_id"].asUUID();
+ }
+ return is_mkey_valid == is_key_valid;
+}
+
+// eof
diff --git a/indra/newview/llfloaterclassified.h b/indra/newview/llfloaterclassified.h
new file mode 100644
index 0000000000..e02dca29d5
--- /dev/null
+++ b/indra/newview/llfloaterclassified.h
@@ -0,0 +1,45 @@
+/**
+ * @file llfloaterclassified.h
+ * @brief Avatar profile floater.
+ *
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2022, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERCLASSIFIED_H
+#define LL_LLFLOATERCLASSIFIED_H
+
+#include "llfloater.h"
+
+class LLFloaterClassified : public LLFloater
+{
+ LOG_CLASS(LLFloaterClassified);
+public:
+ LLFloaterClassified(const LLSD& key);
+ virtual ~LLFloaterClassified();
+
+ void onOpen(const LLSD& key) override;
+ BOOL postBuild() override;
+
+ bool matchesKey(const LLSD& key) override;
+};
+
+#endif // LL_LLFLOATERCLASSIFIED_H
diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp
index b259bd28f5..78920863e2 100644
--- a/indra/newview/llfloaterprofile.cpp
+++ b/indra/newview/llfloaterprofile.cpp
@@ -2,9 +2,9 @@
* @file llfloaterprofile.cpp
* @brief Avatar profile floater.
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -65,6 +65,11 @@ BOOL LLFloaterProfile::postBuild()
return TRUE;
}
+void LLFloaterProfile::createPick(const LLPickData &data)
+{
+ mPanelProfile->createPick(data);
+}
+
void LLFloaterProfile::showPick(const LLUUID& pick_id)
{
mPanelProfile->showPick(pick_id);
diff --git a/indra/newview/llfloaterprofile.h b/indra/newview/llfloaterprofile.h
index 3026f174fb..1d0450be9c 100644
--- a/indra/newview/llfloaterprofile.h
+++ b/indra/newview/llfloaterprofile.h
@@ -2,9 +2,9 @@
* @file llfloaterprofile.h
* @brief Avatar profile floater.
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,7 @@
#define LL_LLFLOATERPROFILE_H
#include "llavatarnamecache.h"
+#include "llavatarpropertiesprocessor.h"
#include "llfloater.h"
class LLPanelProfile;
@@ -42,6 +43,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ BOOL postBuild();
+ void createPick(const LLPickData &data);
void showPick(const LLUUID& pick_id = LLUUID::null);
bool isPickTabSelected();
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 249b895abb..98fd97f00a 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -128,17 +128,18 @@ protected:
// mLoaded: false: Initial state, show loading indicator
// true: Data recieved, which comes in a single message, hide indicator
ELoadingState getLoadingState() { return mLoadingState; }
- void setIsLoading() { mLoadingState = PROFILE_LOADING; }
virtual void setLoaded();
+ void setApplyProgress(bool started);
+
+ const bool getSelfProfile() const { return mSelfProfile; }
+
+public:
+ void setIsLoading() { mLoadingState = PROFILE_LOADING; }
void resetLoading() { mLoadingState = PROFILE_INIT; }
bool getStarted() { return mLoadingState != PROFILE_INIT; }
bool getIsLoaded() { return mLoadingState == PROFILE_LOADED; }
- const bool getSelfProfile() const { return mSelfProfile; }
-
- void setApplyProgress(bool started);
-
private:
LLUUID mAvatarId;
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index ce17da3076..c3334605ae 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -29,6 +29,7 @@
#include "llpanellandmarks.h"
#include "llbutton.h"
+#include "llfloaterprofile.h"
#include "llfloaterreg.h"
#include "llnotificationsutil.h"
#include "llsdutil.h"
@@ -1003,17 +1004,6 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
return can_be_modified;
}
-void LLLandmarksPanel::onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* owner, const LLSD& params)
-{
- pick_panel->setVisible(FALSE);
- owner->removeChild(pick_panel);
- //we need remove observer to avoid processParcelInfo in the future.
- LLRemoteParcelInfoProcessor::getInstance()->removeObserver(params["parcel_id"].asUUID(), this);
-
- delete pick_panel;
- pick_panel = NULL;
-}
-
bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data , EAcceptance* accept)
{
*accept = ACCEPT_NO;
@@ -1080,49 +1070,21 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark,
LLInventoryItem* inv_item,
const LLParcelData& parcel_data)
{
- LLPanelPickEdit* panel_pick = LLPanelPickEdit::create();
LLVector3d landmark_global_pos;
landmark->getGlobalPos(landmark_global_pos);
- // let's toggle pick panel into panel places
- LLPanel* panel_places = NULL;
- LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>("places");
- if (floaterp)
- {
- panel_places = floaterp->findChild<LLPanel>("main_panel");
- }
-
- if (!panel_places)
- {
- llassert(NULL != panel_places);
- return;
- }
- panel_places->addChild(panel_pick);
- LLRect paren_rect(panel_places->getRect());
- panel_pick->reshape(paren_rect.getWidth(),paren_rect.getHeight(), TRUE);
- panel_pick->setRect(paren_rect);
- panel_pick->onOpen(LLSD());
-
LLPickData data;
data.pos_global = landmark_global_pos;
data.name = inv_item->getName();
data.desc = inv_item->getDescription();
data.snapshot_id = parcel_data.snapshot_id;
data.parcel_id = parcel_data.parcel_id;
- panel_pick->setPickData(&data);
-
- LLSD params;
- params["parcel_id"] = parcel_data.parcel_id;
- /* set exit callback to get back onto panel places
- in callback we will make cleaning up( delete pick_panel instance,
- remove landmark panel from observer list
- */
- panel_pick->setExitCallback(boost::bind(&LLLandmarksPanel::onPickPanelExit,this,
- panel_pick, panel_places,params));
- panel_pick->setSaveCallback(boost::bind(&LLLandmarksPanel::onPickPanelExit,this,
- panel_pick, panel_places,params));
- panel_pick->setCancelCallback(boost::bind(&LLLandmarksPanel::onPickPanelExit,this,
- panel_pick, panel_places,params));
+
+ LLFloaterProfile* profile_floater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgentID)));
+ if (profile_floater)
+ {
+ profile_floater->createPick(data);
+ }
}
void LLLandmarksPanel::doCreatePick(LLLandmark* landmark, const LLUUID &item_id)
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index d7408269b5..16f3a5dc24 100644
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -34,7 +34,6 @@
#include "llinventorymodel.h"
#include "lllandmarklist.h"
#include "llpanelplacestab.h"
-#include "llpanelpick.h"
#include "llremoteparcelrequest.h"
class LLAccordionCtrlTab;
@@ -136,7 +135,6 @@ private:
* For now it checks cut/rename/delete/paste actions.
*/
bool canItemBeModified(const std::string& command_name, LLFolderViewItem* item) const;
- void onPickPanelExit( LLPanelPickEdit* pick_panel, LLView* owner, const LLSD& params);
/**
* Landmark actions callbacks. Fire when a landmark is loaded from the list.
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
deleted file mode 100644
index 40326cfb39..0000000000
--- a/indra/newview/llpanelpick.cpp
+++ /dev/null
@@ -1,620 +0,0 @@
-/**
- * @file llpanelpick.cpp
- * @brief LLPanelPick class implementation
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-// Display of a "Top Pick" used both for the global top picks in the
-// Find directory, and also for each individual user's picks in their
-// profile.
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llpanelpick.h"
-
-#include "message.h"
-
-#include "llparcel.h"
-
-#include "llbutton.h"
-#include "llfloaterreg.h"
-#include "lliconctrl.h"
-#include "lllineeditor.h"
-#include "llpanel.h"
-#include "llscrollcontainer.h"
-#include "lltexteditor.h"
-
-#include "llagent.h"
-#include "llagentpicksinfo.h"
-#include "llavatarpropertiesprocessor.h"
-#include "llfloaterworldmap.h"
-#include "lltexturectrl.h"
-#include "lluiconstants.h"
-#include "llviewerparcelmgr.h"
-#include "llviewerregion.h"
-#include "llworldmap.h"
-
-
-#define XML_PANEL_EDIT_PICK "panel_edit_pick.xml"
-#define XML_PANEL_PICK_INFO "panel_pick_info.xml"
-
-#define XML_NAME "pick_name"
-#define XML_DESC "pick_desc"
-#define XML_SNAPSHOT "pick_snapshot"
-#define XML_LOCATION "pick_location"
-
-#define XML_BTN_ON_TXTR "edit_icon"
-#define XML_BTN_SAVE "save_changes_btn"
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-//static
-LLPanelPickInfo* LLPanelPickInfo::create()
-{
- LLPanelPickInfo* panel = new LLPanelPickInfo();
- panel->buildFromFile(XML_PANEL_PICK_INFO);
- return panel;
-}
-
-LLPanelPickInfo::LLPanelPickInfo()
- : LLPanel()
- , LLAvatarPropertiesObserver()
- , LLRemoteParcelInfoObserver()
- , mAvatarId(LLUUID::null)
- , mSnapshotCtrl(NULL)
- , mPickId(LLUUID::null)
- , mParcelId(LLUUID::null)
- , mRequestedId(LLUUID::null)
- , mScrollingPanelMinHeight(0)
- , mScrollingPanelWidth(0)
- , mScrollingPanel(NULL)
- , mScrollContainer(NULL)
-{
-}
-
-LLPanelPickInfo::~LLPanelPickInfo()
-{
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
-
- if (mParcelId.notNull())
- {
- LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
- }
-}
-
-void LLPanelPickInfo::onOpen(const LLSD& key)
-{
- LLUUID avatar_id = key["avatar_id"];
- if(avatar_id.isNull())
- {
- return;
- }
-
- if(getAvatarId().notNull())
- {
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(
- getAvatarId(), this);
- }
-
- setAvatarId(avatar_id);
-
- resetData();
- resetControls();
-
- setPickId(key["pick_id"]);
- setPickName(key["pick_name"]);
- setPickDesc(key["pick_desc"]);
- setSnapshotId(key["snapshot_id"]);
-
- LLAvatarPropertiesProcessor::getInstance()->addObserver(
- getAvatarId(), this);
- LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(
- getAvatarId(), getPickId());
-}
-
-BOOL LLPanelPickInfo::postBuild()
-{
- mSnapshotCtrl = getChild<LLTextureCtrl>(XML_SNAPSHOT);
-
- childSetAction("teleport_btn", boost::bind(&LLPanelPickInfo::onClickTeleport, this));
- childSetAction("show_on_map_btn", boost::bind(&LLPanelPickInfo::onClickMap, this));
- childSetAction("back_btn", boost::bind(&LLPanelPickInfo::onClickBack, this));
-
- mScrollingPanel = getChild<LLPanel>("scroll_content_panel");
- mScrollContainer = getChild<LLScrollContainer>("profile_scroll");
-
- mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight();
- mScrollingPanelWidth = mScrollingPanel->getRect().getWidth();
-
- LLTextEditor* text_desc = getChild<LLTextEditor>(XML_DESC);
- text_desc->setContentTrusted(false);
-
- return TRUE;
-}
-
-void LLPanelPickInfo::reshape(S32 width, S32 height, BOOL called_from_parent)
-{
- LLPanel::reshape(width, height, called_from_parent);
-
- if (!mScrollContainer || !mScrollingPanel)
- return;
-
- static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0);
-
- S32 scroll_height = mScrollContainer->getRect().getHeight();
- if (mScrollingPanelMinHeight >= scroll_height)
- {
- mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight);
- }
- else
- {
- mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height);
- }
-}
-
-void LLPanelPickInfo::processProperties(void* data, EAvatarProcessorType type)
-{
- if(APT_PICK_INFO != type)
- {
- return;
- }
- LLPickData* pick_info = static_cast<LLPickData*>(data);
- if(!pick_info
- || pick_info->creator_id != getAvatarId()
- || pick_info->pick_id != getPickId())
- {
- return;
- }
-
- mParcelId = pick_info->parcel_id;
- setSnapshotId(pick_info->snapshot_id);
- setPickName(pick_info->name);
- setPickDesc(pick_info->desc);
- setPosGlobal(pick_info->pos_global);
-
- // Send remote parcel info request to get parcel name and sim (region) name.
- sendParcelInfoRequest();
-
- // *NOTE dzaporozhan
- // We want to keep listening to APT_PICK_INFO because user may
- // edit the Pick and we have to update Pick info panel.
- // revomeObserver is called from onClickBack
-}
-
-void LLPanelPickInfo::sendParcelInfoRequest()
-{
- if (mParcelId != mRequestedId)
- {
- LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelId, this);
- LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelId);
-
- mRequestedId = mParcelId;
- }
-}
-
-void LLPanelPickInfo::setExitCallback(const commit_callback_t& cb)
-{
- getChild<LLButton>("back_btn")->setClickedCallback(cb);
-}
-
-void LLPanelPickInfo::processParcelInfo(const LLParcelData& parcel_data)
-{
- setPickLocation(createLocationText(LLStringUtil::null, parcel_data.name,
- parcel_data.sim_name, getPosGlobal()));
-
- // We have received parcel info for the requested ID so clear it now.
- mRequestedId.setNull();
-
- if (mParcelId.notNull())
- {
- LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
- }
-}
-
-void LLPanelPickInfo::setEditPickCallback(const commit_callback_t& cb)
-{
- getChild<LLButton>("edit_btn")->setClickedCallback(cb);
-}
-
-// PROTECTED AREA
-
-void LLPanelPickInfo::resetControls()
-{
- if(getAvatarId() == gAgent.getID())
- {
- getChildView("edit_btn")->setEnabled(TRUE);
- getChildView("edit_btn")->setVisible( TRUE);
- }
- else
- {
- getChildView("edit_btn")->setEnabled(FALSE);
- getChildView("edit_btn")->setVisible( FALSE);
- }
-}
-
-void LLPanelPickInfo::resetData()
-{
- setPickName(LLStringUtil::null);
- setPickDesc(LLStringUtil::null);
- setPickLocation(LLStringUtil::null);
- setPickId(LLUUID::null);
- setSnapshotId(LLUUID::null);
- mPosGlobal.clearVec();
- mParcelId.setNull();
- mRequestedId.setNull();
-}
-
-// static
-std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, const std::string& original_name, const std::string& sim_name, const LLVector3d& pos_global)
-{
- std::string location_text;
- location_text.append(owner_name);
- if (!original_name.empty())
- {
- if (!location_text.empty()) location_text.append(", ");
- location_text.append(original_name);
-
- }
- if (!sim_name.empty())
- {
- if (!location_text.empty()) location_text.append(", ");
- location_text.append(sim_name);
- }
-
- if (!location_text.empty()) location_text.append(" ");
-
- if (!pos_global.isNull())
- {
- S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
- S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
- S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
- location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
- }
- return location_text;
-}
-
-void LLPanelPickInfo::setSnapshotId(const LLUUID& id)
-{
- mSnapshotCtrl->setImageAssetID(id);
- mSnapshotCtrl->setValid(TRUE);
-}
-
-void LLPanelPickInfo::setPickName(const std::string& name)
-{
- getChild<LLUICtrl>(XML_NAME)->setValue(name);
-}
-
-void LLPanelPickInfo::setPickDesc(const std::string& desc)
-{
- getChild<LLUICtrl>(XML_DESC)->setValue(desc);
-}
-
-void LLPanelPickInfo::setPickLocation(const std::string& location)
-{
- getChild<LLUICtrl>(XML_LOCATION)->setValue(location);
-}
-
-void LLPanelPickInfo::onClickMap()
-{
- LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal());
- LLFloaterReg::showInstance("world_map", "center");
-}
-
-void LLPanelPickInfo::onClickTeleport()
-{
- if (!getPosGlobal().isExactlyZero())
- {
- gAgent.teleportViaLocation(getPosGlobal());
- LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal());
- }
-}
-
-void LLPanelPickInfo::onClickBack()
-{
- LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-//static
-LLPanelPickEdit* LLPanelPickEdit::create()
-{
- LLPanelPickEdit* panel = new LLPanelPickEdit();
- panel->buildFromFile(XML_PANEL_EDIT_PICK);
- return panel;
-}
-
-LLPanelPickEdit::LLPanelPickEdit()
- : LLPanelPickInfo()
- , mLocationChanged(false)
- , mNeedData(true)
- , mNewPick(false)
-{
-}
-
-LLPanelPickEdit::~LLPanelPickEdit()
-{
-}
-
-void LLPanelPickEdit::onOpen(const LLSD& key)
-{
- LLUUID pick_id = key["pick_id"];
- mNeedData = true;
-
- // creating new Pick
- if(pick_id.isNull())
- {
- mNewPick = true;
-
- setAvatarId(gAgent.getID());
-
- resetData();
- resetControls();
-
- setPosGlobal(gAgent.getPositionGlobal());
-
- LLUUID parcel_id = LLUUID::null, snapshot_id = LLUUID::null;
- std::string pick_name, pick_desc, region_name;
-
- LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
- if(parcel)
- {
- parcel_id = parcel->getID();
- pick_name = parcel->getName();
- pick_desc = parcel->getDesc();
- snapshot_id = parcel->getSnapshotID();
- }
-
- LLViewerRegion* region = gAgent.getRegion();
- if(region)
- {
- region_name = region->getName();
- }
-
- setParcelID(parcel_id);
- getChild<LLUICtrl>("pick_name")->setValue(pick_name.empty() ? region_name : pick_name);
- getChild<LLUICtrl>("pick_desc")->setValue(pick_desc);
- setSnapshotId(snapshot_id);
- setPickLocation(createLocationText(getLocationNotice(), pick_name, region_name, getPosGlobal()));
-
- enableSaveButton(true);
- }
- // editing existing pick
- else
- {
- mNewPick = false;
- LLPanelPickInfo::onOpen(key);
-
- enableSaveButton(false);
- }
-
- resetDirty();
-}
-
-void LLPanelPickEdit::setPickData(const LLPickData* pick_data)
-{
- if(!pick_data)
- {
- return;
- }
-
- mNeedData = false;
-
- setParcelID(pick_data->parcel_id);
- getChild<LLUICtrl>("pick_name")->setValue(pick_data->name);
- getChild<LLUICtrl>("pick_desc")->setValue(pick_data->desc);
- setSnapshotId(pick_data->snapshot_id);
- setPosGlobal(pick_data->pos_global);
- setPickLocation(createLocationText(LLStringUtil::null, pick_data->name,
- pick_data->sim_name, pick_data->pos_global));
-}
-
-BOOL LLPanelPickEdit::postBuild()
-{
- LLPanelPickInfo::postBuild();
-
- mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPickEdit::onSnapshotChanged, this));
-
- LLLineEditor* line_edit = getChild<LLLineEditor>("pick_name");
- line_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1), NULL);
-
- LLTextEditor* text_edit = getChild<LLTextEditor>("pick_desc");
- text_edit->setKeystrokeCallback(boost::bind(&LLPanelPickEdit::onPickChanged, this, _1));
-
- childSetAction(XML_BTN_SAVE, boost::bind(&LLPanelPickEdit::onClickSave, this));
- childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelPickEdit::onClickSetLocation, this));
-
- initTexturePickerMouseEvents();
-
- return TRUE;
-}
-
-void LLPanelPickEdit::setSaveCallback(const commit_callback_t& cb)
-{
- getChild<LLButton>("save_changes_btn")->setClickedCallback(cb);
-}
-
-void LLPanelPickEdit::setCancelCallback(const commit_callback_t& cb)
-{
- getChild<LLButton>("cancel_btn")->setClickedCallback(cb);
-}
-
-void LLPanelPickEdit::resetDirty()
-{
- LLPanelPickInfo::resetDirty();
-
- getChild<LLLineEditor>("pick_name")->resetDirty();
- getChild<LLTextEditor>("pick_desc")->resetDirty();
- mSnapshotCtrl->resetDirty();
- mLocationChanged = false;
-}
-
-BOOL LLPanelPickEdit::isDirty() const
-{
- if( mNewPick
- || LLPanelPickInfo::isDirty()
- || mLocationChanged
- || mSnapshotCtrl->isDirty()
- || getChild<LLLineEditor>("pick_name")->isDirty()
- || getChild<LLTextEditor>("pick_desc")->isDirty())
- {
- return TRUE;
- }
- return FALSE;
-}
-
-// PROTECTED AREA
-
-void LLPanelPickEdit::sendUpdate()
-{
- LLPickData pick_data;
-
- // If we don't have a pick id yet, we'll need to generate one,
- // otherwise we'll keep overwriting pick_id 00000 in the database.
- if (getPickId().isNull())
- {
- getPickId().generate();
- }
-
- pick_data.agent_id = gAgent.getID();
- pick_data.session_id = gAgent.getSessionID();
- pick_data.pick_id = getPickId();
- pick_data.creator_id = gAgent.getID();;
-
- //legacy var need to be deleted
- pick_data.top_pick = FALSE;
- pick_data.parcel_id = mParcelId;
- pick_data.name = getChild<LLUICtrl>(XML_NAME)->getValue().asString();
- pick_data.desc = getChild<LLUICtrl>(XML_DESC)->getValue().asString();
- pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID();
- pick_data.pos_global = getPosGlobal();
- pick_data.sort_order = 0;
- pick_data.enabled = TRUE;
-
- LLAvatarPropertiesProcessor::instance().sendPickInfoUpdate(&pick_data);
-
- if(mNewPick)
- {
- // Assume a successful create pick operation, make new number of picks
- // available immediately. Actual number of picks will be requested in
- // LLAvatarPropertiesProcessor::sendPickInfoUpdate and updated upon server respond.
- LLAgentPicksInfo::getInstance()->incrementNumberOfPicks();
- }
-}
-
-void LLPanelPickEdit::onSnapshotChanged()
-{
- enableSaveButton(true);
-}
-
-void LLPanelPickEdit::onPickChanged(LLUICtrl* ctrl)
-{
- enableSaveButton(isDirty());
-}
-
-void LLPanelPickEdit::resetData()
-{
- LLPanelPickInfo::resetData();
- mLocationChanged = false;
-}
-
-void LLPanelPickEdit::enableSaveButton(bool enable)
-{
- getChildView(XML_BTN_SAVE)->setEnabled(enable);
-}
-
-void LLPanelPickEdit::onClickSetLocation()
-{
- // Save location for later use.
- setPosGlobal(gAgent.getPositionGlobal());
-
- std::string parcel_name, region_name;
-
- LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
- if (parcel)
- {
- mParcelId = parcel->getID();
- parcel_name = parcel->getName();
- }
-
- LLViewerRegion* region = gAgent.getRegion();
- if(region)
- {
- region_name = region->getName();
- }
-
- setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal()));
-
- mLocationChanged = true;
- enableSaveButton(TRUE);
-}
-
-void LLPanelPickEdit::onClickSave()
-{
- sendUpdate();
-
- mLocationChanged = false;
-
- LLSD params;
- params["action"] = "save_new_pick";
- notifyParent(params);
-}
-
-std::string LLPanelPickEdit::getLocationNotice()
-{
- static std::string notice = getString("location_notice");
- return notice;
-}
-
-void LLPanelPickEdit::processProperties(void* data, EAvatarProcessorType type)
-{
- if(mNeedData)
- {
- LLPanelPickInfo::processProperties(data, type);
- }
-}
-
-// PRIVATE AREA
-
-void LLPanelPickEdit::initTexturePickerMouseEvents()
-{
- text_icon = getChild<LLIconCtrl>(XML_BTN_ON_TXTR);
- mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseEnter, this, _1));
- mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelPickEdit::onTexturePickerMouseLeave, this, _1));
-
- text_icon->setVisible(FALSE);
-}
-
-void LLPanelPickEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl)
-{
- text_icon->setVisible(TRUE);
-}
-
-void LLPanelPickEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl)
-{
- text_icon->setVisible(FALSE);
-}
diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h
deleted file mode 100644
index 7a8bd66fcf..0000000000
--- a/indra/newview/llpanelpick.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * @file llpanelpick.h
- * @brief LLPanelPick class definition
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-// Display of a "Top Pick" used both for the global top picks in the
-// Find directory, and also for each individual user's picks in their
-// profile.
-
-#ifndef LL_LLPANELPICK_H
-#define LL_LLPANELPICK_H
-
-#include "llpanel.h"
-#include "llremoteparcelrequest.h"
-#include "llavatarpropertiesprocessor.h"
-
-class LLIconCtrl;
-class LLTextureCtrl;
-class LLScrollContainer;
-class LLMessageSystem;
-class LLAvatarPropertiesObserver;
-
-/**
- * Panel for displaying Pick Information - snapshot, name, description, etc.
- */
-class LLPanelPickInfo : public LLPanel, public LLAvatarPropertiesObserver, LLRemoteParcelInfoObserver
-{
- LOG_CLASS(LLPanelPickInfo);
-public:
-
- // Creates new panel
- static LLPanelPickInfo* create();
-
- virtual ~LLPanelPickInfo();
-
- /**
- * Initializes panel properties
- *
- * By default Pick will be created for current Agent location.
- * Use setPickData to change Pick properties.
- */
- /*virtual*/ void onOpen(const LLSD& key);
-
- /*virtual*/ BOOL postBuild();
-
- /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
-
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
- /**
- * Sends remote parcel info request to resolve parcel name from its ID.
- */
- void sendParcelInfoRequest();
-
- /**
- * Sets "Back" button click callback
- */
- virtual void setExitCallback(const commit_callback_t& cb);
-
- /**
- * Sets "Edit" button click callback
- */
- virtual void setEditPickCallback(const commit_callback_t& cb);
-
- //This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing
- /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
- /*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; }
- /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {};
-
-protected:
-
- LLPanelPickInfo();
-
- /**
- * Resets Pick information
- */
- virtual void resetData();
-
- /**
- * Resets UI controls (visibility, values)
- */
- virtual void resetControls();
-
- /**
- * "Location text" is actually the owner name, the original
- * name that owner gave the parcel, and the location.
- */
- static std::string createLocationText(
- const std::string& owner_name,
- const std::string& original_name,
- const std::string& sim_name,
- const LLVector3d& pos_global);
-
- virtual void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; }
- virtual LLUUID& getAvatarId() { return mAvatarId; }
-
- /**
- * Sets snapshot id.
- *
- * Will mark snapshot control as valid if id is not null.
- * Will mark snapshot control as invalid if id is null. If null id is a valid value,
- * you have to manually mark snapshot is valid.
- */
- virtual void setSnapshotId(const LLUUID& id);
-
- virtual void setPickId(const LLUUID& id) { mPickId = id; }
- virtual LLUUID& getPickId() { return mPickId; }
-
- virtual void setPickName(const std::string& name);
-
- virtual void setPickDesc(const std::string& desc);
-
- virtual void setPickLocation(const std::string& location);
-
- virtual void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; }
- virtual LLVector3d& getPosGlobal() { return mPosGlobal; }
-
- /**
- * Callback for "Map" button, opens Map
- */
- void onClickMap();
-
- /**
- * Callback for "Teleport" button, teleports user to Pick location.
- */
- void onClickTeleport();
-
- void onClickBack();
-
-protected:
-
- S32 mScrollingPanelMinHeight;
- S32 mScrollingPanelWidth;
- LLScrollContainer* mScrollContainer;
- LLPanel* mScrollingPanel;
- LLTextureCtrl* mSnapshotCtrl;
-
- LLUUID mAvatarId;
- LLVector3d mPosGlobal;
- LLUUID mParcelId;
- LLUUID mPickId;
- LLUUID mRequestedId;
-};
-
-/**
- * Panel for creating/editing Pick.
- */
-class LLPanelPickEdit : public LLPanelPickInfo
-{
- LOG_CLASS(LLPanelPickEdit);
-public:
-
- /**
- * Creates new panel
- */
- static LLPanelPickEdit* create();
-
- /*virtual*/ ~LLPanelPickEdit();
-
- /*virtual*/ void onOpen(const LLSD& key);
-
- virtual void setPickData(const LLPickData* pick_data);
-
- /*virtual*/ BOOL postBuild();
-
- /**
- * Sets "Save" button click callback
- */
- virtual void setSaveCallback(const commit_callback_t& cb);
-
- /**
- * Sets "Cancel" button click callback
- */
- virtual void setCancelCallback(const commit_callback_t& cb);
-
- /**
- * Resets panel and all cantrols to unedited state
- */
- /*virtual*/ void resetDirty();
-
- /**
- * Returns true if any of Pick properties was changed by user.
- */
- /*virtual*/ BOOL isDirty() const;
-
- /*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
-
-protected:
-
- LLPanelPickEdit();
-
- /**
- * Sends Pick properties to server.
- */
- void sendUpdate();
-
- /**
- * Called when snapshot image changes.
- */
- void onSnapshotChanged();
-
- /**
- * Callback for Pick snapshot, name and description changed event.
- */
- void onPickChanged(LLUICtrl* ctrl);
-
- /*virtual*/ void resetData();
-
- /**
- * Enables/disables "Save" button
- */
- void enableSaveButton(bool enable);
-
- /**
- * Callback for "Set Location" button click
- */
- void onClickSetLocation();
-
- /**
- * Callback for "Save" button click
- */
- void onClickSave();
-
- std::string getLocationNotice();
-
-protected:
-
- bool mLocationChanged;
- bool mNeedData;
- bool mNewPick;
-
-private:
-
- void initTexturePickerMouseEvents();
- void onTexturePickerMouseEnter(LLUICtrl* ctrl);
- void onTexturePickerMouseLeave(LLUICtrl* ctrl);
-
-private:
-
- LLIconCtrl* text_icon;
-};
-
-#endif // LL_LLPANELPICK_H
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 9157df789f..fb5957ff8f 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -27,6 +27,8 @@
#include "llviewerprecompiledheaders.h"
#include "llpanelplaceinfo.h"
+#include "llfloaterprofile.h"
+#include "llfloaterreg.h"
#include "llavatarname.h"
#include "llsdutil.h"
@@ -42,7 +44,6 @@
#include "llagent.h"
#include "llexpandabletextbox.h"
-#include "llpanelpick.h"
#include "llslurl.h"
#include "lltexturectrl.h"
#include "llviewerregion.h"
@@ -287,7 +288,7 @@ void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent)
}
}
-void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel)
+void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global)
{
LLPickData data;
data.pos_global = pos_global;
@@ -296,7 +297,12 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit*
data.desc = mDescEditor->getText();
data.snapshot_id = mSnapshotCtrl->getImageAssetID();
data.parcel_id = mParcelID;
- pick_panel->setPickData(&data);
+
+ LLFloaterProfile* profile_floater = dynamic_cast<LLFloaterProfile*>(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgentID)));
+ if (profile_floater)
+ {
+ profile_floater->createPick(data);
+ }
}
// static
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index 8bf67cfe7d..533215016a 100644
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -38,7 +38,6 @@ class LLAvatarName;
class LLExpandableTextBox;
class LLIconCtrl;
class LLInventoryItem;
-class LLPanelPickEdit;
class LLParcel;
class LLScrollContainer;
class LLTextBox;
@@ -94,7 +93,7 @@ public:
// Create a pick for the location specified
// by global_pos.
- void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel);
+ void createPick(const LLVector3d& pos_global);
protected:
static void onNameCache(LLTextBox* text, const std::string& full_name);
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 69f181e1b3..74ec576554 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -63,7 +63,6 @@
#include "lllayoutstack.h"
#include "llpanellandmarkinfo.h"
#include "llpanellandmarks.h"
-#include "llpanelpick.h"
#include "llpanelplaceprofile.h"
#include "llpanelteleporthistory.h"
#include "llremoteparcelrequest.h"
@@ -238,7 +237,6 @@ LLPanelPlaces::LLPanelPlaces()
mFilterEditor(NULL),
mPlaceProfile(NULL),
mLandmarkInfo(NULL),
- mPickPanel(NULL),
mItem(NULL),
mPlaceMenu(NULL),
mLandmarkMenu(NULL),
@@ -952,28 +950,11 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param)
}
else if (item == "pick")
{
- if (mPickPanel == NULL)
- {
- mPickPanel = LLPanelPickEdit::create();
- addChild(mPickPanel);
-
- mPickPanel->setExitCallback(boost::bind(&LLPanelPlaces::togglePickPanel, this, FALSE));
- mPickPanel->setCancelCallback(boost::bind(&LLPanelPlaces::togglePickPanel, this, FALSE));
- mPickPanel->setSaveCallback(boost::bind(&LLPanelPlaces::togglePickPanel, this, FALSE));
- }
-
- togglePickPanel(TRUE);
- mPickPanel->onOpen(LLSD());
-
LLPanelPlaceInfo* panel = getCurrentInfoPanel();
if (panel)
{
- panel->createPick(mPosGlobal, mPickPanel);
+ panel->createPick(mPosGlobal);
}
-
- LLRect rect = getRect();
- mPickPanel->reshape(rect.getWidth(), rect.getHeight());
- mPickPanel->setRect(rect);
}
else if (item == "add_to_favbar")
{
@@ -1050,17 +1031,6 @@ bool LLPanelPlaces::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_t
return false;
}
-void LLPanelPlaces::togglePickPanel(BOOL visible)
-{
- if (mPickPanel)
- {
- mPickPanel->setVisible(visible);
- mPlaceProfile->setVisible(!visible);
- updateVerbs();
- }
-
-}
-
void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
{
if (!mPlaceProfile || !mLandmarkInfo)
@@ -1309,15 +1279,11 @@ void LLPanelPlaces::updateVerbs()
bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE;
bool is_create_landmark_visible = mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE;
- bool is_pick_panel_visible = false;
- if(mPickPanel)
- {
- is_pick_panel_visible = mPickPanel->isInVisibleChain();
- }
+
bool have_3d_pos = ! mPosGlobal.isExactlyZero();
- mTeleportBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible);
- mShowOnMapBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible);
+ mTeleportBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn);
+ mShowOnMapBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn);
mSaveBtn->setVisible(isLandmarkEditModeOn);
mCancelBtn->setVisible(isLandmarkEditModeOn);
mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn);
diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h
index 3b87eb6cb9..e554099343 100644
--- a/indra/newview/llpanelplaces.h
+++ b/indra/newview/llpanelplaces.h
@@ -38,7 +38,6 @@ class LLLandmark;
class LLPanelLandmarkInfo;
class LLPanelPlaceProfile;
-class LLPanelPickEdit;
class LLPanelPlaceInfo;
class LLPanelPlacesTab;
class LLParcelSelection;
@@ -95,7 +94,6 @@ private:
void onOverflowButtonClicked();
void onOverflowMenuItemClicked(const LLSD& param);
bool onOverflowMenuItemEnable(const LLSD& param);
- void onCreateLandmarkButtonClicked(const LLUUID& folder_id);
void onBackButtonClicked();
void onGearMenuClick();
void onSortingMenuClick();
@@ -103,9 +101,6 @@ private:
void onRemoveButtonClicked();
bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept);
-
- void toggleMediaPanel();
- void togglePickPanel(BOOL visible);
void togglePlaceInfoPanel(BOOL visible);
/*virtual*/ void onVisibilityChange(BOOL new_visibility);
@@ -122,7 +117,6 @@ private:
LLPanelPlaceProfile* mPlaceProfile;
LLPanelLandmarkInfo* mLandmarkInfo;
- LLPanelPickEdit* mPickPanel;
LLToggleableMenu* mPlaceMenu;
LLToggleableMenu* mLandmarkMenu;
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 8a07315035..41d8a3e51c 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -2,9 +2,9 @@
* @file llpanelprofile.cpp
* @brief Profile panel implementation
*
-* $LicenseInfo:firstyear=2009&license=viewerlgpl$
+* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
-* Copyright (C) 2010, Linden Research, Inc.
+* Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -947,12 +947,14 @@ void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avat
{
LLUUID avatar_id = getAvatarId();
const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
- if (relationship != NULL && !getSelfProfile())
+ if ((relationship != NULL || gAgent.isGodlike()) && !getSelfProfile())
{
- // subscribe observer to get online status. Request will be sent by LLPanelProfileSecondLife itself.
- // do not subscribe for friend avatar because online status can be wrong overridden
- // via LLAvatarData::flags if Preferences: "Only Friends & Groups can see when I am online" is set.
- processOnlineStatus(relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS), avatar_data->flags & AVATAR_ONLINE);
+ // Relies onto friend observer to get information about online status updates.
+ // Once SL-17506 gets implemented, condition might need to become:
+ // (gAgent.isGodlike() || isRightGrantedFrom || flags & AVATAR_ONLINE)
+ processOnlineStatus(relationship != NULL,
+ gAgent.isGodlike() || relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS),
+ (avatar_data->flags & AVATAR_ONLINE));
}
fillCommonData(avatar_data);
@@ -1238,7 +1240,7 @@ void LLPanelProfileSecondLife::updateOnlineStatus()
// For friend let check if he allowed me to see his status
bool online = relationship->isOnline();
bool perm_granted = relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS);
- processOnlineStatus(perm_granted, online);
+ processOnlineStatus(true, perm_granted, online);
}
else
{
@@ -1249,10 +1251,10 @@ void LLPanelProfileSecondLife::updateOnlineStatus()
}
}
-void LLPanelProfileSecondLife::processOnlineStatus(bool show_online, bool online)
+void LLPanelProfileSecondLife::processOnlineStatus(bool is_friend, bool show_online, bool online)
{
childSetVisible("spacer_layout", false);
- childSetVisible("frind_layout", true);
+ childSetVisible("frind_layout", is_friend);
childSetVisible("online_layout", online && show_online);
childSetVisible("offline_layout", !online && show_online);
}
@@ -2095,11 +2097,6 @@ void LLPanelProfile::onTabChange()
{
active_panel->updateData();
}
- updateBtnsVisibility();
-}
-
-void LLPanelProfile::updateBtnsVisibility()
-{
}
void LLPanelProfile::onOpen(const LLSD& key)
@@ -2133,8 +2130,6 @@ void LLPanelProfile::onOpen(const LLSD& key)
resetLoading();
updateData();
- updateBtnsVisibility();
-
// Some tabs only request data when opened
mTabContainer->setCommitCallback(boost::bind(&LLPanelProfile::onTabChange, this));
}
@@ -2148,6 +2143,11 @@ void LLPanelProfile::updateData()
{
setIsLoading();
+ mPanelSecondlife->setIsLoading();
+ mPanelPicks->setIsLoading();
+ mPanelFirstlife->setIsLoading();
+ mPanelNotes->setIsLoading();
+
std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
if (!cap_url.empty())
{
@@ -2157,6 +2157,12 @@ void LLPanelProfile::updateData()
}
}
+void LLPanelProfile::createPick(const LLPickData &data)
+{
+ mTabContainer->selectTabPanel(mPanelPicks);
+ mPanelPicks->createPick(data);
+}
+
void LLPanelProfile::showPick(const LLUUID& pick_id)
{
if (pick_id.notNull())
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index cf3b6c0eb1..2f2437ed0a 100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -2,9 +2,9 @@
* @file llpanelprofile.h
* @brief Profile panel
*
-* $LicenseInfo:firstyear=2009&license=viewerlgpl$
+* $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
-* Copyright (C) 2010, Linden Research, Inc.
+* Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -160,7 +160,7 @@ protected:
* - Else: Offline
*/
void updateOnlineStatus();
- void processOnlineStatus(bool show_online, bool online);
+ void processOnlineStatus(bool is_friend, bool show_online, bool online);
private:
/*virtual*/ void setLoaded();
@@ -346,12 +346,11 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
+ void createPick(const LLPickData &data);
void showPick(const LLUUID& pick_id = LLUUID::null);
bool isPickTabSelected();
bool isNotesTabSelected();
- void updateBtnsVisibility();
-
void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false);
LLAvatarData getAvatarData() { return mAvatarData; };
diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp
index 7f7bba3b91..91243169a9 100644
--- a/indra/newview/llpanelprofileclassifieds.cpp
+++ b/indra/newview/llpanelprofileclassifieds.cpp
@@ -2,9 +2,9 @@
* @file llpanelprofileclassifieds.cpp
* @brief LLPanelProfileClassifieds and related class implementations
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -36,6 +36,7 @@
#include "llcommandhandler.h" // for classified HTML detail page click tracking
#include "llcorehttputil.h"
#include "lldispatcher.h"
+#include "llfloaterclassified.h"
#include "llfloaterreg.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloaterworldmap.h"
@@ -146,15 +147,19 @@ public:
{
LLSD params;
params["id"] = c_info->creator_id;
- params["open_tab_name"] = "panel_picks";
- params["show_tab_panel"] = "classified_details";
params["classified_id"] = c_info->classified_id;
params["classified_creator_id"] = c_info->creator_id;
params["classified_snapshot_id"] = c_info->snapshot_id;
params["classified_name"] = c_info->name;
params["classified_desc"] = c_info->description;
params["from_search"] = true;
- LLFloaterSidePanelContainer::showPanel("picks", params);
+
+ LLFloaterClassified* floaterp = LLFloaterReg::getTypedInstance<LLFloaterClassified>("classified", params);
+ if (floaterp)
+ {
+ floaterp->openFloater(params);
+ floaterp->setVisibleAndFrontmost();
+ }
}
}
}
diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h
index 3c4dfc9bd0..368718e9dc 100644
--- a/indra/newview/llpanelprofileclassifieds.h
+++ b/indra/newview/llpanelprofileclassifieds.h
@@ -2,9 +2,9 @@
* @file llpanelprofileclassifieds.h
* @brief LLPanelProfileClassifieds and related class implementations
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index 08c4690eaa..f5c0fb46c8 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -148,6 +148,27 @@ void LLPanelProfilePicks::onOpen(const LLSD& key)
childSetVisible("buttons_header", own_profile);
}
+void LLPanelProfilePicks::createPick(const LLPickData &data)
+{
+ if (getIsLoaded())
+ {
+ mNoItemsLabel->setVisible(FALSE);
+ LLPanelProfilePick* pick_panel = LLPanelProfilePick::create();
+ pick_panel->setAvatarId(getAvatarId());
+ pick_panel->processProperties(&data);
+ mTabContainer->addTabPanel(
+ LLTabContainer::TabPanelParams().
+ panel(pick_panel).
+ select_tab(true).
+ label(pick_panel->getPickName()));
+ updateButtons();
+ }
+ else
+ {
+ mSheduledPickCreation.push_back(data);
+ }
+}
+
void LLPanelProfilePicks::selectPick(const LLUUID& pick_id)
{
if (getIsLoaded())
@@ -252,6 +273,7 @@ void LLPanelProfilePicks::processProperties(void* data, EAvatarProcessorType typ
void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks)
{
LLUUID selected_id = mPickToSelectOnLoad;
+ bool has_selection = false;
if (mPickToSelectOnLoad.isNull())
{
if (mTabContainer->getTabCount() > 0)
@@ -287,9 +309,28 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks)
if (selected_id == pick_id)
{
mPickToSelectOnLoad = LLUUID::null;
+ has_selection = true;
}
}
+ while (!mSheduledPickCreation.empty())
+ {
+ const LLPickData data =
+ mSheduledPickCreation.back();
+
+ LLPanelProfilePick* pick_panel = LLPanelProfilePick::create();
+ pick_panel->setAvatarId(getAvatarId());
+ pick_panel->processProperties(&data);
+ mTabContainer->addTabPanel(
+ LLTabContainer::TabPanelParams().
+ panel(pick_panel).
+ select_tab(!has_selection).
+ label(pick_panel->getPickName()));
+
+ mSheduledPickCreation.pop_back();
+ has_selection = true;
+ }
+
BOOL no_data = !mTabContainer->getTabCount();
mNoItemsLabel->setVisible(no_data);
if (no_data)
@@ -303,7 +344,7 @@ void LLPanelProfilePicks::processProperties(const LLAvatarPicks* avatar_picks)
mNoItemsLabel->setValue(LLTrans::getString("NoAvatarPicksText"));
}
}
- else if (selected_id.isNull())
+ else if (!has_selection)
{
mTabContainer->selectFirstTab();
}
@@ -349,11 +390,14 @@ void LLPanelProfilePicks::updateData()
if (!getStarted() && avatar_id.notNull())
{
setIsLoading();
- mNoItemsLabel->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
- mNoItemsLabel->setVisible(TRUE);
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(avatar_id);
}
+ if (!getIsLoaded())
+ {
+ mNoItemsLabel->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
+ mNoItemsLabel->setVisible(TRUE);
+ }
}
bool LLPanelProfilePicks::canAddNewPick()
@@ -516,6 +560,11 @@ void LLPanelProfilePick::processProperties(void* data, EAvatarProcessorType type
return;
}
+ processProperties(pick_info);
+}
+
+void LLPanelProfilePick::processProperties(const LLPickData* pick_info)
+{
mIsEditing = false;
mPickDescription->setParseHTML(true);
mParcelId = pick_info->parcel_id;
diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h
index 046f13292e..e1c424ca24 100644
--- a/indra/newview/llpanelprofilepicks.h
+++ b/indra/newview/llpanelprofilepicks.h
@@ -2,9 +2,9 @@
* @file llpanelprofilepicks.h
* @brief LLPanelProfilePicks and related class definitions
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2022&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2022, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -54,6 +54,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
+ void createPick(const LLPickData &data);
void selectPick(const LLUUID& pick_id);
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
@@ -89,6 +90,7 @@ private:
LLButton* mDeleteButton;
LLUUID mPickToSelectOnLoad;
+ std::list<LLPickData> mSheduledPickCreation;
};
@@ -116,6 +118,7 @@ public:
const std::string getPickName();
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type);
+ void processProperties(const LLPickData* pick_data);
/**
* Saves changes.
diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp
index 055ccd5818..f4ace52faa 100644
--- a/indra/newview/llremoteparcelrequest.cpp
+++ b/indra/newview/llremoteparcelrequest.cpp
@@ -213,7 +213,12 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url,
if (!status)
{
- observer->setErrorStatus(status.getStatus(), status.getMessage());
+ std::string message = status.getMessage();
+ if (message.empty())
+ {
+ message = status.toString();
+ }
+ observer->setErrorStatus(status.getStatus(), message);
}
else
{
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index e7b82fd82d..8ad572f4b9 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -125,7 +125,6 @@
#include "llpanellogin.h"
#include "llmutelist.h"
#include "llavatarpropertiesprocessor.h"
-#include "llpanelpick.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
#include "llparcel.h"
@@ -194,6 +193,7 @@
#include "llavatariconctrl.h"
#include "llvoicechannel.h"
#include "llpathfindingmanager.h"
+#include "llremoteparcelrequest.h"
#include "lllogin.h"
#include "llevents.h"
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 9c8868695a..06a6c5e373 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -57,6 +57,7 @@
#include "llfloatercamera.h"
#include "llfloatercamerapresets.h"
#include "llfloaterchatvoicevolume.h"
+#include "llfloaterclassified.h"
#include "llfloaterconversationlog.h"
#include "llfloaterconversationpreview.h"
#include "llfloatercreatelandmark.h"
@@ -229,6 +230,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("camera_presets", "floater_camera_presets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCameraPresets>);
LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatVoiceVolume>);
LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterIMNearbyChat::buildFloater);
+ LLFloaterReg::add("classified", "floater_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterClassified>);
LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationLog>);
LLFloaterReg::add("add_landmark", "floater_create_landmark.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCreateLandmark>);
@@ -322,7 +324,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTranslationSettings>);
LLFloaterReg::add("prefs_spellchecker", "floater_spellcheck.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerSettings>);
LLFloaterReg::add("prefs_autoreplace", "floater_autoreplace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAutoReplaceSettings>);
- LLFloaterReg::add("picks", "floater_picks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>);
LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewAnim>, "preview");
LLFloaterReg::add("preview_conversation", "floater_conversation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationPreview>);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index b95997ac7d..4ea75ad3f1 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -266,14 +266,13 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
return;
}
- LLWorld *world_inst = LLWorld::getInstance(); // Not a singleton!
- if (!world_inst)
+ if (!LLWorld::instanceExists())
{
LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities, but world no longer exists!" << LL_ENDL;
return;
}
- regionp = world_inst->getRegionFromHandle(regionHandle);
+ regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities for region that no longer exists!" << LL_ENDL;
@@ -321,7 +320,6 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
regionp = NULL;
impl = NULL;
- world_inst = NULL;
result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
if (STATE_WORLD_INIT > LLStartUp::getStartupState())
@@ -332,17 +330,36 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
if (LLApp::isExiting() || gDisconnected)
{
+ LL_DEBUGS("AppInit", "Capabilities") << "Shutting down" << LL_ENDL;
return;
}
- world_inst = LLWorld::getInstance();
- if (!world_inst)
+ if (!result.isMap() || result.has("error"))
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Malformed response" << LL_ENDL;
+ // setup for retry.
+ continue;
+ }
+
+ LLSD httpResults = result["http_result"];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+ if (!status)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "HttpStatus error " << LL_ENDL;
+ // setup for retry.
+ continue;
+ }
+
+ // remove the http_result from the llsd
+ result.erase("http_result");
+
+ if (!LLWorld::instanceExists())
{
LL_WARNS("AppInit", "Capabilities") << "Received capabilities, but world no longer exists!" << LL_ENDL;
return;
}
- regionp = world_inst->getRegionFromHandle(regionHandle);
+ regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Received capabilities for region that no longer exists!" << LL_ENDL;
@@ -351,7 +368,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
impl = regionp->getRegionImplNC();
- ++impl->mSeedCapAttempts;
+ ++(impl->mSeedCapAttempts);
if (id != impl->mHttpResponderID) // region is no longer referring to this request
{
@@ -360,25 +377,6 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
continue;
}
- if (!result.isMap() || result.has("error"))
- {
- LL_WARNS("AppInit", "Capabilities") << "Malformed response" << LL_ENDL;
- // setup for retry.
- continue;
- }
-
- LLSD httpResults = result["http_result"];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- if (!status)
- {
- LL_WARNS("AppInit", "Capabilities") << "HttpStatus error " << LL_ENDL;
- // setup for retry.
- continue;
- }
-
- // remove the http_result from the llsd
- result.erase("http_result");
-
LLSD::map_const_iterator iter;
for (iter = result.beginMap(); iter != result.endMap(); ++iter)
{
diff --git a/indra/newview/skins/default/xui/en/floater_picks.xml b/indra/newview/skins/default/xui/en/floater_classified.xml
index 3cd6abafe5..5b14c827d0 100644
--- a/indra/newview/skins/default/xui/en/floater_picks.xml
+++ b/indra/newview/skins/default/xui/en/floater_classified.xml
@@ -7,11 +7,10 @@
help_topic="sidebar_me"
min_width="333"
min_height="440"
- name="floater_picks"
+ name="floater_classified"
save_rect="true"
save_visibility="false"
- reuse_instance="true"
- title="Picks"
+ title="Classified"
width="333" >
<panel
class="panel_classified_info"
diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml
deleted file mode 100644
index 8b52b01bc5..0000000000
--- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml
+++ /dev/null
@@ -1,354 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- background_visible="true"
- bevel_style="in"
- follows="left|top|right|bottom"
- height="569"
- label="Edit Classified"
- layout="topleft"
- left="0"
- min_height="350"
- name="panel_edit_classified"
- help_topic="profile_edit_classified"
- top="0"
- width="333">
- <panel.string
- name="location_notice">
- (will update after save)
- </panel.string>
- <string name="publish_label">
- Publish
- </string>
- <string name="save_label">
- Save
- </string>
- <button
- follows="top|left"
- height="24"
- image_hover_unselected="BackButton_Over"
- image_pressed="BackButton_Press"
- image_unselected="BackButton_Off"
- layout="topleft"
- name="back_btn"
- left="10"
- tab_stop="false"
- top="2"
- width="30"
- use_draw_context_alpha="false" />
- <text
- type="string"
- length="1"
- follows="top"
- font="SansSerifHugeBold"
- height="26"
- layout="topleft"
- left_pad="4"
- name="title"
- text_color="LtGray"
- top="0"
- width="250">
- Edit Classified
- </text>
- <scroll_container
- color="DkGray2"
- follows="all"
- height="502"
- layout="topleft"
- left="8"
- top_pad="10"
- name="profile_scroll"
- reserve_scroll_corner="false"
- opaque="true"
- width="312">
- <panel
- name="scroll_content_panel"
- follows="left|top"
- min_height="300"
- layout="topleft"
- top="0"
- background_visible="false"
- height="690"
- left="0"
- width="285">
- <panel
- name="snapshot_panel"
- layout="topleft"
- follows="left|top|right"
- height="197"
- left="10"
- top="10"
- width="272">
- <texture_picker
- fallback_image="default_land_picture.j2c"
- follows="left|top|right"
- height="197"
- width="272"
- layout="topleft"
- top="0"
- left="0"
- name="classified_snapshot" />
- <icon
- height="197"
- image_name="spacer24.tga"
- layout="topleft"
- name="edit_icon"
- label=""
- tool_tip="Click to select an image"
- top="0"
- left="0"
- width="272" />
- </panel>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="15"
- font="SansSerifSmall"
- font.style="BOLD"
- layout="topleft"
- left="10"
- top="215"
- name="Name:"
- text_color="white"
- width="280">
- Title:
- </text>
- <line_editor
- follows="left|top|right"
- font="SansSerif"
- height="20"
- layout="topleft"
- left="10"
- top_pad="2"
- max_length_bytes="30"
- name="classified_name"
- prevalidate_callback="ascii"
- text_color="black"
- width="273" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="15"
- font="SansSerifSmall"
- font.style="BOLD"
- layout="topleft"
- left="10"
- top_pad="20"
- name="description_label"
- text_color="white"
- width="280">
- Description:
- </text>
- <text_editor
- follows="left|top|right"
- height="100"
- width="273"
- layout="topleft"
- left="10"
- top_pad="2"
- max_length="256"
- name="classified_desc"
- text_color="black"
- word_wrap="true" />
- <text
- type="string"
- length="1"
- font="SansSerifSmall"
- font.style="BOLD"
- follows="left|top"
- height="15"
- layout="topleft"
- left="10"
- name="location_label"
- text_color="white"
- top_pad="20"
- width="280">
- Location:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="30"
- layout="topleft"
- left="10"
- name="classified_location"
- right="-10"
- top_pad="2"
- width="280"
- word_wrap="true">
- loading...
- </text>
- <button
- follows="left|top"
- height="23"
- label="Set to Current Location"
- layout="topleft"
- left="10"
- top_pad="5"
- name="set_to_curr_location_btn"
- width="200" />
- <text
- follows="left|top"
- font.style="BOLD"
- height="10"
- layout="topleft"
- left="10"
- name="category_label"
- text_color="white"
- top_pad="15"
- value="Category:"
- width="250" />
- <combo_box
- follows="left|top"
- height="23"
- label=""
- left="10"
- name="category"
- top_pad="5"
- width="156" />
- <text
- follows="left|top"
- font.style="BOLD"
- height="10"
- layout="topleft"
- left="10"
- name="content_type_label"
- text_color="white"
- top_pad="15"
- value="Content type:"
- width="250" />
- <icons_combo_box
- follows="left|top"
- height="23"
- label="General Content"
- layout="topleft"
- left="10"
- name="content_type"
- top_pad="5"
- width="156">
- <icons_combo_box.drop_down_button
- image_overlay="Parcel_PG_Light"
- image_overlay_alignment="left"
- imgoverlay_label_space="3"
- pad_left="3"/>
- <icons_combo_box.item
- label="Moderate Content"
- name="mature_ci"
- value="Mature">
- <item.columns
- halign="center"
- type="icon"
- value="Parcel_M_Light"
- width="20"/>
- </icons_combo_box.item>
- <icons_combo_box.item
- label="General Content"
- name="pg_ci"
- value="PG">
- <item.columns
- halign="center"
- type="icon"
- value="Parcel_PG_Light"
- width="20"/>
- </icons_combo_box.item>
- </icons_combo_box>
- <check_box
- height="16"
- label="Auto renew each week"
- layout="topleft"
- left="10"
- name="auto_renew"
- top_pad="15"
- width="250" />
- <text
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="price_for_listing_label"
- text_color="white"
- top_pad="15"
- value="Price for listing:"
- width="250" />
- <spinner
- decimal_digits="0"
- follows="left|top"
- halign="left"
- height="23"
- increment="1"
- label_width="20"
- label="L$"
- v_pad="10"
- layout="topleft"
- left="10"
- value="50"
- min_val="50"
- max_val="99999"
- name="price_for_listing"
- top_pad="5"
- tool_tip="Price for listing."
- width="105" />
- </panel>
- </scroll_container>
- <panel
- follows="left|right|bottom"
- height="23"
- label="bottom_panel"
- layout="topleft"
- left="8"
- name="bottom_panel"
- top_pad="5"
- width="303">
-
- <layout_stack
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- name="bottom_panel_ls"
- left="1"
- orientation="horizontal"
- top_pad="0"
- width="309">
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left="0"
- name="save_changes_btn_lp"
- auto_resize="true"
- width="156">
- <button
- follows="bottom|left|right"
- height="23"
- label="[LABEL]"
- layout="topleft"
- name="save_changes_btn"
- left="1"
- top="0"
- width="155" />
- </layout_panel>
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left_pad="3"
- name="cancel_btn_lp"
- auto_resize="true"
- width="157">
- <button
- follows="bottom|left|right"
- height="23"
- label="Cancel"
- layout="topleft"
- name="cancel_btn"
- left="1"
- top="0"
- width="156" />
- </layout_panel>
- </layout_stack>
- </panel>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml
deleted file mode 100644
index 357a5559bf..0000000000
--- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml
+++ /dev/null
@@ -1,239 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<panel
- background_visible="true"
- bevel_style="in"
- follows="left|top|right|bottom"
- height="569"
- label="Edit Pick"
- layout="topleft"
- left="0"
- min_height="350"
- name="panel_edit_pick"
- help_topic="profile_edit_pick"
- top="0"
- width="333">
- <panel.string
- name="location_notice">
- (will update after save)
- </panel.string>
- <button
- follows="top|left"
- height="24"
- image_hover_unselected="BackButton_Over"
- image_pressed="BackButton_Press"
- image_unselected="BackButton_Off"
- layout="topleft"
- name="back_btn"
- left="10"
- tab_stop="false"
- top="4"
- width="30"
- use_draw_context_alpha="false" />
- <text
- type="string"
- length="1"
- follows="top"
- font="SansSerifHugeBold"
- height="26"
- layout="topleft"
- left_pad="4"
- name="title"
- text_color="LtGray"
- top="4"
- width="250">
- Edit Pick
- </text>
- <scroll_container
- color="DkGray2"
- follows="all"
- height="501"
- layout="topleft"
- left="8"
- top_pad="9"
- name="profile_scroll"
- opaque="true"
- width="312">
- <panel
- name="scroll_content_panel"
- follows="left|top|right"
- min_height="300"
- layout="topleft"
- top="0"
- background_visible="false"
- height="500"
- left="0"
- width="285">
- <texture_picker
- fallback_image="default_land_picture.j2c"
- follows="left|top|right"
- height="197"
- width="272"
- layout="topleft"
- no_commit_on_selection="true"
- top="10"
- left="11"
- name="pick_snapshot" />
- <icon
- height="197"
- image_name="spacer24.tga"
- layout="topleft"
- name="edit_icon"
- label=""
- tool_tip="Click to select an image"
- top="10"
- left="11"
- width="286" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- height="15"
- font="SansSerifSmall"
- font.style="BOLD"
- layout="topleft"
- left="10"
- top="215"
- name="Name:"
- text_color="white"
- width="280">
- Title:
- </text>
- <line_editor
- follows="left|top|right"
- font="SansSerif"
- height="20"
- layout="topleft"
- left="10"
- top_pad="2"
- max_length_bytes="63"
- name="pick_name"
- text_color="black"
- width="273" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- height="15"
- font="SansSerifSmall"
- font.style="BOLD"
- layout="topleft"
- left="10"
- top_pad="20"
- name="description_label"
- text_color="white"
- width="280">
- Description:
- </text>
- <text_editor
- follows="left|top|right"
- height="100"
- width="273"
- hide_scrollbar="false"
- layout="topleft"
- left="10"
- top_pad="2"
- max_length="1023"
- name="pick_desc"
- spellcheck="true"
- text_color="black"
- word_wrap="true" />
- <text
- type="string"
- length="1"
- font="SansSerifSmall"
- font.style="BOLD"
- follows="left|top|right"
- height="15"
- layout="topleft"
- left="10"
- name="location_label"
- text_color="white"
- top_pad="20"
- width="280">
- Location:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top|right"
- height="50"
- layout="topleft"
- left="10"
- name="pick_location"
- top_pad="2"
- width="280"
- word_wrap="true">
- loading...
- </text>
- <button
- follows="left|top"
- height="23"
- label="Set to Current Location"
- layout="topleft"
- left="8"
- top_pad="0"
- name="set_to_curr_location_btn"
- width="200" />
- </panel>
- </scroll_container>
- <panel
- follows="left|right|bottom"
- height="23"
- label="bottom_panel"
- layout="topleft"
- left="8"
- name="bottom_panel"
- top_pad="5"
- width="315">
-
- <layout_stack
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- name="layout_stack1"
- left="0"
- orientation="horizontal"
- top_pad="0"
- width="313">
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- left="0"
- name="layout_panel1"
- auto_resize="true"
- width="150">
- <button
- follows="bottom|left|right"
- height="23"
- label="Save Pick"
- layout="topleft"
- name="save_changes_btn"
- top="0"
- left="1"
- width="149" />
- </layout_panel>
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- left_pad="4"
- name="layout_panel2"
- auto_resize="true"
- width="146">
- <button
- follows="bottom|left|right"
- height="23"
- label="Cancel"
- layout="topleft"
- name="cancel_btn"
- top="0"
- left="1"
- width="145" />
- </layout_panel>
- </layout_stack>
-
- </panel>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml
deleted file mode 100644
index 99c47eb825..0000000000
--- a/indra/newview/skins/default/xui/en/panel_pick_info.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<?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="panel_pick_info"
- help_topic="profile_pick_info"
- top="0"
- width="333">
- <button
- follows="top|left"
- height="24"
- image_hover_unselected="BackButton_Over"
- image_pressed="BackButton_Press"
- image_unselected="BackButton_Off"
- layout="topleft"
- name="back_btn"
- left="10"
- tab_stop="false"
- top="2"
- width="30"
- use_draw_context_alpha="false" />
- <text
- follows="top|left|right"
- font="SansSerifHugeBold"
- height="26"
- layout="topleft"
- left_pad="4"
- name="title"
- text_color="LtGray"
- top="2"
- value="Pick Info"
- use_ellipses="true"
- width="275" />
- <scroll_container
- color="DkGray2"
- opaque="true"
- follows="all"
- height="503"
- layout="topleft"
- left="8"
- top_pad="10"
- name="profile_scroll"
- width="312">
- <panel
- name="scroll_content_panel"
- follows="left|top|right"
- min_height="300"
- layout="topleft"
- top="0"
- background_visible="false"
- height="400"
- left="0"
- width="285">
- <texture_picker
- fallback_image="default_land_picture.j2c"
- enabled="false"
- follows="left|top|right"
- height="197"
- layout="topleft"
- left="11"
- name="pick_snapshot"
- top="10"
- width="272" />
- <text_editor
- allow_scroll="false"
- bg_visible="false"
- follows="left|top|right"
- h_pad="0"
- height="35"
- width="280"
- layout="topleft"
- font="SansSerifBig"
- font.style="BOLD"
- left="10"
- top_pad="10"
- name="pick_name"
- read_only="true"
- text_color="white"
- v_pad="0"
- value="[name]"
- use_ellipses="true" />
- <text_editor
- allow_scroll="false"
- bg_visible="false"
- follows="left|top|right"
- h_pad="0"
- height="25"
- layout="topleft"
- left="10"
- name="pick_location"
- read_only="true"
- width="280"
- word_wrap="true"
- v_pad="0"
- value="[loading...]" />
- <text_editor
- bg_readonly_color="DkGray2"
- follows="all"
- height="100"
- width="280"
- parse_urls="true"
- layout="topleft"
- left="10"
- top_pad="2"
- max_length="1023"
- name="pick_desc"
- read_only="true"
- text_readonly_color="white"
- value="[description]"
- wrap="true" />
- </panel>
- </scroll_container>
- <panel
- follows="left|right|bottom"
- height="23"
- layout="topleft"
- top_pad="5"
- left="8"
- name="buttons">
-
- <layout_stack
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- name="layout_stack1"
- left="0"
- orientation="horizontal"
- top_pad="0"
- width="312">
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left="0"
- name="layout_panel1"
- auto_resize="true"
- width="101">
- <button
- follows="bottom|left|right"
- height="23"
- label="Teleport"
- layout="topleft"
- name="teleport_btn"
- top="0"
- width="101" />
- </layout_panel>
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left_pad="3"
- name="show_on_map_btn_lp"
- auto_resize="true"
- width="100">
- <button
- follows="bottom|left|right"
- height="23"
- label="Map"
- layout="topleft"
- name="show_on_map_btn"
- top_pad="0"
- width="100" />
- </layout_panel>
-
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left_pad="3"
- name="edit_btn_lp"
- auto_resize="true"
- width="101">
- <button
- follows="bottom|left|right"
- height="23"
- label="Edit"
- layout="topleft"
- name="edit_btn"
- top_pad="0"
- width="101" />
- </layout_panel>
- </layout_stack>
- </panel>
-</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_classified.xml b/indra/newview/skins/default/xui/en/panel_profile_classified.xml
index 60b13c0bc2..e4627309b3 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_classified.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_classified.xml
@@ -78,7 +78,7 @@
left="0"
height="562"
width="290"
- follows="left|top"
+ follows="left|top|right"
layout="topleft"
background_visible="false"
min_height="200"
@@ -88,9 +88,9 @@
enabled="false"
top="0"
left="10"
- height="197"
- width="275"
- follows="left|top|right"
+ height="161"
+ width="260"
+ follows="left|top"
layout="topleft"
fallback_image="default_land_picture.j2c"
/>
@@ -109,7 +109,7 @@
/>
<layout_stack
name="info_panel"
- top="180"
+ top="145"
left="0"
height="375"
width="320"
diff --git a/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml b/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml
index 3dfa0a58df..e73bb91506 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_classifieds.xml
@@ -74,7 +74,7 @@
layout="topleft"
halign="left"
tab_position="left"
- tab_width="85"
+ tab_width="150"
use_ellipses="true"
/>