diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-12 01:12:27 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-12 01:12:27 +0000 |
commit | 0bf4b5f2222ffb8171be094613363427f3b8470a (patch) | |
tree | 4b742d6815f44a85c98113e9c5a3017eafc5968d /indra/newview/llpanelpicks.cpp | |
parent | 8d7e56f219d0915e2c4a19baf2809dbc6ede7fa5 (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll@1277 https://svn.aws.productengine.com/secondlife/pe/stable-1@1297 -> viewer-2-0
Fixes:
EXT 208 EXT 366 EXT-211 EXT-245 EXT-246 EXT-278 EXT-279 EXT-280 EXT-298 EXT-301 EXT-304 EXT-311 EXT-317 EXT-318 EXT-319 EXT-339 EXT-343 EXT-344 EXT-346 EXT-349 EXT-350 EXT-351 EXT-354 EXT-355 EXT-358 EXT-360 EXT-362 EXT-369 EXT-372 EXT-374 EXT-381 EXT-382 EXT-383 EXT-395 EXT-396 EXT-412
Other changes:
Movement & Caemra controls work
Profile and Me panel refactoring
Notification refactoring
Diffstat (limited to 'indra/newview/llpanelpicks.cpp')
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index e8d6ff9ec9..afcd8c735c 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -57,12 +57,13 @@ static const std::string XML_PICKS_LIST = "back_panel"; #define PICK_ITEMS_BETWEEN 5 +static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks("panel_picks"); //----------------------------------------------------------------------------- // LLPanelPicks //----------------------------------------------------------------------------- LLPanelPicks::LLPanelPicks() -: LLPanelProfileTab(LLUUID::null), +: LLPanelProfileTab(), mPopupMenu(NULL), mSelectedPickItem(NULL), mProfilePanel(NULL), @@ -100,7 +101,6 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) childSetTextArg("pick_title", "[NAME]",name); LLView* picks_list = getPicksList(); - if(!picks_list) return; // to restore selection of the same item later LLUUID pick_id_selected(LLUUID::null); @@ -131,7 +131,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) picture->setPickId(pick_id); picture->setCreatorId(getAvatarId()); - LLAvatarPropertiesProcessor::instance().addObserver(mAvatarId, picture); + LLAvatarPropertiesProcessor::instance().addObserver(getAvatarId(), picture); picture->update(); mPickItemList.push_back(picture); if (pick_id_selected != LLUUID::null && @@ -152,14 +152,11 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) void LLPanelPicks::clear() { LLView* scroll = getPicksList(); - if(scroll) + picture_list_t::const_iterator it = mPickItemList.begin(); + for(; mPickItemList.end() != it; ++it) { - picture_list_t::const_iterator it = mPickItemList.begin(); - for(; mPickItemList.end() != it; ++it) - { - scroll->removeChild(*it); - delete *it; - } + scroll->removeChild(*it); + delete *it; } mPickItemList.clear(); mSelectedPickItem = NULL; @@ -225,7 +222,7 @@ void LLPanelPicks::reshapePickItem(LLView* const pick_item, const S32 last_botto LLView* LLPanelPicks::getPicksList() const { - return getChild<LLView>(XML_PICKS_LIST, TRUE, FALSE); + return getChild<LLView>(XML_PICKS_LIST); } BOOL LLPanelPicks::postBuild() @@ -261,6 +258,8 @@ void LLPanelPicks::onOpen(const LLSD& key) // Disable buttons when viewing profile for first time if(getAvatarId() != id) { + clear(); + childSetEnabled(XML_BTN_INFO,FALSE); childSetEnabled(XML_BTN_TELEPORT,FALSE); childSetEnabled(XML_BTN_SHOW_ON_MAP,FALSE); @@ -373,7 +372,7 @@ void LLPanelPicks::updateButtons() int picks_num = mPickItemList.size(); childSetEnabled(XML_BTN_INFO, picks_num > 0); - if (mAvatarId == gAgentID) + if (getAvatarId() == gAgentID) { childSetEnabled(XML_BTN_NEW, picks_num < MAX_AVATAR_PICKS); childSetEnabled(XML_BTN_DELETE, picks_num > 0); @@ -403,12 +402,14 @@ void LLPanelPicks::setSelectedPickItem(LLPickItem* item) BOOL LLPanelPicks::isMouseInPick( S32 x, S32 y ) { - LLScrollContainer* scroll = getChild<LLScrollContainer>("profile_scroll"); - if (!scroll->parentPointInView(x, y)) return FALSE; - S32 x_l = x; S32 y_l = y; + if(!getChild<LLUICtrl>("profile_scroll")->getRect().pointInRect(x, y)) + { + return FALSE; + } + picture_list_t::const_iterator it = mPickItemList.begin(); for(; mPickItemList.end() != it; ++it) { @@ -516,11 +517,8 @@ void LLPickItem::init(LLPickData* pick_data) mPosGlobal = pick_data->pos_global; mLocation = pick_data->location_text; - LLTextureCtrl* picture = getChild<LLTextureCtrl>("picture", TRUE, FALSE); - if (picture) - { - picture->setImageAssetID(pick_data->snapshot_id); - } + LLTextureCtrl* picture = getChild<LLTextureCtrl>("picture"); + picture->setImageAssetID(pick_data->snapshot_id); } void LLPickItem::setPickName(const std::string& name) |