diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 9c144d9fb..aeab76f94 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -266,9 +266,6 @@ namespace MatterHackers.MatterControl public IEnumerable ActivePrinters => this.Workspaces.Where(w => w.Printer != null).Select(w => w.Printer); - //// A list of printers which are open (i.e. displaying a tab) on this instance of MatterControl - //private List _activePrinters = new List(); - private Dictionary> objectEditorsByType; public PopupMenu GetActionMenuForSceneItem(IObject3D selectedItem, InteractiveScene scene, bool addInSubmenu) @@ -288,9 +285,6 @@ namespace MatterHackers.MatterControl (newName) => { selectedItem.Name = newName; - - // TODO: Revise SelectedObjectPanel to sync name on model change - // editorSectionWidget.Text = newName; })); }; @@ -3242,13 +3236,10 @@ If you experience adhesion problems, please re-run leveling." return Task.CompletedTask; }); - - // Instead of opening printers, we should load open tabs........................ - - // Persist part workspaces - var history = applicationController.Library.PlatingHistory; + // TODO: Loading previous parts/printer is a relatively huge task compared to other startup tasks. These might work better if + // loaded after startup tasks and should have better progress reporting if (File.Exists(ProfileManager.Instance.OpenTabsPath)) { try @@ -3264,9 +3255,6 @@ If you experience adhesion problems, please re-run leveling." // Load the actual workspace if content file exists if (File.Exists(persistedWorkspace.ContentPath)) { - // Spin up the printer if specified - // Push item to loaded workspaces - string printerID = persistedWorkspace.PrinterID; PartWorkspace workspace = null; @@ -3283,7 +3271,7 @@ If you experience adhesion problems, please re-run leveling." workspace = new PartWorkspace(new BedConfig(history)); } - // Load it up + // Load the previous content await workspace.SceneContext.LoadContent(new EditContext() { ContentStore = history, SourceItem = new FileSystemFileItem(persistedWorkspace.ContentPath) @@ -3304,13 +3292,8 @@ If you experience adhesion problems, please re-run leveling." } catch { - // Create new part tab on failure? } } - else - { - // Create new part tab if no existing? - } if (applicationController.Workspaces.Count == 0) { @@ -3338,7 +3321,7 @@ If you experience adhesion problems, please re-run leveling." await applicationController.OpenAllPrinters(); }); - // Batch startup tasks + // Batch execute startup tasks foreach (var task in ApplicationController.StartupTasks.OrderByDescending(t => t.Priority)) { await applicationController.Tasks.Execute(task.Title, null, task.Action); diff --git a/MatterControlLib/ApplicationView/LibraryItemConverter.cs b/MatterControlLib/ApplicationView/LibraryItemConverter.cs index 7524a2d02..b16c87dff 100644 --- a/MatterControlLib/ApplicationView/LibraryItemConverter.cs +++ b/MatterControlLib/ApplicationView/LibraryItemConverter.cs @@ -53,25 +53,24 @@ namespace MatterHackers.MatterControl public override void WriteJson(JsonWriter writer, ILibraryItem value, JsonSerializer serializer) { } + + public class DummyItem : ILibraryItem + { + public string ID { get; set; } + + public string Name { get; set; } + + public bool IsProtected { get; set; } + + public bool IsVisible { get; set; } + + public DateTime DateModified { get; set; } + + public DateTime DateCreated { get; set; } + + public string Path { get; set; } + + public string AssetPath { get; set; } + } } - - public class DummyItem : ILibraryItem - { - public string ID { get; set; } - - public string Name { get; set; } - - public bool IsProtected { get; set; } - - public bool IsVisible { get; set; } - - public DateTime DateModified { get; set; } - - public DateTime DateCreated { get; set; } - - public string Path { get; set; } - - public string AssetPath { get; set; } - } - } \ No newline at end of file diff --git a/MatterControlLib/SlicerConfiguration/Settings/ProfileManager.cs b/MatterControlLib/SlicerConfiguration/Settings/ProfileManager.cs index 985546de5..09ddc3778 100644 --- a/MatterControlLib/SlicerConfiguration/Settings/ProfileManager.cs +++ b/MatterControlLib/SlicerConfiguration/Settings/ProfileManager.cs @@ -456,7 +456,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration oemProfile.Helpers.SetComPort(profile.ComPort); oemProfile.Save(); } - catch { } + catch + { + } return oemProfile; } @@ -478,14 +480,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration return printerSettings; } } - catch { } + catch + { + } } } return null; } - internal static bool ImportFromExisting(string settingsFilePath) { if (string.IsNullOrEmpty(settingsFilePath) || !File.Exists(settingsFilePath))