summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltoolbarview.cpp15
-rw-r--r--indra/llui/lltoolbarview.h3
-rw-r--r--indra/newview/llfloatertoybox.cpp2
3 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp
index 1c6cf3230b..12247519ad 100644
--- a/indra/llui/lltoolbarview.cpp
+++ b/indra/llui/lltoolbarview.cpp
@@ -114,7 +114,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar)
}
bool LLToolBarView::loadToolbars(bool force_default)
-{
+{
LLToolBarView::ToolbarSet toolbar_set;
// Load the toolbars.xml file
@@ -204,6 +204,19 @@ bool LLToolBarView::loadToolbars(bool force_default)
return true;
}
+//static
+bool LLToolBarView::loadDefaultToolbars()
+{
+ bool retval = false;
+
+ if (gToolBarView)
+ {
+ retval = gToolBarView->loadToolbars(true);
+ }
+
+ return retval;
+}
+
void LLToolBarView::saveToolbars() const
{
// Build the parameter tree from the toolbar data
diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h
index efe6920db8..95c09ece73 100644
--- a/indra/llui/lltoolbarview.h
+++ b/indra/llui/lltoolbarview.h
@@ -72,7 +72,8 @@ public:
bool hasCommand(const LLCommandId& commandId) const;
// Loads the toolbars from the existing user or default settings
bool loadToolbars(bool force_default = false); // return false if load fails
- bool loadDefaultToolbars() { return loadToolbars(true); }
+
+ static bool loadDefaultToolbars();
protected:
friend class LLUICtrlFactory;
diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp
index d7f114043d..7a6afb4e33 100644
--- a/indra/newview/llfloatertoybox.cpp
+++ b/indra/newview/llfloatertoybox.cpp
@@ -61,6 +61,8 @@ BOOL LLFloaterToybox::postBuild()
center();
mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");
+ mBtnRestoreDefaults->setCommitCallback(boost::bind(&LLToolBarView::loadDefaultToolbars));
+
mToolBar = getChild<LLToolBar>("toybox_toolbar");
LLCommandManager& cmdMgr = LLCommandManager::instance();