2025-04-15 05:24:25 +00:00
|
|
|
#nullable enable
|
2022-07-01 04:56:15 +00:00
|
|
|
|
2025-06-17 08:55:23 +00:00
|
|
|
namespace Flow.Launcher.Plugin.Explorer.ViewModels
|
2022-07-01 04:56:15 +00:00
|
|
|
{
|
2025-06-17 08:55:23 +00:00
|
|
|
public partial class ActionKeywordModel : BaseModel
|
2022-07-01 04:56:15 +00:00
|
|
|
{
|
2025-04-15 05:24:25 +00:00
|
|
|
private static Settings _settings = null!;
|
2022-07-01 04:56:15 +00:00
|
|
|
|
|
|
|
|
public static void Init(Settings settings)
|
|
|
|
|
{
|
|
|
|
|
_settings = settings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal ActionKeywordModel(Settings.ActionKeyword actionKeyword, string description)
|
|
|
|
|
{
|
|
|
|
|
KeywordProperty = actionKeyword;
|
|
|
|
|
Description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Description { get; private init; }
|
|
|
|
|
|
2025-05-30 02:59:22 +00:00
|
|
|
public string LocalizedDescription => Main.Context.API.GetTranslation(Description);
|
|
|
|
|
|
2022-07-01 04:56:15 +00:00
|
|
|
internal Settings.ActionKeyword KeywordProperty { get; }
|
|
|
|
|
|
|
|
|
|
private string? keyword;
|
|
|
|
|
public string Keyword
|
|
|
|
|
{
|
|
|
|
|
get => keyword ??= _settings.GetActionKeyword(KeywordProperty);
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
keyword = value;
|
|
|
|
|
_settings.SetActionKeyword(KeywordProperty, value);
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-17 08:55:23 +00:00
|
|
|
private bool? enabled;
|
2022-07-01 04:56:15 +00:00
|
|
|
public bool Enabled
|
|
|
|
|
{
|
|
|
|
|
get => enabled ??= _settings.GetActionKeywordEnabled(KeywordProperty);
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
enabled = value;
|
|
|
|
|
_settings.SetActionKeywordEnabled(KeywordProperty, value);
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-15 05:24:25 +00:00
|
|
|
}
|