summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp4
-rw-r--r--indra/newview/llinventorypanel.cpp56
-rw-r--r--indra/newview/llinventorypanel.h10
-rw-r--r--indra/newview/llmeshrepository.cpp2
-rw-r--r--indra/newview/llviewerassetupload.cpp2
-rw-r--r--indra/newview/llviewermessage.cpp19
-rw-r--r--indra/newview/llwearableitemslist.cpp2
7 files changed, 52 insertions, 43 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 385a2569a5..661db13baa 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1765,7 +1765,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
}
else if ("show_in_main_panel" == action)
{
- LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE);
+ LLInventoryPanel::openInventoryPanelAndSetSelection(true, mUUID, true);
return;
}
else if ("cut" == action)
@@ -3396,7 +3396,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
}
else if ("show_in_main_panel" == action)
{
- LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE);
+ LLInventoryPanel::openInventoryPanelAndSetSelection(true, mUUID, true);
return;
}
else if ("cut" == action)
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 54f91451ac..a7d39b1ef6 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1922,46 +1922,52 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
}
//static
-void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL use_main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
+void LLInventoryPanel::openInventoryPanelAndSetSelection(bool auto_open, const LLUUID& obj_id,
+ bool use_main_panel, bool take_keyboard_focus, bool reset_filter)
{
LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
sidepanel_inventory->showInventoryPanel();
- bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
-
- if (!in_inbox && (use_main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected()))
+ LLUUID cat_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
+ bool in_inbox = gInventory.isObjectDescendentOf(obj_id, cat_id);
+ if (!in_inbox && use_main_panel)
{
sidepanel_inventory->selectAllItemsPanel();
}
- LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater();
- if(!auto_open && inventory_floater && inventory_floater->getVisible())
+ if (!auto_open)
{
- LLSidepanelInventory *inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel");
- LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel();
- if(main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode())
+ LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater();
+ if (inventory_floater && inventory_floater->getVisible())
{
- LL_DEBUGS("Inventory") << "Opening gallery panel for item" << obj_id << LL_ENDL;
- main_panel->setGallerySelection(obj_id);
- return;
+ LLSidepanelInventory *inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel");
+ LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel();
+ if (main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode())
+ {
+ LL_DEBUGS("Inventory") << "Opening gallery panel for item" << obj_id << LL_ENDL;
+ main_panel->setGallerySelection(obj_id);
+ return;
+ }
}
}
- LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
- if (main_inventory && main_inventory->isSingleFolderMode()
- && use_main_panel)
+ if (use_main_panel)
{
- const LLInventoryObject *obj = gInventory.getObject(obj_id);
- if (obj)
+ LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
+ if (main_inventory && main_inventory->isSingleFolderMode())
{
- LL_DEBUGS("Inventory") << "Opening main inventory panel for item" << obj_id << LL_ENDL;
- main_inventory->setSingleFolderViewRoot(obj->getParentUUID(), false);
- main_inventory->setGallerySelection(obj_id);
- return;
+ const LLInventoryObject *obj = gInventory.getObject(obj_id);
+ if (obj)
+ {
+ LL_DEBUGS("Inventory") << "Opening main inventory panel for item" << obj_id << LL_ENDL;
+ main_inventory->setSingleFolderViewRoot(obj->getParentUUID(), false);
+ main_inventory->setGallerySelection(obj_id);
+ return;
+ }
}
}
- LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
+ LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
if (active_panel)
{
LL_DEBUGS("Messaging", "Inventory") << "Highlighting" << obj_id << LL_ENDL;
@@ -1973,11 +1979,8 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
if (in_inbox)
{
-
- LLInventoryPanel * inventory_panel = NULL;
sidepanel_inventory->openInbox();
- inventory_panel = sidepanel_inventory->getInboxPanel();
-
+ LLInventoryPanel* inventory_panel = sidepanel_inventory->getInboxPanel();
if (inventory_panel)
{
inventory_panel->setSelection(obj_id, take_keyboard_focus);
@@ -2002,7 +2005,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
void LLInventoryPanel::setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id)
{
-
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)
{
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 341be0cf86..2c35bdcd11 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -244,12 +244,12 @@ public:
// "Auto_open" determines if we open an inventory panel if none are open.
static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
- static void openInventoryPanelAndSetSelection(BOOL auto_open,
+ static void openInventoryPanelAndSetSelection(bool auto_open,
const LLUUID& obj_id,
- BOOL use_main_panel = FALSE,
- BOOL take_keyboard_focus = TAKE_FOCUS_YES,
- BOOL reset_filter = FALSE);
- static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
+ bool use_main_panel = false,
+ bool take_keyboard_focus = true,
+ bool reset_filter = false);
+ static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
void removeItemID(const LLUUID& id);
LLFolderViewItem* getItemByID(const LLUUID& id);
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index d6eba6b4bf..549962ea86 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -5446,7 +5446,7 @@ void on_new_single_inventory_upload_complete(
}
else
{
- LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE);
+ LLInventoryPanel::openInventoryPanelAndSetSelection(true, server_response["new_inventory_item"].asUUID(), true, false, true);
}
// restore keyboard focus
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 13491114b9..036cef5c94 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -847,7 +847,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
- LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, FALSE, TAKE_FOCUS_NO, (panel == NULL));
+ LLInventoryPanel::openInventoryPanelAndSetSelection(true, serverInventoryItem, false, false, !panel);
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index bca7fbac33..17b56c9d1d 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1557,15 +1557,22 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
}
else
{
- // Highlight item
- const BOOL auto_open =
- gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false
- !from_name.empty(); // don't open if it's not from anyone.
- if(auto_open)
+ // Highlight item
+ bool show_in_inventory = gSavedSettings.get<bool>("ShowInInventory");
+ bool auto_open =
+ show_in_inventory && // don't open if ShowInInventory is FALSE
+ !from_name.empty(); // don't open if it's not from anyone
+
+ // SL-20419 : Don't change active tab if floater is visible
+ LLFloater* instance = LLFloaterReg::findInstance("inventory");
+ bool use_main_panel = instance && instance->getVisible();
+
+ if (auto_open)
{
LLFloaterReg::showInstance("inventory");
}
- LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true);
+
+ LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, use_main_panel);
}
}
}
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 83d2b16a86..948fe55e0d 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -797,7 +797,7 @@ void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uui
if (!inv_item)
continue;
- LLUUID linked_uuid = inv_item->getLinkedUUID();
+ const LLUUID& linked_uuid = inv_item->getLinkedUUID();
if (std::find(uuids_begin, uuids_end, linked_uuid) != uuids_end)
{
item->setNeedsRefresh(true);