summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2010-09-28 22:14:22 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2010-09-28 22:14:22 +0300
commitb0cadec6fbd3c8d0ca21d5804061d2ce366b52dc (patch)
treeffcc103ffa227e52134ce414fdfb0766db2b2626 /indra/newview/llsidepanelinventory.cpp
parentdf290ee4d45481144e7cc7675d11575b0eea2c78 (diff)
STORM-248 FIXED The 'Share' button in My Inventory now respects multiple selection.
- The button is now enabled only if all selected items are shareable. (it had checked only one currently selected item) - Eliminated some copy&paste.
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 23e96c22fa..1e585ece23 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -311,18 +311,17 @@ bool LLSidepanelInventory::canShare()
LLPanelMainInventory* panel_main_inventory =
mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
- LLFolderView* root_folder =
- panel_main_inventory->getActivePanel()->getRootFolder();
-
- LLFolderViewItem* current_item = root_folder->hasVisibleChildren()
- ? root_folder->getCurSelectedItem()
- : NULL;
+ if (!panel_main_inventory)
+ {
+ llwarns << "Failed to get the main inventory panel" << llendl;
+ return false;
+ }
- LLInvFVBridge* bridge = current_item
- ? dynamic_cast <LLInvFVBridge*> (current_item->getListener())
- : NULL;
+ LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel();
+ // Avoid flicker in the Recent tab while inventory is being loaded.
+ if (!active_panel->getRootFolder()->hasVisibleChildren()) return false;
- return bridge ? bridge->canShare() : false;
+ return LLAvatarActions::canShareSelectedItems(active_panel);
}
LLInventoryItem *LLSidepanelInventory::getSelectedItem()