Printing/Pdf: Wait 1 sec for process to initialize
This commit is contained in:
@ -26,7 +26,7 @@ namespace Elwig.Helpers.Printing {
|
|||||||
private static Process? WinziPrintProc;
|
private static Process? WinziPrintProc;
|
||||||
public static bool IsReady => WinziPrintProc != null;
|
public static bool IsReady => WinziPrintProc != null;
|
||||||
|
|
||||||
public static Task Init(Action? evtHandler = null) {
|
public static async Task Init(Action? evtHandler = null) {
|
||||||
// NOTE: If the WinziPrint daemon is already running this will succeed, but the process will fail.
|
// NOTE: If the WinziPrint daemon is already running this will succeed, but the process will fail.
|
||||||
// Should be no problem, as long as the daemon is not closed
|
// Should be no problem, as long as the daemon is not closed
|
||||||
var p = new Process() { StartInfo = new() {
|
var p = new Process() { StartInfo = new() {
|
||||||
@ -38,9 +38,9 @@ namespace Elwig.Helpers.Printing {
|
|||||||
p.StartInfo.ArgumentList.Add("-d");
|
p.StartInfo.ArgumentList.Add("-d");
|
||||||
p.StartInfo.ArgumentList.Add(App.TempPath);
|
p.StartInfo.ArgumentList.Add(App.TempPath);
|
||||||
p.Start();
|
p.Start();
|
||||||
|
await Task.Delay(1000);
|
||||||
WinziPrintProc = p;
|
WinziPrintProc = p;
|
||||||
evtHandler?.Invoke();
|
evtHandler?.Invoke();
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task Cleanup() {
|
public static Task Cleanup() {
|
||||||
|
Reference in New Issue
Block a user