• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ParadoxGameConverters / Fronter.NET / 21217561952

21 Jan 2026 04:33PM UTC coverage: 23.05% (+0.07%) from 22.977%
21217561952

push

github

web-flow
Target playset selection (#426)

* TargetPlaysetPickerView

* TargetPlaylist class

* TargetDbManager

* Button for reloading the mods

* selectedPlaysetID

* TargetPlayset was an unneed wrap

* styling

* cleanup

* Post-merge fixes

* Log selected playset change

* Write the selected playset's mods to configuration.txt

* Add margin to SELECT_PLAYSET_INFO TextBlock

* Add blank option to target playset picker

* Load selectedPlayset from configuration.txt

144 of 774 branches covered (18.6%)

Branch coverage included in aggregate %.

28 of 147 new or added lines in 9 files covered. (19.05%)

7 existing lines in 1 file now uncovered.

728 of 3009 relevant lines covered (24.19%)

8.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.29
/Fronter.NET/ViewModels/TargetPlaysetPickerViewModel.cs
1
using DynamicData;
2
using DynamicData.Binding;
3
using Fronter.Models.Configuration;
4
using Fronter.Models.Database;
5
using log4net;
6
using System;
7
using System.Collections.ObjectModel;
8
using System.Linq;
9

10
namespace Fronter.ViewModels;
11

12
/// <summary>
13
///     The TargetPlaysetPickerViewModel lets the user select paths to various stuff the converter needs to know where to find.
14
/// </summary>
15
internal class TargetPlaysetPickerViewModel : ViewModelBase {
16
        private readonly Config config;
17
        private readonly ILog logger = LogManager.GetLogger("Mod copier");
2✔
18
        
19
        public TargetPlaysetPickerViewModel(Config config) {
4✔
20
                this.config = config;
2✔
21
                
22
                config.AutoLocatedPlaysets.ToObservableChangeSet()
2✔
23
                        .Bind(out targetPlaysets)
2✔
24
                        .Subscribe();
2✔
25

26
                // Keep a ComboBox-friendly list in sync, but with an extra leading null entry ("no selection").
27
                config.AutoLocatedPlaysets.ToObservableChangeSet()
2✔
28
                        .ToCollection()
2✔
29
                        .Subscribe(playsets => {
2✔
30
                                TargetPlaysetsWithBlank = new(new Playset?[] { null }.Concat(playsets));
2✔
31
                        });
4✔
32

33
                if (!config.TargetPlaysetSelectionEnabled) {
4✔
34
                        TabDisabled = true;
2✔
35
                }
2✔
36
        }
2✔
37

38
        private readonly ReadOnlyObservableCollection<Playset> targetPlaysets;
NEW
39
        public ReadOnlyObservableCollection<Playset> TargetPlaysets => targetPlaysets;
×
40

41
        public ObservableCollection<Playset?> TargetPlaysetsWithBlank { get; private set; } = [];
4✔
42

43
        public bool TabDisabled { get; } = false;
2✔
44

NEW
45
        public void ReloadPlaysets() {
×
NEW
46
                config.SelectedPlayset = null;
×
NEW
47
                config.AutoLocatePlaysets();
×
NEW
48
        }
×
49

50
        public Playset? SelectedPlayset {
NEW
51
                get => config.SelectedPlayset;
×
NEW
52
                set {
×
NEW
53
                        config.SelectedPlayset = value;
×
54

NEW
55
                        if (value is null) {
×
NEW
56
                                logger.Info("Unset the target playset.");
×
NEW
57
                        } else {
×
NEW
58
                                logger.Info("Set the target playset to \"" + value.Name + "\".");
×
NEW
59
                        }
×
NEW
60
                }
×
61
        }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc