Save as causes the file dest to change and the tab name
Refactoring Add dispose to content store Added event for source item changed on edit context Added rename to extensions method Added local file path to tab tool tip
This commit is contained in:
parent
9ef5181983
commit
1095d6741a
15 changed files with 141 additions and 116 deletions
|
|
@ -180,22 +180,9 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
DialogWindow.Show(
|
||||
new SaveAsPage(
|
||||
(newName, destinationContainer) =>
|
||||
(newName, container) =>
|
||||
{
|
||||
// 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(selectedItem)
|
||||
{
|
||||
Name = newName
|
||||
}
|
||||
});
|
||||
|
||||
destinationContainer.Dispose();
|
||||
}
|
||||
sceneContext.Rename(newName);
|
||||
}));
|
||||
}),
|
||||
IsEnabled = () => sceneContext.EditableScene
|
||||
|
|
@ -679,22 +666,9 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
DialogWindow.Show(
|
||||
new SaveAsPage(
|
||||
async (newName, destinationContainer) =>
|
||||
async (newName, container) =>
|
||||
{
|
||||
// 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();
|
||||
}
|
||||
sceneContext.Rename(newName);
|
||||
}));
|
||||
}),
|
||||
IsEnabled = () => sceneContext.EditableScene
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue