summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-12 21:46:53 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-12 21:46:53 +0300
commit1483c05c9f61e7ce44e8883d8e10d976867882fa (patch)
tree5a0cc952ba337914e57c2596065e22342419e523 /indra/newview
parentf42dba8d928da51ee93eae4e15b64280bfcf7ffd (diff)
SL-15312 Legacy profiles remake #5
Mostly changes for notes tab and first life tab
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterprofile.cpp11
-rw-r--r--indra/newview/llfloaterprofile.h4
-rw-r--r--indra/newview/llpanelprofile.cpp388
-rw-r--r--indra/newview/llpanelprofile.h51
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_firstlife.xml20
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_notes.xml21
6 files changed, 223 insertions, 272 deletions
diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp
index 0a775f217a..b259bd28f5 100644
--- a/indra/newview/llfloaterprofile.cpp
+++ b/indra/newview/llfloaterprofile.cpp
@@ -80,17 +80,6 @@ void LLFloaterProfile::showClassified(const LLUUID& classified_id, bool edit)
mPanelProfile->showClassified(classified_id, edit);
}
-void LLFloaterProfile::onOKBtn()
-{
- mPanelProfile->apply();
- closeFloater();
-}
-
-void LLFloaterProfile::onCancelBtn()
-{
- closeFloater();
-}
-
void LLFloaterProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
{
mNameCallbackConnection.disconnect();
diff --git a/indra/newview/llfloaterprofile.h b/indra/newview/llfloaterprofile.h
index 22ed47e54f..3026f174fb 100644
--- a/indra/newview/llfloaterprofile.h
+++ b/indra/newview/llfloaterprofile.h
@@ -47,10 +47,6 @@ public:
void showClassified(const LLUUID& classified_id = LLUUID::null, bool edit = false);
-protected:
- void onOKBtn();
- void onCancelBtn();
-
private:
LLAvatarNameCache::callback_connection_t mNameCallbackConnection;
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index c00e25a31d..b7bc1e2cba 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -195,10 +195,7 @@ void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id)
LLPanelProfileFirstLife *panel_first = dynamic_cast<LLPanelProfileFirstLife*>(panel);
if (panel_first)
{
- panel_first->mCurrentDescription = avatar_data->fl_about_text;
- panel_first->mDescriptionEdit->setValue(panel_first->mCurrentDescription);
- panel_first->mPicture->setValue(avatar_data->fl_image_id);
- panel_first->updateButtons();
+ panel_first->processProperties(avatar_data);
}
// Picks
@@ -399,26 +396,39 @@ void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::s
LLUUID result = post_profile_image(cap_url, data, path_to_image, handle);
// reset loading indicator
- switch (type)
+ if (!handle->isDead())
{
- case PROFILE_IMAGE_SL:
- if (!handle->isDead())
+ switch (type)
{
- LLPanelProfileSecondLife* panel = static_cast<LLPanelProfileSecondLife*>(handle->get());
- if (result.notNull())
+ case PROFILE_IMAGE_SL:
{
- panel->setProfileImageUploaded(result);
+ LLPanelProfileSecondLife* panel = static_cast<LLPanelProfileSecondLife*>(handle->get());
+ if (result.notNull())
+ {
+ panel->setProfileImageUploaded(result);
+ }
+ else
+ {
+ // failure, just stop progress indicator
+ panel->setProfileImageUploading(false);
+ }
+ break;
}
- else
+ case PROFILE_IMAGE_FL:
{
- // failure, just stop progress indicator
- panel->setProfileImageUploading(false);
+ LLPanelProfileFirstLife* panel = static_cast<LLPanelProfileFirstLife*>(handle->get());
+ if (result.notNull())
+ {
+ panel->setProfileImageUploaded(result);
+ }
+ else
+ {
+ // failure, just stop progress indicator
+ panel->setProfileImageUploading(false);
+ }
+ break;
}
}
- break;
- case PROFILE_IMAGE_FL:
- // Todo: refresh the panel
- break;
}
// Cleanup
@@ -426,30 +436,6 @@ void post_profile_image_coro(std::string cap_url, EProfileImageType type, std::s
delete handle;
}
-void launch_profile_image_coro(EProfileImageType type, const std::string &file_path, LLHandle<LLPanel> *handle)
-{
- std::string cap_url = gAgent.getRegionCapability(PROFILE_IMAGE_UPLOAD_CAP);
- if (!cap_url.empty())
- {
- // todo: createUploadFile needs to be done when user picks up a file,
- // not when user clicks 'ok', but coroutine should happen on 'ok'.
- // but this waits for a UI update, the main point is a functional coroutine
- std::string temp_file = gDirUtilp->getTempFilename();
- U32 codec = LLImageBase::getCodecFromExtension(gDirUtilp->getExtension(file_path));
- const S32 MAX_DIM = 256;
-
- if (LLViewerTextureList::createUploadFile(file_path, temp_file, codec, MAX_DIM))
- {
- LLCoros::instance().launch("postAgentUserImageCoro",
- boost::bind(post_profile_image_coro, cap_url, type, temp_file, handle));
- }
- }
- else
- {
- LL_WARNS("AvatarProperties") << "Failed to upload profile image of type " << (S32)PROFILE_IMAGE_SL << ", no cap found" << LL_ENDL;
- }
-}
-
//////////////////////////////////////////////////////////////////////////
// LLProfileHandler
@@ -682,14 +668,9 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
mDescriptionEdit->setParseHTML(!own_profile && !getEmbedded());
- LLProfileDropTarget* drop_target = getChild<LLProfileDropTarget>("drop_target");
- drop_target->setVisible(!own_profile);
- drop_target->setEnabled(!own_profile);
-
if (!own_profile)
{
mVoiceStatus = LLAvatarActions::canCall() && (LLAvatarActions::isFriend(avatar_id) ? LLAvatarTracker::instance().isBuddyOnline(avatar_id) : TRUE);
- drop_target->setAgentID(avatar_id);
updateOnlineStatus();
}
@@ -698,45 +679,6 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCache, this, _1, _2));
}
-// todo:: remove apply
-void LLPanelProfileSecondLife::apply(LLAvatarData* data)
-{
- if (getIsLoaded() && getSelfProfile())
- {
- // Might be a better idea to accumulate changes in floater
- // instead of sending a request per tab
-
- LLSD params = LLSDMap();
- // we have an image, check if it is local. Server won't recognize local ids.
- if (data->image_id != mImageAssetId
- && !LLLocalBitmapMgr::getInstance()->isLocal(mImageAssetId))
- {
- params["sl_image_id"] = mImageAssetId;
- }
- if (data->about_text != mDescriptionEdit->getValue().asString())
- {
- params["sl_about_text"] = mDescriptionEdit->getValue().asString();
- }
- if ((bool)data->allow_publish != mShowInSearchCheckbox->getValue().asBoolean())
- {
- params["allow_publish"] = mShowInSearchCheckbox->getValue().asBoolean();
- }
- if (!params.emptyMap())
- {
- std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
- if (!cap_url.empty())
- {
- LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
- }
- else
- {
- LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL;
- }
- }
- }
-}
-
void LLPanelProfileSecondLife::updateData()
{
LLUUID avatar_id = getAvatarId();
@@ -846,7 +788,7 @@ void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const L
mAvatarNameCacheConnection.disconnect();
// Should be possible to get this from AgentProfile capability
getChild<LLUICtrl>("display_name")->setValue( av_name.getDisplayName() );
- getChild<LLUICtrl>("user_name")->setValue(av_name.getUserName() );
+ getChild<LLUICtrl>("user_name")->setValue(av_name.getAccountName());
}
void LLPanelProfileSecondLife::setProfileImageUploading(bool loading)
@@ -888,10 +830,17 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data)
LLStringUtil::format_map_t args;
args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now());
std::string register_date = getString("AgeFormat", args);
- getChild<LLUICtrl>("user_age")->setValue(register_date );
+ getChild<LLUICtrl>("user_age")->setValue(register_date);
setDescriptionText(avatar_data->about_text);
- mImageAssetId = avatar_data->image_id;
- mSecondLifePic->setValue(mImageAssetId);
+
+ if (avatar_data->image_id.notNull())
+ {
+ mSecondLifePic->setValue(avatar_data->image_id);
+ }
+ else
+ {
+ mSecondLifePic->setValue("Generic_Person_Large");
+ }
// Will be loaded as a LLViewerFetchedTexture::BOOST_UI due to mSecondLifePic
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(avatar_data->image_id);
@@ -1227,7 +1176,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata)
else if (item_name == "remove_photo")
{
LLSD params;
- params["sl_image_id"] = LLUUID::null; // todo: verify that it works and matches Generic_Person_Large
+ params["sl_image_id"] = LLUUID::null;
std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
if (!cap_url.empty())
@@ -1351,25 +1300,20 @@ void LLPanelProfileSecondLife::onSetDescriptionDirty()
void LLPanelProfileSecondLife::onSaveDescriptionChanges()
{
- // todo: force commit changes in mDescriptionEdit, reset dirty flags
- // todo: check if mDescriptionEdit can be made to not commit immediately
-
mDescriptionText = mDescriptionEdit->getValue().asString();
- LLSD params;
- params["sl_about_text"] = mDescriptionText;
-
std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
if (!cap_url.empty())
{
LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("sl_about_text", mDescriptionText)));
}
else
{
LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL;
}
- updateButtons();
+ mSaveDescriptionChanges->setEnabled(FALSE);
+ mDiscardDescriptionChanges->setEnabled(FALSE);
}
void LLPanelProfileSecondLife::onDiscardDescriptionChanges()
@@ -1430,11 +1374,6 @@ void LLPanelProfileWeb::resetData()
mWebBrowser->navigateHome();
}
-void LLPanelProfileWeb::apply(LLAvatarData* data)
-{
-
-}
-
void LLPanelProfileWeb::updateData()
{
LLUUID avatar_id = getAvatarId();
@@ -1547,8 +1486,7 @@ void LLPanelProfileWeb::updateButtons()
//////////////////////////////////////////////////////////////////////////
LLPanelProfileFirstLife::LLPanelProfileFirstLife()
- : LLPanelProfileTab(),
- mIsEditing(false)
+ : LLPanelProfileTab()
{
}
@@ -1559,14 +1497,18 @@ LLPanelProfileFirstLife::~LLPanelProfileFirstLife()
BOOL LLPanelProfileFirstLife::postBuild()
{
mDescriptionEdit = getChild<LLTextEditor>("fl_description_edit");
- mPicture = getChild<LLTextureCtrl>("real_world_pic");
+ mPicture = getChild<LLIconCtrl>("real_world_pic");
mChangePhoto = getChild<LLButton>("fl_upload_image");
mRemovePhoto = getChild<LLButton>("fl_remove_image");
mSaveChanges = getChild<LLButton>("fl_save_changes");
mDiscardChanges = getChild<LLButton>("fl_discard_changes");
- mDescriptionEdit->setFocusReceivedCallback(boost::bind(&LLPanelProfileFirstLife::onDescriptionFocusReceived, this));
+ mChangePhoto->setCommitCallback([this](LLUICtrl*, void*) { onChangePhoto(); }, nullptr);
+ mRemovePhoto->setCommitCallback([this](LLUICtrl*, void*) { onRemovePhoto(); }, nullptr);
+ mSaveChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveDescriptionChanges(); }, nullptr);
+ mDiscardChanges->setCommitCallback([this](LLUICtrl*, void*) { onDiscardDescriptionChanges(); }, nullptr);
+ mDescriptionEdit->setKeystrokeCallback([this](LLTextEditor* caller) { onSetDescriptionDirty(); });
return TRUE;
}
@@ -1578,15 +1520,82 @@ void LLPanelProfileFirstLife::onOpen(const LLSD& key)
resetData();
}
+void LLPanelProfileFirstLife::setProfileImageUploading(bool loading)
+{
+ mChangePhoto->setEnabled(loading);
+ mRemovePhoto->setEnabled(loading);
+
+ // Todo: loading indicator here
+}
+
+void LLPanelProfileFirstLife::setProfileImageUploaded(const LLUUID &image_asset_id)
+{
+ mPicture->setValue(image_asset_id);
+ mChangePhoto->setEnabled(TRUE);
+ mRemovePhoto->setEnabled(TRUE);
+
+ // Todo: reset loading indicator here
+}
+
+void LLPanelProfileFirstLife::onChangePhoto()
+{
+ (new LLProfileImagePicker(PROFILE_IMAGE_FL, new LLHandle<LLPanel>(getHandle())))->getFile();
+}
+
+void LLPanelProfileFirstLife::onRemovePhoto()
+{
+ LLSD params;
+ params["fl_image_id"] = LLUUID::null;
+
+ std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
+ if (!cap_url.empty())
+ {
+ LLCoros::instance().launch("putAgentUserInfoCoro",
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
+
+ mPicture->setValue("Generic_Person_Large");
+ }
+ else
+ {
+ LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL;
+ }
+}
+
+void LLPanelProfileFirstLife::setDescriptionText(const std::string &text)
+{
+ mSaveChanges->setEnabled(FALSE);
+ mDiscardChanges->setEnabled(FALSE);
+ mCurrentDescription = text;
+ mDescriptionEdit->setValue(mCurrentDescription);
+}
+
+void LLPanelProfileFirstLife::onSetDescriptionDirty()
+{
+ mSaveChanges->setEnabled(TRUE);
+ mDiscardChanges->setEnabled(TRUE);
+}
-void LLPanelProfileFirstLife::onDescriptionFocusReceived()
+void LLPanelProfileFirstLife::onSaveDescriptionChanges()
{
- if (!mIsEditing && getSelfProfile())
+ mCurrentDescription = mDescriptionEdit->getValue().asString();
+ std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
+ if (!cap_url.empty())
{
- mIsEditing = true;
- mDescriptionEdit->setParseHTML(false);
- mDescriptionEdit->setText(mCurrentDescription);
+ LLCoros::instance().launch("putAgentUserInfoCoro",
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("sl_about_text", mCurrentDescription)));
}
+ else
+ {
+ LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL;
+ }
+
+ mSaveChanges->setEnabled(FALSE);
+ mDiscardChanges->setEnabled(FALSE);
+}
+
+void LLPanelProfileFirstLife::onDiscardDescriptionChanges()
+{
+ setDescriptionText(mCurrentDescription);
}
void LLPanelProfileFirstLife::processProperties(void* data, EAvatarProcessorType type)
@@ -1596,68 +1605,36 @@ void LLPanelProfileFirstLife::processProperties(void* data, EAvatarProcessorType
const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
if (avatar_data && getAvatarId() == avatar_data->avatar_id)
{
- mCurrentDescription = avatar_data->fl_about_text;
- mDescriptionEdit->setValue(mCurrentDescription);
- mPicture->setValue(avatar_data->fl_image_id);
- updateButtons();
+ processProperties(avatar_data);
}
}
}
void LLPanelProfileFirstLife::processProperties(const LLAvatarData* avatar_data)
{
- mCurrentDescription = avatar_data->fl_about_text;
- mDescriptionEdit->setValue(mCurrentDescription);
- mPicture->setValue(avatar_data->fl_image_id);
+ setDescriptionText(avatar_data->fl_about_text);
+ if (avatar_data->fl_image_id.notNull())
+ {
+ mPicture->setValue(avatar_data->fl_image_id);
+ }
+ else
+ {
+ mPicture->setValue("Generic_Person_Large");
+ }
updateButtons();
}
void LLPanelProfileFirstLife::resetData()
{
mDescriptionEdit->setValue(LLStringUtil::null);
- mPicture->setValue(mPicture->getDefaultImageAssetID());
-
+ mPicture->setValue("Generic_Person_Large");
+
mChangePhoto->setVisible(getSelfProfile());
mRemovePhoto->setVisible(getSelfProfile());
mSaveChanges->setVisible(getSelfProfile());
mDiscardChanges->setVisible(getSelfProfile());
}
-void LLPanelProfileFirstLife::apply(LLAvatarData* data)
-{
- LLSD params = LLSDMap();
- if (data->fl_image_id != mPicture->getImageAssetID()
- && !LLLocalBitmapMgr::getInstance()->isLocal(mPicture->getImageAssetID()))
- {
- params["fl_image_id"] = mPicture->getImageAssetID();
- }
- if (data->fl_about_text != mDescriptionEdit->getValue().asString())
- {
- params["fl_about_text"] = mDescriptionEdit->getValue().asString();
- }
- if (!params.emptyMap())
- {
- std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
- if (getIsLoaded() && !cap_url.empty())
- {
- LLCoros::instance().launch("putAgentUserInfoCoro",
- boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), params));
- }
- else
- {
- LL_WARNS("AvatarProperties") << "Failed to upload profile data " << PROFILE_PROPERTIES_CAP << " cap not found" << LL_ENDL;
- }
- }
-
- if (data->fl_image_id != mPicture->getImageAssetID()
- && LLLocalBitmapMgr::getInstance()->isLocal(mPicture->getImageAssetID()))
- {
- // todo: temporary file, connect to UI
- std::string file_path = gDirUtilp->findSkinnedFilename("textures", "icons/Default_Outfit_Photo.png");
- launch_profile_image_coro(PROFILE_IMAGE_FL, file_path, new LLHandle<LLPanel>(getHandle()));
- }
-}
-
void LLPanelProfileFirstLife::updateButtons()
{
LLPanelProfileTab::updateButtons();
@@ -1675,7 +1652,6 @@ void LLPanelProfileFirstLife::updateButtons()
LLPanelProfileNotes::LLPanelProfileNotes()
: LLPanelProfileTab()
-, mAvatarNameCacheConnection()
{
}
@@ -1686,11 +1662,6 @@ LLPanelProfileNotes::~LLPanelProfileNotes()
{
LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
}
-
- if (mAvatarNameCacheConnection.connected())
- {
- mAvatarNameCacheConnection.disconnect();
- }
}
void LLPanelProfileNotes::updateData()
@@ -1715,10 +1686,13 @@ BOOL LLPanelProfileNotes::postBuild()
mMapRights = getChild<LLCheckBoxCtrl>("map_check");
mEditObjectRights = getChild<LLCheckBoxCtrl>("objects_check");
mNotesEditor = getChild<LLTextEditor>("notes_edit");
+ mSaveChanges = getChild<LLButton>("notes_save_changes");
+ mDiscardChanges = getChild<LLButton>("notes_discard_changes");
mEditObjectRights->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitRights, this));
-
- mNotesEditor->setCommitCallback(boost::bind(&LLPanelProfileNotes::onCommitNotes,this));
+ mSaveChanges->setCommitCallback([this](LLUICtrl*, void*) { onSaveNotesChanges(); }, nullptr);
+ mDiscardChanges->setCommitCallback([this](LLUICtrl*, void*) { onDiscardNotesChanges(); }, nullptr);
+ mNotesEditor->setKeystrokeCallback([this](LLTextEditor* caller) { onSetNotesDirty(); });
return TRUE;
}
@@ -1730,14 +1704,6 @@ void LLPanelProfileNotes::onOpen(const LLSD& key)
resetData();
fillRightsData();
-
- mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileNotes::onAvatarNameCache, this, _1, _2));
-}
-
-void LLPanelProfileNotes::apply()
-{
- onCommitNotes();
- applyRights();
}
void LLPanelProfileNotes::fillRightsData()
@@ -1778,6 +1744,43 @@ void LLPanelProfileNotes::onCommitNotes()
}
}
+void LLPanelProfileNotes::setNotesText(const std::string &text)
+{
+ mSaveChanges->setEnabled(FALSE);
+ mDiscardChanges->setEnabled(FALSE);
+ mCurrentNotes = text;
+ mNotesEditor->setValue(mCurrentNotes);
+}
+
+void LLPanelProfileNotes::onSetNotesDirty()
+{
+ mSaveChanges->setEnabled(TRUE);
+ mDiscardChanges->setEnabled(TRUE);
+}
+
+void LLPanelProfileNotes::onSaveNotesChanges()
+{
+ mCurrentNotes = mNotesEditor->getValue().asString();
+ std::string cap_url = gAgent.getRegionCapability(PROFILE_PROPERTIES_CAP);
+ if (!cap_url.empty())
+ {
+ LLCoros::instance().launch("putAgentUserInfoCoro",
+ boost::bind(put_avatar_properties_coro, cap_url, getAvatarId(), LLSD().with("notes", mCurrentNotes)));
+ }
+ else
+ {
+ LL_WARNS("AvatarProperties") << "Failed to update profile data, no cap found" << LL_ENDL;
+ }
+
+ mSaveChanges->setEnabled(FALSE);
+ mDiscardChanges->setEnabled(FALSE);
+}
+
+void LLPanelProfileNotes::onDiscardNotesChanges()
+{
+ setNotesText(mCurrentNotes);
+}
+
void LLPanelProfileNotes::rightsConfirmationCallback(const LLSD& notification,
const LLSD& response)
{
@@ -1875,8 +1878,6 @@ void LLPanelProfileNotes::resetData()
mOnlineStatus->setValue(FALSE);
mMapRights->setValue(FALSE);
mEditObjectRights->setValue(FALSE);
-
- mURLWebProfile.clear();
}
void LLPanelProfileNotes::enableCheckboxes(bool enable)
@@ -1906,23 +1907,6 @@ void LLPanelProfileNotes::setAvatarId(const LLUUID& avatar_id)
}
}
-void LLPanelProfileNotes::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name)
-{
- mAvatarNameCacheConnection.disconnect();
-
- std::string username = av_name.getAccountName();
- if (username.empty())
- {
- username = LLCacheName::buildUsername(av_name.getDisplayName());
- }
- else
- {
- LLStringUtil::replaceChar(username, ' ', '.');
- }
-
- mURLWebProfile = getProfileURL(username, false);
-}
-
//////////////////////////////////////////////////////////////////////////
// LLPanelProfile
@@ -2027,28 +2011,6 @@ void LLPanelProfile::updateData()
}
}
-void LLPanelProfile::apply()
-{
- if (getSelfProfile())
- {
- //KC - AvatarData is spread over 3 different panels
- // collect data from the last 2 and give to the first to save
- mPanelFirstlife->apply(&mAvatarData);
- mPanelWeb->apply(&mAvatarData);
- mPanelSecondlife->apply(&mAvatarData);
-
- mPanelPicks->apply();
- mPanelNotes->apply();
- mPanelClassifieds->apply();
-
- //KC - Classifieds handles this itself
- }
- else
- {
- mPanelNotes->apply();
- }
-}
-
void LLPanelProfile::showPick(const LLUUID& pick_id)
{
if (pick_id.notNull())
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index 345935a091..428f4ce78d 100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -61,6 +61,7 @@ class LLPanelProfileClassifieds;
class LLPanelProfilePicks;
class LLViewerFetchedTexture;
+
/**
* Panel for displaying Avatar's second life related info.
*/
@@ -76,11 +77,6 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
/**
- * Saves changes.
- */
- void apply(LLAvatarData* data);
-
- /**
* LLFriendObserver trigger
*/
virtual void changed(U32 mask);
@@ -190,7 +186,6 @@ private:
bool mVoiceStatus;
bool mWaitingForImageUpload;
std::string mDescriptionText;
- LLUUID mImageAssetId;
boost::signals2::connection mAvatarNameCacheConnection;
};
@@ -216,11 +211,6 @@ public:
void resetData();
/**
- * Saves changes.
- */
- void apply(LLAvatarData* data);
-
- /**
* Loads web profile.
*/
/*virtual*/ void updateData();
@@ -265,25 +255,28 @@ public:
void resetData();
- /**
- * Saves changes.
- */
- void apply(LLAvatarData* data);
+ void setProfileImageUploading(bool loading);
+ void setProfileImageUploaded(const LLUUID &image_asset_id);
friend void request_avatar_properties_coro(std::string cap_url, LLUUID agent_id);
protected:
/*virtual*/ void updateButtons();
- void onDescriptionFocusReceived();
+
+ void onChangePhoto();
+ void onRemovePhoto();
+ void setDescriptionText(const std::string &text);
+ void onSetDescriptionDirty();
+ void onSaveDescriptionChanges();
+ void onDiscardDescriptionChanges();
LLTextEditor* mDescriptionEdit;
- LLTextureCtrl* mPicture;
+ LLIconCtrl* mPicture;
LLButton* mChangePhoto;
LLButton* mRemovePhoto;
LLButton* mSaveChanges;
LLButton* mDiscardChanges;
- bool mIsEditing;
std::string mCurrentDescription;
};
@@ -316,13 +309,6 @@ public:
/*virtual*/ void updateData();
- /**
- * Saves changes.
- */
- virtual void apply();
-
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
-
protected:
/**
* Fills rights data for friends.
@@ -334,6 +320,10 @@ protected:
void onCommitRights();
void onCommitNotes();
void enableCheckboxes(bool enable);
+ void setNotesText(const std::string &text);
+ void onSetNotesDirty();
+ void onSaveNotesChanges();
+ void onDiscardNotesChanges();
void applyRights();
@@ -341,10 +331,10 @@ protected:
LLCheckBoxCtrl* mMapRights;
LLCheckBoxCtrl* mEditObjectRights;
LLTextEditor* mNotesEditor;
+ LLButton* mSaveChanges;
+ LLButton* mDiscardChanges;
- std::string mURLWebProfile;
-
- boost::signals2::connection mAvatarNameCacheConnection;
+ std::string mCurrentNotes;
};
@@ -366,11 +356,6 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
- /**
- * Saves changes.
- */
- void apply();
-
void showPick(const LLUUID& pick_id = LLUUID::null);
bool isPickTabSelected();
bool isNotesTabSelected();
diff --git a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml
index 70063e8fc9..e656fd7b07 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_firstlife.xml
@@ -19,19 +19,15 @@
layout="topleft"
visible="false"
/>
- <texture_picker
+ <icon
name="real_world_pic"
- enabled="false"
- top="10"
- left="6"
- height="225"
- width="202"
+ image_name="Generic_Person_Large"
follows="top|left"
layout="topleft"
- allow_no_texture="true"
- default_image_name="None"
- fallback_image="Generic_Person_Large"
- />
+ top="10"
+ left="8"
+ height="202"
+ width="202"/>
<button
name="fl_upload_image"
label="Change Photo"
@@ -57,7 +53,7 @@
top="220"
left="6"
right="-6"
- height="230"
+ height="224"
follows="all"
layout="topleft"
bg_readonly_color="Transparent"
@@ -73,6 +69,7 @@
right="-108"
height="20"
width="80"
+ enabled="false"
follows="top|right"
layout="topleft"/>
<button
@@ -82,6 +79,7 @@
right="-4"
height="20"
width="100"
+ enabled="false"
follows="top|right"
layout="topleft"/>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_profile_notes.xml b/indra/newview/skins/default/xui/en/panel_profile_notes.xml
index c7dfaa1e67..2d9d513ce0 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_notes.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_notes.xml
@@ -42,6 +42,7 @@
max_length="65530"
word_wrap="true"
/>
+ <!--Placeholder, will be moved into BIO's clickable icons-->
<text
name="status_message2"
value="Allow this avatar to:"
@@ -84,4 +85,24 @@
follows="left|bottom|right"
layout="topleft"
/>
+ <button
+ name="notes_save_changes"
+ label="Save"
+ top="429"
+ right="-108"
+ height="20"
+ width="80"
+ enabled="false"
+ follows="top|right"
+ layout="topleft"/>
+ <button
+ name="notes_discard_changes"
+ label="Discard"
+ top_delta="0"
+ right="-4"
+ height="20"
+ width="100"
+ enabled="false"
+ follows="top|right"
+ layout="topleft"/>
</panel>