summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolbarview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolbarview.cpp')
-rw-r--r--indra/newview/lltoolbarview.cpp53
1 files changed, 43 insertions, 10 deletions
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 75bec15082..619d17efad 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -29,6 +29,7 @@
#include "lltoolbarview.h"
+#include "llappviewer.h"
#include "lldir.h"
#include "llxmlnode.h"
#include "lltoolbar.h"
@@ -36,12 +37,18 @@
#include "lltooldraganddrop.h"
#include "llclipboard.h"
+#include "llagent.h" // HACK for destinations guide on startup
+#include "llfloaterreg.h" // HACK for destinations guide on startup
+#include "llviewercontrol.h" // HACK for destinations guide on startup
+
#include <boost/foreach.hpp>
LLToolBarView* gToolBarView = NULL;
static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");
+void handleLoginToolbarSetup();
+
bool isToolDragged()
{
return (LLToolDragAndDrop::getInstance()->getSource() == LLToolDragAndDrop::SOURCE_VIEWER);
@@ -97,6 +104,8 @@ BOOL LLToolBarView::postBuild()
mToolbarBottom->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3));
mToolbarBottom->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4));
mToolbarBottom->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4));
+
+ LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&handleLoginToolbarSetup));
return TRUE;
}
@@ -128,7 +137,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar)
}
else
{
- llwarns << "Toolbars creation : the command " << command.name() << " cannot be found in the command manager" << llendl;
+ llwarns << "Toolbars creation : the command with id " << command.uuid().asString() << " cannot be found in the command manager" << llendl;
return false;
}
return true;
@@ -193,9 +202,12 @@ bool LLToolBarView::loadToolbars(bool force_default)
LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;
mToolbarLeft->setButtonType(button_type);
}
- BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.left_toolbar.commands)
+ BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.left_toolbar.commands)
{
- addCommand(LLCommandId(command),mToolbarLeft);
+ if (addCommand(LLCommandId(command_name_param), mToolbarLeft) == false)
+ {
+ llwarns << "Error adding command '" << command_name_param.name() << "' to left toolbar." << llendl;
+ }
}
}
if (toolbar_set.right_toolbar.isProvided() && mToolbarRight)
@@ -205,9 +217,12 @@ bool LLToolBarView::loadToolbars(bool force_default)
LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;
mToolbarRight->setButtonType(button_type);
}
- BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.right_toolbar.commands)
+ BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.right_toolbar.commands)
{
- addCommand(LLCommandId(command),mToolbarRight);
+ if (addCommand(LLCommandId(command_name_param), mToolbarRight) == false)
+ {
+ llwarns << "Error adding command '" << command_name_param.name() << "' to right toolbar." << llendl;
+ }
}
}
if (toolbar_set.bottom_toolbar.isProvided() && mToolbarBottom)
@@ -217,9 +232,12 @@ bool LLToolBarView::loadToolbars(bool force_default)
LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;
mToolbarBottom->setButtonType(button_type);
}
- BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.bottom_toolbar.commands)
+ BOOST_FOREACH(const LLCommandId::Params& command_name_param, toolbar_set.bottom_toolbar.commands)
{
- addCommand(LLCommandId(command),mToolbarBottom);
+ if (addCommand(LLCommandId(command_name_param), mToolbarBottom) == false)
+ {
+ llwarns << "Error adding command '" << command_name_param.name() << "' to bottom toolbar." << llendl;
+ }
}
}
return true;
@@ -289,9 +307,9 @@ void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolb
LLCommand* command = mgr.getCommand(*it);
if (command)
{
- LLCommandId::Params commandParams;
- commandParams.name = command->id().name();
- toolbar.commands.add(commandParams);
+ LLCommandId::Params command_name_param;
+ command_name_param.name = command->name();
+ toolbar.commands.add(command_name_param);
}
}
}
@@ -457,3 +475,18 @@ bool LLToolBarView::isModified() const
return modified;
}
+
+
+//
+// HACK to bring up destinations guide at startup
+//
+
+void handleLoginToolbarSetup()
+{
+ // Open the destinations guide by default on first login, per Rhett
+ if (gSavedSettings.getBOOL("FirstLoginThisInstall") || gAgent.isFirstLogin())
+ {
+ LLFloaterReg::showInstance("destinations");
+ }
+}
+