Fixed legacy-legacy people search profile preview to work more than once

Cleaned up unneeded code
meow-7.2.2
Kadah_Coba 2013-08-01 00:59:04 -07:00
parent 3e7ebb59fe
commit 1aad52fd14
4 changed files with 25 additions and 20 deletions

View File

@ -79,14 +79,6 @@ LLRadioGroup* mSearchRadio;
LLComboBox* mCategoryPlaces;
LLComboBox* mCategoryEvents;
static const std::string PANEL_PROFILE = "panel_profile_secondlife";
static const std::string PANEL_WEB = "panel_profile_web";
static const std::string PANEL_INTERESTS = "panel_profile_interests";
static const std::string PANEL_PICKS = "panel_profile_picks";
static const std::string PANEL_CLASSIFIEDS = "panel_profile_classified";
static const std::string PANEL_FIRSTLIFE = "panel_profile_firstlife";
static const std::string PANEL_NOTES = "panel_profile_notes";
////////////////////////////////////////
// Observer Classes //
////////////////////////////////////////
@ -344,12 +336,13 @@ BOOL FSFloaterSearch::postBuild()
resetVerbs();
// <KC> If skin has legacy full profile view, use it
LLPanel* panel_people = getChild<LLPanel>("panel_ls_people");
FSPanelSearchPeople* panel_people = findChild<FSPanelSearchPeople>("panel_ls_people");
mPanelProfile = panel_people->findChild<FSPanelProfile>("panel_profile_view");
if (mPanelProfile)
{
mPanelProfile->setVisible(false);
panel_people->childSetAction("people_profile_btn", boost::bind(&FSFloaterSearch::onBtnPeopleProfile, this));
panel_people->setUseLegacyResultBehavior(TRUE);
}
mDetailsPanel = getChild<LLPanel>("panel_ls_details");
@ -616,14 +609,6 @@ void FSFloaterSearch::avatarNameUpdatedCallback(const LLUUID& id, const LLAvatar
{
mDetailTitle->setValue(av_name.getCompleteName());
setLoadingProgress(false);
// FSPanelProfileSecondLife* panel_profile = findChild<FSPanelProfileSecondLife>(PANEL_PROFILE);
// if (panel_profile)
// {
// FSPanelProfileWeb* panel_web = findChild<FSPanelProfileWeb>(PANEL_WEB);
// panel_profile->onAvatarNameCache(id, av_name);
// if (panel_web) panel_web->onAvatarNameCache(id, av_name);
// }
}
// Otherwise possibly a request for an older selection, ignore it.
}
@ -1048,6 +1033,12 @@ void FSPanelSearchPeople::processSearchReply(LLMessageSystem* msg, void**)
{
search_results->selectFirstItem();
search_results->setFocus(TRUE);
//<FS:KC> Load the first result
if (self->getUseLegacyResultBehavior())
{
self->onSelectItem();
}
}
}

View File

@ -150,6 +150,7 @@ public:
FSPanelSearchPeople();
void onSearchPanelOpen(FSFloaterSearch* parent);
static void processSearchReply(LLMessageSystem* msg, void**);
void setUseLegacyResultBehavior(BOOL use_legacy) { mUseLegacyResultBehavior = use_legacy; }
protected:
private:
/*virtual*/ BOOL postBuild();
@ -169,12 +170,14 @@ private:
void setLoadingProgress(bool started);
const LLUUID& getQueryID() const { return mQueryID; }
const BOOL getUseLegacyResultBehavior() const { return mUseLegacyResultBehavior; }
int mNumResultsReturned;
S32 mStartSearch;
S32 mResultsReceived;
LLSD mResultsContent;
LLUUID mQueryID;
BOOL mUseLegacyResultBehavior;
FSFloaterSearch* mParent;
LLSearchComboBox* mSearchComboBox;

View File

@ -2118,6 +2118,12 @@ void FSPanelProfile::onTabChange()
void FSPanelProfile::onOpen(const LLSD& key)
{
// don't reload the same profile
if (getAvatarId() == key)
{
return;
}
FSPanelProfileTab::onOpen(key);
mPanelSecondlife = findChild<FSPanelProfileSecondLife>(PANEL_SECONDLIFE);
@ -2137,6 +2143,7 @@ void FSPanelProfile::onOpen(const LLSD& key)
mPanelNotes->onOpen(getAvatarId());
//always request the base profile info
resetLoading();
updateData();
if ( (false) && (getAvatarId() == gAgent.getID()))

View File

@ -60,17 +60,17 @@ public:
/**
* Sets avatar ID, sets panel as observer of avatar related info replies from server.
*/
virtual void setAvatarId(const LLUUID& id);
void setAvatarId(const LLUUID& id);
/**
* Processes data received from server.
*/
/*virtual*/ void processProperties(void* data, EAvatarProcessorType type) = 0;
virtual void processProperties(void* data, EAvatarProcessorType type) = 0;
/**
* Returns avatar ID.
*/
virtual const LLUUID& getAvatarId() { return mAvatarId; }
const LLUUID& getAvatarId() { return mAvatarId; }
/**
* Clears panel data if viewing avatar info for first time and sends update data request.
@ -85,6 +85,10 @@ 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
bool getIsLoading() { return mLoading; }
void setIsLoading() { mLoading = TRUE; }
bool getIsLoaded() { return mLoaded; }