2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-11 14:34:44 -04:00

New feature: Monitor on start ()

* 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
parent d3315c5c65
commit 889825275d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 3 deletions
ObservatoryCore

@ -4,8 +4,6 @@ using Observatory.Framework.Files;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Observatory.Framework.Files.Journal;
namespace Observatory.PluginManagement

@ -238,5 +238,17 @@ namespace Observatory.Properties {
this["NativeNotifyTimeout"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool StartMonitor {
get {
return ((bool)(this["StartMonitor"]));
}
set {
this["StartMonitor"] = value;
}
}
}
}

@ -56,5 +56,8 @@
<Setting Name="NativeNotifyTimeout" Type="System.Int32" Scope="User">
<Value Profile="(Default)">8000</Value>
</Setting>
<Setting Name="StartMonitor" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

@ -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()

@ -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);