Skip to content

Commit

Permalink
importer: added some missing tool tips to the filtering criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
stojy committed Nov 18, 2022
1 parent ad007be commit 8ed4f98
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 26 deletions.
3 changes: 2 additions & 1 deletion ClrVpin/Controls/ControlTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<TextBlock Text="{TemplateBinding controls:GenericAttached.String}"
MinWidth="{TemplateBinding controls:GenericAttached.Double}"
FontSize="{TemplateBinding controls:GenericAttached.Double2}"
Style="{StaticResource KeyTextBlockAutoStyle}" />
Style="{StaticResource KeyTextBlockAutoStyle}"
ToolTip="{TemplateBinding controls:GenericAttached.String2}"/>
<ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" />
</WrapPanel>
</ControlTemplate>
Expand Down
57 changes: 42 additions & 15 deletions ClrVpin/Importer/ImporterResults.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@
Text="{Binding Path=Settings.SelectedTableFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Table"
Style="{StaticResource EditComboBoxStyle}"
Width="265" Margin="0,0,10,0">
Width="265" Margin="0,0,10,0"
ToolTip="Filter the tables based on the table name.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="TextBoxBase.TextChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -311,7 +312,8 @@
Text="{Binding Path=Settings.SelectedManufacturerFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Manufacturer"
Style="{StaticResource EditComboBoxStyle}"
Width="230" Margin="0">
Width="230" Margin="0"
ToolTip="Filter the tables based on the manufacturer.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="TextBoxBase.TextChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -338,7 +340,8 @@
SelectedItem="{Binding Path=Settings.SelectedTypeFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Type"
Style="{StaticResource ComboBoxStyle}"
Width="65" Margin="0,0,0,0">
Width="65" Margin="0,0,0,0"
ToolTip="Filter the tables based on the table construction type.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="ComboBox.SelectionChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -350,7 +353,8 @@
SelectedItem="{Binding Path=Settings.SelectedFormatFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Format"
Style="{StaticResource ComboBoxStyle}"
Width="80" Margin="10,0,0,0">
Width="80" Margin="10,0,0,0"
ToolTip="Filter the tables based on the emulator. Ignored for unmatched tables.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="ComboBox.SelectionChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -362,7 +366,8 @@
SelectedItem="{Binding Path=Settings.SelectedYearBeginFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Year From"
Style="{StaticResource ComboBoxStyle}"
Width="100" Margin="10,0,0,0">
Width="100" Margin="10,0,0,0"
ToolTip="Filter the tables based on the earliest manufacture year.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="ComboBox.SelectionChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -374,7 +379,8 @@
SelectedItem="{Binding Path=Settings.SelectedYearEndFilter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
materialDesign:HintAssist.Hint="Year To"
Style="{StaticResource ComboBoxStyle}"
Width="80" Margin="10,0,0,0">
Width="80" Margin="10,0,0,0"
ToolTip="Filter the tables based on the latest manufacture year.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="ComboBox.SelectionChanged">
<b:InvokeCommandAction Command="{Binding FilterChangedCommand}" />
Expand All @@ -395,17 +401,24 @@
</Style>
</WrapPanel.Resources>

<DatePicker materialDesign:HintAssist.Hint="Updated From" Style="{StaticResource DatePickerStyle}" SelectedDate="{Binding Settings.SelectedUpdatedAtDateBegin}"
DisplayDateEnd="{Binding Settings.SelectedUpdatedAtDateEnd}" Margin="0">
<DatePicker materialDesign:HintAssist.Hint="Updated From"
Style="{StaticResource DatePickerStyle}"
SelectedDate="{Binding Settings.SelectedUpdatedAtDateBegin}"
DisplayDateEnd="{Binding Settings.SelectedUpdatedAtDateEnd}"
Margin="0"
ToolTip="Filter the tables based on when the table was last updated. Ignored for unmatched tables.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="DatePicker.SelectedDateChanged">
<b:InvokeCommandAction Command="{Binding UpdatedFilterTimeChanged}" />
</controls:RoutedEventTrigger>
</b:Interaction.Triggers>
</DatePicker>

<DatePicker materialDesign:HintAssist.Hint="Updated To" Style="{StaticResource DatePickerStyle}" SelectedDate="{Binding Settings.SelectedUpdatedAtDateEnd}"
DisplayDateStart="{Binding Settings.SelectedUpdatedAtDateBegin}">
<DatePicker materialDesign:HintAssist.Hint="Updated To"
Style="{StaticResource DatePickerStyle}"
SelectedDate="{Binding Settings.SelectedUpdatedAtDateEnd}"
DisplayDateStart="{Binding Settings.SelectedUpdatedAtDateBegin}"
ToolTip="Filter the tables based on when the table was last updated. Ignored for unmatched tables.">
<b:Interaction.Triggers>
<controls:RoutedEventTrigger RoutedEvent="DatePicker.SelectedDateChanged">
<b:InvokeCommandAction Command="{Binding UpdatedFilterTimeChanged}" />
Expand All @@ -418,7 +431,7 @@
PopupMode="Click"
PopupUniformCornerRadius="5"
Width="30"
ToolTip="Preset Dates">
ToolTip="Filter the tables based on when the table was last updated via the preset dates. Ignored for unmatched tables.">
<ItemsControl ItemsSource="{Binding PresetDateOptionsView}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -441,13 +454,19 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentControl Template="{StaticResource KeyValueAutoPair}" controls:GenericAttached.String="Fuzzy" controls:GenericAttached.Double="60" controls:GenericAttached.Double2="14">
<ContentControl Template="{StaticResource KeyValueAutoPair}"
controls:GenericAttached.String="Fuzzy"
controls:GenericAttached.String2="Filter the tables based on whether the fuzzy matching was successful."
controls:GenericAttached.Double="60" controls:GenericAttached.Double2="14">
<ContentControl ContentTemplate="{StaticResource FeatureTypeTemplate}" Content="{Binding TableMatchOptionsView}" />
</ContentControl>

<Separator Grid.Column="1" Style="{StaticResource SeparatorStyle}" />

<ContentControl Grid.Column="2" Template="{StaticResource KeyValueAutoPair}" controls:GenericAttached.String="Style" controls:GenericAttached.Double="60"
<ContentControl Grid.Column="2" Template="{StaticResource KeyValueAutoPair}"
controls:GenericAttached.String="Style"
controls:GenericAttached.String2="Filter the tables based on whether the table was physically manufactured."
controls:GenericAttached.Double="60"
controls:GenericAttached.Double2="14">
<ContentControl ContentTemplate="{StaticResource FeatureTypeTemplate}" Content="{Binding TableStyleOptionsView}" />
</ContentControl>
Expand All @@ -459,13 +478,20 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentControl Template="{StaticResource KeyValueAutoPair}" controls:GenericAttached.String="Updated" controls:GenericAttached.Double="60" controls:GenericAttached.Double2="14">
<ContentControl Template="{StaticResource KeyValueAutoPair}"
controls:GenericAttached.String="Updated"
controls:GenericAttached.String2="Filter the tables based on the type of content that was updated. Not applicable for unmatched tables."
controls:GenericAttached.Double="60"
controls:GenericAttached.Double2="14">
<ContentControl ContentTemplate="{StaticResource FeatureTypeTemplate}" Content="{Binding TableNewContentOptionsView}" />
</ContentControl>

<Separator Grid.Column="1" Style="{StaticResource SeparatorStyle}" />

<ContentControl Grid.Column="2" Template="{StaticResource KeyValueAutoPair}" controls:GenericAttached.String="Table" controls:GenericAttached.Double="60"
<ContentControl Grid.Column="2" Template="{StaticResource KeyValueAutoPair}"
controls:GenericAttached.String="Table"
controls:GenericAttached.String2="Filter the tables based on whether the table can be downloaded. Not applicable for unmatched tables."
controls:GenericAttached.Double="60"
controls:GenericAttached.Double2="14">
<ContentControl ContentTemplate="{StaticResource FeatureTypeTemplate}" Content="{Binding TableAvailabilityOptionsView}" />
</ContentControl>
Expand All @@ -478,6 +504,7 @@
<WrapPanel Margin="0,5,0,0">
<ContentControl Template="{StaticResource KeyValuePair}"
controls:GenericAttached.String="Existing Tables"
controls:GenericAttached.String2="tba"
controls:GenericAttached.Double="100"
controls:GenericAttached.Double2="14">
<WrapPanel>
Expand Down
8 changes: 4 additions & 4 deletions ClrVpin/Importer/ImporterResultsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public ImporterResultsViewModel(IList<GameItem> gameItems, IList<LocalGame> loca

TableStyleOptionsView = CreateFeatureOptionsView(StaticSettings.TableStyleOptions, TableStyleOptionEnum.Manufactured, () => Model.Settings.Importer.SelectedTableStyleOption);
TableMatchOptionsView = CreateFeatureOptionsView(StaticSettings.TableMatchOptions, TableMatchOptionEnum.All, () => Model.Settings.Importer.SelectedTableMatchOption);
TableAvailabilityOptionsView = CreateFeatureOptionsView(StaticSettings.TableAvailabilityOptions, TableAvailabilityOptionEnum.Both, () => Model.Settings.Importer.SelectedTableAvailabilityOption);
TableNewContentOptionsView = CreateFeatureOptionsView(StaticSettings.TableNewContentOptions, TableNewContentOptionEnum.All, () => Model.Settings.Importer.SelectedTableNewContentOption);
TableAvailabilityOptionsView = CreateFeatureOptionsView(StaticSettings.TableAvailabilityOptions, TableAvailabilityOptionEnum.Any, () => Model.Settings.Importer.SelectedTableAvailabilityOption);
TableNewContentOptionsView = CreateFeatureOptionsView(StaticSettings.TableNewContentOptions, TableNewContentOptionEnum.Any, () => Model.Settings.Importer.SelectedTableNewContentOption);
PresetDateOptionsView = CreatePresetDateOptionsView(StaticSettings.PresetDateOptions);

// assign VM properties
Expand Down Expand Up @@ -108,8 +108,8 @@ public ImporterResultsViewModel(IList<GameItem> gameItems, IList<LocalGame> loca
// filter the table names list to reflect the various view filtering criteria
// - quickest checks placed first to short circuit evaluation of more complex checks
Filter = game =>
(Settings.SelectedTableAvailabilityOption == TableAvailabilityOptionEnum.Both || game.OnlineGame?.TableAvailability == Settings.SelectedTableAvailabilityOption) &&
(Settings.SelectedTableNewContentOption == TableNewContentOptionEnum.All || game.OnlineGame?.NewContentType == Settings.SelectedTableNewContentOption) &&
(Settings.SelectedTableAvailabilityOption == TableAvailabilityOptionEnum.Any || game.OnlineGame?.TableAvailability == Settings.SelectedTableAvailabilityOption) &&
(Settings.SelectedTableNewContentOption == TableNewContentOptionEnum.Any || game.OnlineGame?.NewContentType == Settings.SelectedTableNewContentOption) &&
(Settings.SelectedTableMatchOption == TableMatchOptionEnum.All || game.TableMatchType == Settings.SelectedTableMatchOption) &&
(Settings.SelectedTableStyleOption == TableStyleOptionEnum.Both || game.TableStyleOption == Settings.SelectedTableStyleOption) &&
(Settings.SelectedYearBeginFilter == null || string.CompareOrdinal(game.Year, 0, Settings.SelectedYearBeginFilter, 0, 50) >= 0) &&
Expand Down
2 changes: 1 addition & 1 deletion ClrVpin/Models/Importer/TableAvailabilityOptionEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public enum TableAvailabilityOptionEnum
{
[Description("Available")] Available,
[Description("Unavailable")] Unavailable,
[Description("Both")] Both
[Description("Any")] Any
}
}
2 changes: 1 addition & 1 deletion ClrVpin/Models/Importer/TableNewContentOptionEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ public enum TableNewContentOptionEnum
{
[Description("Table, Backglass, DMD")] TableBackglassDmd,
[Description("Other")] Other,
[Description("All")] All
[Description("Any")] Any
}
4 changes: 2 additions & 2 deletions ClrVpin/Models/Settings/ImporterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class ImporterSettings
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global - setter is assigned member expression, refer Accessor.cs
public TableStyleOptionEnum SelectedTableStyleOption { get; set; } = TableStyleOptionEnum.Manufactured;
public TableMatchOptionEnum SelectedTableMatchOption { get; set; } = TableMatchOptionEnum.All;
public TableAvailabilityOptionEnum SelectedTableAvailabilityOption { get; set; } = TableAvailabilityOptionEnum.Both;
public TableNewContentOptionEnum SelectedTableNewContentOption { get; set; } = TableNewContentOptionEnum.All;
public TableAvailabilityOptionEnum SelectedTableAvailabilityOption { get; set; } = TableAvailabilityOptionEnum.Any;
public TableNewContentOptionEnum SelectedTableNewContentOption { get; set; } = TableNewContentOptionEnum.Any;
// ReSharper restore AutoPropertyCanBeMadeGetOnly.Global

public bool IsDynamicFiltering { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions ClrVpin/Models/Settings/StaticSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ static StaticSettings()
{
new() {Enum = TableAvailabilityOptionEnum.Available, Tip = "Tables that are available for download, i.e. valid table URL(s) exist"},
new() {Enum = TableAvailabilityOptionEnum.Unavailable, Tip = "Tables that are unavailable for download, i.e. no valid URL(s) exist"},
new() {Enum = TableAvailabilityOptionEnum.Both, Tip = "Available and unavailable tables"}
new() {Enum = TableAvailabilityOptionEnum.Any, Tip = "Available and unavailable tables"}
};

public static readonly EnumOption<TableNewContentOptionEnum>[] TableNewContentOptions =
{
new() {Enum = TableNewContentOptionEnum.TableBackglassDmd, Tip = "Tables with new content of type: Table, Backglass, or DMDs"},
new() {Enum = TableNewContentOptionEnum.Other, Tip = "Tables with new content of type: Wheels, ROMs, Media Packs, Sounds, Toppers, PuP Packs, POVs, Alt. Sounds, or Rules"},
new() {Enum = TableNewContentOptionEnum.All, Tip = "Tables with new content of any type, including any unmatched tables where new content is n/a"}
new() {Enum = TableNewContentOptionEnum.Any, Tip = "Tables with new content of any type, including any unmatched tables where new content is n/a"}
};

// all possible file merge options - to be used elsewhere (importer)
Expand Down

0 comments on commit 8ed4f98

Please sign in to comment.