diff options
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.h | 2 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.h | 2 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.h | 1 |
7 files changed, 56 insertions, 8 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index dd7ce40e97..a875d33679 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -90,6 +90,29 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) } } +LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater() +{ + LLFloater* topmost_floater = NULL; + S32 z_min = S32_MAX; + + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + { + LLFloater* inventory_floater = (*iter); + + if (inventory_floater && inventory_floater->getVisible()) + { + S32 z_order = gFloaterView->getZOrder(inventory_floater); + if (z_order < z_min) + { + z_min = z_order; + topmost_floater = inventory_floater; + } + } + } + return topmost_floater; +} + LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 20baf28184..5e7e755d1f 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -57,6 +57,8 @@ public: LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); + static LLFloater* getTopmostInventoryFloater(); + static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index da58aa70f9..c4da11a570 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -696,7 +696,7 @@ void LLInventoryGallery::updateAddedItem(LLUUID item_id) LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, inventory_type, misc_flags, obj->getIsLinkType(), is_worn); mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item)); item->setRightMouseDownCallback(boost::bind(&LLInventoryGallery::showContextMenu, this, _1, _2, _3, item_id)); - item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::onChangeItemSelection, this, item_id)); + item->setFocusReceivedCallback(boost::bind(&LLInventoryGallery::changeItemSelection, this, item_id)); if (mGalleryCreated) { addToGallery(item); @@ -789,21 +789,21 @@ void LLInventoryGallery::showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLU } } -void LLInventoryGallery::onChangeItemSelection(const LLUUID& category_id) +void LLInventoryGallery::changeItemSelection(const LLUUID& item_id) { - if (mSelectedItemID == category_id) + if ((mItemMap.count(item_id) > 0) && (mSelectedItemID == item_id)) return; if (mItemMap[mSelectedItemID]) { mItemMap[mSelectedItemID]->setSelected(FALSE); } - if (mItemMap[category_id]) + if (mItemMap[item_id]) { - mItemMap[category_id]->setSelected(TRUE); + mItemMap[item_id]->setSelected(TRUE); } - mSelectedItemID = category_id; - signalSelectionItemID(category_id); + mSelectedItemID = item_id; + signalSelectionItemID(item_id); } void LLInventoryGallery::updateMessageVisibility() diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index cef7574093..7284c92c96 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -110,6 +110,7 @@ public: void computeDifference(const LLInventoryModel::cat_array_t vcats, const LLInventoryModel::item_array_t vitems, uuid_vec_t& vadded, uuid_vec_t& vremoved); void deselectItem(const LLUUID& category_id); + void changeItemSelection(const LLUUID& item_id); void signalSelectionItemID(const LLUUID& category_id); boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); LLUUID getSelectedItemID() { return mSelectedItemID; } @@ -121,7 +122,6 @@ public: protected: - void onChangeItemSelection(const LLUUID& category_id); void showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& item_id); void applyFilter(LLInventoryGalleryItem* item, const std::string& filter_substring); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 392624a7e8..f97f07f52c 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1793,6 +1793,20 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L { sidepanel_inventory->selectAllItemsPanel(); } + + LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater(); + if(!auto_open && inventory_floater && inventory_floater->getVisible()) + { + LLSidepanelInventory *inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel"); + LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel(); + if(main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode()) + { + main_panel->setGallerySelection(obj_id); + return; + } + } + + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 383250e3ac..79b41f8e5f 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2180,5 +2180,13 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter() return mActivePanel->getFilter(); } } + +void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) +{ + if(mSingleFolderMode && isGalleryViewMode()) + { + mInventoryGalleryPanel->changeItemSelection(item_id); + } +} // List Commands // //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 1f0dfc82d2..1e171d5066 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -118,6 +118,7 @@ public: void onBackFolderClicked(); void onForwardFolderClicked(); void setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history = true); + void setGallerySelection(const LLUUID& item_id); LLUUID getSingleFolderViewRoot(); bool isSingleFolderMode() { return mSingleFolderMode; } |