Moving the ActivePrinterChanged call back and Active Printer calls all into ActivePrinterProfile
This commit is contained in:
parent
5036b364c0
commit
0040895615
21 changed files with 102 additions and 98 deletions
|
|
@ -159,7 +159,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
//this.AnchorAll();
|
||||
this.AddChild(textContainer);
|
||||
|
||||
PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);
|
||||
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);
|
||||
PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);
|
||||
}
|
||||
|
||||
|
|
@ -194,9 +194,9 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
string statusString = new LocalizedString("Status: {0}").Translated;
|
||||
printerStatusText.Text = string.Format(statusString, PrinterCommunication.Instance.PrinterConnectionStatusVerbose);
|
||||
}
|
||||
if (PrinterCommunication.Instance.ActivePrinter != null)
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter != null)
|
||||
{
|
||||
printerNameText.Text = PrinterCommunication.Instance.ActivePrinter.Name;
|
||||
printerNameText.Text = ActivePrinterProfile.Instance.ActivePrinter.Name;
|
||||
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl
|
|||
event EventHandler unregisterEvents;
|
||||
private void AddHandlers()
|
||||
{
|
||||
PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
private string getHelpMessageFromStatus()
|
||||
{
|
||||
if (PrinterCommunication.Instance.ActivePrinter == null)
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter == null)
|
||||
{
|
||||
return new LocalizedString("No printer selected. Press 'Connect' to choose a printer.").Translated;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
event EventHandler unregisterEvents;
|
||||
protected override void AddHandlers()
|
||||
{
|
||||
PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(ReloadPrinterSelectionWidget, ref unregisterEvents);
|
||||
PrinterCommunication.Instance.ActivePrinterChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);
|
||||
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(ReloadPrinterSelectionWidget, ref unregisterEvents);
|
||||
ActivePrinterProfile.Instance.ActivePrinterChanged.RegisterEvent(onActivePrinterChanged, ref unregisterEvents);
|
||||
PrinterCommunication.Instance.EnableChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents);
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
if (buttonClicked.Enabled)
|
||||
{
|
||||
if (PrinterCommunication.Instance.ActivePrinter == null)
|
||||
if (ActivePrinterProfile.Instance.ActivePrinter == null)
|
||||
{
|
||||
OpenConnectionWindow();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue