diff --git a/PrinterApp/App.xaml.cs b/PrinterApp/App.xaml.cs
index 968da09..d48704e 100644
--- a/PrinterApp/App.xaml.cs
+++ b/PrinterApp/App.xaml.cs
@@ -87,6 +87,7 @@ private void MainWindowClosing(object? sender, System.ComponentModel.CancelEvent
return;
}
+ Marketing.ManualShutdown();
_printerModel.SocketsClose();
_autoUpdater.StopTimer();
Current.Shutdown();
diff --git a/PrinterApp/MainWindow.xaml b/PrinterApp/MainWindow.xaml
index acde9f4..e487e2b 100644
--- a/PrinterApp/MainWindow.xaml
+++ b/PrinterApp/MainWindow.xaml
@@ -12,7 +12,7 @@
ResizeMode="NoResize"
Topmost="True"
ShowInTaskbar="False"
- d:DataContext="{d:DesignInstance local:PrinterViewModel}">
+ d:DataContext="{d:DesignInstance local:PrinterViewModel}" Focusable="False">
diff --git a/PrinterApp/MainWindow.xaml.cs b/PrinterApp/MainWindow.xaml.cs
index c48de7a..b707314 100644
--- a/PrinterApp/MainWindow.xaml.cs
+++ b/PrinterApp/MainWindow.xaml.cs
@@ -99,6 +99,7 @@ public MainWindow(PrinterModel printerModel)
Topmost = false;
ShowInTaskbar = true;
#endif
+ _printerModel.PrintAsyncCompleteEvent += () => { CodeBox.Focus(); };
Marketing.MainWindowLoaded();
}
diff --git a/PrinterApp/Marketing.cs b/PrinterApp/Marketing.cs
index 91db911..346d9f9 100644
--- a/PrinterApp/Marketing.cs
+++ b/PrinterApp/Marketing.cs
@@ -153,6 +153,15 @@ public static void ManualReboot()
pathTo: "");
}
+ public static void ManualShutdown()
+ {
+ Post(
+ action: "print terminal manual shutdown",
+ status: "ok",
+ pathFrom: "",
+ pathTo: "");
+ }
+
public static void SocketException(string status)
{
Post(
diff --git a/PrinterApp/PrinterApp.csproj b/PrinterApp/PrinterApp.csproj
index 5940878..62fff89 100644
--- a/PrinterApp/PrinterApp.csproj
+++ b/PrinterApp/PrinterApp.csproj
@@ -11,7 +11,7 @@
PrinterApp
gui fo work https://app.profcomff.com/print/docs
Dyakov EI
- 2.1.3.0
+ 2.1.4.0
dyakov.space
dyakov.space @ 2022
diff --git a/PrinterApp/PrinterModel.cs b/PrinterApp/PrinterModel.cs
index 83a74ca..375e2a2 100644
--- a/PrinterApp/PrinterModel.cs
+++ b/PrinterApp/PrinterModel.cs
@@ -49,6 +49,10 @@ public class PrinterModel
public event RebootHandler? Reboot;
+ public delegate void PrintAsyncCompleteHandler();
+
+ public event PrintAsyncCompleteHandler? PrintAsyncCompleteEvent;
+
public PrinterModel(ConfigFile configFile, AutoUpdater autoUpdater)
{
_configFile = configFile;
@@ -191,6 +195,7 @@ await _httpClient.GetStreamAsync(
PrinterViewModel.DownloadNotInProgress = true;
Log.Debug(
$"{GetType().Name} {MethodBase.GetCurrentMethod()?.Name}: End response code {PrinterViewModel.CodeTextBoxText}");
+ PrintAsyncCompleteEvent?.Invoke();
}
public bool WrongExitCode()