diff options
author | sr55 <[email protected]> | 2019-12-21 12:22:18 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-12-21 12:22:18 +0000 |
commit | 3b5993b58166a41f3155871afdbe460eb84514f8 (patch) | |
tree | 43cde111de39f6d84aa5eb8683cd0d71ab31cb02 | |
parent | 3de424035dfeceedbe289358abd0359b28ab8dd6 (diff) |
WinGui: Cleanup a bunch of Code Warnings + Fix missing ico resource. #2519
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs | 4 | ||||
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrake.sln | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Queue/QueueService.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs | 6 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ErrorView.xaml.cs | 8 |
8 files changed, 25 insertions, 15 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs index 2b97ce1b2..aab7d220e 100644 --- a/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs @@ -91,7 +91,7 @@ namespace HandBrake.Interop.Interop initSuccess = TryInit(); } } - catch (Exception e) + catch (Exception) { initSuccess = false; } @@ -375,7 +375,7 @@ namespace HandBrake.Interop.Interop throw new InvalidOperationException("HB global init failed."); } } - catch (Exception e) + catch (Exception) { return false; } diff --git a/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs index ff2b8b633..9edf733af 100644 --- a/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs @@ -5,6 +5,7 @@ // <summary> // Defines the hb_image_s type. // </summary> +// <auto-generated> Disable Stylecop. HandBrake internal object. </auto-generated> // -------------------------------------------------------------------------------------------------------------------- // ReSharper disable InconsistentNaming @@ -19,6 +20,7 @@ namespace HandBrake.Interop.Interop.HbLib /// </summary> internal struct hb_image_s { +#pragma warning disable 0649 public int format; public int max_plane; public int width; @@ -27,6 +29,7 @@ namespace HandBrake.Interop.Interop.HbLib [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] public image_plane[] plane; +#pragma warning restore 0649 } /// <summary> @@ -34,11 +37,13 @@ namespace HandBrake.Interop.Interop.HbLib /// </summary> internal struct image_plane { +#pragma warning disable 0649 public IntPtr data; public int width; public int height; public int stride; public int height_stride; public int size; +#pragma warning restore 0649 } } diff --git a/win/CS/HandBrake.sln b/win/CS/HandBrake.sln index df3f66233..8fe39dd24 100644 --- a/win/CS/HandBrake.sln +++ b/win/CS/HandBrake.sln @@ -15,7 +15,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.Worker", "HandBra EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandBrake.Interop", "HandBrake.Interop\HandBrake.Interop.csproj", "{ED5C8D53-0988-4CEB-934A-6B1D840C6335}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeWPF", "HandBrakeWPF\HandBrakeWPF.csproj", "{C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandBrakeWPF", "HandBrakeWPF\HandBrakeWPF.csproj", "{C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 280ecf949..603eefd5f 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -15,6 +15,7 @@ <RepositoryType>git</RepositoryType>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<Platforms>x64</Platforms>
+ <PlatformTarget>x64</PlatformTarget>
<ApplicationIcon>handbrakepineapple.ico</ApplicationIcon>
<StartupObject />
<AssemblyName>HandBrake</AssemblyName>
@@ -34,6 +35,10 @@ </PropertyGroup>
<ItemGroup>
+ <None Remove="handbrakepineapple.ico" />
+ </ItemGroup>
+
+ <ItemGroup>
<PackageReference Include="Caliburn.Micro" Version="3.2.0" />
<PackageReference Include="gong-wpf-dragdrop" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
@@ -53,6 +58,7 @@ </ItemGroup>
<ItemGroup>
+ <Resource Include="handbrakepineapple.ico" />
<Resource Include="Views\Images\close64.png" />
<Resource Include="Views\Images\close64_dark.png" />
<Resource Include="Views\Images\Complete.png" />
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs index 3f570fcac..7450f06e9 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/SubtitleTrack.cs @@ -173,7 +173,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models this.NotifyOfPropertyChange(() => this.SourceTrack); if (this.sourceTrack != null) { - this.Track = this.sourceTrack.ToString(); this.SubtitleType = this.sourceTrack.SubtitleType; } @@ -257,12 +256,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models /// </summary> public SubtitleType SubtitleType { get; set; } - /// <summary> - /// Gets or sets Track. - /// </summary> - [Obsolete("Use SourceTrack Instead")] - public string Track { get; set; } - public string Name { get => this.name; diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs index 5599953c1..bd5bb5960 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs @@ -177,7 +177,6 @@ namespace HandBrakeWPF.Services.Queue public void ImportJson(string path) { - List<Task> tasks; using (StreamReader reader = new StreamReader(path)) { string fileContent = reader.ReadToEnd(); @@ -197,6 +196,7 @@ namespace HandBrakeWPF.Services.Queue { this.queue.Add(task); } + if (reloadedQueue.Count > 0) { this.InvokeQueueChanged(EventArgs.Empty); diff --git a/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs index 6adde6b6e..61e220a12 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs @@ -79,9 +79,9 @@ namespace HandBrakeWPF.ViewModels public void SetSource(Source source, Title selectedTitle, Preset currentPreset, EncodeTask encodeTask) { return; // Disabled for now. - this.task = encodeTask; - this.task.MetaData = new MetaData(selectedTitle.Metadata); - this.NotifyOfPropertyChange(() => this.MetaData); + // this.task = encodeTask; + // this.task.MetaData = new MetaData(selectedTitle.Metadata); + // this.NotifyOfPropertyChange(() => this.MetaData); } /// <summary> diff --git a/win/CS/HandBrakeWPF/Views/ErrorView.xaml.cs b/win/CS/HandBrakeWPF/Views/ErrorView.xaml.cs index 0effdbfdd..a5d1d0d0d 100644 --- a/win/CS/HandBrakeWPF/Views/ErrorView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ErrorView.xaml.cs @@ -10,6 +10,7 @@ namespace HandBrakeWPF.Views
{
using System;
+ using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -35,6 +36,8 @@ namespace HandBrakeWPF.Views this.textBlock = textBlock;
}
+ public event EventHandler CanExecuteChanged;
+
public bool CanExecute(object parameter)
{
return true;
@@ -48,6 +51,9 @@ namespace HandBrakeWPF.Views }
}
- public event EventHandler CanExecuteChanged;
+ protected virtual void OnCanExecuteChanged()
+ {
+ this.CanExecuteChanged?.Invoke(this, EventArgs.Empty);
+ }
}
}
|