From a80d5f2b46b21a8d1a48da4b4d2c740cb8260928 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Mon, 26 Sep 2011 15:21:46 +0300 Subject: EXP-1222 FIXED Added a floater for My Profile side tab. - Replaced calls to LLSideTray with LLFloaterSidePanelContainer. - Removed obsolete code implementing the tri-state behavior of Profile side panel. - Added People panel XUI which is referenced from Profile panel. --- indra/newview/llpanelme.cpp | 40 --------------------- indra/newview/llpanelme.h | 1 - indra/newview/llpanelpicks.cpp | 17 +++++---- indra/newview/llviewerfloaterreg.cpp | 2 ++ .../skins/default/xui/en/floater_my_profile.xml | 19 ++++++++++ .../skins/default/xui/en/floater_people.xml | 41 ++++++++++++++++++++++ 6 files changed, 72 insertions(+), 48 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_my_profile.xml create mode 100644 indra/newview/skins/default/xui/en/floater_people.xml (limited to 'indra') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 1347a02a52..4d86fa15df 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -37,7 +37,6 @@ #include "llfirstuse.h" #include "llfloaterreg.h" #include "llhints.h" -#include "llsidetray.h" #include "llviewercontrol.h" #include "llviewerdisplayname.h" @@ -89,45 +88,6 @@ void LLPanelMe::onOpen(const LLSD& key) //} } -bool LLPanelMe::notifyChildren(const LLSD& info) -{ - if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state") - { - // Implement task panel tri-state behavior. - // - // When the button of an active open task panel is clicked, side tray - // calls notifyChildren() on the panel, passing task-panel-action=>handle-tri-state as an argument. - // The task panel is supposed to handle this by reverting to the default view, - // i.e. closing any dependent panels like "pick info" or "profile edit". - - bool on_default_view = true; - - const LLRect& task_panel_rect = getRect(); - for (LLView* child = getFirstChild(); child; child = findNextSibling(child)) - { - LLPanel* panel = dynamic_cast(child); - if (!panel) - continue; - - // *HACK: implement panel stack instead (e.g. me->pick_info->pick_edit). - if (panel->getRect().getWidth() == task_panel_rect.getWidth() && - panel->getRect().getHeight() == task_panel_rect.getHeight() && - panel->getVisible()) - { - panel->setVisible(FALSE); - on_default_view = false; - } - } - - if (on_default_view) - LLSideTray::getInstance()->collapseSideBar(); - - return true; // this notification is only supposed to be handled by task panels - } - - return LLPanel::notifyChildren(info); -} - void LLPanelMe::buildEditPanel() { if (NULL == mEditPanel) diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h index f27f5a268e..22cbb9e055 100644 --- a/indra/newview/llpanelme.h +++ b/indra/newview/llpanelme.h @@ -49,7 +49,6 @@ public: LLPanelMe(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ bool notifyChildren(const LLSD& info); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index ddce83c616..15b5fc8301 100755 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -48,11 +48,11 @@ #include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llavatarpropertiesprocessor.h" +#include "llfloatersidepanelcontainer.h" #include "llpanelavatar.h" #include "llpanelprofile.h" #include "llpanelpick.h" #include "llpanelclassified.h" -#include "llsidetray.h" static const std::string XML_BTN_NEW = "new_btn"; static const std::string XML_BTN_DELETE = "trash_btn"; @@ -133,7 +133,7 @@ public: params["id"] = gAgent.getID(); params["open_tab_name"] = "panel_picks"; params["show_tab_panel"] = "create_pick"; - LLSideTray::getInstance()->showPanel("panel_me", params); + LLFloaterSidePanelContainer::showPanel("my_profile", params); } void editPick(LLPickData* pick_info) @@ -146,8 +146,7 @@ public: params["snapshot_id"] = pick_info->snapshot_id; params["pick_name"] = pick_info->name; params["pick_desc"] = pick_info->desc; - - LLSideTray::getInstance()->showPanel("panel_me", params); + LLFloaterSidePanelContainer::showPanel("my_profile", params); } /*virtual*/ void processProperties(void* data, EAvatarProcessorType type) @@ -252,7 +251,7 @@ public: params["id"] = gAgent.getID(); params["open_tab_name"] = "panel_picks"; params["show_tab_panel"] = "create_classified"; - LLSideTray::getInstance()->showPanel("panel_me", params); + LLFloaterSidePanelContainer::showPanel("my_profile", params); } void openClassified(LLAvatarClassifiedInfo* c_info) @@ -270,7 +269,11 @@ public: params["classified_name"] = c_info->name; params["classified_desc"] = c_info->description; params["from_search"] = true; - LLSideTray::getInstance()->showPanel("panel_profile_view", params); + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance("people"); + if (floaterp) + { + floaterp->openChildPanel("panel_profile_view", params); + } } else if (mRequestVerb == "edit") { @@ -283,7 +286,7 @@ public: params["open_tab_name"] = "panel_picks"; params["show_tab_panel"] = "edit_classified"; params["classified_id"] = c_info->classified_id; - LLSideTray::getInstance()->showPanel("panel_me", params); + LLFloaterSidePanelContainer::showPanel("my_profile", params); } else { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index b28373c6d5..b30ef11978 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -223,6 +223,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mute_object_by_name", "floater_mute_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("my_profile", "floater_my_profile.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("notification_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -231,6 +232,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterPayUtil::registerFloater(); + LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("postcard", "floater_postcard.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_my_profile.xml b/indra/newview/skins/default/xui/en/floater_my_profile.xml new file mode 100644 index 0000000000..b3ebe7f791 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_my_profile.xml @@ -0,0 +1,19 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml new file mode 100644 index 0000000000..13e0738e52 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_people.xml @@ -0,0 +1,41 @@ + + + + + + + + + -- cgit v1.2.3