diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp index 8a2855eb83..c3baa1ecdd 100644 --- a/indra/newview/fsfloatersearch.cpp +++ b/indra/newview/fsfloatersearch.cpp @@ -301,7 +301,7 @@ BOOL FSFloaterSearch::postBuild() if (mPanelProfile) { mPanelProfile->setVisible(false); - mPanelProfile->setEmbedded(TRUE); + mPanelProfile->setEmbedded(true); mPanelPeople->childSetAction("people_profile_btn", boost::bind(&FSFloaterSearch::onBtnPeopleProfile, this)); } diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index 9d0152c8a4..5de1195704 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -94,10 +94,10 @@ static const std::string PANEL_NOTES = "panel_profile_notes"; FSPanelProfileTab::FSPanelProfileTab() : LLPanel() , mAvatarId(LLUUID::null) -, mLoading(FALSE) -, mLoaded(FALSE) -, mEmbedded(FALSE) -, mSelfProfile(FALSE) +, mLoading(false) +, mLoaded(false) +, mEmbedded(false) +, mSelfProfile(false) { } @@ -136,7 +136,7 @@ void FSPanelProfileTab::enableControls() { setApplyProgress(false); - mLoaded = TRUE; + mLoaded = true; } void FSPanelProfileTab::setApplyProgress(bool started) @@ -316,7 +316,7 @@ void FSPanelProfileSecondLife::onOpen(const LLSD& key) mDisplayNameButton->setEnabled(TRUE); } - mDescriptionEdit->setParseHTML( !own_profile && !getEmbedded() ); + mDescriptionEdit->setParseHTML(!own_profile && !getEmbedded()); FSDropTarget* drop_target = getChild("drop_target"); drop_target->setVisible(!own_profile); @@ -750,10 +750,10 @@ void FSPanelProfileSecondLife::enableControls() if (getSelfProfile() && !getEmbedded()) { - mShowInSearchCheckbox->setVisible( TRUE ); - mShowInSearchCheckbox->setEnabled( TRUE ); - mDescriptionEdit->setEnabled( TRUE ); - mSecondLifePic->setEnabled( TRUE ); + mShowInSearchCheckbox->setVisible(TRUE); + mShowInSearchCheckbox->setEnabled(TRUE); + mDescriptionEdit->setEnabled(TRUE); + mSecondLifePic->setEnabled(TRUE); } } @@ -1039,7 +1039,7 @@ void FSPanelProfileWeb::enableControls() if (getSelfProfile() && !getEmbedded()) { - mUrlEdit->setEnabled( TRUE ); + mUrlEdit->setEnabled(TRUE); } } @@ -1296,10 +1296,6 @@ void FSPanelPick::setAvatarId(const LLUUID& avatar_id) mPickDescription->setEnabled(TRUE); mSetCurrentLocationButton->setVisible(TRUE); } - /*else - { - mSnapshotCtrl->setEnabled(FALSE); - }*/ } BOOL FSPanelPick::postBuild() @@ -1925,8 +1921,8 @@ void FSPanelProfileFirstLife::enableControls() if (getSelfProfile() && !getEmbedded()) { - mDescriptionEdit->setEnabled( TRUE ); - mPicture->setEnabled( TRUE ); + mDescriptionEdit->setEnabled(TRUE); + mPicture->setEnabled(TRUE); } } @@ -2150,12 +2146,17 @@ void FSPanelAvatarNotes::setAvatarId(const LLUUID& id) ////////////////////////////////////////////////////////////////////////// FSPanelProfile::FSPanelProfile() - : FSPanelProfileTab() + : FSPanelProfileTab(), + mAvatarNameCacheConnection() { } FSPanelProfile::~FSPanelProfile() { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } } BOOL FSPanelProfile::postBuild() @@ -2229,7 +2230,7 @@ void FSPanelProfile::onOpen(const LLSD& key) getChild("cancel_btn")->setVisible(TRUE); } - LLAvatarNameCache::get(getAvatarId(), boost::bind(&FSPanelProfile::onAvatarNameCache, this, _1, _2)); + mAvatarNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&FSPanelProfile::onAvatarNameCache, this, _1, _2)); } void FSPanelProfile::updateData() @@ -2254,8 +2255,6 @@ void FSPanelProfile::apply() mPanelWeb->apply(&data); mPanelSecondlife->apply(&data); - // panel_classifieds->apply(); - mPanelInterests->apply(); mPanelPicks->apply(); mPanelNotes->apply(); @@ -2264,9 +2263,8 @@ void FSPanelProfile::apply() void FSPanelProfile::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { + mAvatarNameCacheConnection.disconnect(); + mPanelSecondlife->onAvatarNameCache(agent_id, av_name); mPanelWeb->onAvatarNameCache(agent_id, av_name); } - - -// eof diff --git a/indra/newview/fspanelprofile.h b/indra/newview/fspanelprofile.h index f953835ac1..ae8372d796 100644 --- a/indra/newview/fspanelprofile.h +++ b/indra/newview/fspanelprofile.h @@ -85,7 +85,7 @@ public: /*virtual*/ ~FSPanelProfileTab(); - void setEmbedded(BOOL embedded) { mEmbedded = embedded; } + void setEmbedded(bool embedded) { mEmbedded = embedded; } protected: @@ -93,28 +93,28 @@ protected: virtual void enableControls(); - // mLoading: FALSE: Initial state, can request - // TRUE: Data requested, skip duplicate requests (happens due to LLUI's habit of repeated callbacks) - // mLoaded: FALSE: Initial state, show loading indicator - // TRUE: Data recieved, which comes in a single message, hide indicator + // mLoading: false: Initial state, can request + // true: Data requested, skip duplicate requests (happens due to LLUI's habit of repeated callbacks) + // mLoaded: false: Initial state, show loading indicator + // true: Data recieved, which comes in a single message, hide indicator bool getIsLoading() { return mLoading; } - void setIsLoading() { mLoading = TRUE; } + void setIsLoading() { mLoading = true; } bool getIsLoaded() { return mLoaded; } - void resetLoading() { mLoading = FALSE; mLoaded = FALSE; } + void resetLoading() { mLoading = false; mLoaded = false; } - const BOOL getEmbedded() const { return mEmbedded; } + const bool getEmbedded() const { return mEmbedded; } - const BOOL getSelfProfile() const { return mSelfProfile; } + const bool getSelfProfile() const { return mSelfProfile; } void setApplyProgress(bool started); private: - LLUUID mAvatarId; - BOOL mLoading; - BOOL mLoaded; - BOOL mEmbedded; - BOOL mSelfProfile; + LLUUID mAvatarId; + bool mLoading; + bool mLoaded; + bool mEmbedded; + bool mSelfProfile; }; @@ -248,11 +248,11 @@ private: void onAvatarNameCacheSetName(const LLUUID& id, const LLAvatarName& av_name); private: - typedef std::map group_map_t; - group_map_t mGroups; - void openGroupProfile(); + typedef std::map group_map_t; + group_map_t mGroups; + void openGroupProfile(); - LLTextBox* mStatusText; + LLTextBox* mStatusText; LLGroupList* mGroupList; LLCheckBoxCtrl* mShowInSearchCheckbox; LLTextureCtrl* mSecondLifePic; @@ -268,7 +268,7 @@ private: LLButton* mIMButton; LLMenuButton* mOverflowButton; - bool mVoiceStatus; + bool mVoiceStatus; boost::signals2::connection mRlvBehaviorCallbackConnection; void updateRlvRestrictions(ERlvBehaviour behavior); @@ -306,12 +306,6 @@ public: /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - // void load(std::string url); - // static void onURLKeystroke(LLLineEditor* editor, void* data); - // static void onCommitLoad(LLUICtrl* ctrl, void* data); - // static void onCommitURL(LLUICtrl* ctrl, void* data); - // static void onClickWebProfileHelp(void *); - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); virtual void enableControls(); @@ -359,8 +353,8 @@ protected: virtual void enableControls(); private: - LLCheckBoxCtrl *mWantChecks[8]; - LLCheckBoxCtrl *mSkillChecks[6]; + LLCheckBoxCtrl* mWantChecks[8]; + LLCheckBoxCtrl* mSkillChecks[6]; LLLineEditor* mWantToEditor; LLLineEditor* mSkillsEditor; LLLineEditor* mLanguagesEditor; @@ -499,14 +493,14 @@ protected: LLButton* mSetCurrentLocationButton; LLButton* mSaveButton; - LLVector3d mPosGlobal; - LLUUID mParcelId; - LLUUID mPickId; - LLUUID mRequestedId; + LLVector3d mPosGlobal; + LLUUID mParcelId; + LLUUID mPickId; + LLUUID mRequestedId; - bool mLocationChanged; - bool mNewPick; - bool mIsEditing; + bool mLocationChanged; + bool mNewPick; + bool mIsEditing; std::string mCurrentPickDescription; @@ -630,8 +624,7 @@ protected: */ void fillRightsData(); - void rightsConfirmationCallback(const LLSD& notification, - const LLSD& response, S32 rights); + void rightsConfirmationCallback(const LLSD& notification, const LLSD& response, S32 rights); void confirmModifyRights(bool grant, S32 rights); void onCommitRights(); void onCommitNotes(); @@ -680,6 +673,8 @@ private: FSPanelProfileFirstLife* mPanelFirstlife; FSPanelAvatarNotes* mPanelNotes; LLTabContainer* mTabContainer; + + boost::signals2::connection mAvatarNameCacheConnection; }; #endif // FS_PANELPROFILE_H