summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Services/DriveDetectService.cs48
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs15
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml11
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml1
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml1
-rw-r--r--win/CS/HandBrakeWPF/Views/Styles/Styles.xaml17
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml2
8 files changed, 69 insertions, 27 deletions
diff --git a/win/CS/HandBrakeWPF/Services/DriveDetectService.cs b/win/CS/HandBrakeWPF/Services/DriveDetectService.cs
index 7f1b3f9b9..3a4ef5113 100644
--- a/win/CS/HandBrakeWPF/Services/DriveDetectService.cs
+++ b/win/CS/HandBrakeWPF/Services/DriveDetectService.cs
@@ -11,6 +11,7 @@ namespace HandBrakeWPF.Services
{
using System;
using System.Management;
+ using System.Threading;
using HandBrakeWPF.Services.Interfaces;
@@ -37,28 +38,32 @@ namespace HandBrakeWPF.Services
/// </param>
public void StartDetection(Action action)
{
- this.detectionAction = action;
+ ThreadPool.QueueUserWorkItem(
+ delegate
+ {
+ this.detectionAction = action;
- var options = new ConnectionOptions { EnablePrivileges = true };
- var scope = new ManagementScope(@"root\CIMV2", options);
+ var options = new ConnectionOptions { EnablePrivileges = true };
+ var scope = new ManagementScope(@"root\CIMV2", options);
- try
- {
- var query = new WqlEventQuery
- {
- EventClassName = "__InstanceModificationEvent",
- WithinInterval = TimeSpan.FromSeconds(1),
- Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 5" // DriveType - 5: CDROM
- };
+ try
+ {
+ var query = new WqlEventQuery
+ {
+ EventClassName = "__InstanceModificationEvent",
+ WithinInterval = TimeSpan.FromSeconds(1),
+ Condition = @"TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 5" // DriveType - 5: CDROM
+ };
- this.watcher = new ManagementEventWatcher(scope, query);
- this.watcher.EventArrived += this.WatcherEventArrived;
- this.watcher.Start();
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
+ this.watcher = new ManagementEventWatcher(scope, query);
+ this.watcher.EventArrived += this.WatcherEventArrived;
+ this.watcher.Start();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e.Message);
+ }
+ });
}
/// <summary>
@@ -66,7 +71,10 @@ namespace HandBrakeWPF.Services
/// </summary>
public void Close()
{
- this.watcher.Stop();
+ if (watcher != null)
+ {
+ this.watcher.Stop();
+ }
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index aea8461bc..c1df4b8be 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1114,6 +1114,21 @@ namespace HandBrakeWPF.ViewModels
MessageBoxImage.Information);
}
+ /// <summary>
+ /// The debug scan log.
+ /// </summary>
+ public void DebugScanLog()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog();
+
+ dialog.ShowDialog();
+
+ if (File.Exists(dialog.FileName))
+ {
+ this.scanService.DebugScanLog(dialog.FileName);
+ }
+ }
+
#endregion
#region Main Window Public Methods
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 5950bc448..d5e949809 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -262,6 +262,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Task = task;
this.NotifyOfPropertyChange(() => this.Task.SubtitleTracks);
+ this.NotifyOfPropertyChange(() => this.Task);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
index bea0cb814..e30a0fcd2 100644
--- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
@@ -18,13 +18,15 @@
<Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
+ <Setter Property="Margin" Value="0,2,0,2" />
</Style>
<Style x:Key="LongToolTip" TargetType="TextBlock">
<Setter Property="Width" Value="400" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
- </UserControl.Resources>
+
+ </UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -274,13 +276,10 @@
<ColumnDefinition Width="*" MinWidth="100" />
</Grid.ColumnDefinitions>
- <Label Grid.Row="0"
- Grid.Column="0"
- Content="Adaptive B-Frames:"
+ <Label Content="Adaptive B-Frames:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding BFramesOptionsVisible,
- Converter={StaticResource VisibilityConverter}}"
- />
+ Converter={StaticResource VisibilityConverter}}" Height="26" VerticalAlignment="Top" />
<ComboBox Grid.Row="0"
Grid.Column="1"
Width="120"
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 5f6fe7f14..5515fbbe8 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -128,6 +128,7 @@
<MenuItem Header="Debug" Foreground="Transparent" >
<MenuItem Header="Show CLI Equiv" Micro:Message.Attach="[Event Click] = [Action ShowCliQuery]" />
+ <MenuItem Header="Debug Scan Log" Micro:Message.Attach="[Event Click] = [Action DebugScanLog]" />
</MenuItem>
</Menu>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml
index 9aba2a3fe..b6f3cc9eb 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml
@@ -13,6 +13,7 @@
SnapsToDevicePixels="True"
UseLayoutRounding="True"
WindowStartupLocation="CenterScreen"
+ TextOptions.TextFormattingMode="Display"
>
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
diff --git a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml
index 1bdb2e727..9c3f001c8 100644
--- a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml
+++ b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml
@@ -15,6 +15,23 @@
</Setter>
</Style>
+ <Style TargetType="{x:Type ComboBox}">
+ <Setter Property="Height" Value="22"/>
+ <Setter Property="Margin" Value="0,2,0,2" />
+ </Style>
+
+ <Style TargetType="{x:Type TextBlock}">
+ <Setter Property="VerticalAlignment" Value="Center"/>
+ </Style>
+
+ <Style TargetType="{x:Type Button}">
+ <Setter Property="Height" Value="22"/>
+ </Style>
+
+ <Style TargetType="{x:Type RadioButton}">
+ <Setter Property="Margin" Value="0,0,0,8" />
+ </Style>
+
<SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
</ResourceDictionary> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index 8b6d8cff3..27f2a2f30 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -50,7 +50,7 @@
</StackPanel>
<StackPanel Orientation="Horizontal">
- <TextBlock Text="Framerate (FPS):" Width="100"/>
+ <TextBlock Text="Framerate (FPS):" VerticalAlignment="Top" Margin="0,5,0,0" Width="100"/>
<StackPanel Orientation="Vertical">
<ComboBox Width="120" ItemsSource="{Binding Framerates}" SelectedItem="{Binding SelectedFramerate}" />
<RadioButton Content="Constant Framerate" IsChecked="{Binding IsConstantFramerate}" Margin="0,10,0,0" />