Skip to content

Commit

Permalink
feeder: don't highlight URL as new if the table format (application) …
Browse files Browse the repository at this point in the history
…doesn't match
  • Loading branch information
stojy committed Aug 20, 2023
1 parent ee1c7d3 commit b26ae34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ClrVpin/Feeder/FeederResults.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
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}" />
<b:InvokeCommandAction Command="{Binding FormatChangedCommand}" />
</controls:RoutedEventTrigger>
</b:Interaction.Triggers>
</ComboBox>
Expand Down
6 changes: 6 additions & 0 deletions ClrVpin/Feeder/FeederResultsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public FeederResultsViewModel(IList<GameItem> gameItems, IList<LocalGame> localG

// invoke online game file update to handle IsNew which is time sensitive
UpdatedFilterTimeChanged = new ActionCommand(UpdateOnlineGameFileDetails);
FormatChangedCommand = new ActionCommand(UpdateOnlineGameFileDetails);

NavigateToUrlCommand = new ActionCommand<string>(url => Process.Start(new ProcessStartInfo(url) { UseShellExecute = true }));

Expand Down Expand Up @@ -227,6 +228,7 @@ public FeederResultsViewModel(IList<GameItem> gameItems, IList<LocalGame> localG
public ICommand DynamicFilteringCommand { get; }
public ICommand FilterChangedCommand { get; set; }
public ICommand UpdatedFilterTimeChanged { get; set; }
public ICommand FormatChangedCommand { get; }

public ICommand NavigateToUrlCommand { get; }
public ICommand AllTableAddMissingDatabaseInfoCommand { get; }
Expand Down Expand Up @@ -400,6 +402,10 @@ private void UpdateOnlineGameFileDetails()
if (file.IsNew && file is ImageFile { IsFullDmd: true } && !Settings.SelectedMiscFeatureOptions.Contains(MiscFeatureOptionEnum.FullDmd))
file.IsNew = false;
// - table format
if (file.IsNew && Settings.SelectedFormatFilter != null && (file as TableFile)?.TableFormat != Settings.SelectedFormatFilter)
file.IsNew = false;
// flag each url within the file - required to allow for simpler view binding
file.Urls.ForEach(url => url.IsNew = file.IsNew);
});
Expand Down

0 comments on commit b26ae34

Please sign in to comment.