New feature: Monitor on start (#42)

* Implement monitor on start

* finish implementation of monitor on start
This commit is contained in:
Xjph 2021-12-18 12:21:07 -03:30 committed by GitHub
commit 889825275d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 3 deletions

View file

@ -56,6 +56,11 @@ namespace Observatory.UI.ViewModels
tabs.Add(new CoreModel() { Name = "Core", UI = new BasicUIViewModel(new ObservableCollection<object>()) { UIType = Framework.PluginUI.UIType.Core } });
if (Properties.Core.Default.StartMonitor)
{
ToggleMonitor();
}
}
public void ReadAll()

View file

@ -655,7 +655,24 @@ namespace Observatory.UI.Views
Properties.Core.Default.Save();
};
#endregion
#region Monitor On Launch
TextBlock startMonitorLabel = new() { Text = "Start monitor on Observatory launch" };
CheckBox startMonitorCheckbox = new() { IsChecked = Properties.Core.Default.StartMonitor, Content = startMonitorLabel };
startMonitorCheckbox.Checked += (object sender, RoutedEventArgs e) =>
{
Properties.Core.Default.StartMonitor = true;
Properties.Core.Default.Save();
};
startMonitorCheckbox.Unchecked += (object sender, RoutedEventArgs e) =>
{
Properties.Core.Default.StartMonitor = false;
Properties.Core.Default.Save();
};
#endregion
@ -726,6 +743,7 @@ namespace Observatory.UI.Views
#endregion
gridManager.AddSetting(primeSystemContexCheckbox);
gridManager.AddSetting(startMonitorCheckbox);
gridManager.AddSettingWithLabel(journalPathLabel, journalPath);
gridManager.AddSetting(journalBrowse);