summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2011-04-14 18:27:31 +0000
committerDon Kjer <don@lindenlab.com>2011-04-14 18:27:31 +0000
commit01f4570c795b197e74bfa96139631c43df8d0664 (patch)
tree7c1952cc51adec21025f537281e59f828e75224d /indra/newview/llfloaterpreference.cpp
parent2bf967149626672584b17b53fb5d2e6186f3d896 (diff)
parent88a7262340f2fc5085f4ac6600790518d01292d6 (diff)
Merge with viewer-development
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-xindra/newview/llfloaterpreference.cpp53
1 files changed, 38 insertions, 15 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index ffbb0efad3..1a9d0af9af 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -285,6 +285,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mGotPersonalInfo(false),
mOriginalIMViaEmail(false),
mLanguageChanged(false),
+ mAvatarDataInitialized(false),
mDoubleClickActionDirty(false),
mFavoritesRecordMayExist(false)
{
@@ -343,7 +344,7 @@ void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType t
if ( APT_PROPERTIES == type )
{
const LLAvatarData* pAvatarData = static_cast<const LLAvatarData*>( pData );
- if( pAvatarData && gAgent.getID() == pAvatarData->avatar_id )
+ if (pAvatarData && (gAgent.getID() == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null))
{
storeAvatarProperties( pAvatarData );
processProfileProperties( pAvatarData );
@@ -353,14 +354,19 @@ void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType t
void LLFloaterPreference::storeAvatarProperties( const LLAvatarData* pAvatarData )
{
- mAvatarProperties.avatar_id = gAgent.getID();
- mAvatarProperties.image_id = pAvatarData->image_id;
- mAvatarProperties.fl_image_id = pAvatarData->fl_image_id;
- mAvatarProperties.about_text = pAvatarData->about_text;
- mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
- mAvatarProperties.profile_url = pAvatarData->profile_url;
- mAvatarProperties.flags = pAvatarData->flags;
- mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
+ if (LLStartUp::getStartupState() == STATE_STARTED)
+ {
+ mAvatarProperties.avatar_id = pAvatarData->avatar_id;
+ mAvatarProperties.image_id = pAvatarData->image_id;
+ mAvatarProperties.fl_image_id = pAvatarData->fl_image_id;
+ mAvatarProperties.about_text = pAvatarData->about_text;
+ mAvatarProperties.fl_about_text = pAvatarData->fl_about_text;
+ mAvatarProperties.profile_url = pAvatarData->profile_url;
+ mAvatarProperties.flags = pAvatarData->flags;
+ mAvatarProperties.allow_publish = pAvatarData->flags & AVATAR_ALLOW_PUBLISH;
+
+ mAvatarDataInitialized = true;
+ }
}
void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarData )
@@ -370,15 +376,31 @@ void LLFloaterPreference::processProfileProperties(const LLAvatarData* pAvatarDa
void LLFloaterPreference::saveAvatarProperties( void )
{
- mAvatarProperties.allow_publish = getChild<LLUICtrl>("online_searchresults")->getValue();
- if ( mAvatarProperties.allow_publish )
+ const BOOL allowPublish = getChild<LLUICtrl>("online_searchresults")->getValue();
+
+ if (allowPublish)
{
mAvatarProperties.flags |= AVATAR_ALLOW_PUBLISH;
}
-
- LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
-}
+ //
+ // NOTE: We really don't want to send the avatar properties unless we absolutely
+ // need to so we can avoid the accidental profile reset bug, so, if we're
+ // logged in, the avatar data has been initialized and we have a state change
+ // for the "allow publish" flag, then set the flag to its new value and send
+ // the properties update.
+ //
+ // NOTE: The only reason we can not remove this update altogether is because of the
+ // "allow publish" flag, the last remaining profile setting in the viewer
+ // that doesn't exist in the web profile.
+ //
+ if ((LLStartUp::getStartupState() == STATE_STARTED) && mAvatarDataInitialized && (allowPublish != mAvatarProperties.allow_publish))
+ {
+ mAvatarProperties.allow_publish = allowPublish;
+
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate( &mAvatarProperties );
+ }
+}
BOOL LLFloaterPreference::postBuild()
{
@@ -1355,6 +1377,8 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
mOriginalHideOnlineStatus = true;
}
+ getChild<LLUICtrl>("online_searchresults")->setEnabled(TRUE);
+
getChildView("include_im_in_chat_history")->setEnabled(TRUE);
getChildView("show_timestamps_check_im")->setEnabled(TRUE);
getChildView("friends_online_notify_checkbox")->setEnabled(TRUE);
@@ -1734,7 +1758,6 @@ void LLPanelPreferenceGraphics::draw()
bool enable = hasDirtyChilds();
button_apply->setEnabled(enable);
-
}
}
bool LLPanelPreferenceGraphics::hasDirtyChilds()