summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-24 14:14:55 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-24 14:14:55 -0700
commitdbf7bdfe8f266ffb95a6a1def58ccbf46f63eb1c (patch)
treee97c70757ae17603538602a74bdc1eb1e65fd642 /indra
parenta22a2412da437835167e92545c0662f27fb1fb5c (diff)
EXP-1354 : Fixed. Toolbars now saved whenever changing their config and only if initialized correctly.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lltoolbarview.cpp14
-rw-r--r--indra/newview/lltoolbarview.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 619d17efad..5d2cebe031 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -72,7 +72,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
mToolbarRight(NULL),
mToolbarBottom(NULL),
mDragStarted(false),
- mDragToolbarButton(NULL)
+ mDragToolbarButton(NULL),
+ mToolbarsLoaded(false)
{
}
@@ -240,6 +241,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
}
}
}
+ mToolbarsLoaded = true;
return true;
}
@@ -251,6 +253,10 @@ bool LLToolBarView::loadDefaultToolbars()
if (gToolBarView)
{
retval = gToolBarView->loadToolbars(true);
+ if (retval)
+ {
+ gToolBarView->saveToolbars();
+ }
}
return retval;
@@ -258,6 +264,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)
@@ -440,6 +449,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
{
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index 60ad6316f8..2b26db3802 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -98,6 +98,7 @@ private:
LLToolBar* mToolbarLeft;
LLToolBar* mToolbarRight;
LLToolBar* mToolbarBottom;
+ bool mToolbarsLoaded;
bool mDragStarted;
LLToolBarButton* mDragToolbarButton;