Fixed quit scenario bug. WorkerApp, when hidden, was eating QuitKey

This commit is contained in:
Tig
2024-03-26 09:23:45 -06:00
parent 0b90274a15
commit 5b03d739a6
2 changed files with 6 additions and 11 deletions

View File

@@ -702,7 +702,7 @@ public class ListView : View
/// <returns><see langword="true"/> if the <see cref="OpenSelectedItem"/> event was fired.</returns>
public bool OnOpenSelectedItem ()
{
if (_source.Count <= _selected || _selected < 0 || OpenSelectedItem is null)
if (_source is null || _source.Count <= _selected || _selected < 0 || OpenSelectedItem is null)
{
return false;
}

View File

@@ -295,7 +295,7 @@ public class BackgroundWorkerCollection : Scenario
KeyDown += (s, e) =>
{
if (e.KeyCode == KeyCode.Esc)
if (e == Application.QuitKey)
{
OnReportClosed (this, EventArgs.Empty);
}
@@ -357,6 +357,9 @@ public class BackgroundWorkerCollection : Scenario
};
Add (_listLog);
// We don't want WorkerApp to respond to the quitkey
KeyBindings.Remove (Application.QuitKey);
Closing += WorkerApp_Closing;
Closed += WorkerApp_Closed;
}
@@ -439,15 +442,7 @@ public class BackgroundWorkerCollection : Scenario
{
// Failed
WriteLog (
$"Exception occurred {
e.Error.Message
} on Worker {
staging.StartStaging
}.{
staging.StartStaging
:fff} at {
DateTime.Now
}"
$"Exception occurred {e.Error.Message} on Worker {staging.StartStaging}.{staging.StartStaging:fff} at {DateTime.Now}"
);
}
else if (e.Cancelled)