diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 85e07fc6a6a0f2a3dd2a41c61e4bae891db5422b..0b27ff3567e7b524dfb5202949ee2a8d2be2c3b8 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -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() { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index e3b17dcb4fc7507e8846984b61027732275bb0f4..b33757955218b33da950b0631a1f815151a00937 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -128,6 +128,7 @@ class LLFloaterReg // 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> diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 656b69d3ed50ba0d3d9876a23afff9d3fbe94431..f9e81dd43c213d4f566bda05a2dabf0f8307dab6 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -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 diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index f34760a6bf7c38c31ad6138c9205031fed3f5fe5..a6cdf4b0c1567a5d4ae09e5ac9577510d9f74858 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -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; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ac69f5a7489b1e859d953ccbf0ce01ecfc64e91f..a5f79d4e28dc6605d3c2dfee732e49eaf8aba678 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -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