SL-15340 The list of parcels is duplicated after reopening
1. Clean list before requesting 2. Don't trigger onOpen from menu if already openmaster
parent
777f3f48d0
commit
416ad1831f
|
|
@ -524,6 +524,58 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD&
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
// Same as toggleInstanceOrBringToFront but does not close floater.
|
||||
// unlike showInstance() does not trigger onOpen() if already open
|
||||
void LLFloaterReg::showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key)
|
||||
{
|
||||
std::string name = sdname.asString();
|
||||
LLFloater* instance = getInstance(name, key);
|
||||
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
// If hosted, we need to take that into account
|
||||
LLFloater* host = instance->getHost();
|
||||
|
||||
if (host)
|
||||
{
|
||||
if (host->isMinimized() || !host->isShown() || !host->isFrontmost())
|
||||
{
|
||||
host->setMinimized(FALSE);
|
||||
instance->openFloater(key);
|
||||
instance->setVisibleAndFrontmost(true, key);
|
||||
}
|
||||
else if (!instance->getVisible())
|
||||
{
|
||||
instance->openFloater(key);
|
||||
instance->setVisibleAndFrontmost(true, key);
|
||||
instance->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (instance->isMinimized())
|
||||
{
|
||||
instance->setMinimized(FALSE);
|
||||
instance->setVisibleAndFrontmost(true, key);
|
||||
}
|
||||
else if (!instance->isShown())
|
||||
{
|
||||
instance->openFloater(key);
|
||||
instance->setVisibleAndFrontmost(true, key);
|
||||
}
|
||||
else if (!instance->isFrontmost())
|
||||
{
|
||||
instance->setVisibleAndFrontmost(true, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
U32 LLFloaterReg::getVisibleFloaterInstanceCount()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ public:
|
|||
|
||||
// Callback wrappers
|
||||
static void toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD());
|
||||
static void showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key = LLSD());
|
||||
|
||||
// Typed find / get / show
|
||||
template <class T>
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ mHelpImpl(NULL)
|
|||
reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD()));
|
||||
reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD()));
|
||||
reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), FALSE));
|
||||
reg.add("Floater.ShowOrBringToFront", boost::bind(&LLFloaterReg::showInstanceOrBringToFront, _2, LLSD()));
|
||||
reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD()));
|
||||
|
||||
// Button initialization callback for toggle buttons
|
||||
|
|
|
|||
|
|
@ -105,6 +105,9 @@ LLFloaterLandHoldings::~LLFloaterLandHoldings()
|
|||
|
||||
void LLFloaterLandHoldings::onOpen(const LLSD& key)
|
||||
{
|
||||
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("parcel list");
|
||||
list->clearRows();
|
||||
|
||||
// query_id null is known to be us
|
||||
const LLUUID& query_id = LLUUID::null;
|
||||
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@
|
|||
label="My land holdings..."
|
||||
name="My Land">
|
||||
<menu_item_call.on_click
|
||||
function="Floater.Show"
|
||||
function="Floater.ShowOrBringToFront"
|
||||
parameter="land_holdings" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
|
|
|
|||
Loading…
Reference in New Issue