From 4ffc6c3fde17de5e18370139274bbd44b1b61a23 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 30 May 2022 22:06:59 +0300 Subject: 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 --- indra/newview/llfloaterclassified.cpp | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 indra/newview/llfloaterclassified.cpp (limited to 'indra/newview/llfloaterclassified.cpp') 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("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 -- cgit v1.3 From c4aa8b1636b92f2b746df4ef319c10679883eb59 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 6 Jun 2022 18:22:57 +0300 Subject: SL-15312 Header fixes fixed 'remove_proto' being active even if there is no photo. --- indra/newview/llfloaterclassified.cpp | 2 +- indra/newview/llfloaterclassified.h | 2 +- indra/newview/llpanelprofile.cpp | 8 +++++++- indra/newview/llpanelprofile.h | 1 + indra/newview/skins/default/xui/en/floater_profile.xml | 2 +- .../newview/skins/default/xui/en/floater_profile_permissions.xml | 2 +- indra/newview/skins/default/xui/en/panel_profile_secondlife.xml | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterclassified.cpp') diff --git a/indra/newview/llfloaterclassified.cpp b/indra/newview/llfloaterclassified.cpp index 58b81153a4..3520b0f67a 100644 --- a/indra/newview/llfloaterclassified.cpp +++ b/indra/newview/llfloaterclassified.cpp @@ -1,6 +1,6 @@ /** * @file llfloaterclassified.cpp - * @brief Avatar profile floater. + * @brief LLFloaterClassified for displaying classifieds. * * $LicenseInfo:firstyear=2022&license=viewerlgpl$ * Second Life Viewer Source Code diff --git a/indra/newview/llfloaterclassified.h b/indra/newview/llfloaterclassified.h index e02dca29d5..2c95d82b2c 100644 --- a/indra/newview/llfloaterclassified.h +++ b/indra/newview/llfloaterclassified.h @@ -1,6 +1,6 @@ /** * @file llfloaterclassified.h - * @brief Avatar profile floater. + * @brief LLFloaterClassified for displaying classifieds. * * $LicenseInfo:firstyear=2022&license=viewerlgpl$ * Second Life Viewer Source Code diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 8db9658837..1542c425ce 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -967,6 +967,8 @@ void LLPanelProfileSecondLife::resetData() // Set default image and 1:1 dimensions for it mSecondLifePic->setValue("Generic_Person_Large"); + mImageId = LLUUID::null; + LLRect imageRect = mSecondLifePicLayout->getRect(); mSecondLifePicLayout->reshape(imageRect.getHeight(), imageRect.getHeight()); @@ -1055,6 +1057,7 @@ void LLPanelProfileSecondLife::setProfileImageUploading(bool loading) void LLPanelProfileSecondLife::setProfileImageUploaded(const LLUUID &image_asset_id) { mSecondLifePic->setValue(image_asset_id); + mImageId = image_asset_id; LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(image_asset_id); if (imagep->getFullHeight()) @@ -1120,10 +1123,12 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) if (avatar_data->image_id.notNull()) { mSecondLifePic->setValue(avatar_data->image_id); + mImageId = avatar_data->image_id; } else { mSecondLifePic->setValue("Generic_Person_Large"); + mImageId = LLUUID::null; } // Will be loaded as a LLViewerFetchedTexture::BOOST_UI due to mSecondLifePic @@ -1523,6 +1528,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params)); mSecondLifePic->setValue("Generic_Person_Large"); + mImageId = LLUUID::null; } else { @@ -1581,7 +1587,7 @@ bool LLPanelProfileSecondLife::onEnableMenu(const LLSD& userdata) else if (item_name == "remove_photo") { std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP); - return !cap_url.empty() && !mWaitingForImageUpload; + return mImageId.notNull() && !cap_url.empty() && !mWaitingForImageUpload; } return false; diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 19ce92a2d4..549e84b1fa 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -209,6 +209,7 @@ private: bool mWaitingForImageUpload; bool mAllowPublish; std::string mDescriptionText; + LLUUID mImageId; boost::signals2::connection mAvatarNameCacheConnection; }; diff --git a/indra/newview/skins/default/xui/en/floater_profile.xml b/indra/newview/skins/default/xui/en/floater_profile.xml index 61347c7348..32ab811a6e 100644 --- a/indra/newview/skins/default/xui/en/floater_profile.xml +++ b/indra/newview/skins/default/xui/en/floater_profile.xml @@ -31,7 +31,7 @@ follows="all" layout="topleft" halign="center" - tab_min_width="70" + tab_min_width="81" tab_height="30" tab_position="top" > diff --git a/indra/newview/skins/default/xui/en/floater_profile_permissions.xml b/indra/newview/skins/default/xui/en/floater_profile_permissions.xml index 62cf9b3272..9f3b4d9a00 100644 --- a/indra/newview/skins/default/xui/en/floater_profile_permissions.xml +++ b/indra/newview/skins/default/xui/en/floater_profile_permissions.xml @@ -9,7 +9,7 @@ bg_alpha_image="Window_NoTitle_Background" height="115" layout="topleft" - name="profile_permissiona" + name="profile_permissions" width="300">