summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-10-19 17:33:27 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-10-19 17:33:27 -0700
commit6d546f1fc3386a05a06c5b1a0ea9e84506380bb1 (patch)
tree1f2f6f04c5ecfb7a1eb8de09b6a8c6aa1dd15eef
parentf3a4a48d8ed20b4bbd65d7cdb9b191c9faf2544b (diff)
parent2bf9acabfb534821e5302848860ef6a01af23b1b (diff)
Merge
-rw-r--r--indra/llui/llfloater.cpp23
-rw-r--r--indra/llui/llfloater.h2
-rw-r--r--indra/llui/llfloaterreg.cpp1
-rw-r--r--indra/newview/app_settings/commands.xml2
-rw-r--r--indra/newview/llviewerwindow.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_my_appearance.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_my_inventory.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_people.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_picks.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_places.xml1
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml4
11 files changed, 31 insertions, 8 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3085921e04..29d05b8002 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -165,6 +165,7 @@ LLFloater::Params::Params()
: title("title"),
short_title("short_title"),
single_instance("single_instance", false),
+ reuse_instance("reuse_instance", false),
can_resize("can_resize", false),
can_minimize("can_minimize", true),
can_close("can_close", true),
@@ -239,6 +240,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mTitle(p.title),
mShortTitle(p.short_title),
mSingleInstance(p.single_instance),
+ mReuseInstance(p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance), // reuse single-instance floaters by default
mKey(key),
mCanTearOff(p.can_tear_off),
mCanMinimize(p.can_minimize),
@@ -776,12 +778,19 @@ void LLFloater::closeFloater(bool app_quitting)
else
{
setVisible(FALSE);
+ if (!mReuseInstance)
+ {
+ destroy();
+ }
}
}
else
{
setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called)
- destroy();
+ if (!mReuseInstance)
+ {
+ destroy();
+ }
}
}
}
@@ -861,9 +870,15 @@ bool LLFloater::applyRectControl()
{
bool saved_rect = false;
- // If we have a saved rect, use it
- if (mRectControl.size() > 1)
+ if (LLFloaterReg::getLastFloaterInGroup(mInstanceName))
+ {
+ // other floaters in our group, position ourselves relative to them and don't save the rect
+ mRectControl.clear();
+ mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADING;
+ }
+ else if (mRectControl.size() > 1)
{
+ // If we have a saved rect, use it
const LLRect& rect = getControlGroup()->getRect(mRectControl);
saved_rect = rect.notEmpty();
if (saved_rect)
@@ -2949,6 +2964,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
mHeaderHeight = p.header_height;
mLegacyHeaderHeight = p.legacy_header_height;
mSingleInstance = p.single_instance;
+ mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance;
mOpenPositioning = p.open_positioning;
mSpecifiedLeft = p.specified_left;
@@ -3230,7 +3246,6 @@ void LLFloater::stackWith(LLFloater& other)
next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight());
- mRectControl.clear(); // don't save rect of stacked floaters
setShape(next_rect);
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index f610b04e35..f384e64e53 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -120,6 +120,7 @@ public:
short_title;
Optional<bool> single_instance,
+ reuse_instance,
can_resize,
can_minimize,
can_close,
@@ -409,6 +410,7 @@ private:
LLUIString mShortTitle;
BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater
+ bool mReuseInstance; // true if we want to hide the floater when we close it instead of destroying it
std::string mInstanceName; // Store the instance name so we can remove ourselves from the list
BOOL mCanTearOff;
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index df3cff9968..e144b68f5e 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -167,6 +167,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
res->setInstanceName(name);
LLFloater *last_floater = (list.empty() ? NULL : list.back());
+
res->applyControlsAndPosition(last_floater);
gFloaterView->adjustToFitScreen(res, false);
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 391a864846..a44b895f7b 100644
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -10,7 +10,7 @@
is_running_function="Floater.IsOpen"
is_running_parameters="about_land"
/>
- <command name="appearance"
+ <command name="appearance"
available_in_toybox="true"
icon="Command_Appearance_Icon"
label_ref="Command_Appearance_Label"
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b84db6b1c0..369e56878c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3174,7 +3174,7 @@ void LLViewerWindow::updateLayout()
//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
}
- LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
+ LLFloaterBuildOptions* build_options_floater = LLFloaterReg::findTypedInstance<LLFloaterBuildOptions>("build_options");
if (build_options_floater && build_options_floater->getVisible())
{
build_options_floater->updateGridMode();
diff --git a/indra/newview/skins/default/xui/en/floater_my_appearance.xml b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
index d9f3f1e13f..a40393aed8 100644
--- a/indra/newview/skins/default/xui/en/floater_my_appearance.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_appearance.xml
@@ -10,6 +10,7 @@
help_topic="appearance"
save_rect="true"
single_instance="true"
+ reuse_instance="true"
title="APPEARANCE"
min_height="260"
min_width="333"
diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
index 44491c671f..80718584e3 100644
--- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
@@ -10,6 +10,7 @@
name="floater_my_inventory"
save_rect="true"
save_visibility="true"
+ reuse_instance="false"
title="INVENTORY"
width="333" >
<panel
diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml
index 9c1d121433..32dda1b694 100644
--- a/indra/newview/skins/default/xui/en/floater_people.xml
+++ b/indra/newview/skins/default/xui/en/floater_people.xml
@@ -12,6 +12,7 @@
name="floater_people"
save_rect="true"
single_instance="true"
+ reuse_instance="true"
title="PEOPLE"
width="333">
<panel_container
diff --git a/indra/newview/skins/default/xui/en/floater_picks.xml b/indra/newview/skins/default/xui/en/floater_picks.xml
index 2d307028e4..7882116662 100644
--- a/indra/newview/skins/default/xui/en/floater_picks.xml
+++ b/indra/newview/skins/default/xui/en/floater_picks.xml
@@ -10,6 +10,7 @@
name="floater_picks"
save_rect="true"
save_visibility="true"
+ reuse_instance="true"
title="Picks"
width="333" >
<panel
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index b7cb86b468..6484b54360 100644
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -9,6 +9,7 @@
name="floater_places"
help_topic="floater_places"
save_rect="true"
+ reuse_instance="true"
title="PLACES"
min_height="230"
min_width="333"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 78e10d207c..f2617556e6 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -3678,7 +3678,7 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Snapshot_Label">Snapshot</string>
<string name="Command_Speak_Label">Speak</string>
<string name="Command_View_Label">View</string>
- <string name="Command_Voice_Label">Nearby voice</string>
+ <string name="Command_Voice_Label">Voice settings</string>
<string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
<string name="Command_Appearance_Tooltip">Change your avatar</string>
@@ -3703,7 +3703,7 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Snapshot_Tooltip">Take a picture</string>
<string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string>
<string name="Command_View_Tooltip">Changing camera angle</string>
- <string name="Command_Voice_Tooltip">People nearby with voice capability</string>
+ <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>
<!-- Mesh UI terms -->
<string name="Retain%">Retain%</string>