summaryrefslogtreecommitdiff
path: root/indra/llui/llfloater.cpp
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-30 09:42:04 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-30 09:42:04 -0700
commit6324cf82f290e88c3db677e1ced706560d5ca00b (patch)
treebb6a8ba8b71a8ee15ab4423b157d18f11ae5b3c5 /indra/llui/llfloater.cpp
parent478f3d075b778740abe12f92c00ad6527545ee6c (diff)
parentb2526cde2393ca7d84284b254fb4f37b9e8abb5b (diff)
Merge hg.aws.productengine.com/secondlife/viewer-2-0/ revs 3836-3849
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r--indra/llui/llfloater.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c8e26ecaea..6dcc1957a9 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -189,6 +189,7 @@ LLFloater::Params::Params()
can_close("can_close", true),
can_drag_on_left("can_drag_on_left", false),
can_tear_off("can_tear_off", true),
+ save_dock_state("save_dock_state", false),
save_rect("save_rect", false),
save_visibility("save_visibility", false),
can_dock("can_dock", false),
@@ -508,6 +509,7 @@ LLFloater::~LLFloater()
storeRectControl();
setVisible(false); // We're not visible if we're destroyed
storeVisibilityControl();
+ storeDockStateControl();
}
void LLFloater::storeRectControl()
@@ -526,6 +528,15 @@ void LLFloater::storeVisibilityControl()
}
}
+void LLFloater::storeDockStateControl()
+{
+ if( !sQuitting && mDocStateControl.size() > 1 )
+ {
+ LLUI::sSettingGroups["floater"]->setBOOL( mDocStateControl, isDocked() );
+ }
+}
+
+
void LLFloater::setVisible( BOOL visible )
{
LLPanel::setVisible(visible); // calls handleVisibilityChange()
@@ -784,6 +795,16 @@ void LLFloater::applyRectControl()
}
}
+void LLFloater::applyDockState()
+{
+ if (mDocStateControl.size() > 1)
+ {
+ bool dockState = LLUI::sSettingGroups["floater"]->getBOOL(mDocStateControl);
+ setDocked(dockState);
+ }
+
+}
+
void LLFloater::applyTitle()
{
if (!mDragHandle)
@@ -1403,7 +1424,10 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock)
mButtonsEnabled[BUTTON_DOCK] = !mDocked;
mButtonsEnabled[BUTTON_UNDOCK] = mDocked;
updateButtons();
+
+ storeDockStateControl();
}
+
}
// static
@@ -2520,6 +2544,11 @@ void LLFloater::setInstanceName(const std::string& name)
{
mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName);
}
+ if(!mDocStateControl.empty())
+ {
+ mDocStateControl = LLFloaterReg::declareDockStateControl(mInstanceName);
+ }
+
}
}
@@ -2592,6 +2621,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
{
mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set
}
+
+ if(p.save_dock_state)
+ {
+ mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set
+ }
// open callback
if (p.open_callback.isProvided())
@@ -2670,6 +2704,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o
moveResizeHandlesToFront();
+ applyDockState();
+
return true; // *TODO: Error checking
}