diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-09-28 16:55:10 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-09-28 16:55:10 -0700 |
commit | 71ed326f51770b215ba5dd2ac8d159c3b764c2d2 (patch) | |
tree | 8e34bff5a8285d41fdc7e59f18b5758ac9df87f8 | |
parent | fdf042bdb9aeefa209694e04d4012a3a1f911a52 (diff) | |
parent | 2a459e1060255d0334ab5ed73c0deaa93015cafc (diff) |
Merge with latest
-rw-r--r-- | indra/llui/lltoolbarview.cpp | 56 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.h | 6 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_nearby_chat.xml | 50 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 4 |
6 files changed, 32 insertions, 90 deletions
diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index b374a0bfc4..f60598edcb 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -76,9 +76,6 @@ BOOL LLToolBarView::postBuild() mToolbarRight = getChild<LLToolBar>("toolbar_right"); mToolbarBottom = getChild<LLToolBar>("toolbar_bottom"); - // Load the toolbars from the settings - loadToolbars(); - return TRUE; } @@ -120,8 +117,12 @@ bool LLToolBarView::loadToolbars() LLToolBarView::ToolbarSet toolbar_set; // Load the default toolbars.xml file - // *TODO : pick up the user's toolbar setting if existing - std::string toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "toolbars.xml"); + std::string toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml"); + if (!gDirUtilp->fileExists(toolbar_file)) + { + llwarns << "User toolbars def not found -> use default" << llendl; + toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "toolbars.xml"); + } LLXMLNodePtr root; if(!LLXMLNode::parseFile(toolbar_file, root, NULL)) @@ -173,43 +174,17 @@ void LLToolBarView::saveToolbars() const { // Build the parameter tree from the toolbar data LLToolBarView::ToolbarSet toolbar_set; - - // *TODO : factorize that code a bit... if (mToolbarLeft) { - command_id_list_t& command_list = mToolbarLeft->getCommandsList(); - for (command_id_list_t::const_iterator it = command_list.begin(); - it != command_list.end(); - ++it) - { - LLCommandId::Params command; - command.name = it->name(); - toolbar_set.left_toolbar.commands.add(command); - } + addToToolset(mToolbarLeft->getCommandsList(),toolbar_set.left_toolbar); } if (mToolbarRight) { - command_id_list_t& command_list = mToolbarRight->getCommandsList(); - for (command_id_list_t::const_iterator it = command_list.begin(); - it != command_list.end(); - ++it) - { - LLCommandId::Params command; - command.name = it->name(); - toolbar_set.right_toolbar.commands.add(command); - } + addToToolset(mToolbarRight->getCommandsList(),toolbar_set.right_toolbar); } if (mToolbarBottom) { - command_id_list_t& command_list = mToolbarBottom->getCommandsList(); - for (command_id_list_t::const_iterator it = command_list.begin(); - it != command_list.end(); - ++it) - { - LLCommandId::Params command; - command.name = it->name(); - toolbar_set.bottom_toolbar.commands.add(command); - } + addToToolset(mToolbarBottom->getCommandsList(),toolbar_set.bottom_toolbar); } // Serialize the parameter tree @@ -231,6 +206,19 @@ void LLToolBarView::saveToolbars() const } } +// Enumerate the commands in command_list and add them as Params to the toolbar +void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const +{ + for (command_id_list_t::const_iterator it = command_list.begin(); + it != command_list.end(); + ++it) + { + LLCommandId::Params command; + command.name = it->name(); + toolbar.commands.add(command); + } +} + void LLToolBarView::draw() { static bool debug_print = true; diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index 646a1fd636..b19841997b 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -67,7 +67,10 @@ public: virtual void draw(); // Toolbar view interface with the rest of the world + // Checks if the commandId is being used somewhere in one of the toolbars bool hasCommand(const LLCommandId& commandId) const; + // Loads the toolbars from the existing user or default settings + bool loadToolbars(); // return false if load fails protected: friend class LLUICtrlFactory; @@ -76,10 +79,9 @@ protected: void initFromParams(const Params&); private: - // Loads the toolbars from the existing user or default settings - bool loadToolbars(); // return false if load fails void saveToolbars() const; bool addCommand(const LLCommandId& commandId, LLToolBar* toolbar); + void addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const; // Pointers to the toolbars handled by the toolbar view LLToolBar* mToolbarLeft; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9a06423422..148b80e817 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1493,7 +1493,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>ChatBubbleOpacity</key> <map> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7c930b80c2..6c9ee17a76 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1950,9 +1950,11 @@ void LLViewerWindow::initWorldUI() buttons_panel->setFollowsAll(); buttons_panel_container->addChild(buttons_panel); - // Make the toolbars visible + // Load and make the toolbars visible + // Note: we need to load the toolbars only *after* the user is logged in and IW if (gToolBarView) { + gToolBarView->loadToolbars(); gToolBarView->setVisible(TRUE); } } diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml deleted file mode 100644 index ab966dbb0e..0000000000 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater - border_visible="false" - border="false" - legacy_header_height="18" - can_minimize="true" - can_tear_off="false" - can_resize="true" - can_drag_on_left="false" - can_close="false" - can_dock="true" - bevel_style="in" - height="300" - min_width="235" - layout="topleft" - name="nearby_chat" - help_topic="nearby_chat" - save_rect="true" - title="NEARBY CHAT" - save_dock_state="true" - save_visibility="true" - single_instance="true" - width="320"> - <check_box - bottom_delta="36" - control_name="TranslateChat" - enabled="true" - height="16" - label="Translate chat (powered by Google)" - layout="topleft" - left="5" - name="translate_chat_checkbox" - width="230" /> - <chat_history - parse_urls="true" - bg_readonly_color="ChatHistoryBgColor" - bg_writeable_color="ChatHistoryBgColor" - follows="all" - left="5" - top_delta="17" - layout="topleft" - height="260" - name="chat_history" - parse_highlights="true" - text_color="ChatHistoryTextColor" - text_readonly_color="ChatHistoryTextColor" - right_widget_pad="5" - left_widget_pad="0" - width="315" /> -</floater> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5ec62d82c0..733b97d827 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -227,10 +227,10 @@ use_mac_ctrl="true"> <menu_item_check.on_check function="Floater.Visible" - parameter="nearby_chat" /> + parameter="chat_bar" /> <menu_item_check.on_click function="Floater.Toggle" - parameter="nearby_chat" /> + parameter="chat_bar" /> </menu_item_check> <menu_item_call label="Nearby People" |