Atom Tools: moving custom asset browser code to common location

Consolidated duplicate asset browser code from multiple tools into single class in atom tools framework
Moved creation of asset browser and Python terminal windows into base main window class
Fixed docked window orientations
Added checks to asset browser to prevent crashes if tree state saver was null

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
This commit is contained in:
Guthrie Adams
2022-01-18 01:50:05 -06:00
parent 4cd3568d7b
commit eb51cd4c06
22 changed files with 212 additions and 408 deletions
@@ -230,7 +230,10 @@ namespace AzToolsFramework
{
QModelIndex curIndex = selectedIndexes[0];
m_expandToEntriesByDefault = true;
m_treeStateSaver->ApplySnapshot();
if (m_treeStateSaver)
{
m_treeStateSaver->ApplySnapshot();
}
setCurrentIndex(curIndex);
scrollTo(curIndex);
@@ -240,8 +243,12 @@ namespace AzToolsFramework
// Flag our default expansion state so that we expand down to source entries after filtering
m_expandToEntriesByDefault = hasFilter;
// Then ask our state saver to apply its current snapshot again, falling back on asking us if entries should be expanded or not
m_treeStateSaver->ApplySnapshot();
if (m_treeStateSaver)
{
m_treeStateSaver->ApplySnapshot();
}
// If we're filtering for a valid entry, select the first valid entry
if (hasFilter && selectFirstValidEntry)