summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rwxr-xr-xindra/newview/llavataractions.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 8344b08bfb..8ca621538f 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -47,6 +47,7 @@
#include "llfloatergroups.h"
#include "llfloaterreg.h"
#include "llfloaterpay.h"
+#include "llfloatersidepanelcontainer.h"
#include "llfloaterwebcontent.h"
#include "llfloaterworldmap.h"
#include "llfolderview.h"
@@ -60,7 +61,6 @@
#include "llpaneloutfitedit.h"
#include "llpanelprofile.h"
#include "llrecentpeople.h"
-#include "llsidetray.h"
#include "lltrans.h"
#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
@@ -302,6 +302,12 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids)
make_ui_sound("UISndStartIM");
}
+static const char* get_profile_floater_name(const LLUUID& avatar_id)
+{
+ // Use different floater XML for our profile to be able to save its rect.
+ return avatar_id == gAgentID ? "my_profile" : "profile";
+}
+
static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
{
std::string username = av_name.mUsername;
@@ -314,9 +320,10 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa
std::string url = getProfileURL(username);
// PROFILES: open in webkit window
- const bool show_chrome = false;
- static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect");
- LLFloaterWebContent::create(url, "", agent_id.asString(), show_chrome, profile_rect);
+ LLFloaterWebContent::Params p;
+ p.url(url).
+ id(agent_id.asString());
+ LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
}
// static
@@ -331,15 +338,26 @@ void LLAvatarActions::showProfile(const LLUUID& id)
//static
bool LLAvatarActions::profileVisible(const LLUUID& id)
{
- LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString()));
+ LLSD sd;
+ sd["id"] = id;
+ LLFloater* browser = getProfileFloater(id);
return browser && browser->isShown();
}
+//static
+LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id)
+{
+ LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*>
+ (LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id)));
+ return browser;
+}
//static
void LLAvatarActions::hideProfile(const LLUUID& id)
{
- LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("web_content", id.asString()));
+ LLSD sd;
+ sd["id"] = id;
+ LLFloater* browser = getProfileFloater(id);
if (browser)
{
browser->closeFloater();
@@ -429,8 +447,7 @@ void LLAvatarActions::csr(const LLUUID& id, std::string name)
void LLAvatarActions::share(const LLUUID& id)
{
LLSD key;
- LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
-
+ LLFloaterSidePanelContainer::showPanel("inventory", key);
LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,id);
@@ -453,7 +470,7 @@ namespace action_give_inventory
*/
static LLInventoryPanel* get_outfit_editor_inventory_panel()
{
- LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLSideTray::getInstance()->getPanel("panel_outfit_edit"));
+ LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
if (NULL == panel_outfit_edit) return NULL;
LLInventoryPanel* inventory_panel = panel_outfit_edit->findChild<LLInventoryPanel>("folder_view");
@@ -687,13 +704,11 @@ std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
if (inventory_selected_uuids.empty())
{
- LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
- LLInventoryPanel * inbox = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox");
- if (inbox)
+ LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
+ if (sidepanel_inventory)
{
- inventory_selected_uuids = inbox->getRootFolder()->getSelectionList();
+ inventory_selected_uuids = sidepanel_inventory->getInboxOrOutboxSelectionList();
}
-
}
return inventory_selected_uuids;