diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-11-18 22:23:09 +0200 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-11-18 22:23:09 +0200 |
commit | 649beed53bd44ae5b06cd36f40897ed561fe48ab (patch) | |
tree | b9ae9e0051195e6d2f65a4d6b6a9283d5df843e2 /indra/newview/llavataractions.cpp | |
parent | 1543f98bab0ca7445c09e63644c8a5e428f9c5b1 (diff) |
EXP-1577 FIX Made agent profile position and size persistent.
Enable My Profile to use saved_rect.
Value of the "WebProfileRect" setting is ignored in this case.
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rwxr-xr-x | indra/newview/llavataractions.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 10fd6b739e..7f6abb0937 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -302,6 +302,25 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids) make_ui_sound("UISndStartIM"); } +static const LLRect& get_preferred_profile_rect(const LLUUID& avatar_id) +{ + if (avatar_id == gAgentID) + { + return LLRect::null; // no preference + } + + // Preferred size for all residents' profiles except our own, + // for which saved_rect will be used. + static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); + return profile_rect; +} + +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; @@ -315,14 +334,13 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa // PROFILES: open in webkit window const bool show_chrome = false; - static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); LLFloaterWebContent::Params p; p.url(url). id(agent_id.asString()). show_chrome(show_chrome). window_class("profile"). - preferred_media_size(profile_rect); - LLFloaterReg::showInstance("profile", p); + preferred_media_size(get_preferred_profile_rect(agent_id)); + LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p); } // static @@ -339,14 +357,15 @@ bool LLAvatarActions::profileVisible(const LLUUID& id) { LLSD sd; sd["id"] = id; - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd)); + LLFloater* browser = getProfileFloater(id); return browser && browser->isShown(); } //static LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) { - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", LLSD().with("id", id))); + LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> + (LLFloaterReg::findInstance(get_profile_floater_name(id), LLSD().with("id", id))); return browser; } @@ -355,7 +374,7 @@ void LLAvatarActions::hideProfile(const LLUUID& id) { LLSD sd; sd["id"] = id; - LLFloaterWebContent *browser = dynamic_cast<LLFloaterWebContent*> (LLFloaterReg::findInstance("profile", sd)); + LLFloater* browser = getProfileFloater(id); if (browser) { browser->closeFloater(); |