summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfloater.cpp7
-rwxr-xr-xindra/newview/llavataractions.cpp10
-rw-r--r--indra/newview/llavataractions.h3
-rw-r--r--indra/newview/llfloateravatarpicker.cpp79
-rw-r--r--indra/newview/llfloateravatarpicker.h9
-rw-r--r--indra/newview/llfloatercolorpicker.cpp2
-rw-r--r--indra/newview/llfloatergodtools.cpp6
-rw-r--r--indra/newview/llfloaterland.cpp12
-rw-r--r--indra/newview/llfloaterregioninfo.cpp26
-rw-r--r--indra/newview/llfloaterreporter.cpp7
-rw-r--r--indra/newview/llfloatersellland.cpp3
-rw-r--r--indra/newview/llimfloater.cpp6
-rw-r--r--indra/newview/llimfloatercontainer.cpp4
-rw-r--r--indra/newview/llinventorypanel.cpp2
-rw-r--r--indra/newview/llpanelblockedlist.cpp26
-rw-r--r--indra/newview/llpanelblockedlist.h2
-rw-r--r--indra/newview/llpanelgroupinvite.cpp6
-rw-r--r--indra/newview/llpanelmaininventory.cpp2
-rw-r--r--indra/newview/llpanelobjectinventory.cpp2
-rw-r--r--indra/newview/llpanelpeople.cpp20
-rw-r--r--indra/newview/llpanelpeople.h3
-rw-r--r--indra/newview/llsidepanelinventory.cpp2
22 files changed, 201 insertions, 38 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 8145d6d347..52812dc050 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -713,6 +713,13 @@ void LLFloater::closeFloater(bool app_quitting)
make_ui_sound("UISndWindowClose");
}
+ //If floater is a dependent, remove it from parent (dependee)
+ LLFloater* dependee = mDependeeHandle.get();
+ if (dependee)
+ {
+ dependee->removeDependentFloater(this);
+ }
+
// now close dependent floater
for(handle_set_iter_t dependent_it = mDependents.begin();
dependent_it != mDependents.end(); )
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 93e8b9ca40..9a0c517ee0 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -744,12 +744,13 @@ std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
}
//static
-void LLAvatarActions::shareWithAvatars()
+void LLAvatarActions::shareWithAvatars(LLPanel * panel)
{
using namespace action_give_inventory;
+ LLFloater* root_floater = gFloaterView->getParentFloater(panel);
LLFloaterAvatarPicker* picker =
- LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE);
+ LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE, FALSE, root_floater->getName());
if (!picker)
{
return;
@@ -757,6 +758,11 @@ void LLAvatarActions::shareWithAvatars()
picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable));
picker->openFriendsTab();
+
+ if (root_floater)
+ {
+ root_floater->addDependentFloater(picker);
+ }
LLNotificationsUtil::add("ShareNotification");
}
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 259e87c336..9d9ce966b5 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -37,6 +37,7 @@
class LLAvatarName;
class LLInventoryPanel;
class LLFloater;
+class LLPanel;
/**
* Friend-related actions (add, remove, offer teleport, etc)
@@ -117,7 +118,7 @@ public:
/**
* Share items with the picked avatars.
*/
- static void shareWithAvatars();
+ static void shareWithAvatars(LLPanel * panel);
/**
* Block/unblock the avatar.
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 47acdf7057..4ac022e350 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -49,6 +49,8 @@
#include "llscrolllistcell.h"
#include "lltabcontainer.h"
#include "lluictrlfactory.h"
+#include "llfocusmgr.h"
+#include "lldraghandle.h"
#include "message.h"
//#include "llsdserialize.h"
@@ -56,14 +58,20 @@
//put it back as a member once the legacy path is out?
static std::map<LLUUID, LLAvatarName> sAvatarNameMap;
+const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
+const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
+const F32 CONTEXT_FADE_TIME = 0.08f;
+
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
BOOL allow_multiple,
BOOL closeOnSelect,
- BOOL skip_agent)
+ BOOL skip_agent,
+ const std::string& name,
+ LLView * frustumOrigin)
{
// *TODO: Use a key to allow this not to be an effective singleton
LLFloaterAvatarPicker* floater =
- LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker");
+ LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker", LLSD(name));
if (!floater)
{
llwarns << "Cannot instantiate avatar picker" << llendl;
@@ -85,6 +93,11 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
floater->getChild<LLButton>("cancel_btn")->setLabel(close_string);
}
+ if(frustumOrigin)
+ {
+ floater->mFrustumOrigin = frustumOrigin->getHandle();
+ }
+
return floater;
}
@@ -93,7 +106,8 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
: LLFloater(key),
mNumResultsReturned(0),
mNearMeListComplete(FALSE),
- mCloseOnSelect(FALSE)
+ mCloseOnSelect(FALSE),
+ mContextConeOpacity ( 0.f )
{
mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
}
@@ -340,8 +354,67 @@ void LLFloaterAvatarPicker::populateFriend()
friends_scroller->sortByColumnIndex(0, TRUE);
}
+void LLFloaterAvatarPicker::drawFrustum()
+{
+ if(mFrustumOrigin.get())
+ {
+ LLView * frustumOrigin = mFrustumOrigin.get();
+ LLRect origin_rect;
+ frustumOrigin->localRectToOtherView(frustumOrigin->getLocalRect(), &origin_rect, this);
+ // draw context cone connecting color picker with color swatch in parent floater
+ LLRect local_rect = getLocalRect();
+ if (hasFocus() && frustumOrigin->isInVisibleChain() && mContextConeOpacity > 0.001f)
+ {
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ LLGLEnable(GL_CULL_FACE);
+ gGL.begin(LLRender::QUADS);
+ {
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
+ gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(local_rect.mRight, local_rect.mTop);
+ gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
+
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
+ gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
+ gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
+
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
+ gGL.vertex2i(local_rect.mRight, local_rect.mTop);
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
+ gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
+
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
+ gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
+ gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
+ gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
+ gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
+ }
+ gGL.end();
+ }
+
+ if (gFocusMgr.childHasMouseCapture(getDragHandle()))
+ {
+ mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
+ }
+ else
+ {
+ mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
+ }
+ }
+}
+
void LLFloaterAvatarPicker::draw()
{
+ drawFrustum();
+
// sometimes it is hard to determine when Select/Ok button should be disabled (see LLAvatarActions::shareWithAvatars).
// lets check this via mOkButtonValidateSignal callback periodically.
static LLFrameTimer timer;
diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h
index 7067cd7b3e..46b685ad02 100644
--- a/indra/newview/llfloateravatarpicker.h
+++ b/indra/newview/llfloateravatarpicker.h
@@ -34,7 +34,7 @@
class LLAvatarName;
class LLScrollListCtrl;
-class LLFloaterAvatarPicker : public LLFloater
+class LLFloaterAvatarPicker :public LLFloater
{
public:
typedef boost::signals2::signal<bool(const uuid_vec_t&), boost_boolean_combiner> validate_signal_t;
@@ -46,7 +46,9 @@ public:
static LLFloaterAvatarPicker* show(select_callback_t callback,
BOOL allow_multiple = FALSE,
BOOL closeOnSelect = FALSE,
- BOOL skip_agent = FALSE);
+ BOOL skip_agent = FALSE,
+ const std::string& name = "",
+ LLView * frustumOrigin = NULL);
LLFloaterAvatarPicker(const LLSD& key);
virtual ~LLFloaterAvatarPicker();
@@ -86,6 +88,7 @@ private:
void setAllowMultiple(BOOL allow_multiple);
LLScrollListCtrl* getActiveList();
+ void drawFrustum();
virtual void draw();
virtual BOOL handleKeyHere(KEY key, MASK mask);
@@ -94,6 +97,8 @@ private:
BOOL mNearMeListComplete;
BOOL mCloseOnSelect;
BOOL mExcludeAgentFromSearchResults;
+ LLHandle <LLView> mFrustumOrigin;
+ F32 mContextConeOpacity;
validate_signal_t mOkButtonValidateSignal;
select_callback_t mSelectionCallback;
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 05d73c2416..1cebdcffca 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -486,7 +486,7 @@ void LLFloaterColorPicker::draw()
mSwatch->localRectToOtherView(mSwatch->getLocalRect(), &swatch_rect, this);
// draw context cone connecting color picker with color swatch in parent floater
LLRect local_rect = getLocalRect();
- if (gFocusMgr.childHasKeyboardFocus(this) && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f)
+ if (hasFocus() && mSwatch->isInVisibleChain() && mContextConeOpacity > 0.001f)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable(GL_CULL_FACE);
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index fb905eae11..51745fb191 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -1123,11 +1123,13 @@ bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const
void LLPanelObjectTools::onClickSet()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2));
+ LLView * button = getChildView("Set Target");
+ LLFloater * root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2), FALSE, FALSE, FALSE, root_floater->getName(), button);
// grandparent is a floater, which can have a dependent
if (picker)
{
- gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+ root_floater->addDependentFloater(picker);
}
}
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 55f3d548ec..64336b5cf7 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -2733,11 +2733,13 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
void LLPanelLandAccess::onClickAddAccess()
{
+ LLView * button = getChildView("add_allowed");
+ LLFloater * root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
- boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1));
+ boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1), FALSE, FALSE, FALSE, root_floater->getName(), button);
if (picker)
{
- gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+ root_floater->addDependentFloater(picker);
}
}
@@ -2782,11 +2784,13 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data)
// static
void LLPanelLandAccess::onClickAddBanned()
{
+ LLView * button = getChildView("add_banned");
+ LLFloater * root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
- boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1));
+ boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1), FALSE, FALSE, FALSE, root_floater->getName(), button);
if (picker)
{
- gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+ root_floater->addDependentFloater(picker);
}
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index fe29bb38c7..4aebd9a4f4 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -648,7 +648,7 @@ void LLPanelRegionGeneralInfo::onClickKick()
// this depends on the grandparent view being a floater
// in order to set up floater dependency
LLFloater* parent_floater = gFloaterView->getParentFloater(this);
- LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE);
+ LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE, FALSE, parent_floater->getName());
if (child_floater)
{
parent_floater->addDependentFloater(child_floater);
@@ -924,7 +924,12 @@ BOOL LLPanelRegionDebugInfo::sendUpdate()
void LLPanelRegionDebugInfo::onClickChooseAvatar()
{
- LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionDebugInfo::callbackAvatarID, this, _1, _2), FALSE, TRUE);
+ LLFloater* parent_floater = gFloaterView->getParentFloater(this);
+ LLFloater * child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionDebugInfo::callbackAvatarID, this, _1, _2), FALSE, TRUE, FALSE, parent_floater->getName());
+ if (child_floater)
+ {
+ parent_floater->addDependentFloater(child_floater);
+ }
}
@@ -1471,7 +1476,7 @@ void LLPanelEstateInfo::onClickKickUser()
// this depends on the grandparent view being a floater
// in order to set up floater dependency
LLFloater* parent_floater = gFloaterView->getParentFloater(this);
- LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE);
+ LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE, FALSE, parent_floater->getName());
if (child_floater)
{
parent_floater->addDependentFloater(child_floater);
@@ -1646,8 +1651,21 @@ bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& res
}
LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
+ //Get parent floater name
+ LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
+ LLFloater* parent_floater = panel ? gFloaterView->getParentFloater(panel) : NULL;
+ const std::string& parent_floater_name = parent_floater ? parent_floater->getName() : "";
+
// avatar picker yes multi-select, yes close-on-select
- LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, (void*)change_info), TRUE, TRUE);
+ LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::accessAddCore3, _1, (void*)change_info),
+ TRUE, TRUE, FALSE, parent_floater_name);
+
+ //Allows the closed parent floater to close the child floater (avatar picker)
+ if (child_floater)
+ {
+ parent_floater->addDependentFloater(child_floater);
+ }
+
return false;
}
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 3ec1e372eb..206bcb2c7e 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -285,10 +285,13 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
void LLFloaterReporter::onClickSelectAbuser()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE );
+ LLView * button = getChildView("select_abuser", TRUE);
+
+ LLFloater * root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE, FALSE, root_floater->getName(), button);
if (picker)
{
- gFloaterView->getParentFloater(this)->addDependentFloater(picker);
+ root_floater->addDependentFloater(picker);
}
}
diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp
index 64c0dfa023..2ac82c553b 100644
--- a/indra/newview/llfloatersellland.cpp
+++ b/indra/newview/llfloatersellland.cpp
@@ -392,7 +392,8 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata)
void LLFloaterSellLandUI::doSelectAgent()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE);
+ LLView * button = getChildView("sell_to_select_agent");
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE, FALSE, this->getName(), button);
// grandparent is a floater, in order to set up dependency
if (picker)
{
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 1c6445610f..732a204ddf 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -359,7 +359,9 @@ BOOL LLIMFloater::postBuild()
void LLIMFloater::onAddButtonClicked()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloater::addSessionParticipants, this, _1), TRUE, TRUE);
+ LLView * button = getChildView("toolbar_panel")->getChildView("add_btn");
+ LLFloater* root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloater::addSessionParticipants, this, _1), TRUE, TRUE, FALSE, root_floater->getName(), button);
if (!picker)
{
return;
@@ -367,7 +369,7 @@ void LLIMFloater::onAddButtonClicked()
// Need to disable 'ok' button when selected users are already in conversation.
picker->setOkBtnEnableCb(boost::bind(&LLIMFloater::canAddSelectedToChat, this, _1));
- LLFloater* root_floater = gFloaterView->getParentFloater(this);
+
if (root_floater)
{
root_floater->addDependentFloater(picker);
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 4d0bd623f8..bfe4afe80b 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -415,8 +415,10 @@ void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width)
void LLIMFloaterContainer::onAddButtonClicked()
{
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE, TRUE);
+ LLView * button = getChildView("conversations_pane_buttons_expanded")->getChildView("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLIMFloaterContainer::onAvatarPicked, this, _1), TRUE, TRUE, TRUE, root_floater->getName(), button);
+
if (picker && root_floater)
{
root_floater->addDependentFloater(picker);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 03dfada77c..2a84616ddf 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -147,7 +147,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLInventoryPanel::doCreate, this, _2));
mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2));
mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars));
+ mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
}
diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp
index 35cda14f8d..8d03930699 100644
--- a/indra/newview/llpanelblockedlist.cpp
+++ b/indra/newview/llpanelblockedlist.cpp
@@ -66,10 +66,19 @@ LLPanelBlockedList::LLPanelBlockedList()
mEnableCallbackRegistrar.add("Block.Check", boost::bind(&LLPanelBlockedList::isActionChecked, this, _2));
}
+void LLPanelBlockedList::removePicker()
+{
+ if(mPicker.get())
+ {
+ mPicker.get()->closeFloater();
+ }
+}
+
BOOL LLPanelBlockedList::postBuild()
{
mBlockedList = getChild<LLBlockList>("blocked");
mBlockedList->setCommitOnSelectionChange(TRUE);
+ this->setVisibleCallback(boost::bind(&LLPanelBlockedList::removePicker, this));
switch (gSavedSettings.getU32("BlockPeopleSortOrder"))
{
@@ -185,11 +194,18 @@ void LLPanelBlockedList::blockResidentByName()
{
const BOOL allow_multiple = FALSE;
const BOOL close_on_select = TRUE;
- /*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(boost::bind(&LLPanelBlockedList::callbackBlockPicked, this, _1, _2), allow_multiple, close_on_select);
-
- // *TODO: mantipov: should LLFloaterAvatarPicker be closed when panel is closed?
- // old Floater dependency is not enable in panel
- // addDependentFloater(picker);
+
+ LLView * button = getChildView("plus_btn", TRUE);
+ LLFloater* root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker * picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelBlockedList::callbackBlockPicked, this, _1, _2),
+ allow_multiple, close_on_select, FALSE, root_floater->getName(), button);
+
+ if (root_floater)
+ {
+ root_floater->addDependentFloater(picker);
+ }
+
+ mPicker = picker->getHandle();
}
void LLPanelBlockedList::blockObjectByName()
diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h
index 332349dfc0..07f0437656 100644
--- a/indra/newview/llpanelblockedlist.h
+++ b/indra/newview/llpanelblockedlist.h
@@ -61,6 +61,7 @@ private:
E_SORT_BY_TYPE = 1,
} ESortOrder;
+ void removePicker();
void updateButtons();
// UI callbacks
@@ -78,6 +79,7 @@ private:
private:
LLBlockList* mBlockedList;
+ LLHandle<LLFloater> mPicker;
};
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index 00dd206571..290e38ee1f 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -301,11 +301,13 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata)
//Soon the avatar picker will be embedded into this panel
//instead of being it's own separate floater. But that is next week.
//This will do for now. -jwolk May 10, 2006
+ LLView * button = panelp->getChildView("add_button");
+ LLFloater * root_floater = gFloaterView->getParentFloater(panelp);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
- boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE);
+ boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE, FALSE, FALSE, root_floater->getName(), button);
if (picker)
{
- gFloaterView->getParentFloater(panelp)->addDependentFloater(picker);
+ root_floater->addDependentFloater(picker);
}
}
}
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index eb3877da5a..35cb3d59c5 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -118,7 +118,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mCommitCallbackRegistrar.add("Inventory.ShowFilters", boost::bind(&LLPanelMainInventory::toggleFindOptions, this));
mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this));
mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars));
+ mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 82956beb3d..de12826452 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1498,7 +1498,7 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par
mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&do_nothing));
mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&do_nothing));
mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&do_nothing));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars));
+ mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
}
// Destroys the object
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 260de40eef..14045df42e 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -556,6 +556,15 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL
}
}
+
+void LLPanelPeople::removePicker()
+{
+ if(mPicker.get())
+ {
+ mPicker.get()->closeFloater();
+ }
+}
+
BOOL LLPanelPeople::postBuild()
{
getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
@@ -571,6 +580,7 @@ BOOL LLPanelPeople::postBuild()
LLPanel* friends_tab = getChild<LLPanel>(FRIENDS_TAB_NAME);
// updater is active only if panel is visible to user.
friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2));
+ friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this));
mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online");
mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all");
mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online"));
@@ -1079,8 +1089,12 @@ bool LLPanelPeople::isItemsFreeOfFriends(const uuid_vec_t& uuids)
void LLPanelPeople::onAddFriendWizButtonClicked()
{
+ LLPanel* cur_panel = mTabContainer->getCurrentPanel();
+ LLView * button = cur_panel->getChildView("friends_add_btn", TRUE);
+
// Show add friend wizard.
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE);
+ LLFloater* root_floater = gFloaterView->getParentFloater(this);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE, FALSE, root_floater->getName(), button);
if (!picker)
{
return;
@@ -1088,11 +1102,13 @@ void LLPanelPeople::onAddFriendWizButtonClicked()
// Need to disable 'ok' button when friend occurs in selection
picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1));
- LLFloater* root_floater = gFloaterView->getParentFloater(this);
+
if (root_floater)
{
root_floater->addDependentFloater(picker);
}
+
+ mPicker = picker->getHandle();
}
void LLPanelPeople::onDeleteFriendButtonClicked()
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index da27f83074..4740964dee 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -68,6 +68,8 @@ private:
E_SORT_BY_RECENT_SPEAKERS = 4,
} ESortOrder;
+ void removePicker();
+
// methods indirectly called by the updaters
void updateFriendListHelpText();
void updateFriendList();
@@ -139,6 +141,7 @@ private:
Updater* mNearbyListUpdater;
Updater* mRecentListUpdater;
Updater* mButtonsUpdater;
+ LLHandle< LLFloater > mPicker;
};
#endif //LL_LLPANELPEOPLE_H
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index acb232c77f..8915bb2fef 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -448,7 +448,7 @@ void LLSidepanelInventory::onInfoButtonClicked()
void LLSidepanelInventory::onShareButtonClicked()
{
- LLAvatarActions::shareWithAvatars();
+ LLAvatarActions::shareWithAvatars(this);
}
void LLSidepanelInventory::onShopButtonClicked()