diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index b990a2bdc..3c6029195 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -1595,6 +1595,7 @@ namespace MatterHackers.MatterControl public IEnumerable RegisteredSceneOperations => registeredSceneOperations; public static IObject3D ClipboardItem { get; internal set; } + public Action ShareLibraryItem { get; set; } public event EventHandler AddPrintersTabRightElement; diff --git a/Library/Widgets/PrintLibraryWidget.cs b/Library/Widgets/PrintLibraryWidget.cs index 2648fd74b..446741776 100644 --- a/Library/Widgets/PrintLibraryWidget.cs +++ b/Library/Widgets/PrintLibraryWidget.cs @@ -740,6 +740,7 @@ namespace MatterHackers.MatterControl.PrintLibrary // Singleselect - disallow containers and protected items return listView.SelectedItems.Count == 1 && selectedListItems.FirstOrDefault()?.Model is ILibraryItem firstItem + && listView.ActiveContainer.GetType().Name.IndexOf("Cloud", StringComparison.OrdinalIgnoreCase) >= 0 && !(firstItem is ILibraryContainer) && !firstItem.IsProtected; } @@ -882,19 +883,14 @@ namespace MatterHackers.MatterControl.PrintLibrary } } + + + private void shareFromLibraryButton_Click(object sender, EventArgs e) { // TODO: Should be rewritten to Register from cloudlibrary, include logic to add to library as needed - throw new NotImplementedException(); - if (libraryView.SelectedItems.Count == 1) - { - var partItem = libraryView.SelectedItems.Select(i => i.Model).FirstOrDefault(); - if (partItem != null) - { - //libraryView.ActiveContainer.ShareItem(partItem, "something"); - } - } + ApplicationController.Instance.ShareLibraryItem(libraryView.SelectedItems.Select(i => i.Model).FirstOrDefault()); } private void exportButton_Click(object sender, EventArgs e) diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index b6351d66c..905cc369e 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit b6351d66c348fd1e188dffbc77df4d551d19333f +Subproject commit 905cc369efa6e8eb8c07cd1f4468d7692f16839d