summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofile.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-12 01:12:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-12 01:12:27 +0000
commit0bf4b5f2222ffb8171be094613363427f3b8470a (patch)
tree4b742d6815f44a85c98113e9c5a3017eafc5968d /indra/newview/llpanelprofile.cpp
parent8d7e56f219d0915e2c4a19baf2809dbc6ede7fa5 (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/llpanelprofile.cpp')
-rw-r--r--indra/newview/llpanelprofile.cpp63
1 files changed, 36 insertions, 27 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index f97105caa8..017a7312a1 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -32,20 +32,16 @@
#include "llviewerprecompiledheaders.h"
#include "llpanelprofile.h"
-#include "lltabcontainer.h"
-#include "llpanelpicks.h"
+
#include "llagent.h"
-#include "llcommandhandler.h"
#include "llavataractions.h"
+#include "llcommandhandler.h"
+#include "llpanelpicks.h"
+#include "lltabcontainer.h"
static const std::string PANEL_PICKS = "panel_picks";
-static const std::string PANEL_NOTES = "panel_notes";
static const std::string PANEL_PROFILE = "panel_profile";
-static LLRegisterPanelClassWrapper<LLPanelAvatarProfile> t_panel_profile(PANEL_PROFILE);
-static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks(PANEL_PICKS);
-
-
class LLAgentHandler : public LLCommandHandler
{
public:
@@ -74,34 +70,45 @@ LLAgentHandler gAgentHandler;
LLPanelProfile::LLPanelProfile()
-: LLPanel(),
- mTabContainer(NULL)
-{
-}
-
-LLPanelProfile::~LLPanelProfile()
+ : LLPanel()
+ , mTabCtrl(NULL)
+ , mAvatarId(LLUUID::null)
{
}
BOOL LLPanelProfile::postBuild()
{
- mTabContainer = getChild<LLTabContainer>("tabs");
- mTabContainer->setCommitCallback(boost::bind(&LLPanelProfile::onTabSelected, this, _2));
+ mTabCtrl = getChild<LLTabContainer>("tabs");
+
+ getTabCtrl()->setCommitCallback(boost::bind(&LLPanelProfile::onTabSelected, this, _2));
LLPanelPicks* panel_picks = getChild<LLPanelPicks>(PANEL_PICKS);
panel_picks->setProfilePanel(this);
- mTabs[PANEL_PICKS] = panel_picks;
- mTabs[PANEL_PROFILE] = getChild<LLPanelAvatarProfile>(PANEL_PROFILE);
+ getTabContainer()[PANEL_PICKS] = panel_picks;
+ getTabContainer()[PANEL_PROFILE] = getChild<LLPanelAvatarProfile>(PANEL_PROFILE);
return TRUE;
}
+void LLPanelProfile::onOpen(const LLSD& key)
+{
+ if (key.has("open_tab_name"))
+ {
+ // onOpen from selected panel will be called from onTabSelected callback
+ getTabCtrl()->selectTabByName(key["open_tab_name"]);
+ }
+ else
+ {
+ getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId());
+ }
+}
+
//*TODO redo panel toggling
void LLPanelProfile::togglePanel(LLPanel* panel)
{
// TRUE - we need to open/expand "panel"
- BOOL expand = this->getChildList()->back() != panel; // mTabContainer->getVisible();
+ bool expand = getChildList()->back() != panel; // mTabCtrl->getVisible();
if (expand)
{
@@ -128,29 +135,31 @@ void LLPanelProfile::togglePanel(LLPanel* panel)
else
{
this->setAllChildrenVisible(TRUE);
- if (panel->getParent() == this) removeChild(panel);
- sendChildToBack(mTabContainer);
- mTabContainer->getCurrentPanel()->onOpen(mAvatarId);
+ if (panel->getParent() == this)
+ {
+ removeChild(panel);
+ }
+ sendChildToBack(getTabCtrl());
+ getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId());
}
}
-
void LLPanelProfile::onTabSelected(const LLSD& param)
{
std::string tab_name = param.asString();
- if (NULL != mTabs[tab_name])
+ if (NULL != getTabContainer()[tab_name])
{
- mTabs[tab_name]->onOpen(mAvatarId);
+ getTabContainer()[tab_name]->onOpen(getAvatarId());
}
}
void LLPanelProfile::setAllChildrenVisible(BOOL visible)
{
const child_list_t* child_list = getChildList();
- for (child_list_const_iter_t child_it = child_list->begin(); child_it != child_list->end(); ++child_it)
+ child_list_const_iter_t child_it = child_list->begin();
+ for (; child_it != child_list->end(); ++child_it)
{
LLView* viewp = *child_it;
viewp->setVisible(visible);
}
}
-