summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpanelmaininventory.cpp26
-rw-r--r--indra/newview/llpanelmaininventory.h1
2 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 0ad4e69942..9892360a1b 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -515,16 +515,15 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata)
mForceShowInvLayout = true;
}
- LLHandle<LLPanel> handle = mCombinationInventoryPanel->getHandle();
+ LLHandle<LLPanel> handle = getHandle();
std::function<void(const LLUUID&)> callback_cat_created = [handle](const LLUUID& new_category_id)
{
gInventory.notifyObservers(); // not really needed, should have been already done
- LLInventorySingleFolderPanel* panel = (LLInventorySingleFolderPanel*)handle.get();
+ LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get();
if (new_category_id.notNull() && panel)
{
- panel->setSelectionByID(new_category_id, TRUE);
- panel->getRootFolder()->scrollToShowSelection();
- panel->getRootFolder()->setNeedsAutoRename(TRUE);
+ // might need to refresh visibility, delay rename
+ panel->mCombInvUUIDNeedsRename = new_category_id;
}
};
menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created);
@@ -532,12 +531,17 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata)
}
else
{
- std::function<void(const LLUUID&)> callback_cat_created = [this](const LLUUID &new_category_id)
+ LLHandle<LLPanel> handle = getHandle();
+ std::function<void(const LLUUID&)> callback_cat_created = [handle](const LLUUID &new_category_id)
{
gInventory.notifyObservers(); // not really needed, should have been already done
if (new_category_id.notNull())
{
- setGallerySelection(new_category_id);
+ LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get();
+ if (panel)
+ {
+ panel->setGallerySelection(new_category_id);
+ }
}
};
menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created);
@@ -2414,6 +2418,14 @@ void LLPanelMainInventory::updateCombinationVisibility()
mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/);
}
}
+
+ if (mCombInvUUIDNeedsRename.notNull() && !mReshapeInvLayout)
+ {
+ mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE);
+ mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();
+ mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE);
+ mCombInvUUIDNeedsRename.setNull();
+ }
}
}
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index ae2e07da11..6d749f269c 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -250,6 +250,7 @@ private:
bool mForceShowInvLayout;
bool mReshapeInvLayout;
+ LLUUID mCombInvUUIDNeedsRename;
// List Commands //
////////////////////////////////////////////////////////////////////////////////
};