mattercontrol/SetupWizard/SyncingPrintersPage.cs
Matt Moening bc3f95d80c Created Wizard Page to Sync Profiles after log in.
Prompt to log in now Properly launched if no user is logged in and sync only called if user is logged in
Removed comments from PrinterProfileHistoryPage that were meant to outline process
2016-07-18 14:03:45 -07:00

36 lines
975 B
C#

using MatterHackers.Localizations;
using MatterHackers.Agg.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.MatterControl.CustomWidgets;
namespace MatterHackers.MatterControl.SetupWizard
{
public class SyncingPrintersPage: WizardPage
{
public SyncingPrintersPage()
{
TextWidget syncingText = new TextWidget("Syncing Profiles...".Localize(),textColor: ActiveTheme.Instance.PrimaryTextColor);
contentRow.AddChild(syncingText);
ApplicationController.SyncPrinterProfiles().ContinueWith((task) =>
{
if (!ProfileManager.Instance.ActiveProfiles.Any())
{
// Switch to setup wizard if no profiles exist
WizardWindow.ChangeToSetupPrinterForm();
}
UiThread.RunOnIdle(WizardWindow.Close);
});
footerRow.AddChild(new HorizontalSpacer());
footerRow.AddChild(cancelButton);
}
}
}