Merge pull request #452 from jlewin/master

User configurable library folders
This commit is contained in:
johnlewin 2015-11-12 11:46:07 -08:00
commit bf2f291325

View file

@ -141,6 +141,19 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
AddFolderImage("download_folder.png");
}
string userLibraryFoldersPath = Path.Combine(ApplicationDataStorage.ApplicationUserDataPath, "LibraryFolders.conf");
if (File.Exists(userLibraryFoldersPath))
{
foreach (string directory in File.ReadLines(userLibraryFoldersPath))
{
if(Directory.Exists(directory))
{
libraryCreators.Add(new LibraryProviderFileSystemCreator(directory, (new DirectoryInfo(directory).Name)));
AddFolderImage("download_folder.png");
}
}
}
firstAddedDirectoryIndex = libraryCreators.Count;
OnDataReloaded(null);
}