summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorKartic Krishnamurthy <drunkensufi@lindenlab.com>2007-07-18 01:28:59 +0000
committerKartic Krishnamurthy <drunkensufi@lindenlab.com>2007-07-18 01:28:59 +0000
commite1ab7d8a30cc40cbd1d471c67def21508c82ff49 (patch)
tree3f834cc8207ea481f6caf820738c8cbf5388bc9a /indra/newview
parent7964c6f7a5b622d698f7d471690b29122966b1b2 (diff)
svn merge -r63705:65463 svn+ssh://svn/svn/linden/branches/dpo-3-bug-fix
NOTE: r63705 is *not* the earliest rev# for dpo-3-bug-fix.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelavatar.cpp27
-rw-r--r--indra/newview/llpanelavatar.h18
2 files changed, 35 insertions, 10 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index daea084759..2567684fa9 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -71,6 +71,7 @@ BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
// RN: move these to lldbstrings.h
static const S32 DB_USER_FAVORITES_STR_LEN = 254;
+const char LOADING_MSG[] = "Loading...";
static const char IM_DISABLED_TOOLTIP[] = "Instant Message (IM).\nDisabled because you do not have their card.";
static const char IM_ENABLED_TOOLTIP[] = "Instant Message (IM)";
static const S32 LEFT = HPAD;
@@ -810,7 +811,7 @@ void LLPanelAvatarNotes::refresh()
void LLPanelAvatarNotes::clearControls()
{
- childSetText("notes edit", "Loading...");
+ childSetText("notes edit", LOADING_MSG);
childSetEnabled("notes edit", false);
}
@@ -1251,6 +1252,8 @@ LLPanelAvatar::LLPanelAvatar(
mAvatarID( LLUUID::null ), // mAvatarID is set with 'setAvatar' or 'setAvatarID'
mHaveProperties(FALSE),
mHaveStatistics(FALSE),
+ mHaveNotes(false),
+ mLastNotes(),
mAllowEdit(allow_edit)
{
@@ -1440,6 +1443,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
mPanelNotes->clearControls();
mPanelNotes->setDataRequested(false);
+ mHaveNotes = false;
+ mLastNotes.clear();
// Request just the first two pages of data. The picks,
// classifieds, and notes will be requested when that panel
@@ -1451,8 +1456,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name,
if (mAllowEdit)
{
// OK button disabled until properties data arrives
- childSetVisible("OK",TRUE);
- childSetEnabled("OK",TRUE);
+ childSetVisible("OK", true);
+ childSetEnabled("OK", false);
childSetVisible("Cancel",TRUE);
childSetEnabled("Cancel",TRUE);
}
@@ -1747,7 +1752,19 @@ void LLPanelAvatar::sendAvatarPropertiesRequest()
void LLPanelAvatar::sendAvatarNotesUpdate()
{
std::string notes = mPanelNotes->childGetValue("notes edit").asString();
-
+
+ if (!mHaveNotes
+ && (notes.empty() || notes == LOADING_MSG))
+ {
+ // no notes from server and no user updates
+ return;
+ }
+ if (notes == mLastNotes)
+ {
+ // Avatar notes unchanged
+ return;
+ }
+
LLMessageSystem *msg = gMessageSystem;
msg->newMessage("AvatarNotesUpdate");
@@ -2155,6 +2172,8 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**)
msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text);
self->childSetValue("notes edit", text);
self->childSetEnabled("notes edit", true);
+ self->mHaveNotes = true;
+ self->mLastNotes = text;
}
}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index cbc4c55b52..1469be2e9d 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -303,16 +303,15 @@ public:
static void onClickCSR( void *userdata);
static void onClickMute( void *userdata);
+private:
+ void enableOKIfReady();
+
static void finishKick(S32 option, const LLString& text, void* userdata);
static void finishFreeze(S32 option, const LLString& text, void* userdata);
static void finishUnfreeze(S32 option, const LLString& text, void* userdata);
static void showProfileCallback(S32 option, void *userdata);
- // Teen users are not allowed to see or enter data into the first life page,
- // or their own about/interests text entry fields.
- static BOOL sAllowFirstLife;
-
static void* createPanelAvatar(void* data);
static void* createFloaterAvatarInfo(void* data);
static void* createPanelAvatarSecondLife(void* data);
@@ -333,13 +332,20 @@ public:
LLPanelAvatarWeb* mPanelWeb;
LLDropTarget* mDropTarget;
+
+ // Teen users are not allowed to see or enter data into the first life page,
+ // or their own about/interests text entry fields.
+ static BOOL sAllowFirstLife;
-protected:
- void enableOKIfReady();
+private:
LLUUID mAvatarID; // for which avatar is this window?
BOOL mIsFriend; // Are we friends?
BOOL mHaveProperties;
BOOL mHaveStatistics;
+ // only update note if data received from database and
+ // note is changed from database version
+ bool mHaveNotes;
+ std::string mLastNotes;
LLTabContainerCommon* mTab;
BOOL mAllowEdit;