Rename WizardPanels to WizardPage

This commit is contained in:
John Lewin 2016-06-08 09:31:26 -07:00
parent 5c926cc1a1
commit 6ff04a73d2
15 changed files with 42 additions and 42 deletions

View file

@ -246,8 +246,8 @@
<Compile Include="Library\Provider\LibraryProvider.cs" /> <Compile Include="Library\Provider\LibraryProvider.cs" />
<Compile Include="Queue\OptionsMenu\ExportGcodePlugin.cs" /> <Compile Include="Queue\OptionsMenu\ExportGcodePlugin.cs" />
<Compile Include="Queue\OptionsMenu\MergeQueueItems.cs" /> <Compile Include="Queue\OptionsMenu\MergeQueueItems.cs" />
<Compile Include="SetupWizard\AndroidConnectDevicePanel.cs" /> <Compile Include="SetupWizard\AndroidConnectDevicePage.cs" />
<Compile Include="SetupWizard\WizardPanel.cs" /> <Compile Include="SetupWizard\WizardPage.cs" />
<Compile Include="SetupWizard\SetupWizardHome.cs" /> <Compile Include="SetupWizard\SetupWizardHome.cs" />
<Compile Include="SetupWizard\SetupWizardTroubleshooting.cs" /> <Compile Include="SetupWizard\SetupWizardTroubleshooting.cs" />
<Compile Include="SetupWizard\SetupWizardWifi.cs" /> <Compile Include="SetupWizard\SetupWizardWifi.cs" />
@ -336,7 +336,7 @@
<Compile Include="PrinterControls\ManualPrinterControls.cs" /> <Compile Include="PrinterControls\ManualPrinterControls.cs" />
<Compile Include="PrinterControls\PrinterConnections\BaseConnectionWidget.cs" /> <Compile Include="PrinterControls\PrinterConnections\BaseConnectionWidget.cs" />
<Compile Include="PrinterControls\PrinterConnections\PrinterChooser.cs" /> <Compile Include="PrinterControls\PrinterConnections\PrinterChooser.cs" />
<Compile Include="PrinterControls\PrinterConnections\ConnectionWizardPanel.cs" /> <Compile Include="PrinterControls\PrinterConnections\ConnectionWizardPage.cs" />
<Compile Include="PrinterControls\TemperatureIndicator.cs" /> <Compile Include="PrinterControls\TemperatureIndicator.cs" />
<Compile Include="PrinterControls\XYZJogControls.cs" /> <Compile Include="PrinterControls\XYZJogControls.cs" />
<Compile Include="Library\LibraryDataView.cs" /> <Compile Include="Library\LibraryDataView.cs" />

View file

@ -8,11 +8,11 @@ using System;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class ConnectionWizardPanel : WizardPanel public class ConnectionWizardPage : WizardPage
{ {
private PrinterInfo activePrinter; private PrinterInfo activePrinter;
public ConnectionWizardPanel() : base("Cancel") public ConnectionWizardPage() : base("Cancel")
{ {
cancelButton.Click += (s, e) => PrinterConnectionAndCommunication.Instance.HaltConnectionThread(); cancelButton.Click += (s, e) => PrinterConnectionAndCommunication.Instance.HaltConnectionThread();
} }

View file

@ -7,7 +7,7 @@ using System.Collections.Generic;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class SetupStepBaudRate : ConnectionWizardPanel public class SetupStepBaudRate : ConnectionWizardPage
{ {
private List<RadioButton> BaudRateButtonsList = new List<RadioButton>(); private List<RadioButton> BaudRateButtonsList = new List<RadioButton>();
private FlowLayoutWidget printerBaudRateContainer; private FlowLayoutWidget printerBaudRateContainer;

View file

@ -13,7 +13,7 @@ using System.Text.RegularExpressions;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class SetupStepComPortManual : ConnectionWizardPanel public class SetupStepComPortManual : ConnectionWizardPage
{ {
private static Regex linuxDefaultUIFilter = new Regex("/dev/ttyS*\\d+", RegexOptions.CultureInvariant | RegexOptions.Compiled); private static Regex linuxDefaultUIFilter = new Regex("/dev/ttyS*\\d+", RegexOptions.CultureInvariant | RegexOptions.Compiled);
@ -46,7 +46,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
connectButton.Click += ConnectButton_Click; connectButton.Click += ConnectButton_Click;
refreshButton = textImageButtonFactory.Generate("Refresh".Localize()); refreshButton = textImageButtonFactory.Generate("Refresh".Localize());
refreshButton.Click += (s, e) => WizardWindow.ChangeToPanel<SetupStepComPortManual>(); refreshButton.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortManual>();
//Add buttons to buttonContainer //Add buttons to buttonContainer
footerRow.AddChild(nextButton); footerRow.AddChild(nextButton);

View file

@ -7,7 +7,7 @@ using System;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class SetupStepComPortOne : ConnectionWizardPanel public class SetupStepComPortOne : ConnectionWizardPage
{ {
private Button nextButton; private Button nextButton;
@ -17,7 +17,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
//Construct buttons //Construct buttons
nextButton = textImageButtonFactory.Generate("Continue".Localize()); nextButton = textImageButtonFactory.Generate("Continue".Localize());
nextButton.Click += (s, e) => WizardWindow.ChangeToPanel<SetupStepComPortTwo>(); nextButton.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortTwo>();
//Add buttons to buttonContainer //Add buttons to buttonContainer
footerRow.AddChild(nextButton); footerRow.AddChild(nextButton);
@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
Button manualLink = linkButtonFactory.Generate(LocalizedString.Get("Manually Configure Connection")); Button manualLink = linkButtonFactory.Generate(LocalizedString.Get("Manually Configure Connection"));
manualLink.Margin = new BorderDouble(0, 5); manualLink.Margin = new BorderDouble(0, 5);
manualLink.Click += (s, e) => WizardWindow.ChangeToPanel<SetupStepComPortManual>(); manualLink.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortManual>();
string printerMessageFourText = LocalizedString.Get("or"); string printerMessageFourText = LocalizedString.Get("or");
TextWidget printerMessageFour = new TextWidget(printerMessageFourText, 0, 0, 10); TextWidget printerMessageFour = new TextWidget(printerMessageFourText, 0, 0, 10);

View file

@ -10,7 +10,7 @@ using System.Linq;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class SetupStepComPortTwo : ConnectionWizardPanel public class SetupStepComPortTwo : ConnectionWizardPage
{ {
private string[] startingPortNames; private string[] startingPortNames;
private string[] currentPortNames; private string[] currentPortNames;
@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize()); Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize());
manualLink.Margin = new BorderDouble(0, 5); manualLink.Margin = new BorderDouble(0, 5);
manualLink.Click += (s, e) => WizardWindow.ChangeToPanel<SetupStepComPortManual>(); manualLink.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortManual>();
printerErrorMessage = new TextWidget("", 0, 0, 10); printerErrorMessage = new TextWidget("", 0, 0, 10);
printerErrorMessage.AutoExpandBoundsToText = true; printerErrorMessage.AutoExpandBoundsToText = true;

View file

@ -11,7 +11,7 @@ using System.IO;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class SetupStepInstallDriver : ConnectionWizardPanel public class SetupStepInstallDriver : ConnectionWizardPage
{ {
private FlowLayoutWidget printerDriverContainer; private FlowLayoutWidget printerDriverContainer;
private TextWidget printerDriverMessage; private TextWidget printerDriverMessage;

View file

@ -14,7 +14,7 @@ using System.IO;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
//Normally step one of the setup process //Normally step one of the setup process
public class SetupStepMakeModelName : ConnectionWizardPanel public class SetupStepMakeModelName : ConnectionWizardPage
{ {
private FlowLayoutWidget printerModelContainer; private FlowLayoutWidget printerModelContainer;
private FlowLayoutWidget printerMakeContainer; private FlowLayoutWidget printerMakeContainer;
@ -84,9 +84,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
if (canContinue) if (canContinue)
{ {
#if __ANDROID__ #if __ANDROID__
WizardWindow.ChangeToPanel<AndroidConnectDevicePanel>(); WizardWindow.ChangeToPage<AndroidConnectDevicePage>();
#else #else
WizardWindow.ChangeToPanel<SetupStepInstallDriver>(); WizardWindow.ChangeToPage<SetupStepInstallDriver>();
#endif #endif
} }
}; };

View file

@ -32,7 +32,7 @@ using MatterHackers.MatterControl.CustomWidgets;
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
{ {
public class ShowAuthPanel : ConnectionWizardPanel public class ShowAuthPanel : ConnectionWizardPage
{ {
public ShowAuthPanel() public ShowAuthPanel()
{ {
@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
nextButton.Name = "Connection Wizard Skip Sign In Button"; nextButton.Name = "Connection Wizard Skip Sign In Button";
nextButton.Click += (sender, e) => nextButton.Click += (sender, e) =>
{ {
WizardWindow.ChangeToPanel<SetupStepMakeModelName>(); WizardWindow.ChangeToPage<SetupStepMakeModelName>();
}; };
var signInButton = textImageButtonFactory.Generate("Sign In"); var signInButton = textImageButtonFactory.Generate("Sign In");

View file

@ -37,7 +37,7 @@ using MatterHackers.MatterControl.PrinterCommunication;
namespace MatterHackers.MatterControl namespace MatterHackers.MatterControl
{ {
public class AndroidConnectDevicePanel : WizardPanel public class AndroidConnectDevicePage : WizardPage
{ {
private event EventHandler unregisterEvents; private event EventHandler unregisterEvents;
@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl
private FlowLayoutWidget retryButtonContainer; private FlowLayoutWidget retryButtonContainer;
private FlowLayoutWidget connectButtonContainer; private FlowLayoutWidget connectButtonContainer;
public AndroidConnectDevicePanel() public AndroidConnectDevicePage()
{ {
TextWidget printerNameLabel = new TextWidget("Connect Your Device".Localize() + ":", 0, 0, labelFontSize) TextWidget printerNameLabel = new TextWidget("Connect Your Device".Localize() + ":", 0, 0, labelFontSize)
{ {
@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl
//Construct buttons //Construct buttons
troubleshootButton = whiteImageButtonFactory.Generate("Troubleshoot".Localize(), centerText:true); troubleshootButton = whiteImageButtonFactory.Generate("Troubleshoot".Localize(), centerText:true);
troubleshootButton.Click += (s, e) => WizardWindow.ChangeToPanel<SetupWizardTroubleshooting>(); troubleshootButton.Click += (s, e) => WizardWindow.ChangeToPage<SetupWizardTroubleshooting>();
retryButtonContainer = new FlowLayoutWidget() retryButtonContainer = new FlowLayoutWidget()
{ {

View file

@ -19,17 +19,17 @@ using MatterHackers.MatterControl.SlicerConfiguration;
namespace MatterHackers.MatterControl namespace MatterHackers.MatterControl
{ {
//Normally step one of the setup process //Normally step one of the setup process
public class SetupWizardHome : WizardPanel public class SetupWizardHome : WizardPage
{ {
public SetupWizardHome() public SetupWizardHome()
: base(unlocalizedTextForCancelButton: "Done") : base("Done")
{ {
headerLabel.Text = "Setup Options".Localize(); headerLabel.Text = "Setup Options".Localize();
textImageButtonFactory.borderWidth = 1; textImageButtonFactory.borderWidth = 1;
textImageButtonFactory.normalBorderColor = RGBA_Bytes.White; textImageButtonFactory.normalBorderColor = RGBA_Bytes.White;
contentRow.AddChild(new SetupPrinterView(this.textImageButtonFactory) { WizardPanel = this }); contentRow.AddChild(new SetupPrinterView(this.textImageButtonFactory) { WizardPage = this });
contentRow.AddChild(new SetupAccountView(this.textImageButtonFactory)); contentRow.AddChild(new SetupAccountView(this.textImageButtonFactory));
contentRow.AddChild(new EnterCodesView(this.textImageButtonFactory)); contentRow.AddChild(new EnterCodesView(this.textImageButtonFactory));
@ -89,7 +89,7 @@ namespace MatterHackers.MatterControl
public class SetupPrinterView : SetupViewBase public class SetupPrinterView : SetupViewBase
{ {
internal WizardPanel WizardPanel { get; set; } internal WizardPage WizardPage { get; set; }
private Button disconnectButton; private Button disconnectButton;
private TextWidget connectionStatus; private TextWidget connectionStatus;
@ -114,7 +114,7 @@ namespace MatterHackers.MatterControl
buttonContainer.AddChild(printerSelectorAndEditButton); buttonContainer.AddChild(printerSelectorAndEditButton);
var printerSelector = new PrinterSelector(); var printerSelector = new PrinterSelector();
printerSelector.AddPrinter += (s, e) => WizardPanel.WizardWindow.ChangeToSetupPrinterForm(); printerSelector.AddPrinter += (s, e) => WizardPage.WizardWindow.ChangeToSetupPrinterForm();
printerSelectorAndEditButton.AddChild(printerSelector); printerSelectorAndEditButton.AddChild(printerSelector);
var editButton = TextImageButtonFactory.GetThemedEditButton(); var editButton = TextImageButtonFactory.GetThemedEditButton();
@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl
disconnectButton.Click += (sender, e) => disconnectButton.Click += (sender, e) =>
{ {
PrinterConnectionAndCommunication.Instance.Disable(); PrinterConnectionAndCommunication.Instance.Disable();
WizardPanel.WizardWindow.ChangeToPanel<SetupWizardHome>(); WizardPage.WizardWindow.ChangeToPage<SetupWizardHome>();
}; };
buttonContainer.AddChild(disconnectButton); buttonContainer.AddChild(disconnectButton);

View file

@ -20,7 +20,7 @@ using Android.Content;
namespace MatterHackers.MatterControl namespace MatterHackers.MatterControl
{ {
public class SetupWizardTroubleshooting : WizardPanel public class SetupWizardTroubleshooting : WizardPage
{ {
private Button nextButton; private Button nextButton;
@ -44,7 +44,7 @@ namespace MatterHackers.MatterControl
//Construct buttons //Construct buttons
cancelButton = whiteImageButtonFactory.Generate("Cancel".Localize(), centerText:true); cancelButton = whiteImageButtonFactory.Generate("Cancel".Localize(), centerText:true);
cancelButton.Click += (s, e) => this.WizardWindow.ChangeToPanel<AndroidConnectDevicePanel>(); cancelButton.Click += (s, e) => this.WizardWindow.ChangeToPage<AndroidConnectDevicePage>();
//Construct buttons //Construct buttons
nextButton = textImageButtonFactory.Generate("Continue".Localize()); nextButton = textImageButtonFactory.Generate("Continue".Localize());

View file

@ -35,7 +35,7 @@ using MatterHackers.MatterControl.CustomWidgets;
namespace MatterHackers.MatterControl namespace MatterHackers.MatterControl
{ {
//Normally step one of the setup process //Normally step one of the setup process
public class SetupWizardWifi : WizardPanel public class SetupWizardWifi : WizardPage
{ {
public SetupWizardWifi() public SetupWizardWifi()
{ {

View file

@ -5,7 +5,7 @@ using MatterHackers.Localizations;
namespace MatterHackers.MatterControl namespace MatterHackers.MatterControl
{ {
public class WizardPanel : GuiWidget public class WizardPage : GuiWidget
{ {
protected FlowLayoutWidget headerRow; protected FlowLayoutWidget headerRow;
protected FlowLayoutWidget contentRow; protected FlowLayoutWidget contentRow;
@ -25,7 +25,7 @@ namespace MatterHackers.MatterControl
protected GuiWidget mainContainer; protected GuiWidget mainContainer;
public WizardPanel(string unlocalizedTextForCancelButton = "Cancel", TextImageButtonFactory textButtonFactory = null) public WizardPage(string unlocalizedTextForCancelButton = "Cancel", TextImageButtonFactory textButtonFactory = null)
{ {
whiteImageButtonFactory = new TextImageButtonFactory() whiteImageButtonFactory = new TextImageButtonFactory()
{ {

View file

@ -24,7 +24,7 @@ namespace MatterHackers.MatterControl
if (openToHome) if (openToHome)
{ {
ChangeToPanel<SetupWizardHome>(); ChangeToPage<SetupWizardHome>();
} }
else else
{ {
@ -32,7 +32,7 @@ namespace MatterHackers.MatterControl
bool WifiDetected = MatterControlApplication.Instance.IsNetworkConnected(); bool WifiDetected = MatterControlApplication.Instance.IsNetworkConnected();
if (!WifiDetected) if (!WifiDetected)
{ {
ChangeToPanel<SetupWizardWifi>(); ChangeToPage<SetupWizardWifi>();
} }
else else
{ {
@ -64,11 +64,11 @@ namespace MatterHackers.MatterControl
bool showAuthPanel = ShouldShowAuthPanel?.Invoke() ?? false; bool showAuthPanel = ShouldShowAuthPanel?.Invoke() ?? false;
if (showAuthPanel) if (showAuthPanel)
{ {
ChangeToPanel<ShowAuthPanel>(); ChangeToPage<ShowAuthPanel>();
} }
else else
{ {
ChangeToPanel<SetupStepMakeModelName>(); ChangeToPage<SetupStepMakeModelName>();
} }
} }
@ -76,11 +76,11 @@ namespace MatterHackers.MatterControl
{ {
if (ActiveSliceSettings.Instance.PrinterDrivers().Count > 0) if (ActiveSliceSettings.Instance.PrinterDrivers().Count > 0)
{ {
ChangeToPanel<SetupStepInstallDriver>(); ChangeToPage<SetupStepInstallDriver>();
} }
else else
{ {
ChangeToPanel<SetupStepComPortOne>(); ChangeToPage<SetupStepComPortOne>();
} }
} }
@ -88,15 +88,15 @@ namespace MatterHackers.MatterControl
{ {
if (string.IsNullOrEmpty(PrinterConnectionAndCommunication.Instance?.ActivePrinter?.BaudRate())) if (string.IsNullOrEmpty(PrinterConnectionAndCommunication.Instance?.ActivePrinter?.BaudRate()))
{ {
ChangeToPanel<SetupStepBaudRate>(); ChangeToPage<SetupStepBaudRate>();
} }
else else
{ {
ChangeToPanel<SetupStepComPortOne>(); ChangeToPage<SetupStepComPortOne>();
} }
} }
internal void ChangeToPanel<PanelType>() where PanelType : WizardPanel, new() internal void ChangeToPage<PanelType>() where PanelType : WizardPage, new()
{ {
UiThread.RunOnIdle(() => UiThread.RunOnIdle(() =>
{ {