From 0297f55c6d4be505fe6831a593ed2630d565e14a Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 21 Oct 2011 17:26:47 +0200 Subject: EXP-1416 FIXED "Speak" and "Voice controls" buttons added as control views in LLTransientFloaterMgr to prevent hiding the transient IM floater. --- indra/llui/lltoolbar.cpp | 14 +++++++++++++- indra/llui/lltoolbar.h | 5 +++++ indra/newview/lltoolbarview.cpp | 20 +++++++++++++++++++ indra/newview/lltoolbarview.h | 2 ++ indra/newview/lltransientfloatermgr.cpp | 34 +++++++++++++++++++++++---------- indra/newview/lltransientfloatermgr.h | 9 +++++---- 6 files changed, 69 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 515605200e..b0a072c00e 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -112,6 +112,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mStartDragItemCallback(NULL), mHandleDragItemCallback(NULL), mHandleDropCallback(NULL), + mButtonAddSignal(NULL), mDragAndDropTarget(false) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; @@ -121,6 +122,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) LLToolBar::~LLToolBar() { delete mPopupMenuHandle.get(); + delete mButtonAddSignal; } void LLToolBar::createContextMenu() @@ -212,7 +214,6 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) mButtonPanel->addChild(button); mButtonMap.insert(std::make_pair(commandId.uuid(), button)); - // Insert the command and button in the right place in their respective lists if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE)) { @@ -236,6 +237,11 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) mButtons.insert(it_button,button); } + if (mButtonAddSignal) + { + (*mButtonAddSignal)(button); + } + mNeedsLayout = true; return true; @@ -898,6 +904,12 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) return button; } +boost::signals2::connection LLToolBar::setButtonAddCallback(const button_add_signal_t::slot_type& cb) +{ + if (!mButtonAddSignal) mButtonAddSignal = new button_add_signal_t(); + return mButtonAddSignal->connect(cb); +} + BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index e634e57f93..68fc44ee8e 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -195,6 +195,9 @@ public: LLToolBarButton* createButton(const LLCommandId& id); + typedef boost::signals2::signal button_add_signal_t; + boost::signals2::connection setButtonAddCallback(const button_add_signal_t::slot_type& cb); + bool hasButtons() const { return !mButtons.empty(); } bool isModified() const { return mModified; } @@ -255,6 +258,8 @@ private: LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; LLHandle mPopupMenuHandle; + + button_add_signal_t* mButtonAddSignal; }; diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 619d17efad..affa7241d1 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -35,6 +35,7 @@ #include "lltoolbar.h" #include "llbutton.h" #include "lltooldraganddrop.h" +#include "lltransientfloatermgr.h" #include "llclipboard.h" #include "llagent.h" // HACK for destinations guide on startup @@ -96,14 +97,17 @@ BOOL LLToolBarView::postBuild() mToolbarLeft->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); mToolbarLeft->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); mToolbarLeft->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + mToolbarLeft->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded, _1)); mToolbarRight->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); mToolbarRight->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); mToolbarRight->setHandleDropCallback(boost::bind(LLToolBarView::handleDropTool,_1,_2,_3,_4)); + mToolbarRight->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded, _1)); 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)); + mToolbarBottom->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded, _1)); LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&handleLoginToolbarSetup)); @@ -314,6 +318,22 @@ void LLToolBarView::addToToolset(command_id_list_t& command_list, Toolbar& toolb } } +void LLToolBarView::onToolBarButtonAdded(LLView* button) +{ + if (button && button->getName() == "speak") + { + // Add the "Speak" button as a control view in LLTransientFloaterMgr + // to prevent hiding the transient IM floater upon pressing "Speak". + LLTransientFloaterMgr::getInstance()->addControlView(button); + } + else if (button && button->getName() == "voice") + { + // Add the "Voice controls" button as a control view in LLTransientFloaterMgr + // to prevent hiding the transient IM floater upon pressing "Voice controls". + LLTransientFloaterMgr::getInstance()->addControlView(button); + } +} + void LLToolBarView::draw() { //LLPanel* sizer_left = getChild("sizer_left"); diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 60ad6316f8..8cafbc9308 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -94,6 +94,8 @@ private: bool addCommand(const LLCommandId& commandId, LLToolBar* toolbar); void addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const; + static void onToolBarButtonAdded(LLView* button); + // Pointers to the toolbars handled by the toolbar view LLToolBar* mToolbarLeft; LLToolBar* mToolbarRight; diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index c648a6a28a..d15efb048b 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -42,9 +42,9 @@ LLTransientFloaterMgr::LLTransientFloaterMgr() &LLTransientFloaterMgr::leftMouseClickCallback, this, _2, _3, _4)); } - mGroupControls.insert(std::pair >(GLOBAL, std::set())); - mGroupControls.insert(std::pair >(DOCKED, std::set())); - mGroupControls.insert(std::pair >(IM, std::set())); + mGroupControls.insert(std::pair(GLOBAL, controls_set_t())); + mGroupControls.insert(std::pair(DOCKED, controls_set_t())); + mGroupControls.insert(std::pair(IM, controls_set_t())); } void LLTransientFloaterMgr::registerTransientFloater(LLTransientFloater* floater) @@ -59,12 +59,16 @@ void LLTransientFloaterMgr::unregisterTransientFloater(LLTransientFloater* float void LLTransientFloaterMgr::addControlView(ETransientGroup group, LLView* view) { - mGroupControls.find(group)->second.insert(view); + if (!view) return; + + mGroupControls.find(group)->second.insert(view->getHandle()); } void LLTransientFloaterMgr::removeControlView(ETransientGroup group, LLView* view) { - mGroupControls.find(group)->second.erase(view); + if (!view) return; + + mGroupControls.find(group)->second.erase(view->getHandle()); } void LLTransientFloaterMgr::addControlView(LLView* view) @@ -89,7 +93,7 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) { ETransientGroup group = floater->getGroup(); - bool hide = isControlClicked(mGroupControls.find(group)->second, x, y); + bool hide = isControlClicked(group, mGroupControls.find(group)->second, x, y); if (hide) { floater->setTransientVisible(FALSE); @@ -98,13 +102,23 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) } } -bool LLTransientFloaterMgr::isControlClicked(std::set& set, S32 x, S32 y) +bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y) { bool res = true; for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) { - LLView* control_view = *it; + LLView* control_view = NULL; + + LLHandle handle = *it; + if (handle.isDead()) + { + mGroupControls.find(group)->second.erase(handle); + continue; + } + + control_view = handle.get(); + if (!control_view->getVisible()) { continue; @@ -130,8 +144,8 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y, return; } - bool hide = isControlClicked(mGroupControls.find(DOCKED)->second, x, y) - && isControlClicked(mGroupControls.find(GLOBAL)->second, x, y); + bool hide = isControlClicked(DOCKED, mGroupControls.find(DOCKED)->second, x, y) + && isControlClicked(GLOBAL, mGroupControls.find(GLOBAL)->second, x, y); if (hide) { hideTransientFloaters(x, y); diff --git a/indra/newview/lltransientfloatermgr.h b/indra/newview/lltransientfloatermgr.h index 2919244121..b4611c8c87 100644 --- a/indra/newview/lltransientfloatermgr.h +++ b/indra/newview/lltransientfloatermgr.h @@ -56,14 +56,15 @@ public: void removeControlView(LLView* view); private: + typedef std::set > controls_set_t; + typedef std::map group_controls_t; + void hideTransientFloaters(S32 x, S32 y); void leftMouseClickCallback(S32 x, S32 y, MASK mask); - bool isControlClicked(std::set& set, S32 x, S32 y); -private: + bool isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y); + std::set mTransSet; - typedef std::set controls_set_t; - typedef std::map > group_controls_t; group_controls_t mGroupControls; }; -- cgit v1.2.3 From 2456573925567ed91d4cc227d7fc97b90248a1fa Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 21 Oct 2011 19:14:10 +0200 Subject: EXP-1404 FIXED (Dock icon shown in lower left corner of call dialog when user has speak icon hidden) - Don't draw tongue of dockable call dialog floater in case speak button is not present in any tool bar. --- indra/llui/lldockablefloater.h | 2 ++ indra/newview/llimview.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 8deb6c1159..1484ea3978 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -113,6 +113,8 @@ public: bool getUniqueDocking() { return mUniqueDocking; } bool getUseTongue() { return mUseTongue; } + + void setUseTongue(bool use_tongue) { mUseTongue = use_tongue;} private: /** * Provides unique of dockable floater. diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6e9baed5f2..33c6b2218c 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1683,6 +1683,8 @@ BOOL LLCallDialog::postBuild() LLView *anchor_panel = gToolBarView->findChildView("speak"); setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + setUseTongue(anchor_panel); + return TRUE; } -- cgit v1.2.3 From f19ee13c0450e0e16e7c8c9d7f700e11c36886ef Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 21 Oct 2011 14:43:16 -0700 Subject: EXP-1430 FIX -- Minimizing voice settings floater corrupts layout throughout rest of session * Added minimum size for layout panel that holds voice morphing and removed user resizability. Reviewed by Richard. --- indra/newview/skins/default/xui/en/floater_voice_controls.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 93a04050b6..6807b01fa3 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -89,7 +89,7 @@ visible="true" width="20" /> - + Date: Fri, 21 Oct 2011 16:29:36 -0700 Subject: EXP-1434 FIX -- Mini-location bar disappears after maximizing/restoring viewer window * The topinfo bar no longer follows the right edge of the window so it doesn't scale down and disappear. --- indra/newview/skins/default/xui/en/panel_topinfo_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml index 79f29777ce..fc527f5f9d 100644 --- a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml @@ -4,7 +4,7 @@ background_opaque="false" bg_opaque_color="Black_50" bg_alpha_color="Black_50" - follows="left|top|right" + follows="left|top" height="19" layout="topleft" name="topinfo_bar" -- cgit v1.2.3 From 5676e4a62efd2636840395a0667e3df3a48f1989 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 21 Oct 2011 18:36:06 -0700 Subject: EXP-1439 : Modify DaD on the Favorite toolbar so that reordering visible landmarks don't send any back to the end of the list --- indra/newview/llfavoritesbar.cpp | 65 ++++++++++++++++++++++++-------------- indra/newview/llfavoritesbar.h | 2 +- indra/newview/llinventorymodel.cpp | 50 +++++++++++++++++++++-------- indra/newview/llinventorymodel.h | 11 +++++-- 4 files changed, 86 insertions(+), 42 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 98de418878..4e0c838454 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -504,20 +504,29 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) { + // Identify the button hovered and the side to drop LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab); + bool insert_before = true; + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } - // there is no need to handle if an item was dragged onto itself + // There is no need to handle if an item was dragged onto itself if (dest && dest->getLandmarkId() == mDragItemId) { return; } + // Insert the dragged item in the right place if (dest) { - LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId()); + LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId(), insert_before); } else { + // This can happen when the item list is empty mItems.push_back(gInventory.getItem(mDragItemId)); } @@ -534,22 +543,31 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) { + // Identify the button hovered and the side to drop LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab); - - // there is no need to handle if an item was dragged onto itself + bool insert_before = true; + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } + + // There is no need to handle if an item was dragged onto itself if (dest && dest->getLandmarkId() == mDragItemId) { return; } - + LLPointer viewer_item = new LLViewerInventoryItem(item); + // Insert the dragged item in the right place if (dest) { - insertBeforeItem(mItems, dest->getLandmarkId(), viewer_item); + insertItem(mItems, dest->getLandmarkId(), viewer_item, insert_before); } else { + // This can happen when the item list is empty mItems.push_back(viewer_item); } @@ -1337,29 +1355,28 @@ BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array return result; } -LLInventoryModel::item_array_t::iterator LLFavoritesBarCtrl::findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) +void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before) { - LLInventoryModel::item_array_t::iterator result = items.end(); + // Get the iterator to the destination item + LLInventoryModel::item_array_t::iterator it_dest = LLInventoryModel::findItemIterByUUID(items, dest_item_id); + if (it_dest == items.end()) + return; - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + // Go to the next element if one wishes to insert after the dest element + if (!insert_before) { - if ((*i)->getUUID() == id) - { - result = i; - break; - } + ++it_dest; } - - return result; -} - -void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem) -{ - LLViewerInventoryItem* beforeItem = gInventory.getItem(beforeItemId); - llassert(beforeItem); - if (beforeItem) + + // Insert the source item in the right place + if (it_dest != items.end()) + { + items.insert(it_dest, insertedItem); + } + else { - items.insert(findItemByUUID(items, beforeItem->getUUID()), insertedItem); + // Append to the list if it_dest reached the end + items.push_back(insertedItem); } } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 1b11d6196e..2f75b3bb0e 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -130,7 +130,7 @@ private: * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId. * this function assumes that an item identified by insertedItemId doesn't exist in items array. */ - void insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem); + void insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before); // finds an item by it's UUID in the items array LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e86c427ae2..fb02fe0ff7 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2879,40 +2879,62 @@ BOOL LLInventoryModel::getIsFirstTimeInViewer2() return sFirstTimeInViewer2; } -static LLInventoryModel::item_array_t::iterator find_item_iter_by_uuid(LLInventoryModel::item_array_t& items, const LLUUID& id) +LLInventoryModel::item_array_t::iterator LLInventoryModel::findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id) { - LLInventoryModel::item_array_t::iterator result = items.end(); + LLInventoryModel::item_array_t::iterator curr_item = items.begin(); - for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + while (curr_item != items.end()) { - if ((*i)->getUUID() == id) + if ((*curr_item)->getUUID() == id) { - result = i; break; } + ++curr_item; } - return result; + return curr_item; } // static // * @param[in, out] items - vector with items to be updated. It should be sorted in a right way // * before calling this method. // * @param src_item_id - LLUUID of inventory item to be moved in new position -// * @param dest_item_id - LLUUID of inventory item before which source item should be placed. -void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id) +// * @param dest_item_id - LLUUID of inventory item before (or after) which source item should +// * be placed. +// * @param insert_before - bool indicating if src_item_id should be placed before or after +// * dest_item_id. Default is true. +void LLInventoryModel::updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, const LLUUID& dest_item_id, bool insert_before) { - LLInventoryModel::item_array_t::iterator it_src = find_item_iter_by_uuid(items, src_item_id); - LLInventoryModel::item_array_t::iterator it_dest = find_item_iter_by_uuid(items, dest_item_id); + LLInventoryModel::item_array_t::iterator it_src = findItemIterByUUID(items, src_item_id); + LLInventoryModel::item_array_t::iterator it_dest = findItemIterByUUID(items, dest_item_id); - if (it_src == items.end() || it_dest == items.end()) return; + // If one of the passed UUID is not in the item list, bail out + if ((it_src == items.end()) || (it_dest == items.end())) + return; + // Erase the source element from the list, keep a copy before erasing. LLViewerInventoryItem* src_item = *it_src; items.erase(it_src); - // target iterator can not be valid because the container was changed, so update it. - it_dest = find_item_iter_by_uuid(items, dest_item_id); - items.insert(it_dest, src_item); + // Note: Target iterator is not valid anymore because the container was changed, so update it. + it_dest = findItemIterByUUID(items, dest_item_id); + + // Go to the next element if one wishes to insert after the dest element + if (!insert_before) + { + ++it_dest; + } + + // Reinsert the source item in the right place + if (it_dest != items.end()) + { + items.insert(it_dest, src_item); + } + else + { + // Append to the list if it_dest reached the end + items.push_back(src_item); + } } //* @param[in] items vector of items in order to be saved. diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index e0e81f1006..a0fd455cf3 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -332,11 +332,16 @@ protected: //-------------------------------------------------------------------- public: // Changes items order by insertion of the item identified by src_item_id - // before the item identified by dest_item_id. Both items must exist in items array. - // Sorting is stored after method is finished. Only src_item_id is moved before dest_item_id. + // before (or after) the item identified by dest_item_id. Both items must exist in items array. + // Sorting is stored after method is finished. Only src_item_id is moved before (or after) dest_item_id. + // The parameter "insert_before" controls on which side of dest_item_id src_item_id gets rensinserted. static void updateItemsOrder(LLInventoryModel::item_array_t& items, const LLUUID& src_item_id, - const LLUUID& dest_item_id); + const LLUUID& dest_item_id, + bool insert_before = true); + // Gets an iterator on an item vector knowing only the item UUID. + // Returns end() of the vector if not found. + static LLInventoryModel::item_array_t::iterator findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); // Saves current order of the passed items using inventory item sort field. // Resets 'items' sort fields and saves them on server. -- cgit v1.2.3 From 443d1b08b22262566dc4d476ca0bdef665518721 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 21 Oct 2011 18:51:39 -0700 Subject: EXP-1439 : Fix potential crash when the favorites bar is empty --- indra/newview/llfavoritesbar.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 4e0c838454..c48b809114 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -544,12 +544,16 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) { // Identify the button hovered and the side to drop - LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab); - bool insert_before = true; - if (!dest) + LLFavoriteLandmarkButton* dest = NULL; + bool insert_before = true; + if (!mItems.empty()) { - insert_before = false; - dest = dynamic_cast(mLastTab); + dest = dynamic_cast(mLandingTab); + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } } // There is no need to handle if an item was dragged onto itself -- cgit v1.2.3 From 338914bd7d7e776d3ca5a4eb9a579fcbe53cf1b9 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Mon, 24 Oct 2011 14:17:15 +0200 Subject: EXP-1400 FIXED (Call request docking icon overlays other toolbar buttons when speak button in side toolbar) - LLDockableFloater::getDockTongue to init dock tongue with proper image depending on floater dock side, also added images for left and right tongues. - Added proper call floater positioning relatively to the speak button --- indra/llui/lldockablefloater.cpp | 15 ++++++- indra/llui/lldockablefloater.h | 2 +- indra/llui/lldockcontrol.cpp | 43 +++++++++++++-------- indra/llui/lldockcontrol.h | 1 + indra/newview/llimview.cpp | 19 ++++++++- indra/newview/llimview.h | 5 ++- .../skins/default/textures/windows/Flyout_Left.png | Bin 0 -> 271 bytes .../default/textures/windows/Flyout_Right.png | Bin 0 -> 280 bytes .../skins/default/xui/en/floater_outgoing_call.xml | 1 + 9 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 indra/newview/skins/default/textures/windows/Flyout_Left.png create mode 100644 indra/newview/skins/default/textures/windows/Flyout_Right.png (limited to 'indra') diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index aea58be12a..0fcd937361 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -239,8 +239,21 @@ void LLDockableFloater::setDockControl(LLDockControl* dockControl) setDocked(isDocked()); } -const LLUIImagePtr& LLDockableFloater::getDockTongue() +const LLUIImagePtr& LLDockableFloater::getDockTongue(LLDockControl::DocAt dock_side) { + switch(dock_side) + { + case LLDockControl::LEFT: + mDockTongue = LLUI::getUIImage("windows/Flyout_Left.png"); + break; + case LLDockControl::RIGHT: + mDockTongue = LLUI::getUIImage("windows/Flyout_Right.png"); + break; + default: + mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); + break; + } + return mDockTongue; } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 1484ea3978..89c9852f4a 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -124,7 +124,7 @@ private: protected: void setDockControl(LLDockControl* dockControl); - const LLUIImagePtr& getDockTongue(); + const LLUIImagePtr& getDockTongue(LLDockControl::DocAt dock_side = LLDockControl::TOP); // Checks if docking should be forced. // It may be useful e.g. if floater created in mouselook mode (see EXT-5609) diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 6397bbd0de..8cb2e57b98 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -203,21 +203,33 @@ void LLDockControl::moveDockable() switch (mDockAt) { case LEFT: - x = dockRect.mLeft; - y = dockRect.mTop + mDockTongue->getHeight() + dockableRect.getHeight(); - // check is dockable inside root view rect - if (x < rootRect.mLeft) + + x = dockRect.mLeft - dockableRect.getWidth(); + y = dockRect.getCenterY() + dockableRect.getHeight() / 2; + + if (use_tongue) { - x = rootRect.mLeft; + x -= mDockTongue->getWidth(); } - if (x + dockableRect.getWidth() > rootRect.mRight) + + mDockTongueX = dockableRect.mRight; + mDockTongueY = dockableRect.getCenterY() - mDockTongue->getHeight() / 2; + + break; + + case RIGHT: + + x = dockRect.mRight; + y = dockRect.getCenterY() + dockableRect.getHeight() / 2; + + if (use_tongue) { - x = rootRect.mRight - dockableRect.getWidth(); + x += mDockTongue->getWidth(); } - - mDockTongueX = x + dockableRect.getWidth()/2 - mDockTongue->getWidth() / 2; - - mDockTongueY = dockRect.mTop; + + mDockTongueX = dockRect.mRight; + mDockTongueY = dockableRect.getCenterY() - mDockTongue->getHeight() / 2; + break; case TOP: @@ -315,13 +327,12 @@ void LLDockControl::moveDockable() dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(), dockableRect.getHeight()); } + LLRect localDocableParentRect; - mDockableFloater->getParent()->screenRectToLocal(dockableRect, - &localDocableParentRect); - mDockableFloater->setRect(localDocableParentRect); - mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY, - &mDockTongueX, &mDockTongueY); + mDockableFloater->getParent()->screenRectToLocal(dockableRect, &localDocableParentRect); + mDockableFloater->setRect(localDocableParentRect); + mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY, &mDockTongueX, &mDockTongueY); } diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index 2e7359245f..463223fafd 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -43,6 +43,7 @@ public: { TOP, LEFT, + RIGHT, BOTTOM }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 33c6b2218c..c751394455 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1681,7 +1681,8 @@ BOOL LLCallDialog::postBuild() return FALSE; LLView *anchor_panel = gToolBarView->findChildView("speak"); - setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(), LLDockControl::TOP)); + LLDockControl::DocAt dock_pos = getDockControlPos(); + setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos)); setUseTongue(anchor_panel); @@ -1751,6 +1752,22 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) } } +LLDockControl::DocAt LLCallDialog::getDockControlPos() +{ + LLToolBar* tool_bar = NULL; + + if((tool_bar = gToolBarView->getChild("toolbar_left")) && tool_bar->hasChild("speak", true)) + { + return LLDockControl::RIGHT; // Speak button in the left toolbar so the call floater should be to the right of the speak button + } + else if((tool_bar = gToolBarView->getChild("toolbar_right")) && tool_bar->hasChild("speak", true)) + { + return LLDockControl::LEFT; // Speak button in the right toolbar so the call floater should be to the left of the speak button + } + + return LLDockControl::TOP; +} + bool LLCallDialog::lifetimeHasExpired() { if (mLifetimeTimer.getStarted()) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 93b604d36a..33c7ae9e54 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -491,7 +491,7 @@ class LLCallDialog : public LLDockableFloater { public: LLCallDialog(const LLSD& payload); - ~LLCallDialog(); + virtual ~LLCallDialog(); virtual BOOL postBuild(); @@ -519,6 +519,9 @@ protected: void setIcon(const LLSD& session_id, const LLSD& participant_id); LLSD mPayload; + +private: + LLDockControl::DocAt getDockControlPos(); }; class LLIncomingCallDialog : public LLCallDialog diff --git a/indra/newview/skins/default/textures/windows/Flyout_Left.png b/indra/newview/skins/default/textures/windows/Flyout_Left.png new file mode 100644 index 0000000000..6ac9fe2efd Binary files /dev/null and b/indra/newview/skins/default/textures/windows/Flyout_Left.png differ diff --git a/indra/newview/skins/default/textures/windows/Flyout_Right.png b/indra/newview/skins/default/textures/windows/Flyout_Right.png new file mode 100644 index 0000000000..aa1f0625aa Binary files /dev/null and b/indra/newview/skins/default/textures/windows/Flyout_Right.png differ diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 9db6568ee3..ffbb6aa28b 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -8,6 +8,7 @@ layout="topleft" name="outgoing call" help_topic="outgoing_call" + save_dock_state="true" title="CALLING" width="410"> Date: Mon, 24 Oct 2011 13:56:14 -0700 Subject: EXP-1458 FIX Chat text entry bar does not have focus when chat floater is opened while chat history is toggled open made expando-button chrome, so it doesn't steal focus --- indra/newview/skins/default/xui/en/floater_chat_bar.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml index 989b4a0580..86191b789c 100644 --- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml @@ -68,6 +68,7 @@ image_pressed="ComboButton_UpSelected" image_pressed_selected="ComboButton_Selected" height="23" + chrome="true" name="show_nearby_chat" tool_tip="Shows/hides nearby chat log"> -- cgit v1.2.3 From cd13933b0942ef4fdf2d4ec8f558d0ec2312b691 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 24 Oct 2011 14:14:55 -0700 Subject: EXP-1354 : Fixed. Toolbars now saved whenever changing their config and only if initialized correctly. --- indra/newview/lltoolbarview.cpp | 14 +++++++++++++- indra/newview/lltoolbarview.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index affa7241d1..f481455834 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -73,7 +73,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) mToolbarRight(NULL), mToolbarBottom(NULL), mDragStarted(false), - mDragToolbarButton(NULL) + mDragToolbarButton(NULL), + mToolbarsLoaded(false) { } @@ -244,6 +245,7 @@ bool LLToolBarView::loadToolbars(bool force_default) } } } + mToolbarsLoaded = true; return true; } @@ -255,6 +257,10 @@ bool LLToolBarView::loadDefaultToolbars() if (gToolBarView) { retval = gToolBarView->loadToolbars(true); + if (retval) + { + gToolBarView->saveToolbars(); + } } return retval; @@ -262,6 +268,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) @@ -460,6 +469,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 8cafbc9308..ea14e471cd 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -100,6 +100,7 @@ private: LLToolBar* mToolbarLeft; LLToolBar* mToolbarRight; LLToolBar* mToolbarBottom; + bool mToolbarsLoaded; bool mDragStarted; LLToolBarButton* mDragToolbarButton; -- cgit v1.2.3 From 399de4f345eb0bf43e84bf0a65b3251798f59a13 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 24 Oct 2011 14:28:09 -0700 Subject: EXP-1454 FIX People floater 'cascades' as if opening a new window while looking at group profiles --- indra/llui/llfloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7100ea13a7..2c707afa8f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -935,7 +935,7 @@ void LLFloater::applyPositioning(LLFloater* other) case LLFloaterEnums::OPEN_POSITIONING_CASCADE_GROUP: case LLFloaterEnums::OPEN_POSITIONING_CASCADING: - if (other != NULL) + if (other != NULL && other != this) { stackWith(*other); } -- cgit v1.2.3 From b3c1e967ee9aa1b19622fe7b40e73417ac931b1d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 24 Oct 2011 15:42:07 -0700 Subject: EXP-1354 : FIX. Force loading the default toolbars if the user toolbar loading fails somewhat. --- indra/newview/lltoolbarview.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index f481455834..9eea49914f 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -151,6 +151,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar) bool LLToolBarView::loadToolbars(bool force_default) { LLToolBarView::ToolbarSet toolbar_set; + bool err = false; // Load the toolbars.xml file std::string toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "toolbars.xml"); @@ -165,24 +166,39 @@ bool LLToolBarView::loadToolbars(bool force_default) } LLXMLNodePtr root; - if(!LLXMLNode::parseFile(toolbar_file, root, NULL)) + if (!LLXMLNode::parseFile(toolbar_file, root, NULL)) { llwarns << "Unable to load toolbars from file: " << toolbar_file << llendl; - return false; + err = true; } - if(!root->hasName("toolbars")) + + if (!err && !root->hasName("toolbars")) { llwarns << toolbar_file << " is not a valid toolbars definition file" << llendl; - return false; + err = true; } // Parse the toolbar settings LLXUIParser parser; - parser.readXUI(root, toolbar_set, toolbar_file); - if (!toolbar_set.validateBlock()) + if (!err) { - llerrs << "Unable to validate toolbars from file: " << toolbar_file << llendl; - return false; + parser.readXUI(root, toolbar_set, toolbar_file); + } + if (!err && !toolbar_set.validateBlock()) + { + llwarns << "Unable to validate toolbars from file: " << toolbar_file << llendl; + err = true; + } + + if (err) + { + if (force_default) + { + llerrs << "Unable to load toolbars from default file : " << toolbar_file << llendl; + return false; + } + // Try to load the default toolbars + return loadToolbars(true); } // Clear the toolbars now before adding the loaded commands and settings -- cgit v1.2.3 From 4af2cc2e743a79944df6aef6d209ea8b8a1c33e2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 24 Oct 2011 15:52:50 -0700 Subject: EXP-1421 FIX -- Linden Dollars Still visually looks like a button. * L$ background color now matches the menu bar. The tooltip and click behavior have been left untouched, per design. --- indra/newview/skins/default/xui/en/panel_status_bar.xml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 422bbada7f..b321e0162e 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -2,7 +2,7 @@ + follows="right|top" + name="balance_bg">