Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions CPAP-Exporter.UI/CPAP-Exporter.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Pages\About\**" />
<EmbeddedResource Remove="Pages\About\**" />
<None Remove="Pages\About\**" />
<Page Remove="Pages\About\**" />
</ItemGroup>

<ItemGroup>
<None Remove="Images\AboutBox.png" />
<None Remove="Images\BrowseButtonBackground.png" />
Expand Down Expand Up @@ -57,6 +64,10 @@
<None Remove="Images\SavedFiles.Background.Light.png" />
<None Remove="Images\SavedFiles.EventsFilePanel.Background.png" />
<None Remove="Images\SavedFiles.RawFilePanel.Background.png" />
<None Remove="Images\Settings.Acknowledgements.Dark.png" />
<None Remove="Images\Settings.Acknowledgements.Light.png" />
<None Remove="Images\Settings.FontSize.Dark.png" />
<None Remove="Images\Settings.FontSize.Light.png" />
<None Remove="Images\Settings.Icon.Dark.png" />
<None Remove="Images\Settings.Icon.Light.png" />
<None Remove="Images\Settings.Icon.Selected.png" />
Expand Down Expand Up @@ -105,6 +116,10 @@
<Resource Include="Images\SavedFiles.Background.Light.png" />
<Resource Include="Images\SavedFiles.EventsFilePanel.Background.png" />
<Resource Include="Images\SavedFiles.RawFilePanel.Background.png" />
<Resource Include="Images\Settings.Acknowledgements.Dark.png" />
<Resource Include="Images\Settings.Acknowledgements.Light.png" />
<Resource Include="Images\Settings.FontSize.Dark.png" />
<Resource Include="Images\Settings.FontSize.Light.png" />
<Resource Include="Images\Settings.Icon.Dark.png" />
<Resource Include="Images\Settings.Icon.Light.png" />
<Resource Include="Images\Settings.Icon.Selected.png" />
Expand All @@ -126,8 +141,4 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Pages\About\" />
</ItemGroup>

</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/Acknowledgement.cs
Original file line number Diff line number Diff line change
@@ -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)
{
}
}
}
}
59 changes: 59 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<UserControl x:Class="CascadePass.CPAPExporter.AcknowledgementsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CascadePass.CPAPExporter"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">

<Expander Margin="4">
<Expander.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<Image
Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="1"
Source="{DynamicResource Settings.Acknowledgements.Icon}"
Width="32" Height="32"
HorizontalAlignment="Left" VerticalAlignment="Center" />

<TextBlock
Grid.Row="0" Grid.Column="1"
Text="{x:Static local:Resources.SectionHeader_Acknowledgements}"
FontWeight="Bold"
HorizontalAlignment="Left"
Margin="4,0,0,0" />

<TextBlock
Grid.Row="1" Grid.Column="1"
Text="{x:Static local:Resources.SectionSubtitle_Acknowledgements}"
FontWeight="Bold"
HorizontalAlignment="Left"
Margin="4,0,0,0" />
</Grid>
</Expander.Header>

<ItemsControl ItemsSource="{Binding Acknowledgements}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title}" FontWeight="Bold" Width="100" />
<TextBlock>
<Hyperlink NavigateUri="{Binding Url}" Command="{Binding VisitUrlCommand}">
<Run Text="{Binding Url}" />
</Hyperlink>
</TextBlock>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Expander>
</UserControl>
15 changes: 15 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/AcknowledgementsView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Windows.Controls;

namespace CascadePass.CPAPExporter
{
/// <summary>
/// Interaction logic for AcknowledgementsView.xaml
/// </summary>
public partial class AcknowledgementsView : UserControl
{
public AcknowledgementsView()
{
this.InitializeComponent();
}
}
}
49 changes: 49 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<UserControl x:Class="CascadePass.CPAPExporter.FontSizeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CascadePass.CPAPExporter"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">

<Expander Margin="4">
<Expander.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<Image
Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="1"
Source="{DynamicResource Settings.FontSize.Icon}"
Width="32" Height="32"
HorizontalAlignment="Left" VerticalAlignment="Center" />

<TextBlock
Grid.Row="0" Grid.Column="1"
Text="{x:Static local:Resources.SectionHeader_TextSize}"
FontWeight="Bold"
HorizontalAlignment="Left"
Margin="4,0,0,0" />

<TextBlock
Grid.Row="1" Grid.Column="1"
Text="{x:Static local:Resources.SectionSubtitle_TextSize}"
FontWeight="Bold"
HorizontalAlignment="Left"
Margin="4,0,0,0" />
</Grid>
</Expander.Header>
<StackPanel>
<TextBlock Text="{x:Static local:Resources.Label_FlowReductionExplaination}" TextWrapping="Wrap" />

<Slider />
</StackPanel>
</Expander>
</UserControl>
15 changes: 15 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/FontSizeView.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Windows.Controls;

namespace CascadePass.CPAPExporter
{
/// <summary>
/// Interaction logic for FontSizeView.xaml
/// </summary>
public partial class FontSizeView : UserControl
{
public FontSizeView()
{
this.InitializeComponent();
}
}
}
19 changes: 19 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<UserControl x:Class="CascadePass.CPAPExporter.SettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CascadePass.CPAPExporter"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.DataContext>
<local:SettingsViewModel />
</UserControl.DataContext>

<ScrollViewer>
<StackPanel>
<local:FontSizeView />
<local:AcknowledgementsView />
</StackPanel>
</ScrollViewer>
</UserControl>
28 changes: 28 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/SettingsView.xaml.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Interaction logic for SettingsView.xaml
/// </summary>
public partial class SettingsView : UserControl
{
public SettingsView()
{
InitializeComponent();
}
}
}
23 changes: 23 additions & 0 deletions CPAP-Exporter.UI/Pages/Settings/SettingsViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<Acknowledgement> 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" },
];
}
}
}
54 changes: 54 additions & 0 deletions CPAP-Exporter.UI/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions CPAP-Exporter.UI/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,22 @@
<data name="Nav_ExportSettings_TT" xml:space="preserve">
<value>Export Settings</value>
</data>
<data name="PageTitle_Settings" xml:space="preserve">
<value>CPAP-Exporter Settings</value>
</data>
<data name="PageDesc_Settings" xml:space="preserve">
<value />
</data>
<data name="SectionHeader_Acknowledgements" xml:space="preserve">
<value>Acknowledgements</value>
</data>
<data name="SectionHeader_TextSize" xml:space="preserve">
<value>Text Size</value>
</data>
<data name="SectionSubtitle_TextSize" xml:space="preserve">
<value>Adjust the size of text in CPAP-Exporter</value>
</data>
<data name="SectionSubtitle_Acknowledgements" xml:space="preserve">
<value>Open source projects CPAP-Exporter relies on</value>
</data>
</root>
2 changes: 2 additions & 0 deletions CPAP-Exporter.UI/Themes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@
<BitmapImage x:Key="Settings.Icon.Selected" UriSource="pack://application:,,,/Images/Settings.Icon.Selected.png" />
<BitmapImage x:Key="Menu.Icon" UriSource="pack://application:,,,/Images/Menu.Icon.Dark.png" />
<BitmapImage x:Key="Menu.Icon.Selected" UriSource="pack://application:,,,/Images/Menu.Icon.Selected.png" />
<BitmapImage x:Key="Settings.FontSize.Icon" UriSource="pack://application:,,,/Images/Settings.FontSize.Dark.png" />
<BitmapImage x:Key="Settings.Acknowledgements.Icon" UriSource="pack://application:,,,/Images/Settings.Acknowledgements.Dark.png" />
</ResourceDictionary>
Loading
Loading