summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-31 15:19:14 +0000
committersr55 <[email protected]>2015-01-31 15:19:14 +0000
commit6d57e42b6b2cc38cf256f2970b23b94121e49479 (patch)
tree6841b6c50f50b6ac34bfa9dba954f959f030b480 /win/CS/HandBrakeWPF/Views
parenta4416e99f06e31e1da8767d071e882f32c5a4e67 (diff)
WinGui: Remove a bunch of CLI handling code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6840 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/InstantView.xaml202
-rw-r--r--win/CS/HandBrakeWPF/Views/InstantView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml2
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml.cs26
4 files changed, 8 insertions, 249 deletions
diff --git a/win/CS/HandBrakeWPF/Views/InstantView.xaml b/win/CS/HandBrakeWPF/Views/InstantView.xaml
deleted file mode 100644
index bb9bc1971..000000000
--- a/win/CS/HandBrakeWPF/Views/InstantView.xaml
+++ /dev/null
@@ -1,202 +0,0 @@
-<UserControl x:Class="HandBrakeWPF.Views.InstantView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:cal="http://www.caliburnproject.org"
- xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
- xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- mc:Ignorable="d"
- cal:Message.Attach="[Event Loaded] = [Action Load]"
- >
-
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Drop">
- <cal:ActionMessage MethodName="FilesDroppedOnWindow">
- <cal:Parameter Value="$eventArgs" />
- </cal:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
-
- <UserControl.Resources>
- <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
- </UserControl.Resources>
-
- <!-- Window Body -->
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
-
- <!-- Source -->
- <StackPanel Orientation="Vertical" Grid.Row="0">
- <!-- Source -->
- <StackPanel Margin="10,5,5,5"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- >
- <StackPanel Orientation="Horizontal">
- <Label Content="Source" FontWeight="Bold" />
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">
-
- <TextBlock Text="Drag and Drop a file - OR - Open a " />
- <Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">
- File
- </Button>
- <TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />
- <Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">
- Folder
- </Button>
-
- </StackPanel>
-
- <ListBox Grid.Row="2"
- Margin="10,10,10,10"
- MinHeight="150" MaxHeight="150"
- VerticalAlignment="Stretch"
- Background="LightGray"
- ItemsSource="{Binding TitleList}"
- SelectionMode="Single">
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="Background" Value="WhiteSmoke" />
- <Setter Property="Margin" Value="0,0,0,1" />
- </Style>
- </ListBox.ItemContainerStyle>
-
- <ListBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Select All" cal:Message.Attach="[Event Click] = [Action SelectAll]" />
- <MenuItem Header="Deselect All" cal:Message.Attach="[Event Click] = [Action UnSelectAll]" />
- <Separator />
- <MenuItem Header="Order by Title" IsChecked="{Binding OrderedByTitle}" cal:Message.Attach="[Event Click] = [Action OrderByTitle]" />
- <MenuItem Header="Order by Duration" IsChecked="{Binding OrderedByDuration}" cal:Message.Attach="[Event Click] = [Action OrderByDuration]" />
- </ContextMenu>
- </ListBox.ContextMenu>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid HorizontalAlignment="Stretch" MinHeight="28">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <CheckBox IsChecked="{Binding IsSelected}" Grid.RowSpan="2" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
-
- <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" Margin="10,0,0,0" >
- <TextBlock Text="Title:" Margin="0,0,5,0" FontWeight="Bold" />
- <TextBlock Text="{Binding Title}" Margin="5,0,5,0" />
- </StackPanel>
-
- <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="10,0,0,0" >
- <TextBlock Text="Source:" Margin="0,0,5,0" FontWeight="Bold" />
- <TextBlock Text="{Binding SourceName}" Margin="5,0,5,0" />
- </StackPanel>
- </Grid>
-
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
- </StackPanel>
-
-
- <!-- Destination -->
- <StackPanel Grid.Row="1"
- Margin="10,5,5,5"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- >
- <Label Content="Destination" FontWeight="Bold" />
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Label Margin="8,0,0,0" Content="File" />
- <TextBox Name="Destination"
- Grid.Column="1"
- Margin="8,0,0,0"
- Text="{Binding OutputDirectory,
- UpdateSourceTrigger=PropertyChanged}"
- />
- <Button Name="DestinationBrowser"
- Grid.Column="2"
- Margin="8,0,5,0"
- Padding="8,2"
- Content="Browse"
- cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
- />
- </Grid>
- </StackPanel>
-
- <!-- Opitons -->
- <StackPanel Grid.Row="2"
- Margin="10,5,5,5"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- >
- <Label Content="Options" FontWeight="Bold" />
-
- <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
- <TextBlock Text="Preset:" Margin="0,0,5,0" />
- <ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />
- </StackPanel>
-
- </StackPanel>
-
-
- <!-- Buttons and Queueing -->
- <Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Label Content="Start" FontWeight="Bold" Grid.Row="0" />
- <Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
- Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
- <Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
- Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
- </Grid>
-
-
- <!-- StatusPanel -->
- <controls:StatusPanel x:Name="loadingPanel"
- Grid.Row="3"
- Grid.RowSpan="2"
- Height="70"
- VerticalAlignment="Bottom"
- Panel.ZIndex="10"
- IsLoading="{Binding ShowStatusWindow}"
- Message="{Binding StatusLabel}"
- SubMessage="Please Wait ..."
- />
-
- <!-- Status Bar -->
- <StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >
-
- <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
- Width="100" Height="18" VerticalAlignment="Center"/>
- <Label VerticalAlignment="Center"
- Content="{Binding Path=ProgramStatusLabel}" />
-
- </StatusBar>
-
- </Grid>
-</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/InstantView.xaml.cs b/win/CS/HandBrakeWPF/Views/InstantView.xaml.cs
deleted file mode 100644
index 8ca18aa87..000000000
--- a/win/CS/HandBrakeWPF/Views/InstantView.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="InstantView.xaml.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>
-// Interaction logic for InstantMainView.xaml
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Views
-{
- using System.Windows.Controls;
-
- /// <summary>
- /// Interaction logic for InstantMainView.xaml
- /// </summary>
- public partial class InstantView : UserControl
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="InstantView"/> class.
- /// </summary>
- public InstantView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml
index ab82b298a..9f735ec61 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml
@@ -35,7 +35,5 @@
<ContentControl x:Name="MainViewModel" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
<ContentControl x:Name="OptionsViewModel" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
- <views:InstantView DataContext="{Binding InstantViewModel}"
- Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ShowInstant, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
</Grid>
</Window>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
index 03059a2a8..e38e37c46 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs
@@ -4,12 +4,14 @@
// </copyright>
// <summary>
// Interaction logic for ShellView.xaml
-// </summary>
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.Views
{
using System;
+ using System.ComponentModel;
+ using System.Drawing;
using System.IO;
using System.Windows;
using System.Windows.Forms;
@@ -18,9 +20,6 @@ namespace HandBrakeWPF.Views
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
- using HandBrake.ApplicationServices.Utilities;
-
using HandBrakeWPF.Commands;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Utilities;
@@ -36,7 +35,7 @@ namespace HandBrakeWPF.Views
/// <summary>
/// The my notify icon.
/// </summary>
- private readonly System.Windows.Forms.NotifyIcon notifyIcon;
+ private readonly NotifyIcon notifyIcon;
/// <summary>
/// Initializes a new instance of the <see cref="ShellView"/> class.
@@ -50,14 +49,14 @@ namespace HandBrakeWPF.Views
if (minimiseToTray)
{
- this.notifyIcon = new System.Windows.Forms.NotifyIcon();
+ this.notifyIcon = new NotifyIcon();
this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick) });
StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/handbrakepineapple.ico"));
if (streamResourceInfo != null)
{
Stream iconStream = streamResourceInfo.Stream;
- this.notifyIcon.Icon = new System.Drawing.Icon(iconStream);
+ this.notifyIcon.Icon = new Icon(iconStream);
}
this.notifyIcon.DoubleClick += this.NotifyIconClick;
this.StateChanged += this.ShellViewStateChanged;
@@ -70,7 +69,6 @@ namespace HandBrakeWPF.Views
// Add to Queue (Ctrl+A)
// Scan a File (Ctrl+F)
// Scan a Folder (Ctrl+R)
- // Show CLI Query (Ctrl+Shift+D)
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.S, ModifierKeys.Control)), new KeyGesture(Key.S, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.K, ModifierKeys.Control)), new KeyGesture(Key.K, ModifierKeys.Control)));
@@ -80,7 +78,6 @@ namespace HandBrakeWPF.Views
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.F, ModifierKeys.Control)), new KeyGesture(Key.F, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.O, ModifierKeys.Control)), new KeyGesture(Key.O, ModifierKeys.Control)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.R, ModifierKeys.Control)), new KeyGesture(Key.R, ModifierKeys.Control)));
- this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.D, ModifierKeys.Control | ModifierKeys.Shift)), new KeyGesture(Key.D, ModifierKeys.Control | ModifierKeys.Shift)));
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.G, ModifierKeys.Control | ModifierKeys.Shift)), new KeyGesture(Key.G, ModifierKeys.Control | ModifierKeys.Shift)));
// Enable Windows 7 Taskbar progress indication.
@@ -88,14 +85,6 @@ namespace HandBrakeWPF.Views
{
this.TaskbarItemInfo = Win7.WindowsTaskbar;
}
-
- // Window Sizing
- if (AppArguments.IsInstantHandBrake)
- {
- this.SizeToContent = SizeToContent.WidthAndHeight;
- this.MinHeight = 380;
- this.MinWidth = 600;
- }
}
/// <summary>
@@ -129,6 +118,7 @@ namespace HandBrakeWPF.Views
{
this.ShowInTaskbar = false;
notifyIcon.Visible = true;
+
// notifyIcon.ShowBalloonTip(5000, "HandBrake", "Application Minimised", ToolTipIcon.Info);
}
else if (this.WindowState == WindowState.Normal)
@@ -145,7 +135,7 @@ namespace HandBrakeWPF.Views
/// <param name="e">
/// The CancelEventArgs.
/// </param>
- protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
+ protected override void OnClosing(CancelEventArgs e)
{
IShellViewModel shellViewModel = this.DataContext as IShellViewModel;