summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-01-13 17:51:42 +0000
committersr55 <[email protected]>2013-01-13 17:51:42 +0000
commitf3fcc49085f080ad5f075da4a87bbaff47f92572 (patch)
tree2b483848c6111e73958d4f69af03e790a8abadc3 /win/CS/HandBrakeWPF/Views
parentb62992bfb1623ae6c0930c41e00c2b150ea780d9 (diff)
WinGui: Options screen refactoring.
Help -> Check for updates now takes the user to the options screen update tab. Help -> About now takes the user to the options screen about tab. Saves popping up annoying window. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5169 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml55
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml.cs4
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml7
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml43
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml2
5 files changed, 51 insertions, 60 deletions
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml b/win/CS/HandBrakeWPF/Views/AboutView.xaml
index a9e7e4319..d7b63c08b 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml
@@ -1,13 +1,7 @@
-<Window x:Class="HandBrakeWPF.Views.AboutView"
+<UserControl x:Class="HandBrakeWPF.Views.AboutView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
- Title="{Binding Title}"
- Width="600"
- Height="320"
- ResizeMode="NoResize"
- TextOptions.TextFormattingMode="Display"
- WindowStartupLocation="CenterScreen">
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ TextOptions.TextFormattingMode="Display">
<Grid>
<Grid.RowDefinitions>
@@ -34,54 +28,23 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0"
Margin="5,10,0,0"
Orientation="Horizontal">
- <TextBlock Margin="0,0,5,0"
- FontSize="14"
- FontWeight="Bold"
- Text="HandBrake" />
- <TextBlock Margin="0,0,0,1"
- VerticalAlignment="Bottom"
- Text="{Binding Version}" />
+ <TextBlock Margin="0,0,5,0" FontSize="12" FontWeight="Bold" Text="HandBrake " />
+ <TextBlock Margin="0,0,0,1" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Version}" />
</StackPanel>
- <TextBlock Grid.Row="1"
- Margin="5,0,0,0 "
- Text="Copyright 2003-2013 HandBrake Team" />
+ <TextBlock Grid.Row="1" Margin="5,10,0,5" Text="License: " />
- <TextBlock Grid.Row="2"
- Margin="5,10,0,5"
- Text="License:" />
- <TextBox Grid.Row="3"
- Margin="10,0,10,10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsReadOnly="True"
- TextWrapping="Wrap"
- VerticalScrollBarVisibility="Auto">
- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </TextBox>
+ <TextBox Text="{x:Static Properties:Resources.About_GPL}" Grid.Row="2" Margin="10,0,10,10" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />
</Grid>
</Grid>
- <StackPanel Grid.Row="1"
- HorizontalAlignment="Stretch"
- Background="LightGray">
- <Button Margin="0,5,10,5"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Content="Close"
- IsDefault="True"
- Micro:Message.Attach="[Event Click] = [Action Close]"
- Padding="12,2" />
- </StackPanel>
</Grid>
-</Window>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
index 55665fc8b..2be3fd009 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
@@ -9,12 +9,12 @@
namespace HandBrakeWPF.Views
{
- using System.Windows;
+ using System.Windows.Controls;
/// <summary>
/// Interaction logic for AboutView.xaml
/// </summary>
- public partial class AboutView : Window
+ public partial class AboutView : UserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="AboutView"/> class.
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index d90e5643f..af5b81514 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -111,15 +111,14 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
-
-
-
-
+
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 9c2080db5..99d857bdc 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -3,7 +3,8 @@
xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
- xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Background="White">
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" xmlns:local="clr-namespace:HandBrakeWPF.Model"
+ Background="White">
<UserControl.Resources>
<Style TargetType="Button">
@@ -30,7 +31,17 @@
</Style>
<Options:OptionsTabConverter x:Key="tabConverter" />
+ <Options:OptionsTabNameConverter x:Key="tabNameConverter" />
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+
+ <ObjectDataProvider MethodName="GetValues"
+ ObjectType="{x:Type local:OptionsTab}"
+ x:Key="OptionTabsList">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="local:OptionsTab" />
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
</UserControl.Resources>
<Grid>
@@ -44,14 +55,18 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
-
<StackPanel Orientation="Vertical" Grid.Column="0" Margin="10,10,0,0">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">
<TextBlock Text="Preferences" FontSize="16" />
</Border>
- <ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"
+ <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}}" SelectedItem="{Binding SelectedTab}"
BorderThickness="0" Background="Transparent">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
</ListBox>
</StackPanel>
@@ -60,7 +75,7 @@
<StackPanel Orientation="Vertical">
<StackPanel Name="General" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='General'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.General}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="General" FontSize="16" />
@@ -121,7 +136,7 @@
</StackPanel>
<StackPanel Name="Output" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Output Files'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.OutputFiles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Output Files" FontSize="16" />
@@ -161,7 +176,7 @@
</StackPanel>
<StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Audio and Subtitles'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -263,7 +278,7 @@
</StackPanel>
<StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Advanced}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Advanced" FontSize="16" />
@@ -364,7 +379,7 @@
</StackPanel>
<StackPanel Name="Updates" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Updates'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Updates}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -398,6 +413,18 @@
</StackPanel>
</StackPanel>
+
+ <StackPanel Name="About" Orientation="Vertical" Margin="10,10,0,0"
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.About}}">
+
+
+ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
+ <TextBlock Text="About HandBrake" FontSize="16" />
+ </Border>
+
+ <ContentControl x:Name="AboutViewModel" />
+
+ </StackPanel>
</StackPanel>
</ScrollViewer>
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index 83dabf50f..362734851 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -69,6 +69,8 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>