From 13a0bbaa731bceb3ad0bedfb5b8f0be6e8a660e3 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 1 Jan 2018 19:52:49 -0800 Subject: [PATCH] Move DataStore.Initialize before db dependent GetStartupBounds call - Issue MatterHackers/MCCentral#2538 Can't run with no MatterControl directory (new install) --- ApplicationView/ApplicationController.cs | 3 --- Library/Widgets/PrintLibraryWidget.cs | 2 +- Program.cs | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ApplicationView/ApplicationController.cs b/ApplicationView/ApplicationController.cs index 388a4c943..fd47fb1f1 100644 --- a/ApplicationView/ApplicationController.cs +++ b/ApplicationView/ApplicationController.cs @@ -1553,9 +1553,6 @@ namespace MatterHackers.MatterControl //UiThread.RunOnIdle(() => Task.Run(async () => { - ReportStartupProgress(0.1, "Datastore"); - Datastore.Instance.Initialize(); - ReportStartupProgress(0.15, "MatterControlApplication.Initialize"); var mainView = await Initialize(systemWindow, (progress0To1, status) => { diff --git a/Library/Widgets/PrintLibraryWidget.cs b/Library/Widgets/PrintLibraryWidget.cs index 798fffbf1..5c47aa8ab 100644 --- a/Library/Widgets/PrintLibraryWidget.cs +++ b/Library/Widgets/PrintLibraryWidget.cs @@ -809,7 +809,7 @@ namespace MatterHackers.MatterControl.PrintLibrary } else { - var menuItem = popupMenu.CreateMenuItem((string)menuAction.Title); + var menuItem = popupMenu.CreateMenuItem(menuAction.Title); menuItem.Name = $"{menuAction.Title} Menu Item"; menuItem.Enabled = menuAction.Action != null; diff --git a/Program.cs b/Program.cs index 7c30034cc..f5717cb7a 100644 --- a/Program.cs +++ b/Program.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.IO; using System.Threading; using MatterHackers.Agg.Platform; +using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.SettingsManagement; using Mindscape.Raygun4Net; @@ -31,6 +32,7 @@ namespace MatterHackers.MatterControl // Make sure we have the right working directory as we assume everything relative to the executable. Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)); + Datastore.Instance.Initialize(); #if !DEBUG // Conditionally spin up error reporting if not on the Stable channel