summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofile.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-10-04 06:08:09 +0800
committerErik Kundiman <erik@megapahit.org>2023-10-04 06:08:09 +0800
commita332b8faefef8a044a2409957b415b62d6a85181 (patch)
treee76c2d8c9500c700d2d45ea1b4708747854f2f7d /indra/newview/llpanelprofile.cpp
parentbdfd8198eb8fe7128230d562fe37eafac5c52bec (diff)
parentf352fd1090ce4d50db349cdadfa61d66783a20e8 (diff)
Merge tag '6.6.15-release'
source for viewer 6.6.15.581961
Diffstat (limited to 'indra/newview/llpanelprofile.cpp')
-rw-r--r--indra/newview/llpanelprofile.cpp59
1 files changed, 18 insertions, 41 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 7aabd5247a..3333c832d2 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -71,6 +71,7 @@
#include "llpanelblockedlist.h"
#include "llpanelprofileclassifieds.h"
#include "llpanelprofilepicks.h"
+#include "llthumbnailctrl.h"
#include "lltrans.h"
#include "llviewercontrol.h"
#include "llviewermenu.h" //is_agent_mappable
@@ -366,7 +367,7 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri
httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- LL_WARNS("AvatarProperties") << result << LL_ENDL;
+ LL_DEBUGS("AvatarProperties") << result << LL_ENDL;
if (!status)
{
@@ -913,7 +914,7 @@ BOOL LLPanelProfileSecondLife::postBuild()
{
mGroupList = getChild<LLGroupList>("group_list");
mShowInSearchCombo = getChild<LLComboBox>("show_in_search");
- mSecondLifePic = getChild<LLIconCtrl>("2nd_life_pic");
+ mSecondLifePic = getChild<LLThumbnailCtrl>("2nd_life_pic");
mSecondLifePicLayout = getChild<LLPanel>("image_panel");
mDescriptionEdit = getChild<LLTextEditor>("sl_description_edit");
mAgentActionMenuButton = getChild<LLMenuButton>("agent_actions_menu");
@@ -1497,7 +1498,6 @@ void LLPanelProfileSecondLife::setLoaded()
}
-
class LLProfileImagePicker : public LLFilePickerThread
{
public:
@@ -1544,15 +1544,20 @@ void LLProfileImagePicker::notify(const std::vector<std::string>& filenames)
const S32 MAX_DIM = 256;
if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, MAX_DIM))
{
- //todo: image not supported notification
- LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", failed to open image" << LL_ENDL;
+ LLSD notif_args;
+ notif_args["REASON"] = LLImage::getLastError().c_str();
+ LLNotificationsUtil::add("CannotUploadTexture", notif_args);
+ LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)mType << ", " << notif_args["REASON"].asString() << LL_ENDL;
return;
}
std::string cap_url = gAgent.getRegionCapability(PROFILE_IMAGE_UPLOAD_CAP);
if (cap_url.empty())
{
- LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", no cap found" << LL_ENDL;
+ LLSD args;
+ args["CAPABILITY"] = PROFILE_IMAGE_UPLOAD_CAP;
+ LLNotificationsUtil::add("RegionCapabilityRequestError", args);
+ LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)mType << ", no cap found" << LL_ENDL;
return;
}
@@ -1955,30 +1960,16 @@ void LLPanelProfileSecondLife::onShowTexturePicker()
mFloaterTexturePickerHandle = texture_floaterp->getHandle();
- texture_floaterp->setOnFloaterCommitCallback([this](LLTextureCtrl::ETexturePickOp op, LLUUID id)
+ texture_floaterp->setOnFloaterCommitCallback([this](LLTextureCtrl::ETexturePickOp op, LLPickerSource source, const LLUUID& asset_id, const LLUUID&)
{
if (op == LLTextureCtrl::TEXTURE_SELECT)
{
- LLUUID image_asset_id;
- LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterTexturePickerHandle.get();
- if (floaterp)
- {
- if (id.notNull())
- {
- image_asset_id = id;
- }
- else
- {
- image_asset_id = floaterp->getAssetID();
- }
- }
-
- onCommitProfileImage(image_asset_id);
+ onCommitProfileImage(asset_id);
}
});
texture_floaterp->setLocalTextureEnabled(FALSE);
texture_floaterp->setBakeTextureEnabled(FALSE);
- texture_floaterp->setCanApply(false, true);
+ texture_floaterp->setCanApply(false, true, false);
parent_floater->addDependentFloater(mFloaterTexturePickerHandle);
@@ -2193,7 +2184,7 @@ LLPanelProfileFirstLife::~LLPanelProfileFirstLife()
BOOL LLPanelProfileFirstLife::postBuild()
{
mDescriptionEdit = getChild<LLTextEditor>("fl_description_edit");
- mPicture = getChild<LLIconCtrl>("real_world_pic");
+ mPicture = getChild<LLThumbnailCtrl>("real_world_pic");
mUploadPhoto = getChild<LLButton>("fl_upload_image");
mChangePhoto = getChild<LLButton>("fl_change_image");
@@ -2296,29 +2287,15 @@ void LLPanelProfileFirstLife::onChangePhoto()
mFloaterTexturePickerHandle = texture_floaterp->getHandle();
- texture_floaterp->setOnFloaterCommitCallback([this](LLTextureCtrl::ETexturePickOp op, LLUUID id)
+ texture_floaterp->setOnFloaterCommitCallback([this](LLTextureCtrl::ETexturePickOp op, LLPickerSource source, const LLUUID& asset_id, const LLUUID&)
{
if (op == LLTextureCtrl::TEXTURE_SELECT)
{
- LLUUID image_asset_id;
- LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterTexturePickerHandle.get();
- if (floaterp)
- {
- if (id.notNull())
- {
- image_asset_id = id;
- }
- else
- {
- image_asset_id = floaterp->getAssetID();
- }
- }
-
- onCommitPhoto(image_asset_id);
+ onCommitPhoto(asset_id);
}
});
texture_floaterp->setLocalTextureEnabled(FALSE);
- texture_floaterp->setCanApply(false, true);
+ texture_floaterp->setCanApply(false, true, false);
parent_floater->addDependentFloater(mFloaterTexturePickerHandle);