Restore CloudLibrary save functionality, revise convert to AMF behavior

- Fixes #111237022 - Unable to save any changes to CloudLibrary items
 - Add useIncrementedNameDuringTypeChange to PrintItemWrapper to control naming behavior
 - Pass useIncrementedName value though from provider factory all the way to PrintItemWrapper
 - Prevent duplicate calls to GetPrintItemWrapperAsync within the same callstack i.e. pass instance through
 - Only rename files when switching to AMF and use different logic for different provider types
 - Add path helper methods to PrintItemWrapper for clarity and conciseness in callers
This commit is contained in:
John Lewin 2016-01-11 14:06:47 -08:00
parent 7b94b2ede8
commit 40939b906d
5 changed files with 87 additions and 43 deletions

View file

@ -137,7 +137,12 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
string downloadsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
if (Directory.Exists(downloadsDirectory))
{
libraryCreators.Add(new LibraryProviderFileSystemCreator(downloadsDirectory, "Downloads"));
libraryCreators.Add(
new LibraryProviderFileSystemCreator(
downloadsDirectory,
"Downloads",
useIncrementedNameDuringTypeChange: true));
AddFolderImage("download_folder.png");
}
@ -148,7 +153,12 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
{
if(Directory.Exists(directory))
{
libraryCreators.Add(new LibraryProviderFileSystemCreator(directory, (new DirectoryInfo(directory).Name)));
libraryCreators.Add(
new LibraryProviderFileSystemCreator(
directory,
(new DirectoryInfo(directory).Name),
useIncrementedNameDuringTypeChange: true));
AddFolderImage("download_folder.png");
}
}