diff options
-rw-r--r-- | win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/UpdateService.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Utilities/UwpDetect.cs | 48 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 4 |
6 files changed, 4 insertions, 64 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs b/win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs index 069918a71..bc52652f4 100644 --- a/win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs @@ -22,14 +22,11 @@ namespace HandBrakeWPF.Converters public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { OptionsTab[] tabs = value as OptionsTab[]; - if (tabs != null && (UwpDetect.IsUWP() || !Portable.IsUpdateCheckEnabled())) + if (tabs != null && !Portable.IsUpdateCheckEnabled()) { return tabs.Where(s => s != OptionsTab.Updates).ToArray(); } - - - - + return value; } diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs index 693478acb..6acd16061 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs @@ -63,11 +63,6 @@ namespace HandBrakeWPF.Services /// </param>
public void PerformStartupUpdateCheck(Action<UpdateCheckInformation> callback)
{
- if (UwpDetect.IsUWP())
- {
- return; // Disable Update checker if we are in a UWP container.
- }
-
if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())
{
return; // Disable Update Check for Portable Mode.
diff --git a/win/CS/HandBrakeWPF/Utilities/UwpDetect.cs b/win/CS/HandBrakeWPF/Utilities/UwpDetect.cs deleted file mode 100644 index 827b025d0..000000000 --- a/win/CS/HandBrakeWPF/Utilities/UwpDetect.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="UwpDetect.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> -// <summary> -// Helper class to detect if we are running in a UWP container. -// https://msdn.microsoft.com/en-us/library/windows/desktop/hh446599(v=vs.85).aspx -// </summary> -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Utilities -{ - using System; - using System.Runtime.InteropServices; - using System.Text; - - public class UwpDetect - { - [DllImport("kernel32.dll")] - static extern int GetCurrentPackageFullName(ref int length, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder fullName); - - private const int APPMODEL_ERROR_NO_PACKAGE = 15700; - - public static bool IsUWP() - { - if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1) - { - return false; - } - - int length = 0; - StringBuilder packageName = new StringBuilder(1024); - - int result = GetCurrentPackageFullName(ref length, packageName); // Only available in 6.2 or later. - if (result == APPMODEL_ERROR_NO_PACKAGE) - { - return false; - } - - if (packageName.ToString().Trim().Length > 0) - { - return true; - } - - return false; - } - } -} diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 9e9a49e4f..b335e1e2c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -748,8 +748,6 @@ namespace HandBrakeWPF.ViewModels }
}
- public bool IsUWP { get; } = UwpDetect.IsUWP();
-
public string SourceInfo
{
get
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 817fb4041..941381156 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -138,8 +138,6 @@ namespace HandBrakeWPF.ViewModels public IAboutViewModel AboutViewModel { get; set; }
- public bool IsUWP { get; } = UwpDetect.IsUWP();
-
public bool IsNightly { get; } = HandBrakeVersionHelper.IsNightly();
public bool IsWindows10 => HandBrakeWPF.Utilities.SystemInfo.IsWindows10();
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 15719c495..35e25bdec 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -135,8 +135,8 @@ <Image Width="16" Height="16" Source="Images/information.png" />
</MenuItem.Icon>
</MenuItem>
- <Separator Visibility="{Binding IsUWP, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <MenuItem Header="{x:Static Properties:Resources.MainView_CheckForUpdates}" cal:Message.Attach="[Event Click] = [Action CheckForUpdates]" Visibility="{Binding IsUWP, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
+ <Separator />
+ <MenuItem Header="{x:Static Properties:Resources.MainView_CheckForUpdates}" cal:Message.Attach="[Event Click] = [Action CheckForUpdates]" />
<Separator />
<MenuItem Header="{x:Static Properties:Resources.MainView_About}" cal:Message.Attach="[Event Click] = [Action OpenAboutApplication]" />
</MenuItem>
|