mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-01 16:33:43 -04:00
Enclose pre-read with Read-all; de-dupe plugin table and show types, etc
A few changes in preparation for the upcoming Announcer plugin. 1) De-dupe entries in the plugin table in the core settings UI when a plugin implements both Worker and Notifier interfaces. 2) Also add a "Types" column to the plugin table indicating the set of implemented interfaces found. 3) Wrap the pre-reading logic in "Read-all" scope to properly suppress a stampede of notifications (particularly audio ones) when starting the log monitor. 4) Fix the int setting UI. It rendered incorrectly, it didn't get the value from the settings class, nor wrote it back. Also implemented optional value bounding using the new setting attribute (see the related Framework PR). 5) Applied similar fixes to string setting (addressed rendering, write-back although untested). 6) Minor visual fixes (height/vertical alignment) for non-boolean settings to address cut-off/overlapping inputs. Sorry for the larger PR, but these *should* be all the loose ends before we could consider including Basic Announcer...
This commit is contained in:
@ -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,20 @@ namespace Observatory.UI.ViewModels
|
||||
{
|
||||
get { return tabs; }
|
||||
}
|
||||
private void SetWorkerReadAllState(bool isReadingAll)
|
||||
{
|
||||
foreach (var worker in workers)
|
||||
{
|
||||
if (isReadingAll)
|
||||
{
|
||||
worker.ReadAllStarted();
|
||||
}
|
||||
else
|
||||
{
|
||||
worker.ReadAllFinished();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user