notifications settings fix, processing settings added, settings restore button added
This commit is contained in:
@@ -126,6 +126,33 @@
|
||||
<data name="MediaTypeOriginal.Text" xml:space="preserve">
|
||||
<value>Original</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedFast.Text" xml:space="preserve">
|
||||
<value>Fast</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedFaster.Text" xml:space="preserve">
|
||||
<value>Faster</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedMedium.Text" xml:space="preserve">
|
||||
<value>Medium</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedSlow.Text" xml:space="preserve">
|
||||
<value>Slow</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedSlower.Text" xml:space="preserve">
|
||||
<value>Slower</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedSuperFast.Text" xml:space="preserve">
|
||||
<value>Super fast</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedUltraFast.Text" xml:space="preserve">
|
||||
<value>Ultra fast</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedVeryFast.Text" xml:space="preserve">
|
||||
<value>Very fast</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeedVerySlow.Text" xml:space="preserve">
|
||||
<value>Very slow</value>
|
||||
</data>
|
||||
<data name="StartAtMeteredConnectionDialogMessage" xml:space="preserve">
|
||||
<value>You are trying to download a video using a metered connection. Do you want to continue?</value>
|
||||
</data>
|
||||
|
||||
@@ -129,6 +129,27 @@
|
||||
<data name="NotificationsOnUnsuccessful.Header" xml:space="preserve">
|
||||
<value>Show notifications when task ended unsuccessfully</value>
|
||||
</data>
|
||||
<data name="ProcessingFFmpegLocation.Header" xml:space="preserve">
|
||||
<value>FFmpeg location</value>
|
||||
</data>
|
||||
<data name="ProcessingFFmpegLocationButton.Content" xml:space="preserve">
|
||||
<value>Browse</value>
|
||||
</data>
|
||||
<data name="ProcessingHeader.Text" xml:space="preserve">
|
||||
<value>Processing</value>
|
||||
</data>
|
||||
<data name="ProcessingSpeed.Header" xml:space="preserve">
|
||||
<value>Speed</value>
|
||||
</data>
|
||||
<data name="ProcessingUseHardwareAcceleration.Header" xml:space="preserve">
|
||||
<value>Use hardware acceleration</value>
|
||||
</data>
|
||||
<data name="ProcessingUseMultithreading.Header" xml:space="preserve">
|
||||
<value>Use multithreading</value>
|
||||
</data>
|
||||
<data name="RestoreToDefaultButton.Content" xml:space="preserve">
|
||||
<value>Restore settings to default</value>
|
||||
</data>
|
||||
<data name="SearchingHeader.Text" xml:space="preserve">
|
||||
<value>Searching</value>
|
||||
</data>
|
||||
@@ -163,7 +184,7 @@
|
||||
<value>Maximum number of tasks running in parallel</value>
|
||||
</data>
|
||||
<data name="TasksSaveLastOutputDirectory.Description" xml:space="preserve">
|
||||
<value>Otherwise, default directory defined below will be used</value>
|
||||
<value>Otherwise, default directory defined below (after expanding) will be used</value>
|
||||
</data>
|
||||
<data name="TasksSaveLastOutputDirectory.Header" xml:space="preserve">
|
||||
<value>Save last output directory</value>
|
||||
|
||||
@@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VDownload.Models;
|
||||
@@ -76,6 +77,30 @@ namespace VDownload.Core.ViewModels.Settings
|
||||
set => SetProperty(_settingsService.Data.Common.Tasks.DefaultOutputDirectory, value, _settingsService.Data.Common.Tasks, (u, n) => u.DefaultOutputDirectory = n);
|
||||
}
|
||||
|
||||
public string ProcessingFFmpegLocation
|
||||
{
|
||||
get => _settingsService.Data.Common.Processing.FFmpegLocation;
|
||||
set => SetProperty(_settingsService.Data.Common.Processing.FFmpegLocation, value, _settingsService.Data.Common.Processing, (u, n) => u.FFmpegLocation = n);
|
||||
}
|
||||
|
||||
public bool ProcessingUseHardwareAcceleration
|
||||
{
|
||||
get => _settingsService.Data.Common.Processing.UseHardwareAcceleration;
|
||||
set => SetProperty(_settingsService.Data.Common.Processing.UseHardwareAcceleration, value, _settingsService.Data.Common.Processing, (u, n) => u.UseHardwareAcceleration = n);
|
||||
}
|
||||
|
||||
public bool ProcessingUseMultithreading
|
||||
{
|
||||
get => _settingsService.Data.Common.Processing.UseMultithreading;
|
||||
set => SetProperty(_settingsService.Data.Common.Processing.UseMultithreading, value, _settingsService.Data.Common.Processing, (u, n) => u.UseMultithreading = n);
|
||||
}
|
||||
|
||||
public ProcessingSpeed ProcessingSpeed
|
||||
{
|
||||
get => _settingsService.Data.Common.Processing.Speed;
|
||||
set => SetProperty(_settingsService.Data.Common.Processing.Speed, value, _settingsService.Data.Common.Processing, (u, n) => u.Speed = n);
|
||||
}
|
||||
|
||||
public bool NotificationsOnSuccessful
|
||||
{
|
||||
get => _settingsService.Data.Common.Notifications.OnSuccessful;
|
||||
@@ -177,6 +202,26 @@ namespace VDownload.Core.ViewModels.Settings
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task BrowseProcessingFFmpegLocation()
|
||||
{
|
||||
string? newDirectory = await _storagePickerService.OpenDirectory();
|
||||
if (newDirectory is not null)
|
||||
{
|
||||
this.ProcessingFFmpegLocation = newDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task RestoreToDefault()
|
||||
{
|
||||
await _settingsService.Restore();
|
||||
foreach (PropertyInfo property in this.GetType().GetProperties())
|
||||
{
|
||||
base.OnPropertyChanged(property.Name);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -122,6 +122,78 @@
|
||||
</ctc:SettingsExpander>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Processing -->
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingHeader"
|
||||
FontWeight="Bold"
|
||||
FontSize="15"/>
|
||||
<ctc:SettingsCard x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingFFmpegLocation"
|
||||
Description="{Binding ProcessingFFmpegLocation}">
|
||||
<ctc:SettingsCard.HeaderIcon>
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewProcessingFFmpegLocation}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<Button x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingFFmpegLocationButton"
|
||||
Command="{Binding BrowseProcessingFFmpegLocationCommand}"/>
|
||||
</ctc:SettingsCard>
|
||||
<ctc:SettingsCard x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingUseMultithreading">
|
||||
<ctc:SettingsCard.HeaderIcon>
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewProcessingUseMultithreading}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<ToggleSwitch IsOn="{Binding ProcessingUseMultithreading, Mode=TwoWay}"/>
|
||||
</ctc:SettingsCard>
|
||||
<ctc:SettingsCard x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingUseHardwareAcceleration">
|
||||
<ctc:SettingsCard.HeaderIcon>
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewProcessingUseHardwareAcceleration}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<ToggleSwitch IsOn="{Binding ProcessingUseHardwareAcceleration, Mode=TwoWay}"/>
|
||||
</ctc:SettingsCard>
|
||||
<ctc:SettingsCard x:Uid="/VDownload.Core.Strings/SettingsViewResources/ProcessingSpeed">
|
||||
<ctc:SettingsCard.HeaderIcon>
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewProcessingSpeed}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<ComboBox ItemsSource="{ct:EnumValues Type=m:ProcessingSpeed}"
|
||||
SelectedItem="{Binding ProcessingSpeed, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ctuc:SwitchPresenter Value="{Binding Converter={StaticResource ObjectToStringConverter}}">
|
||||
<ctuc:Case Value="VerySlow">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedVerySlow"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="Slower">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedSlower"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="Slow">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedSlow"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="Medium">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedMedium"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="Fast">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedFast"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="Faster">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedFaster"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="VeryFast">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedVeryFast"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="SuperFast">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedSuperFast"/>
|
||||
</ctuc:Case>
|
||||
<ctuc:Case Value="UltraFast">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/CommonResources/ProcessingSpeedUltraFast"/>
|
||||
</ctuc:Case>
|
||||
</ctuc:SwitchPresenter>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</ctc:SettingsCard>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Notifications -->
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock x:Uid="/VDownload.Core.Strings/SettingsViewResources/NotificationsHeader"
|
||||
@@ -132,14 +204,14 @@
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewNotificationOnSuccessful}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<ToggleSwitch IsOn="{Binding NotificationOnSuccessful, Mode=TwoWay}"/>
|
||||
<ToggleSwitch IsOn="{Binding NotificationsOnSuccessful, Mode=TwoWay}"/>
|
||||
</ctc:SettingsCard>
|
||||
<ctc:SettingsCard x:Uid="/VDownload.Core.Strings/SettingsViewResources/NotificationsOnUnsuccessful">
|
||||
<ctc:SettingsCard.HeaderIcon>
|
||||
<BitmapIcon ShowAsMonochrome="False"
|
||||
UriSource="{ThemeResource ImageSettingsViewNotificationOnUnsuccessful}"/>
|
||||
</ctc:SettingsCard.HeaderIcon>
|
||||
<ToggleSwitch IsOn="{Binding NotificationOnUnsuccessful, Mode=TwoWay}"/>
|
||||
<ToggleSwitch IsOn="{Binding NotificationsOnUnsuccessful, Mode=TwoWay}"/>
|
||||
</ctc:SettingsCard>
|
||||
</StackPanel>
|
||||
|
||||
@@ -215,6 +287,11 @@
|
||||
</ctc:SettingsExpander.Items>
|
||||
</ctc:SettingsExpander>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button x:Uid="/VDownload.Core.Strings/SettingsViewResources/RestoreToDefaultButton"
|
||||
Command="{Binding RestoreToDefaultCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user