feat(desktop): add "match all" for notifications

This commit is contained in:
Anna 2020-11-23 00:24:18 -05:00
parent 85004f7a23
commit adae837f70
2 changed files with 12 additions and 2 deletions

View File

@ -364,6 +364,7 @@ namespace XIVChat_Desktop {
[JsonObject]
public class Notification {
public string Name { get; set; }
public bool MatchAll { get; set; }
public List<ChatType> Channels { get; set; } = new List<ChatType>();
public List<string> Substrings { get; set; } = new List<string>();
@ -409,6 +410,10 @@ namespace XIVChat_Desktop {
return false;
}
if (this.MatchAll) {
return true;
}
if (this.Substrings.Count == 0 && this.Regexes.Count == 0) {
return false;
}

View File

@ -27,6 +27,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
@ -91,11 +92,15 @@
Command="local:ManageNotification.AddEmpty"
CommandParameter="{Binding Substrings}" />
<Label Grid.Row="7"
<CheckBox Grid.Row="7"
IsChecked="{Binding Notification.MatchAll}"
Content="Match all messages from selected channels" />
<Label Grid.Row="8"
Margin="0,0,0,8"
Content="Channels" />
<ScrollViewer Grid.Row="8">
<ScrollViewer Grid.Row="9">
<WrapPanel x:Name="Channels"
Orientation="Vertical" />
</ScrollViewer>