This commit is contained in:
Lars Brubaker 2016-07-14 15:05:58 -07:00
commit b9eb54a4e1
5 changed files with 19 additions and 8 deletions

View file

@ -67,6 +67,10 @@ namespace MatterHackers.MatterControl
public void ReloadSliceSettings()
{
WidescreenPanel.PreChangePanels.CallEvents(null, null);
if (advancedTab.HasBeenClosed)
{
return;
}
// remove the advance control and replace it with new ones built for the selected printer
int advancedControlsIndex = GetChildIndex(advancedTab);

View file

@ -169,6 +169,7 @@ namespace MatterHackers.MatterControl
public static Func<string, Task<Dictionary<string, string>>> GetProfileHistory;
public static Func<PrinterInfo,string, Task> GetPrinterProfile;
public static Func<Task> SyncPrinterProfiles;
public SlicePresetsWindow EditMaterialPresetsWindow { get; set; }
@ -369,8 +370,10 @@ namespace MatterHackers.MatterControl
// Ensure SQLite printers are imported
profileManager.EnsurePrintersImported();
var guestDB = ProfileManager.LoadGuestDB();
// If profiles.json was created, run the import wizard to pull in any SQLite printers
if (!profileManager.IsGuestProfile && !profileManager.PrintersImported)
if (guestDB?.Profiles != null && guestDB.Profiles.Any() && !profileManager.IsGuestProfile && !profileManager.PrintersImported)
{
var wizardPage = new CopyGuestProfilesToUser(() =>
{

View file

@ -720,12 +720,16 @@ namespace MatterHackers.MatterControl
{
UiThread.RunOnIdle(() => WizardWindow.Show<LicenseAgreementPage>("SoftwareLicense", "Software License Agreement"));
}
if (!ProfileManager.Instance.ActiveProfiles.Any())
ApplicationController.SyncPrinterProfiles().ContinueWith((task) =>
{
// Start the setup wizard if no profiles exist
UiThread.RunOnIdle(() => WizardWindow.Show());
}
ApplicationController.Instance.ReloadAdvancedControlsPanel();
if (!ProfileManager.Instance.ActiveProfiles.Any())
{
// Start the setup wizard if no profiles exist
UiThread.RunOnIdle(() => WizardWindow.Show());
}
});
}
//msGraph.AddData("ms", totalDrawTime.ElapsedMilliseconds);

View file

@ -233,7 +233,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return ActiveSliceSettings.Instance;
}
string profilePath = Path.Combine(ProfilesPath, profileID + ".json");
string profilePath = Path.Combine(ProfilesPath, profileID + ProfileManager.ProfileExtension);
return File.Exists(profilePath) ? LoadProfileFromDisk(profilePath) : null;
}

View file

@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
jObject["DocumentVersion"] = 201605132;
File.Delete(filePath);
filePath = Path.Combine(Path.GetDirectoryName(filePath), printerID + ".json");
filePath = Path.Combine(Path.GetDirectoryName(filePath), printerID + ProfileManager.ProfileExtension);
}
if (fromVersion < 201606081)