summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofile.cpp
diff options
context:
space:
mode:
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 4b8d92c7fd..c2b66e59b5 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
@@ -372,7 +373,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)
{
@@ -927,7 +928,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");
@@ -1511,7 +1512,6 @@ void LLPanelProfileSecondLife::setLoaded()
}
-
class LLProfileImagePicker : public LLFilePickerThread
{
public:
@@ -1558,15 +1558,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;
}
@@ -1969,30 +1974,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);
@@ -2216,7 +2207,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");
@@ -2319,29 +2310,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);