diff --git a/CPAP-Exporter.UI/CPAP-Exporter.UI.csproj b/CPAP-Exporter.UI/CPAP-Exporter.UI.csproj index ae189de..b3d549c 100644 --- a/CPAP-Exporter.UI/CPAP-Exporter.UI.csproj +++ b/CPAP-Exporter.UI/CPAP-Exporter.UI.csproj @@ -10,6 +10,13 @@ AnyCPU + + + + + + + @@ -57,6 +64,10 @@ + + + + @@ -105,6 +116,10 @@ + + + + @@ -126,8 +141,4 @@ - - - - diff --git a/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Dark.png b/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Dark.png new file mode 100644 index 0000000..14581f8 Binary files /dev/null and b/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Dark.png differ diff --git a/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Light.png b/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Light.png new file mode 100644 index 0000000..24c30c5 Binary files /dev/null and b/CPAP-Exporter.UI/Images/Settings.Acknowledgements.Light.png differ diff --git a/CPAP-Exporter.UI/Images/Settings.FontSize.Dark.png b/CPAP-Exporter.UI/Images/Settings.FontSize.Dark.png new file mode 100644 index 0000000..57487c3 Binary files /dev/null and b/CPAP-Exporter.UI/Images/Settings.FontSize.Dark.png differ diff --git a/CPAP-Exporter.UI/Images/Settings.FontSize.Light.png b/CPAP-Exporter.UI/Images/Settings.FontSize.Light.png new file mode 100644 index 0000000..837b4a3 Binary files /dev/null and b/CPAP-Exporter.UI/Images/Settings.FontSize.Light.png differ diff --git a/CPAP-Exporter.UI/Pages/Settings/Acknowledgement.cs b/CPAP-Exporter.UI/Pages/Settings/Acknowledgement.cs new file mode 100644 index 0000000..e25e93b --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/Acknowledgement.cs @@ -0,0 +1,31 @@ +namespace CascadePass.CPAPExporter +{ + public class Acknowledgement + { + private DelegateCommand visitUrl; + + public string Title { get; set; } + + public string Url { get; set; } + + public DelegateCommand VisitUrlCommand => this.visitUrl ??= new DelegateCommand(() => this.VisitUrl()); + + public void VisitUrl() + { + try + { + if (!string.IsNullOrEmpty(this.Url)) + { + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo + { + FileName = this.Url, + UseShellExecute = true + }); + } + } + catch (Exception) + { + } + } + } +} diff --git a/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml b/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml new file mode 100644 index 0000000..7407629 --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml.cs b/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml.cs new file mode 100644 index 0000000..5b3323a --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace CascadePass.CPAPExporter +{ + /// + /// Interaction logic for AcknowledgementsView.xaml + /// + public partial class AcknowledgementsView : UserControl + { + public AcknowledgementsView() + { + this.InitializeComponent(); + } + } +} diff --git a/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml b/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml new file mode 100644 index 0000000..26fe6c6 --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml.cs b/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml.cs new file mode 100644 index 0000000..d8bdfdb --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace CascadePass.CPAPExporter +{ + /// + /// Interaction logic for FontSizeView.xaml + /// + public partial class FontSizeView : UserControl + { + public FontSizeView() + { + this.InitializeComponent(); + } + } +} diff --git a/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml b/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml new file mode 100644 index 0000000..ce1bc7f --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml.cs b/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml.cs new file mode 100644 index 0000000..8de56e9 --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace CascadePass.CPAPExporter +{ + /// + /// Interaction logic for SettingsView.xaml + /// + public partial class SettingsView : UserControl + { + public SettingsView() + { + InitializeComponent(); + } + } +} diff --git a/CPAP-Exporter.UI/Pages/Settings/SettingsViewModel.cs b/CPAP-Exporter.UI/Pages/Settings/SettingsViewModel.cs new file mode 100644 index 0000000..476f06e --- /dev/null +++ b/CPAP-Exporter.UI/Pages/Settings/SettingsViewModel.cs @@ -0,0 +1,23 @@ +using System.Collections.ObjectModel; + +namespace CascadePass.CPAPExporter +{ + public class SettingsViewModel : PageViewModel + { + public SettingsViewModel() : base(Resources.PageTitle_Settings, Resources.PageDesc_Settings) + { + this.CreateAcknowledgements(); + } + + public ObservableCollection Acknowledgements { get; private set; } + + private void CreateAcknowledgements() + { + this.Acknowledgements = [ + new() { Title = "EEGKit", Url = "https://github.com/EEGKit/cpap-lib" }, + new() { Title = "StagPoint", Url = "https://github.com/EEGKit/StagPoint.EuropeanDataFormat.Net" }, + new() { Title = "Json.net", Url = "https://www.newtonsoft.com/json" }, + ]; + } + } +} diff --git a/CPAP-Exporter.UI/Resources.Designer.cs b/CPAP-Exporter.UI/Resources.Designer.cs index 533698f..8410b54 100644 --- a/CPAP-Exporter.UI/Resources.Designer.cs +++ b/CPAP-Exporter.UI/Resources.Designer.cs @@ -573,6 +573,15 @@ public static string PageDesc_SelectSignals { } } + /// + /// Looks up a localized string similar to . + /// + public static string PageDesc_Settings { + get { + return ResourceManager.GetString("PageDesc_Settings", resourceCulture); + } + } + /// /// Looks up a localized string similar to SHA-256 Hashes. /// @@ -627,6 +636,15 @@ public static string PageTitle_SelectSignals { } } + /// + /// Looks up a localized string similar to CPAP-Exporter Settings. + /// + public static string PageTitle_Settings { + get { + return ResourceManager.GetString("PageTitle_Settings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Welcome to CPAP Exporter. /// @@ -699,6 +717,42 @@ public static string RowsWritten { } } + /// + /// Looks up a localized string similar to Acknowledgements. + /// + public static string SectionHeader_Acknowledgements { + get { + return ResourceManager.GetString("SectionHeader_Acknowledgements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text Size. + /// + public static string SectionHeader_TextSize { + get { + return ResourceManager.GetString("SectionHeader_TextSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open source projects CPAP-Exporter relies on. + /// + public static string SectionSubtitle_Acknowledgements { + get { + return ResourceManager.GetString("SectionSubtitle_Acknowledgements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Adjust the size of text in CPAP-Exporter. + /// + public static string SectionSubtitle_TextSize { + get { + return ResourceManager.GetString("SectionSubtitle_TextSize", resourceCulture); + } + } + /// /// Looks up a localized string similar to Sessions. /// diff --git a/CPAP-Exporter.UI/Resources.resx b/CPAP-Exporter.UI/Resources.resx index f6ca901..90950eb 100644 --- a/CPAP-Exporter.UI/Resources.resx +++ b/CPAP-Exporter.UI/Resources.resx @@ -357,4 +357,22 @@ Export Settings + + CPAP-Exporter Settings + + + + + + Acknowledgements + + + Text Size + + + Adjust the size of text in CPAP-Exporter + + + Open source projects CPAP-Exporter relies on + \ No newline at end of file diff --git a/CPAP-Exporter.UI/Themes/Dark.xaml b/CPAP-Exporter.UI/Themes/Dark.xaml index 06c48ed..a4cfd92 100644 --- a/CPAP-Exporter.UI/Themes/Dark.xaml +++ b/CPAP-Exporter.UI/Themes/Dark.xaml @@ -67,4 +67,6 @@ + + \ No newline at end of file diff --git a/CPAP-Exporter.UI/Themes/Light.xaml b/CPAP-Exporter.UI/Themes/Light.xaml index 259d1a9..c917895 100644 --- a/CPAP-Exporter.UI/Themes/Light.xaml +++ b/CPAP-Exporter.UI/Themes/Light.xaml @@ -61,4 +61,6 @@ + + \ No newline at end of file diff --git a/CPAP-Exporter.UI/ViewModels/NavigationViewModel.cs b/CPAP-Exporter.UI/ViewModels/NavigationViewModel.cs index 89769a5..4117e93 100644 --- a/CPAP-Exporter.UI/ViewModels/NavigationViewModel.cs +++ b/CPAP-Exporter.UI/ViewModels/NavigationViewModel.cs @@ -56,7 +56,7 @@ public FrameworkElement CurrentView set { var old = this.currentView; - if (this.SetPropertyValue(ref this.currentView, value, nameof(this.CurrentView))) + if (this.SetPropertyValue(ref this.currentView, value, [nameof(this.CurrentView), nameof(this.SettingsIcon)])) { if (old?.DataContext is ViewModel oldViewModel) { @@ -177,7 +177,7 @@ public bool ShowNavigationButtonLabels public BitmapImage MenuIcon => this.ShowNavigationButtonLabels ? Application.Current?.FindResource("Menu.Icon.Selected") as BitmapImage : Application.Current?.FindResource("Menu.Icon") as BitmapImage; - public BitmapImage SettingsIcon => this.CurrentStep == NavigationStep.Settings ? Application.Current?.FindResource("Settings.Icon.Selected") as BitmapImage : Application.Current?.FindResource("Settings.Icon") as BitmapImage; + public BitmapImage SettingsIcon => this.CurrentView is SettingsView ? Application.Current?.FindResource("Settings.Icon.Selected") as BitmapImage : Application.Current?.FindResource("Settings.Icon") as BitmapImage; #endregion @@ -197,6 +197,8 @@ public bool ShowNavigationButtonLabels public DelegateCommand ToggleNavDrawerExpansionCommand => this.toggleNavigationDrawerExpansionCommand ??= new DelegateCommand(this.ToggleNavigationDrawerExpansion); + public DelegateCommand ShowSettingsCommand => this.settingsCommand ??= new DelegateCommand(this.ShowSettings); + #endregion #endregion @@ -319,6 +321,17 @@ public void ShowReleaseNotes() } } + public void ShowSettings() + { + if (this.CurrentView is not SettingsView settingsView) + { + //var viewModel = new SettingsViewModel(this.ExportParameters.UserPreferences); + settingsView = new SettingsView() /*{ DataContext = viewModel }*/; + } + + this.CurrentView = settingsView; + } + public void ToggleNavigationDrawerExpansion() { this.ShowNavigationButtonLabels = !this.ShowNavigationButtonLabels; diff --git a/CPAP-Exporter.UI/Views/NavigationBar.xaml b/CPAP-Exporter.UI/Views/NavigationBar.xaml index 8bdccf0..be9d5bf 100644 --- a/CPAP-Exporter.UI/Views/NavigationBar.xaml +++ b/CPAP-Exporter.UI/Views/NavigationBar.xaml @@ -17,7 +17,7 @@