diff --git a/src/Artemis.Core/Plugins/PluginInfo.cs b/src/Artemis.Core/Plugins/PluginInfo.cs index 2773a51c3..5037b186b 100644 --- a/src/Artemis.Core/Plugins/PluginInfo.cs +++ b/src/Artemis.Core/Plugins/PluginInfo.cs @@ -12,15 +12,19 @@ namespace Artemis.Core [JsonObject(MemberSerialization.OptIn)] public class PluginInfo : CorePropertyChanged, IPrerequisitesSubject { - private bool _autoEnableFeatures = true; - private string? _description; private Guid _guid; + private string? _description; + private string? _author; + private Uri? _website; + private Uri? _repository; private string? _icon; private string _main = null!; + private bool _autoEnableFeatures = true; private string _name = null!; private Plugin _plugin = null!; - private bool _requiresAdmin; private Version _version = null!; + private bool _requiresAdmin; + internal PluginInfo() { @@ -56,6 +60,36 @@ namespace Artemis.Core set => SetAndNotify(ref _description, value); } + /// + /// Gets or sets the author of this plugin + /// + [JsonProperty] + public string? Author + { + get => _author; + set => SetAndNotify(ref _author, value); + } + + /// + /// Gets or sets the website of this plugin or its author + /// + [JsonProperty] + public Uri? Website + { + get => _website; + set => SetAndNotify(ref _website, value); + } + + /// + /// Gets or sets the repository of this plugin + /// + [JsonProperty] + public Uri? Repository + { + get => _repository; + set => SetAndNotify(ref _repository, value); + } + /// /// The plugins display icon that's shown in the settings see for /// available icons @@ -108,7 +142,7 @@ namespace Artemis.Core get => _requiresAdmin; internal set => SetAndNotify(ref _requiresAdmin, value); } - + /// /// Gets the plugin this info is associated with /// @@ -118,12 +152,6 @@ namespace Artemis.Core internal set => SetAndNotify(ref _plugin, value); } - /// - public List Prerequisites { get; } = new(); - - /// - public bool ArePrerequisitesMet() => Prerequisites.All(p => p.IsMet()); - internal string PreferredPluginDirectory => $"{Main.Split(".dll")[0].Replace("/", "").Replace("\\", "")}-{Guid.ToString().Substring(0, 8)}"; /// @@ -131,5 +159,14 @@ namespace Artemis.Core { return $"{Name} v{Version} - {Guid}"; } + + /// + public List Prerequisites { get; } = new(); + + /// + public bool ArePrerequisitesMet() + { + return Prerequisites.All(p => p.IsMet()); + } } } \ No newline at end of file diff --git a/src/Artemis.UI/Behaviors/HighlightTermBehavior.cs b/src/Artemis.UI/Behaviors/HighlightTermBehavior.cs index 2d30ae887..53277b426 100644 --- a/src/Artemis.UI/Behaviors/HighlightTermBehavior.cs +++ b/src/Artemis.UI/Behaviors/HighlightTermBehavior.cs @@ -115,7 +115,7 @@ namespace Artemis.UI.Behaviors private static bool TextIsEmpty(string text) { - return text.Length == 0; + return string.IsNullOrEmpty(text); } private static bool TextIsNotContainingTermToBeHighlighted(string text, string termToBeHighlighted) diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsView.xaml b/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsView.xaml index 85d0783ab..82cad706c 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsView.xaml +++ b/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsView.xaml @@ -15,29 +15,29 @@ - + + - - - + + - + + @@ -47,7 +47,7 @@ Height="48" Margin="0 5 0 0" Grid.Row="0" - Grid.RowSpan="2" + Grid.RowSpan="3" HorizontalAlignment="Center" VerticalAlignment="Top" /> @@ -59,6 +59,12 @@ + + + + + + + + + - - + + + + + + + + + + + + - - - - - - - - - - - - - + - - - - Plugin enabled - + - - + + + Plugin enabled + + + - + + + + diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsViewModel.cs b/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsViewModel.cs index cb4dcc8ab..f25606309 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Tabs/Plugins/PluginSettingsViewModel.cs @@ -219,6 +219,11 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins } } + public void OpenUri(Uri uri) + { + Core.Utilities.OpenUrl(uri.ToString()); + } + private void PluginManagementServiceOnPluginToggled(object? sender, PluginEventArgs e) { NotifyOfPropertyChange(nameof(IsEnabled));