diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-11-07 14:43:59 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-11-07 14:43:59 -0800 |
commit | 5dcdb2dd02ac7e7626e03ab7b4f4bb0aaad72742 (patch) | |
tree | b7087b295830e5481840e31ce31ba7c43e48ef96 /indra/newview/llinventorypanel.cpp | |
parent | 32dca99fe59196fa4a92a815b441b4e6e9f747f0 (diff) |
EXP-1548 FIX -- Clicking show on inventory offer does not open inventory (or received items panel) on test grid Ravi set to use Received Items folder for transfers
EXP-1555 FIX -- Double-click is inconsistent between inventory and Received Items
EXP-1547 FIX -- drag/drop inventory to agent - delivers to Objects, not Received items.
* "Show" button from p2p transfer now opens inventory window and inbox panel, setting focus to the item
* Double-click on inbox inventory items now falls through to default item behavior
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 68 |
1 files changed, 60 insertions, 8 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 18c3f76826..f4e6d32510 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1128,19 +1128,71 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { // Make sure the floater is not minimized (STORM-438). if (active_inv_floaterp && active_inv_floaterp->isMinimized()) + { active_inv_floaterp->setMinimized(FALSE); + } + } + else if (auto_open) + { + floater_inventory->openFloater(); - return res; + res = sidepanel_inventory->getActivePanel(); } + + return res; +} + +//static +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id) +{ + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + + if (active_panel) + { + LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; - // C. If no panels are open and we don't want to force open a panel, then just abort out. - if (!auto_open) return NULL; - - // D. Open the inventory side panel floater and use that. - floater_inventory->openFloater(); - return sidepanel_inventory->getActivePanel(); + LLViewerInventoryItem * item = gInventory.getItem(obj_id); + + bool item_in_inbox = false; + bool item_in_outbox = false; + + if (item) + { + LLViewerInventoryCategory * cat = gInventory.getCategory(item->getParentUUID()); + + if (cat) + { + item_in_inbox = (LLFolderType::FT_INBOX == cat->getPreferredType()); + item_in_outbox = (LLFolderType::FT_OUTBOX == cat->getPreferredType()); + } + } + + if (item_in_inbox || item_in_outbox) + { + LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); + LLInventoryPanel * inventory_panel = NULL; + + if (item_in_inbox) + { + sidepanel_inventory->openInbox(); + inventory_panel = sidepanel_inventory->getInboxPanel(); + } + else + { + sidepanel_inventory->openOutbox(); + inventory_panel = sidepanel_inventory->getOutboxPanel(); + } - return NULL; + if (inventory_panel) + { + inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES); + } + } + else + { + active_panel->setSelection(obj_id, TAKE_FOCUS_YES); + } + } } void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) |