Skip to content
Snippets Groups Projects
Commit dbf7bdfe authored by Merov Linden's avatar Merov Linden
Browse files

EXP-1354 : Fixed. Toolbars now saved whenever changing their config and only...

EXP-1354 : Fixed. Toolbars now saved whenever changing their config and only if initialized correctly.
parent a22a2412
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) ...@@ -72,7 +72,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
mToolbarRight(NULL), mToolbarRight(NULL),
mToolbarBottom(NULL), mToolbarBottom(NULL),
mDragStarted(false), mDragStarted(false),
mDragToolbarButton(NULL) mDragToolbarButton(NULL),
mToolbarsLoaded(false)
{ {
} }
...@@ -240,6 +241,7 @@ bool LLToolBarView::loadToolbars(bool force_default) ...@@ -240,6 +241,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
} }
} }
} }
mToolbarsLoaded = true;
return true; return true;
} }
...@@ -251,6 +253,10 @@ bool LLToolBarView::loadDefaultToolbars() ...@@ -251,6 +253,10 @@ bool LLToolBarView::loadDefaultToolbars()
if (gToolBarView) if (gToolBarView)
{ {
retval = gToolBarView->loadToolbars(true); retval = gToolBarView->loadToolbars(true);
if (retval)
{
gToolBarView->saveToolbars();
}
} }
return retval; return retval;
...@@ -258,6 +264,9 @@ bool LLToolBarView::loadDefaultToolbars() ...@@ -258,6 +264,9 @@ bool LLToolBarView::loadDefaultToolbars()
void LLToolBarView::saveToolbars() const void LLToolBarView::saveToolbars() const
{ {
if (!mToolbarsLoaded)
return;
// Build the parameter tree from the toolbar data // Build the parameter tree from the toolbar data
LLToolBarView::ToolbarSet toolbar_set; LLToolBarView::ToolbarSet toolbar_set;
if (mToolbarLeft) if (mToolbarLeft)
...@@ -440,6 +449,9 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t ...@@ -440,6 +449,9 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
int new_rank = toolbar->getRankFromPosition(x,y); int new_rank = toolbar->getRankFromPosition(x,y);
toolbar->addCommand(command_id, new_rank); toolbar->addCommand(command_id, new_rank);
} }
// Save the new toolbars configuration
gToolBarView->saveToolbars();
} }
else else
{ {
......
...@@ -98,6 +98,7 @@ private: ...@@ -98,6 +98,7 @@ private:
LLToolBar* mToolbarLeft; LLToolBar* mToolbarLeft;
LLToolBar* mToolbarRight; LLToolBar* mToolbarRight;
LLToolBar* mToolbarBottom; LLToolBar* mToolbarBottom;
bool mToolbarsLoaded;
bool mDragStarted; bool mDragStarted;
LLToolBarButton* mDragToolbarButton; LLToolBarButton* mDragToolbarButton;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment