2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 17:39:39 -04:00

Merge pull request #11 from fredjk-gh/TheRealPreReadAsReadAll

Make Pre-read act similarly to "Read All"
This commit is contained in:
Xjph 2021-08-17 10:03:01 -02:30 committed by GitHub
commit 254373fe6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 9 deletions

View File

@ -146,7 +146,9 @@ namespace Observatory
// We found an FSD jump, buffered the lines for that system (possibly including startup logs
// over a file boundary). Pump these through the plugins.
readall = true;
ReportErrors(ProcessLines(lastSystemLines, "Pre-read"));
readall = false;
}
#endregion

View File

@ -55,21 +55,15 @@ namespace Observatory.UI.ViewModels
public void ReadAll()
{
foreach (var worker in workers)
{
worker.ReadAllStarted();
}
SetWorkerReadAllState(true);
LogMonitor.GetInstance.ReadAllJournals();
foreach (var worker in workers)
{
worker.ReadAllFinished();
}
SetWorkerReadAllState(false);
}
public void ToggleMonitor()
{
var logMonitor = LogMonitor.GetInstance;
if (logMonitor.IsMonitoring())
{
logMonitor.Stop();
@ -77,7 +71,10 @@ namespace Observatory.UI.ViewModels
}
else
{
// HACK: Find a better way of suppressing notifications when pre-reading.
SetWorkerReadAllState(true);
logMonitor.Start();
SetWorkerReadAllState(false);
ToggleButtonText = "Stop Monitor";
}
}
@ -123,5 +120,21 @@ namespace Observatory.UI.ViewModels
{
get { return tabs; }
}
private void SetWorkerReadAllState(bool isReadingAll)
{
foreach (var worker in workers)
{
if (isReadingAll)
{
worker.ReadAllStarted();
}
else
{
worker.ReadAllFinished();
}
}
}
}
}