Add to Library does old behavior of adding to the sqlite library.

This commit is contained in:
Lars Brubaker 2015-06-23 15:37:49 -07:00
parent e27a3ec16c
commit a7e1e1a14f

View file

@ -121,7 +121,12 @@ namespace MatterHackers.MatterControl.PrintLibrary
indexToInsert = PrintItems.Count;
}
PrintItems.Insert(indexToInsert, item);
OnItemAdded(new IndexArgs(indexToInsert));
// Check if the collection we are adding to is the the currently visible collection.
List<ProviderLocatorNode> currentDisplayedCollection = LibraryProvider.Instance.GetProviderLocator();
if (currentDisplayedCollection.Count > 0 && currentDisplayedCollection[1].Key == LibraryProviderSQLite.StaticProviderKey)
{
OnItemAdded(new IndexArgs(indexToInsert));
}
item.PrintItem.PrintItemCollectionID = LibraryCollection.Id;
item.PrintItem.Commit();
}