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:
commit
254373fe6b
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user