summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs12
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs42
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml39
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml10
5 files changed, 71 insertions, 38 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index 264643847..6a2e64ac8 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -204,7 +204,11 @@ namespace HandBrakeWPF.ViewModels
{
this.Task = task;
this.NotifyOfPropertyChange(() => this.Task);
- this.IncludeChapterMarkers = preset.Task.IncludeChapterMarkers;
+
+ if (preset != null)
+ {
+ this.IncludeChapterMarkers = preset.Task.IncludeChapterMarkers;
+ }
this.SetSourceChapters(title.Chapters);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 28472343c..d42e535c7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -515,9 +515,9 @@ namespace HandBrakeWPF.ViewModels
// Use the Path on the Title, or the Source Scan path if one doesn't exist.
this.CurrentTask.Source = !string.IsNullOrEmpty(this.selectedTitle.SourceName) ? this.selectedTitle.SourceName : this.ScannedSource.ScanPath;
this.CurrentTask.Title = value.TitleNumber;
- this.NotifyOfPropertyChange("StartEndRangeItems");
- this.NotifyOfPropertyChange("SelectedTitle");
- this.NotifyOfPropertyChange("Angles");
+ this.NotifyOfPropertyChange(() => this.StartEndRangeItems);
+ this.NotifyOfPropertyChange(() => this.SelectedTitle);
+ this.NotifyOfPropertyChange(() => this.Angles);
// Default the Start and End Point dropdowns
this.SelectedStartPoint = 1;
@@ -526,7 +526,7 @@ namespace HandBrakeWPF.ViewModels
this.SelectedAngle = 1;
this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
- this.NotifyOfPropertyChange("CurrentTask");
+ this.NotifyOfPropertyChange(() => this.CurrentTask);
this.Duration = selectedTitle.Duration.ToString();
@@ -547,8 +547,8 @@ namespace HandBrakeWPF.ViewModels
}
set
{
- this.CurrentTask.EndPoint = value;
- this.NotifyOfPropertyChange("SelectedAngle");
+ this.CurrentTask.Angle = value;
+ this.NotifyOfPropertyChange(() => this.SelectedAngle);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 7e955e541..2c7b47c95 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -13,6 +13,7 @@ namespace HandBrakeWPF.ViewModels
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Drawing;
+ using System.Globalization;
using Caliburn.Micro;
@@ -477,38 +478,46 @@ namespace HandBrakeWPF.ViewModels
{
this.Task = task;
+
// TODO: These all need to be handled correctly.
+ this.SelectedAnamorphicMode = preset.Task.Anamorphic;
+
if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
{
this.Task.MaxWidth = preset.Task.MaxWidth;
this.Task.MaxHeight = preset.Task.MaxHeight;
- this.Task.Width = preset.Task.MaxWidth ?? 0;
- this.Task.Height = preset.Task.MaxHeight ?? 0;
+ this.Width = preset.Task.Width ?? (sourceResolution.Width - this.CropLeft - this.CropRight);
+ this.Height = preset.Task.Height ?? (sourceResolution.Height - this.CropTop - this.CropBottom);
}
else
{
- this.Task.Width = preset.Task.Width ?? 0;
- this.Task.Height = preset.Task.Height ?? 0;
+ this.Width = preset.Task.Width ?? (sourceResolution.Width - this.CropLeft - this.CropRight);
+ this.Height = preset.Task.Height ?? (sourceResolution.Height - this.CropTop - this.CropBottom);
}
if (this.Task.Anamorphic == Anamorphic.Custom)
{
- this.Task.DisplayWidth = preset.Task.DisplayWidth ?? 0;
- this.Task.PixelAspectX = preset.Task.PixelAspectX;
- this.Task.PixelAspectY = preset.Task.PixelAspectY;
+ this.DisplayWidth = preset.Task.DisplayWidth != null ? int.Parse(preset.Task.DisplayWidth.ToString()) : 0;
+ this.ParWidth = preset.Task.PixelAspectX;
+ this.ParHeight = preset.Task.PixelAspectY;
}
- this.Task.KeepDisplayAspect = preset.Task.KeepDisplayAspect;
+ this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
if (this.Task.Modulus.HasValue)
{
- this.Task.Modulus = preset.Task.Modulus;
+ this.SelectedModulus = preset.Task.Modulus;
}
if (preset.Task.HasCropping)
{
- this.Task.Cropping = preset.Task.Cropping;
+ this.CropLeft = preset.Task.Cropping.Left;
+ this.CropRight = preset.Task.Cropping.Right;
+ this.CropTop = preset.Task.Cropping.Top;
+ this.CropBottom = preset.Task.Cropping.Bottom;
}
+
+ this.NotifyOfPropertyChange(() => this.Task);
}
/// <summary>
@@ -526,6 +535,7 @@ namespace HandBrakeWPF.ViewModels
public void SetSource(Title title, Preset preset, EncodeTask task)
{
this.Task = task;
+
if (title != null)
{
// Set cached info
@@ -549,6 +559,8 @@ namespace HandBrakeWPF.ViewModels
this.Height = title.Resolution.Height;
this.MaintainAspectRatio = true;
}
+
+ this.NotifyOfPropertyChange(() => this.Task);
}
#endregion
@@ -848,7 +860,7 @@ namespace HandBrakeWPF.ViewModels
(this.sourceResolution.Height * this.SourceAspect.Width * crop_width);
this.Task.Height = (int)Math.Round(this.GetModulusValue(newHeight), 0);
- this.NotifyOfPropertyChange("Height");
+ this.NotifyOfPropertyChange(() => this.Height);
}
break;
@@ -856,14 +868,14 @@ namespace HandBrakeWPF.ViewModels
this.Task.Width = 0;
this.Task.Height = 0;
- this.NotifyOfPropertyChange(() => this.Task.Width);
- this.NotifyOfPropertyChange(() => this.Task.Height);
+ this.NotifyOfPropertyChange(() => this.Width);
+ this.NotifyOfPropertyChange(() => this.Height);
this.SetDisplaySize();
break;
case Anamorphic.Loose:
this.Task.Height = 0;
- this.NotifyOfPropertyChange(() => this.Task.Width);
- this.NotifyOfPropertyChange(() => this.Task.Height);
+ this.NotifyOfPropertyChange(() => this.Width);
+ this.NotifyOfPropertyChange(() => this.Height);
this.SetDisplaySize();
break;
case Anamorphic.Custom:
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index af9e27a7b..e6a4e6997 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -3,8 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" Title="{Data:Binding Path=WindowTitle}" Height="655" Width="1015" FontSize="11" Background="#FFF0F0F0"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" Title="{Data:Binding Path=WindowTitle}" Height="625" Width="1015" FontSize="11" Background="#FFF0F0F0"
Micro:Message.Attach="[Event Loaded] = [Action Load]"
+ UseLayoutRounding="True"
AllowDrop="True">
<i:Interaction.Triggers>
@@ -74,14 +75,30 @@
</MenuItem>
<MenuItem Header="Tools">
- <MenuItem Header="Show Queue" Micro:Message.Attach="[Event Click] = [Action OpenQueueWindow]" />
- <MenuItem Header="Activity Window" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]" />
+ <MenuItem Header="Show Queue" Micro:Message.Attach="[Event Click] = [Action OpenQueueWindow]" >
+ <MenuItem.Icon>
+ <Image Source="Images/Queue_Small.png" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <MenuItem Header="Activity Window" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]" >
+ <MenuItem.Icon>
+ <Image Source="Images/Output_Small.png" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
<Separator />
- <MenuItem Header="Options" Micro:Message.Attach="[Event Click] = [Action OpenOptionsWindow]" />
+ <MenuItem Header="Options" Micro:Message.Attach="[Event Click] = [Action OpenOptionsWindow]" >
+ <MenuItem.Icon>
+ <Image Source="Images/Pref_Small.png" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
</MenuItem>
<MenuItem Header="Help">
- <MenuItem Header="HandBrake User Guide" Micro:Message.Attach="[Event Click] = [Action LaunchHelp]" />
+ <MenuItem Header="HandBrake User Guide" Micro:Message.Attach="[Event Click] = [Action LaunchHelp]" >
+ <MenuItem.Icon>
+ <Image Source="Images/Help16.png" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
<Separator />
<MenuItem Header="Check for Updates" Micro:Message.Attach="[Event Click] = [Action CheckForUpdates]" />
<Separator />
@@ -135,21 +152,21 @@
<Button Name="Stop" Micro:Message.Attach="[Event Click] = [Action StopEncode]" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}">
<StackPanel Orientation="Horizontal">
- <Image Source="Images/stop.png" Height="32" Width="32" />
+ <Image Source="Images/stop.png" Height="32" Width="32" SnapsToDevicePixels="True" />
<Label Content="Stop" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button Name="AddToQueue" Micro:Message.Attach="[Event Click] = [Action AddToQueue]">
<StackPanel Orientation="Horizontal">
- <Image Source="Images/AddToQueue.png" Height="32" Width="32" />
+ <Image Source="Images/AddToQueue.png" Height="32" Width="32" SnapsToDevicePixels="True" />
<Label Content="Add To Queue" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</Button>
<Button Name="ShowQueue" Micro:Message.Attach="[Event Click] = [Action OpenQueueWindow]">
<StackPanel Orientation="Horizontal">
- <Image Source="Images/Queue.png" Height="32" Width="32" />
+ <Image Source="Images/Queue.png" Height="32" Width="32" SnapsToDevicePixels="True" />
<Label Content="Show Queue" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</Button>
@@ -158,7 +175,7 @@
<Button Name="Preview" Micro:Message.Attach="[Event Click] = [Action OpenPreviewWindow]">
<StackPanel Orientation="Horizontal">
- <Image Source="Images/window.png" Height="32" Width="32" />
+ <Image Source="Images/window.png" Height="32" Width="32" SnapsToDevicePixels="True" />
<Label Content="Preview" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</Button>
@@ -236,7 +253,7 @@
</StackPanel>
<!-- Tab Control -->
- <TabControl HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="725" Height="330" Margin="10,10,10,10" Name="tabControl" >
+ <TabControl HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="725" Height="300" Margin="10,10,10,10" Name="tabControl" >
<TabItem Header="Picture" Name="pictureTab">
<ContentControl x:Name="PictureSettingsViewModel" ></ContentControl>
</TabItem>
@@ -268,7 +285,7 @@
<StackPanel Orientation="Vertical">
<TreeView ItemsSource="{Binding Source={StaticResource presetsCvs}, Path=Groups}"
- ItemTemplate="{StaticResource presetsCategoryTemplate}" Width="240" Height="460"
+ ItemTemplate="{StaticResource presetsCategoryTemplate}" Width="240" Height="430"
>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectedItemChanged">
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index cc5d5f775..6852e5704 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -1,7 +1,7 @@
<Window x:Class="HandBrakeWPF.Views.OptionsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.caliburnproject.org"
- xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers" Title="{Binding Title}" MinWidth="620" MinHeight="600" Width="620" Height="600">
+ xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers" Title="{Binding Title}" MinWidth="620" MinHeight="545" Width="620" Height="545">
<Window.Resources>
<Style TargetType="Button">
@@ -35,7 +35,7 @@
</StackPanel>
<!-- Options Panel-->
- <TabControl Margin="10,10,10,10" Height="460">
+ <TabControl Margin="10,10,10,10" Height="405">
<TabItem Header="General">
<StackPanel Orientation="Vertical">
<Grid Margin="10,10,0,10">
@@ -178,7 +178,7 @@
<TextBlock Text="Additional Tracks:" Grid.Column="0"/>
<StackPanel Orientation="Horizontal" Grid.Column="1">
- <Grid Margin="10,10,0,10">
+ <Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
@@ -189,7 +189,7 @@
<StackPanel Orientation="Vertical" Grid.Column="0">
<TextBlock Text="Available Langauges" Margin="0,0,0,5"/>
<ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
- SelectionMode="Extended" Width="140" Height="160"></ListBox>
+ SelectionMode="Extended" Width="140" Height="140"></ListBox>
</StackPanel>
<DockPanel Grid.Column="1" Margin="10,0,10,0">
@@ -207,7 +207,7 @@
<StackPanel Orientation="Vertical" Grid.Column="2">
<TextBlock Text="Selected Langauges" Margin="0,0,0,5"/>
<ListBox Name="selectedLangauges" ItemsSource="{Binding SelectedLangauges}" Helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
- SelectionMode="Extended" Width="140" Height="160" />
+ SelectionMode="Extended" Width="140" Height="140" />
</StackPanel>
<DockPanel Grid.Column="3" Margin="10,0,10,0">