Restore 'Share' support, add Action<ILIbraryItem> to AppController
This commit is contained in:
parent
7aeaab5eda
commit
f2a7ad5ec7
3 changed files with 7 additions and 10 deletions
|
|
@ -1595,6 +1595,7 @@ namespace MatterHackers.MatterControl
|
|||
public IEnumerable<SceneSelectionOperation> RegisteredSceneOperations => registeredSceneOperations;
|
||||
|
||||
public static IObject3D ClipboardItem { get; internal set; }
|
||||
public Action<ILibraryItem> ShareLibraryItem { get; set; }
|
||||
|
||||
public event EventHandler<WidgetSourceEventArgs> AddPrintersTabRightElement;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit b6351d66c348fd1e188dffbc77df4d551d19333f
|
||||
Subproject commit 905cc369efa6e8eb8c07cd1f4468d7692f16839d
|
||||
Loading…
Add table
Add a link
Reference in a new issue