diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index 153abb845..98c767d78 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -1336,7 +1336,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var popupMenu = new PopupMenu(ApplicationController.Instance.MenuTheme); var actions = new[] { - WorkspaceActions["Insert"], new ActionSeparator(), new NamedAction() { @@ -1365,8 +1364,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }, IsEnabled = () => Clipboard.Instance.ContainsImage || Clipboard.Instance.GetText() == "!--IObjectSelection--!" }, - WorkspaceActions["Save"], - WorkspaceActions["SaveAs"], WorkspaceActions["Export"], new ActionSeparator(), WorkspaceActions["ArrangeAll"], diff --git a/MatterControlLib/PartPreviewWindow/ViewControls3D.cs b/MatterControlLib/PartPreviewWindow/ViewControls3D.cs index d529c80c5..74b663554 100644 --- a/MatterControlLib/PartPreviewWindow/ViewControls3D.cs +++ b/MatterControlLib/PartPreviewWindow/ViewControls3D.cs @@ -538,7 +538,28 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var saveAs = popupMenu.CreateMenuItem("Save As".Localize()); saveAs.Click += (s, e) => UiThread.RunOnIdle(() => { - this.MenuActions.FirstOrDefault(m => m.ID == "SaveAs")?.Action?.Invoke(); + UiThread.RunOnIdle(() => + { + DialogWindow.Show( + new SaveAsPage( + async (newName, destinationContainer) => + { + // Save to the destination provider + if (destinationContainer is ILibraryWritableContainer writableContainer) + { + // Wrap stream with ReadOnlyStream library item and add to container + writableContainer.Add(new[] + { + new InMemoryLibraryItem(sceneContext.Scene) + { + Name = newName + } + }); + + destinationContainer.Dispose(); + } + })); + }); }); return popupMenu;