Make sure we check for print recovery even if we are connected
This code changed so that we are connected before the UI is available. we still need to check if there is a recovery. issue: MatterHackers/MCCentral#5423 Automatic connect does not say there is a recovery available when there is
This commit is contained in:
parent
46197a10ca
commit
7debe57480
1 changed files with 9 additions and 3 deletions
|
|
@ -229,7 +229,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
};
|
||||
|
||||
// Register listeners
|
||||
printer.Connection.ConnectionSucceeded += ConnectionSucceeded;
|
||||
printer.Connection.ConnectionSucceeded += CheckForPrintRecovery;
|
||||
|
||||
// if we are already connected than check if there is a print recovery right now
|
||||
if (printer.Connection.CommunicationState == CommunicationStates.Connected)
|
||||
{
|
||||
CheckForPrintRecovery(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
bool buttonIsBeingClicked;
|
||||
|
|
@ -265,12 +271,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public override void OnClosed(EventArgs e)
|
||||
{
|
||||
// Unregister listeners
|
||||
printer.Connection.ConnectionSucceeded -= ConnectionSucceeded;
|
||||
printer.Connection.ConnectionSucceeded -= CheckForPrintRecovery;
|
||||
|
||||
base.OnClosed(e);
|
||||
}
|
||||
|
||||
private void ConnectionSucceeded(object s, EventArgs e)
|
||||
private void CheckForPrintRecovery(object s, EventArgs e)
|
||||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue