Merge with head
commit
46082c7d75
|
|
@ -935,7 +935,7 @@ void LLFloater::applyPositioning(LLFloater* other)
|
|||
|
||||
case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP:
|
||||
case LLFloaterEnums::OPEN_POSITIONING_CASCADING:
|
||||
if (other != NULL)
|
||||
if (other != NULL && other != this)
|
||||
{
|
||||
stackWith(*other);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
|
|||
mToolbarRight(NULL),
|
||||
mToolbarBottom(NULL),
|
||||
mDragStarted(false),
|
||||
mDragToolbarButton(NULL)
|
||||
mDragToolbarButton(NULL),
|
||||
mToolbarsLoaded(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -150,6 +151,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar)
|
|||
bool LLToolBarView::loadToolbars(bool force_default)
|
||||
{
|
||||
LLToolBarView::ToolbarSet toolbar_set;
|
||||
bool err = false;
|
||||
|
||||
// Load the toolbars.xml file
|
||||
std::string toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml");
|
||||
|
|
@ -164,24 +166,39 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
}
|
||||
|
||||
LLXMLNodePtr root;
|
||||
if(!LLXMLNode::parseFile(toolbar_file, root, NULL))
|
||||
if (!LLXMLNode::parseFile(toolbar_file, root, NULL))
|
||||
{
|
||||
llwarns << "Unable to load toolbars from file: " << toolbar_file << llendl;
|
||||
return false;
|
||||
err = true;
|
||||
}
|
||||
if(!root->hasName("toolbars"))
|
||||
|
||||
if (!err && !root->hasName("toolbars"))
|
||||
{
|
||||
llwarns << toolbar_file << " is not a valid toolbars definition file" << llendl;
|
||||
return false;
|
||||
err = true;
|
||||
}
|
||||
|
||||
// Parse the toolbar settings
|
||||
LLXUIParser parser;
|
||||
parser.readXUI(root, toolbar_set, toolbar_file);
|
||||
if (!toolbar_set.validateBlock())
|
||||
if (!err)
|
||||
{
|
||||
llerrs << "Unable to validate toolbars from file: " << toolbar_file << llendl;
|
||||
return false;
|
||||
parser.readXUI(root, toolbar_set, toolbar_file);
|
||||
}
|
||||
if (!err && !toolbar_set.validateBlock())
|
||||
{
|
||||
llwarns << "Unable to validate toolbars from file: " << toolbar_file << llendl;
|
||||
err = true;
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
if (force_default)
|
||||
{
|
||||
llerrs << "Unable to load toolbars from default file : " << toolbar_file << llendl;
|
||||
return false;
|
||||
}
|
||||
// Try to load the default toolbars
|
||||
return loadToolbars(true);
|
||||
}
|
||||
|
||||
// Clear the toolbars now before adding the loaded commands and settings
|
||||
|
|
@ -244,6 +261,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
|
|||
}
|
||||
}
|
||||
}
|
||||
mToolbarsLoaded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -255,6 +273,10 @@ bool LLToolBarView::loadDefaultToolbars()
|
|||
if (gToolBarView)
|
||||
{
|
||||
retval = gToolBarView->loadToolbars(true);
|
||||
if (retval)
|
||||
{
|
||||
gToolBarView->saveToolbars();
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
@ -262,6 +284,9 @@ bool LLToolBarView::loadDefaultToolbars()
|
|||
|
||||
void LLToolBarView::saveToolbars() const
|
||||
{
|
||||
if (!mToolbarsLoaded)
|
||||
return;
|
||||
|
||||
// Build the parameter tree from the toolbar data
|
||||
LLToolBarView::ToolbarSet toolbar_set;
|
||||
if (mToolbarLeft)
|
||||
|
|
@ -460,6 +485,9 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
|
|||
int new_rank = toolbar->getRankFromPosition(x,y);
|
||||
toolbar->addCommand(command_id, new_rank);
|
||||
}
|
||||
|
||||
// Save the new toolbars configuration
|
||||
gToolBarView->saveToolbars();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ private:
|
|||
LLToolBar* mToolbarLeft;
|
||||
LLToolBar* mToolbarRight;
|
||||
LLToolBar* mToolbarBottom;
|
||||
bool mToolbarsLoaded;
|
||||
|
||||
bool mDragStarted;
|
||||
LLToolBarButton* mDragToolbarButton;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
image_pressed="ComboButton_UpSelected"
|
||||
image_pressed_selected="ComboButton_Selected"
|
||||
height="23"
|
||||
chrome="true"
|
||||
name="show_nearby_chat"
|
||||
tool_tip="Shows/hides nearby chat log">
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue