From 656158ce6eef5b9069520fd33d45c6d1868b5e47 Mon Sep 17 00:00:00 2001 From: ZaiLynch Date: Thu, 26 Aug 2010 09:03:37 +0200 Subject: fix for VWR-19505 --- indra/newview/llvoavatar.cpp | 9 --------- indra/newview/llvoavatar.h | 1 - indra/newview/llvoavatarself.cpp | 1 + 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 89ce889a61..0f3a7c4e85 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2318,7 +2318,6 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) idleUpdateNameTag( root_pos_last ); idleUpdateRenderCost(); - idleUpdateTractorBeam(); return TRUE; } @@ -3079,14 +3078,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } } -//-------------------------------------------------------------------- -// draw tractor beam when editing objects -//-------------------------------------------------------------------- -// virtual -void LLVOAvatar::idleUpdateTractorBeam() -{ -} - void LLVOAvatar::idleUpdateBelowWater() { F32 avatar_height = (F32)(getPositionGlobal().mdV[VZ]); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 0934f5df36..0017f6b846 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -208,7 +208,6 @@ public: void idleUpdateWindEffect(); void idleUpdateNameTag(const LLVector3& root_pos_last); void idleUpdateRenderCost(); - void idleUpdateTractorBeam(); void idleUpdateBelowWater(); //-------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a28482b4de..26fab47ae0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -634,6 +634,7 @@ BOOL LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return TRUE; } LLVOAvatar::idleUpdate(agent, world, time); + idleUpdateTractorBeam(); return TRUE; } -- cgit v1.2.3 From 225dd434cfeb6a67c5878b41538dafe2a7f4a284 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Thu, 26 Aug 2010 11:25:57 -0700 Subject: EXT-8668 - Fixing accidental case change for the sake of OCD. --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 49ae58d53a..d1cd335783 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -45,7 +45,7 @@ RequestExecutionLevel admin ; on Vista we must be admin because we write to Prog # *TODO: Move these into the language files themselves LangString LanguageCode ${LANG_DANISH} "da" LangString LanguageCode ${LANG_GERMAN} "de" -Langstring LanguageCode ${LANG_ENGLISH} "en" +LangString LanguageCode ${LANG_ENGLISH} "en" LangString LanguageCode ${LANG_SPANISH} "es" LangString LanguageCode ${LANG_FRENCH} "fr" LangString LanguageCode ${LANG_JAPANESE} "ja" -- cgit v1.2.3 From bdd1017d0d553bf0559eb9b59a9b6dbda1d5ca71 Mon Sep 17 00:00:00 2001 From: Ardy Lay Date: Mon, 30 Aug 2010 14:18:48 -0500 Subject: [mq]: VWR-19499-AppUriChatLimit --- doc/contributions.txt | 2 ++ indra/newview/llchatbar.cpp | 29 ++++++++++++++++++++++++----- indra/newview/llnearbychatbar.cpp | 32 ++++++++++++++++++++++++-------- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index fa2737a479..6edb727682 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -120,6 +120,8 @@ Angus Boyd VWR-592 Ann Congrejo CT-193 +Ardy Lay + VWR-19499 Argent Stonecutter VWR-68 Armin Weatherwax diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 967db21244..7d82ec3a71 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -673,11 +673,30 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (tokens.size() < 2) return false; - S32 channel = tokens[0].asInteger(); - std::string mesg = tokens[1].asString(); - send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); - return true; + bool retval = false; + // Need at least 2 tokens to have a valid message. + if (tokens.size() < 2) + { + retval = false; + } + else + { + S32 channel = tokens[0].asInteger(); + // VWR-19499 Restrict function to chat channels greater than 0. + if ((channel > 0) && (channel < 2147483647)) + { + retval = true; + // Say mesg on channel + std::string mesg = tokens[1].asString(); + send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); + } + else + { + retval = false; + // Tell us this is an unsupported SLurl. + } + } + return retval; } }; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4f9845d704..43630c13fd 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -865,14 +865,30 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (tokens.size() < 2) return false; - S32 channel = tokens[0].asInteger(); - - // Send unescaped message, see EXT-6353. - std::string unescaped_mesg (LLURI::unescape(tokens[1].asString())); - - send_chat_from_viewer(unescaped_mesg, CHAT_TYPE_NORMAL, channel); - return true; + bool retval = false; + // Need at least 2 tokens to have a valid message. + if (tokens.size() < 2) + { + retval = false; + } + else + { + S32 channel = tokens[0].asInteger(); + // VWR-19499 Restrict function to chat channels greater than 0. + if ((channel > 0) && (channel < 2147483647)) + { + retval = true; + // Send unescaped message, see EXT-6353. + std::string unescaped_mesg (LLURI::unescape(tokens[1].asString())); + send_chat_from_viewer(unescaped_mesg, CHAT_TYPE_NORMAL, channel); + } + else + { + retval = false; + // Tell us this is an unsupported SLurl. + } + } + return retval; } }; -- cgit v1.2.3 From 82c7366e20d8944fe39b5789b0e74ecb0c06368e Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 1 Sep 2010 19:14:41 +0300 Subject: VWR-21060 FIXED opening side tray tabs via shortcut, menu item or button outside of Side Tray. Reviewed by Vadim Savchuk. --- indra/newview/llsidetray.cpp | 103 ++++++++++++++++++++++++++++++------------- indra/newview/llsidetray.h | 8 ++-- 2 files changed, 76 insertions(+), 35 deletions(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 85b6e0dec4..3d6fc0d8fd 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -212,10 +212,12 @@ void LLSideTrayTab::onOpen (const LLSD& key) void LLSideTrayTab::toggleTabDocked() { - LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", mTabTitle)); + std::string tab_name = getName(); + + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab_name)); if (!floater_tab) return; - LLFloaterReg::toggleInstance("side_bar_tab", LLSD().with("name", mTabTitle)); + LLFloaterReg::toggleInstance("side_bar_tab", LLSD().with("name", tab_name)); LLSideTray* side_tray = LLSideTray::getInstance(); @@ -334,10 +336,9 @@ public: tab->toggleTabDocked(); - LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab->getTabTitle())); + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab->getName())); if (!floater_tab) return FALSE; - LLRect original_rect = floater_tab->getRect(); S32 header_snap_y = floater_tab->getHeaderHeight() / 2; S32 snap_x = screen_x - original_rect.mLeft - original_rect.getWidth() / 2; @@ -485,6 +486,54 @@ void LLSideTray::toggleTabButton(LLSideTrayTab* tab) } } +LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel_name, const LLSD& params) +{ + LLView* view = tab->findChildView(panel_name, true); + if (!view) return NULL; + + std::string tab_name = tab->getName(); + + // Select tab and expand Side Tray only when a tab is attached. + if (isTabAttached(tab_name)) + { + selectTabByName(tab_name); + if (mCollapsed) + expandSideBar(); + } + else + { + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab_name)); + if (!floater_tab) return NULL; + + // Restore the floater if it was minimized. + if (floater_tab->isMinimized()) + { + floater_tab->setMinimized(FALSE); + } + + // Send the floater to the front. + floater_tab->setFrontmost(); + } + + LLSideTrayPanelContainer* container = dynamic_cast(view->getParent()); + if (container) + { + LLSD new_params = params; + new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; + container->onOpen(new_params); + + return container->getCurrentPanel(); + } + + LLPanel* panel = dynamic_cast(view); + if (panel) + { + panel->onOpen(params); + } + + return panel; +} + bool LLSideTray::selectTabByIndex(size_t index) { if(index>=mTabs.size()) @@ -623,6 +672,9 @@ bool LLSideTray::removeTab(LLSideTrayTab* tab) removeChild(tab); mTabs.erase(tab_it); + // Add the tab to detached tabs list. + mDetachedTabs.push_back(tab); + // Remove the button from the buttons panel so that it isn't drawn anymore. mButtonsPanel->removeChild(btn); @@ -684,6 +736,13 @@ bool LLSideTray::addTab(LLSideTrayTab* tab) // Arrange tabs after inserting a new one. arrange(); + // Remove the tab from the list of detached tabs. + child_vector_iter_t tab_it = std::find(mDetachedTabs.begin(), mDetachedTabs.end(), tab); + if (tab_it != mDetachedTabs.end()) + { + mDetachedTabs.erase(tab_it); + } + return true; } @@ -919,35 +978,19 @@ void LLSideTray::reshape(S32 width, S32 height, BOOL called_from_parent) */ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& params) { - //arrange tabs + // Look up the tab in the list of detached tabs. child_vector_const_iter_t child_it; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + for ( child_it = mDetachedTabs.begin(); child_it != mDetachedTabs.end(); ++child_it) { - LLView* view = (*child_it)->findChildView(panel_name,true); - if(view) - { - selectTabByName ((*child_it)->getName()); - if(mCollapsed) - expandSideBar(); - - LLSideTrayPanelContainer* container = dynamic_cast(view->getParent()); - if(container) - { - LLSD new_params = params; - new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; - container->onOpen(new_params); - - return container->getCurrentPanel(); - } - - LLPanel* panel = dynamic_cast(view); - if(panel) - { - panel->onOpen(params); - } + LLPanel* panel = openChildPanel(*child_it, panel_name, params); + if (panel) return panel; + } - return panel; - } + // Look up the tab in the list of attached tabs. + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLPanel* panel = openChildPanel(*child_it, panel_name, params); + if (panel) return panel; } return NULL; } diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index f0cc2c1146..f60c72e7a3 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -177,6 +177,8 @@ protected: void toggleTabButton (LLSideTrayTab* tab); + LLPanel* openChildPanel (LLSideTrayTab* tab, const std::string& panel_name, const LLSD& params); + private: // Implementation of LLDestroyClass static void destroyClass() @@ -187,15 +189,11 @@ private: } private: - - typedef std::pair detached_tab_t; - typedef std::map detached_tab_map_t; - LLPanel* mButtonsPanel; typedef std::map button_map_t; button_map_t mTabButtons; child_vector_t mTabs; - detached_tab_map_t mDetachedTabs; + child_vector_t mDetachedTabs; tab_order_vector_t mOriginalTabOrder; LLSideTrayTab* mActiveTab; -- cgit v1.2.3 From 4020b91ec6e8ab4994969ddda37f5ebbd9985367 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 1 Sep 2010 21:11:25 +0300 Subject: VWR-21127 WIP Implemented saving position and dimensions of detached sidebar tabs. Reviewed by Sergey Litovchuk. --- indra/llui/llfloater.cpp | 14 +++++++++++--- indra/newview/llsidetray.cpp | 8 ++++---- .../newview/skins/default/xui/en/floater_side_bar_tab.xml | 4 +++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e1203971ea..0c4c857022 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2664,18 +2664,26 @@ void LLFloater::setInstanceName(const std::string& name) mInstanceName = name; if (!mInstanceName.empty()) { + std::string ctrl_name = mInstanceName; + + // Add the key to the control name if appropriate. + if (mKey.isString() && !mKey.asString().empty()) + { + ctrl_name += "_" + mKey.asString(); + } + // save_rect and save_visibility only apply to registered floaters if (!mRectControl.empty()) { - mRectControl = LLFloaterReg::declareRectControl(mInstanceName); + mRectControl = LLFloaterReg::declareRectControl(ctrl_name); } if (!mVisibilityControl.empty()) { - mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName); + mVisibilityControl = LLFloaterReg::declareVisibilityControl(ctrl_name); } if(!mDocStateControl.empty()) { - mDocStateControl = LLFloaterReg::declareDockStateControl(mInstanceName); + mDocStateControl = LLFloaterReg::declareDockStateControl(ctrl_name); } } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3d6fc0d8fd..3f0c1fa946 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -214,10 +214,10 @@ void LLSideTrayTab::toggleTabDocked() { std::string tab_name = getName(); - LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab_name)); + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab_name); if (!floater_tab) return; - LLFloaterReg::toggleInstance("side_bar_tab", LLSD().with("name", tab_name)); + LLFloaterReg::toggleInstance("side_bar_tab", tab_name); LLSideTray* side_tray = LLSideTray::getInstance(); @@ -336,7 +336,7 @@ public: tab->toggleTabDocked(); - LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab->getName())); + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab->getName()); if (!floater_tab) return FALSE; LLRect original_rect = floater_tab->getRect(); @@ -502,7 +502,7 @@ LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel } else { - LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", LLSD().with("name", tab_name)); + LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab_name); if (!floater_tab) return NULL; // Restore the floater if it was minimized. diff --git a/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml b/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml index 1466c2d2a5..35df6a37f6 100644 --- a/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml +++ b/indra/newview/skins/default/xui/en/floater_side_bar_tab.xml @@ -1,5 +1,7 @@ + can_resize="true" + save_rect="true" + > -- cgit v1.2.3 From 61555ce1f0d2b45ec21fe123ab604b6e18c21ccc Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 1 Sep 2010 22:58:29 +0300 Subject: VWR-20696 ADDITIONAL FIX Added calling onOpen() for tabs being undocked. Reviewed by Vadim Savchuk. --- indra/newview/llsidetray.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3f0c1fa946..9893370dcf 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -250,6 +250,13 @@ void LLSideTrayTab::toggleTabDocked() { side_tray->collapseSideBar(); } + + if (side_tray->getActiveTab() != this) + { + // When a tab other then current active tab is detached from Side Tray + // onOpen() should be called as tab visibility is changed. + onOpen(LLSD()); + } } else { -- cgit v1.2.3 From c2935e40a6966f47ebd87705dd730ab0960e2b6d Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 2 Sep 2010 20:13:25 +0300 Subject: VWR-20696 ADDITIONAL FIX Fix dock/undock button image changing depending on tab state. --- indra/newview/llsidetray.cpp | 10 +++++++++- .../skins/default/xui/en/panel_side_tray_tab_caption.xml | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 9893370dcf..086e35dfdc 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -176,6 +176,7 @@ BOOL LLSideTrayTab::postBuild() title_panel->getChild(TAB_PANEL_CAPTION_TITLE_BOX)->setValue(mTabTitle); + getChild("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::toggleTabDocked, this)); getChild("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::toggleTabDocked, this)); return true; @@ -221,7 +222,14 @@ void LLSideTrayTab::toggleTabDocked() LLSideTray* side_tray = LLSideTray::getInstance(); - if (LLFloater::isShown(floater_tab)) + bool is_tab_undocked = LLFloater::isShown(floater_tab); + + // Hide the "Tear Off" button when a tab gets undocked + // and show "Dock" button instead. + getChild("undock")->setVisible(!is_tab_undocked); + getChild("dock")->setVisible(is_tab_undocked); + + if (is_tab_undocked) { // Remove the tab from Side Tray's tabs list. // We have to do it despite removing the tab from Side Tray's child view tree diff --git a/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml index 60c2e0830c..349b625cef 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray_tab_caption.xml @@ -22,6 +22,18 @@ - + + - + - + - + - + - + - + Date: Mon, 6 Sep 2010 22:56:14 +0300 Subject: VWR-22690 FIXED Implemented save/load of bottomtray button order. - Added methods responsible for saving and loading order of buttons to bottomtray. Order is saved after each drag'n'drop to ensure user's customization of bottomtray is not lost because of crash. - Added additional argument to layoutstack movePanel() method which tells it to move panel to the beginning of mPanels vector without requiring a pointer to panel before which it should be inserted. Reviewed by Vadim Savchuk. --- indra/llui/lllayoutstack.cpp | 6 ++-- indra/llui/lllayoutstack.h | 3 +- indra/newview/llbottomtray.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++ indra/newview/llbottomtray.h | 5 +++ 4 files changed, 83 insertions(+), 4 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index ab25d1d62b..0ff7557ead 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -368,10 +368,10 @@ S32 LLLayoutStack::getDefaultWidth(S32 cur_width) return cur_width; } -void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel) +void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front) { LayoutPanel* embedded_panel_to_move = findEmbeddedPanel(panel_to_move); - LayoutPanel* embedded_target_panel = findEmbeddedPanel(target_panel); + LayoutPanel* embedded_target_panel = move_to_front ? *mPanels.begin() : findEmbeddedPanel(target_panel); if (!embedded_panel_to_move || !embedded_target_panel || embedded_panel_to_move == embedded_target_panel) { @@ -380,7 +380,7 @@ void LLLayoutStack::movePanel(LLPanel* panel_to_move, LLPanel* target_panel) } e_panel_list_t::iterator it = std::find(mPanels.begin(), mPanels.end(), embedded_panel_to_move); mPanels.erase(it); - it = std::find(mPanels.begin(), mPanels.end(), embedded_target_panel); + it = move_to_front ? mPanels.begin() : std::find(mPanels.begin(), mPanels.end(), embedded_target_panel); mPanels.insert(it, embedded_panel_to_move); } diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index b5287db1cf..6fcc8e2ac3 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -74,8 +74,9 @@ public: S32 getNumPanels() { return mPanels.size(); } /** * Moves panel_to_move before target_panel inside layout stack (both panels should already be there). + * If move_to_front is true target_panel is ignored and panel_to_move is moved to the beginning of mPanels */ - void movePanel(LLPanel* panel_to_move, LLPanel* target_panel); + void movePanel(LLPanel* panel_to_move, LLPanel* target_panel, bool move_to_front = false); void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); void setPanelUserResize(const std::string& panel_name, BOOL user_resize); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 9869ae6e2d..053c400e74 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -50,10 +50,13 @@ #include "llviewerparcelmgr.h" #include "llviewerwindow.h" +#include "llsdserialize.h" // Distance from mouse down on which drag'n'drop should be started. #define DRAG_START_DISTANCE 3 +static const std::string SORTING_DATA_FILE_NAME = "bottomtray_buttons_order.xml"; + LLDefaultChildRegistry::Register bottomtray_button("bottomtray_button"); // LLBottomtrayButton methods @@ -549,6 +552,8 @@ BOOL LLBottomTray::postBuild() showWellButton(RS_IM_WELL, !LLIMWellWindow::getInstance()->isWindowEmpty()); showWellButton(RS_NOTIFICATION_WELL, !LLNotificationWellWindow::getInstance()->isWindowEmpty()); + loadButtonsOrder(); + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&update_build_button_enable_state)); return TRUE; @@ -691,6 +696,74 @@ void LLBottomTray::updateButtonsOrdersAfterDnD() ++it2; } } + + saveButtonsOrder(); +} + +void LLBottomTray::saveButtonsOrder() +{ + std::string user_dir = gDirUtilp->getLindenUserDir(); + if (user_dir.empty()) return; + + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME); + LLSD settings_llsd; + int i = 0; + const resize_state_vec_t::const_iterator it_end = mButtonsOrder.end(); + // we use numbers as keys for map which is saved in file and contains resize states as its values + for (resize_state_vec_t::const_iterator it = mButtonsOrder.begin(); it != it_end; ++it, i++) + { + std::string str = llformat("%d", i); + settings_llsd[str] = *it; + } + llofstream file; + file.open(filename); + LLSDSerialize::toPrettyXML(settings_llsd, file); +} + +void LLBottomTray::loadButtonsOrder() +{ + // load per-resident sorting information + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME); + + LLSD settings_llsd; + llifstream file; + file.open(filename); + if (!file.is_open()) return; + + LLSDSerialize::fromXML(settings_llsd, file); + + + mButtonsOrder.clear(); + mButtonsProcessOrder.clear(); + int i = 0; + // getting button order from file + for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); + iter != settings_llsd.endMap(); ++iter, ++i) + { + std::string str = llformat("%d", i); + EResizeState state = (EResizeState)settings_llsd[str].asInteger(); + mButtonsOrder.push_back(state); + // RS_BUTTON_SPEAK is skipped, because it shouldn't be in mButtonsProcessOrder (it does not hide or shrink). + if (state != RS_BUTTON_SPEAK) + { + mButtonsProcessOrder.push_back(state); + } + } + + // There are other panels in layout stack order of which is not saved. Also, panels order of which is saved, + // are already in layout stack but in wrong order. The most convenient way to place them is moving them + // to front one by one (because in this case we don't have to pass the panel before which we want to insert our + // panel to movePanel()). So panels are moved in order from the end of mButtonsOrder vector(reverse iterator is used). + const resize_state_vec_t::const_reverse_iterator it_end = mButtonsOrder.rend(); + // placing panels in layout stack according to button order which we loaded in previous for + for (resize_state_vec_t::const_reverse_iterator it = mButtonsOrder.rbegin(); it != it_end; ++it, ++i) + { + LLPanel* panel_to_move = *it == RS_BUTTON_SPEAK ? mSpeakPanel : mStateProcessedObjectMap[*it]; + mToolbarStack->movePanel(panel_to_move, NULL, true); // prepend + } + // Nearbychat is not stored in order settings file, but it must be the first of the panels, so moving it + // manually here + mToolbarStack->movePanel(mNearbyChatBar, NULL, true); } void LLBottomTray::onDraggableButtonMouseUp(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 6697d6f679..0973445157 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -188,6 +188,11 @@ private: */ void updateButtonsOrdersAfterDnD(); + // saves order of buttons to file on disk + void saveButtonsOrder(); + // reads order of buttons from file on disk + void loadButtonsOrder(); + /** * Updates child controls size and visibility when it is necessary to reduce total width. * -- cgit v1.2.3 From eb10840623b6f0386a7990ee946cfa5879094fb3 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 7 Sep 2010 18:16:46 +0100 Subject: Fix some build errors. --- indra/newview/llbottomtray.cpp | 3 ++- indra/newview/llbottomtray.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 053c400e74..f3ade83d00 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -655,7 +655,8 @@ void LLBottomTray::updateButtonsOrdersAfterDnD() // Speak button is currently the only draggable button not in mStateProcessedObjectMap, // so if dragged_state is not found in that map, it should be RS_BUTTON_SPEAK. Change this code if any other // exclusions from mStateProcessedObjectMap will become draggable. - EResizeState dragged_state = RS_BUTTON_SPEAK, landing_state; + EResizeState dragged_state = RS_BUTTON_SPEAK; + EResizeState landing_state = RS_NORESIZE; bool landing_state_found = false; // Find states for dragged item and landing tab for (; it != it_end; ++it) diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 0973445157..14a29895f5 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -63,7 +63,7 @@ public: /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); protected: - LLBottomtrayButton::LLBottomtrayButton(const Params& p) + LLBottomtrayButton(const Params& p) : LLButton(p) { -- cgit v1.2.3 From bb51a764ece0f48161ddea1c519a7e427ccfdf23 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 8 Sep 2010 11:30:50 -0400 Subject: SNOW-606 FIX disable packaging of libuuid Patch taken from JIRA, committing locally to fix our project branch. Code reviewed by Nyx / Brad (transplanted from 06c4d6b5d67f6624d76b5a7f61021ef2d53f44b4) --- indra/cmake/APR.cmake | 2 +- indra/cmake/Copy3rdPartyLibs.cmake | 1 - indra/cmake/ViewerMiscLibs.cmake | 1 - indra/newview/viewer_manifest.py | 1 - install.xml | 19 ------------------- 5 files changed, 1 insertion(+), 23 deletions(-) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 180504d286..b6f1e06edd 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -56,7 +56,7 @@ else (STANDALONE) if (LINUX) if (VIEWER) - list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid) + list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES}) endif (VIEWER) list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt) endif (LINUX) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 2dd296bf12..a756770881 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -232,7 +232,6 @@ elseif(LINUX) libssl.so libstacktrace.so libtcmalloc.so - libuuid.so.1 libssl.so.0.9.7 ) diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 32c4bc81df..5710360de2 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -2,7 +2,6 @@ include(Prebuilt) if (NOT STANDALONE) - use_prebuilt_binary(libuuid) use_prebuilt_binary(vivox) use_prebuilt_binary(fontconfig) endif(NOT STANDALONE) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 08ba8c13b1..c447a977f0 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -922,7 +922,6 @@ class Linux_i686Manifest(LinuxManifest): self.path("libcrypto.so.0.9.7") self.path("libexpat.so.1") self.path("libssl.so.0.9.7") - self.path("libuuid.so.1") self.path("libSDL-1.2.so.0") self.path("libELFIO.so") self.path("libopenjpeg.so.1.3.0", "libopenjpeg.so.1.3") diff --git a/install.xml b/install.xml index a47a732d56..3d90c4eed2 100644 --- a/install.xml +++ b/install.xml @@ -891,25 +891,6 @@ anguage Infrstructure (CLI) international standard - libuuid - - copyright - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - description - Generates UUIDs under Linux. Originally a part of the ext2fs filesystem. Also see lluuid.cpp for all platforms. Part of the e2fsprogs package. - license - lgpl - packages - - linux - - md5sum - 91b194aed4b38bc23493b198009a8c6a - url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libuuid-linux-20090417.tar.bz2 - - - libxml license -- cgit v1.2.3