-<?xml version="1.0"?>\r
+<?xml version="1.0" encoding="utf-8" ?>\r
<configuration>\r
<configSections>\r
</configSections>\r
<startup>\r
-\r
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>\r
- </startup>\r
+ </startup>\r
</configuration>\r
--- /dev/null
+<UserControl x:Class="HandBrakeWPF.Controls.SourceSelection"\r
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+ xmlns:cal="http://www.caliburnproject.org"\r
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls"\r
+ Background="{Binding Path=Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}">\r
+\r
+ <Grid VerticalAlignment="Top" HorizontalAlignment="Center">\r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="*" />\r
+ <RowDefinition Height="Auto" />\r
+ </Grid.RowDefinitions>\r
+ \r
+ \r
+ <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="15,30,0,0">\r
+ <TextBlock Text="Source Selection" FontSize="14" FontWeight="Bold" /> \r
+ </StackPanel>\r
+\r
+ <!-- Title Specific Scan -->\r
+ <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Left" Margin="15,10,0,0">\r
+ <StackPanel Orientation="Horizontal">\r
+ <TextBlock Text="Optionally choose a specific title: " />\r
+\r
+ <controls:NumberBox Width="60" Height="24" Margin="10,0,0,0"\r
+ Minimum="0" Maximum="1000" Number="{Binding SelectedTitle, Mode=TwoWay}" />\r
+ </StackPanel>\r
+\r
+ <TextBlock Text="Then choose your source: " Margin="0,20,0,0" />\r
+ </StackPanel>\r
+\r
+ <!-- Source Type -->\r
+ <StackPanel Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Center" Margin="15,10,0,0">\r
+\r
+ <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" cal:Message.Attach="[Event Click] = [Action FolderScan]"\r
+ Margin="0,0,0,10" Padding="8" HorizontalAlignment="Left">\r
+ <StackPanel Orientation="Horizontal" MinWidth="100">\r
+ <Image Source="../Views/Images/folder32.png" Width="32" />\r
+ <StackPanel Orientation="Vertical">\r
+ <TextBlock Text="Folder" VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ <TextBlock Text="Open a Video_TS folder or batch scan a number of files" VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ </StackPanel> \r
+ </StackPanel>\r
+ </Button>\r
+\r
+ <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" cal:Message.Attach="[Event Click] = [Action FileScan]"\r
+ Margin="0,0,0,7" Padding="8" HorizontalAlignment="Left">\r
+ <StackPanel Orientation="Horizontal" MinWidth="100">\r
+ <Image Source="../Views/Images/File32.png" Width="32" />\r
+ <StackPanel Orientation="Vertical">\r
+ <TextBlock Text="File" VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ <TextBlock Text="Open a single file." VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ </StackPanel>\r
+ </StackPanel>\r
+ </Button>\r
+ \r
+ <ListBox ItemsSource="{Binding Drives}" Background="Transparent" BorderThickness="0">\r
+ <ListBox.ItemTemplate>\r
+ <DataTemplate>\r
+ <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" \r
+ cal:Message.Attach="[Event Click] = [Action ProcessDrive($this.Tag)]"\r
+ Margin="0,0,0,10" Padding="8" HorizontalAlignment="Left" \r
+ Tag="{Binding}">\r
+ <StackPanel Orientation="Horizontal" MinWidth="100">\r
+ <Image Source="../Views/Images/Disc.png" Width="32" />\r
+ <StackPanel Orientation="Vertical">\r
+ <TextBlock Text="{Binding Text}" VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ <TextBlock Text="Open this DVD or Bluray Drive" VerticalAlignment="Center" Margin="5,0,0,0" />\r
+ </StackPanel>\r
+ </StackPanel>\r
+ </Button>\r
+ </DataTemplate>\r
+ </ListBox.ItemTemplate>\r
+ \r
+ </ListBox>\r
+ </StackPanel>\r
+\r
+ <!-- Cancel Window -->\r
+ <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,10,10">\r
+ <Button cal:Message.Attach="[Event Click] = [Action CloseSourceSelection]" Content="Cancel" Padding="8,2" />\r
+ </StackPanel>\r
+ \r
+ <StackPanel Grid.Row="4" />\r
+ \r
+ <StackPanel Grid.Row="5" VerticalAlignment="Bottom" Orientation="Vertical">\r
+ <TextBlock Text="This is an experimental replacement for the source selection menu. Feedback welcome on the forum." Margin="10,0,10,0" TextWrapping="Wrap" />\r
+ </StackPanel>\r
+\r
+ </Grid>\r
+</UserControl>\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="SourceSelection.xaml.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Interaction logic for SourceSelection.xaml\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Controls\r
+{\r
+ using System.Windows.Controls;\r
+\r
+ /// <summary>\r
+ /// Interaction logic for SourceSelection.xaml\r
+ /// </summary>\r
+ public partial class SourceSelection : UserControl\r
+ {\r
+ /// <summary>\r
+ /// Initializes a new instance of the <see cref="SourceSelection"/> class. \r
+ /// </summary>\r
+ public SourceSelection()\r
+ {\r
+ this.InitializeComponent();\r
+ }\r
+ }\r
+}\r
<FileAlignment>512</FileAlignment>\r
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
<WarningLevel>4</WarningLevel>\r
+ <IsWebBootstrapper>false</IsWebBootstrapper>\r
<PublishUrl>publish\</PublishUrl>\r
<Install>true</Install>\r
<InstallFrom>Disk</InstallFrom>\r
<MapFileExtensions>true</MapFileExtensions>\r
<ApplicationRevision>0</ApplicationRevision>\r
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
<UseApplicationTrust>false</UseApplicationTrust>\r
<BootstrapperEnabled>true</BootstrapperEnabled>\r
</PropertyGroup>\r
<Compile Include="Constants.cs" />\r
<Compile Include="Controls\SplitButton\SplitMenuButton.cs" />\r
<Compile Include="Converters\Video\ScalingConverter.cs" />\r
+ <Compile Include="Model\ScanMode.cs" />\r
<Compile Include="Factories\HBConfigurationFactory.cs" />\r
<Compile Include="Services\Interfaces\IUserSettingService.cs" />\r
<Compile Include="Services\UserSettingService.cs" />\r
<Compile Include="ViewModels\CountdownAlertViewModel.cs" />\r
<Compile Include="ViewModels\Interfaces\ICountdownAlertViewModel.cs" />\r
+ <Compile Include="Controls\SourceSelection.xaml.cs">\r
+ <DependentUpon>SourceSelection.xaml</DependentUpon>\r
+ </Compile>\r
<Compile Include="ViewModels\Interfaces\IStaticPreviewViewModel.cs" />\r
<Compile Include="ViewModels\StaticPreviewViewModel.cs" />\r
<Compile Include="Views\CountdownAlertView.xaml.cs">\r
<SubType>Designer</SubType>\r
<Generator>MSBuild:Compile</Generator>\r
</Page>\r
+ <Page Include="Controls\SourceSelection.xaml">\r
+ <Generator>MSBuild:Compile</Generator>\r
+ <SubType>Designer</SubType>\r
+ </Page>\r
<Page Include="Views\CountdownAlertView.xaml">\r
<SubType>Designer</SubType>\r
<Generator>MSBuild:Compile</Generator>\r
<Resource Include="Views\Images\Disc.png" />\r
<Resource Include="Views\Images\file.png" />\r
</ItemGroup>\r
+ <ItemGroup>\r
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">\r
+ <Visible>False</Visible>\r
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>\r
+ <Install>true</Install>\r
+ </BootstrapperPackage>\r
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">\r
+ <Visible>False</Visible>\r
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\r
+ <Install>false</Install>\r
+ </BootstrapperPackage>\r
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">\r
+ <Visible>False</Visible>\r
+ <ProductName>.NET Framework 3.5 SP1</ProductName>\r
+ <Install>false</Install>\r
+ </BootstrapperPackage>\r
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">\r
+ <Visible>False</Visible>\r
+ <ProductName>Windows Installer 3.1</ProductName>\r
+ <Install>true</Install>\r
+ </BootstrapperPackage>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Resource Include="Views\Images\folder32.png" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Resource Include="Views\Images\File32.png" />\r
+ </ItemGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<Import Project="$(ProgramFiles)\MSBuild\StyleCop\v4.*\StyleCop.targets" />\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="ScanMode.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Scan Mode\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Model\r
+{\r
+ /// <summary>\r
+ /// ScanModeEnum\r
+ /// </summary>\r
+ public enum ScanMode\r
+ {\r
+ File,\r
+ Folder,\r
+ Disc\r
+ }\r
+}\r
using System.Linq;\r
using System.Threading;\r
using System.Windows;\r
- using System.Windows.Media.Imaging;\r
\r
using Caliburn.Micro;\r
\r
- using HandBrake.ApplicationServices;\r
using HandBrake.ApplicationServices.Factories;\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Model.Encoding;\r
\r
using Ookii.Dialogs.Wpf;\r
\r
- using Image = System.Windows.Controls.Image;\r
-\r
/// <summary>\r
/// HandBrakes Main Window\r
/// </summary>\r
/// </summary>\r
private bool isPresetPanelShowing;\r
\r
+ /// <summary>\r
+ /// The show source selection.\r
+ /// </summary>\r
+ private bool showSourceSelection;\r
+\r
+ /// <summary>\r
+ /// The drives.\r
+ /// </summary>\r
+ private BindingList<SourceMenuItem> drives;\r
+\r
#endregion\r
\r
/// <summary>\r
\r
this.Presets = this.presetService.Presets;\r
this.CancelScanCommand = new CancelScanCommand(this.scanService);\r
+ this.Drives = new BindingList<SourceMenuItem>();\r
}\r
\r
#region View Model Properties\r
{\r
return this.selectedOutputFormat;\r
}\r
+\r
set\r
{\r
this.selectedOutputFormat = value;\r
/// </summary>\r
public int ProgressPercentage { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether show source selection.\r
+ /// </summary>\r
+ public bool ShowSourceSelection\r
+ {\r
+ get\r
+ {\r
+ return this.showSourceSelection;\r
+ }\r
+ set\r
+ {\r
+ if (value.Equals(this.showSourceSelection))\r
+ {\r
+ return;\r
+ }\r
+ this.showSourceSelection = value;\r
+ this.NotifyOfPropertyChange(() => this.ShowSourceSelection);\r
+\r
+ // Refresh the drives.\r
+ if (this.showSourceSelection)\r
+ {\r
+ this.Drives.Clear();\r
+ foreach (SourceMenuItem menuItem in from item in GeneralUtilities.GetDrives()\r
+ let driveInformation = item\r
+ select new SourceMenuItem\r
+ {\r
+ Text = string.Format("{0} ({1})", item.RootDirectory, item.VolumeLabel),\r
+ Command = new SourceMenuCommand(() => this.ProcessDrive(driveInformation)),\r
+ Tag = item,\r
+ IsDrive = true\r
+ })\r
+ {\r
+ this.Drives.Add(menuItem);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the drives.\r
+ /// </summary>\r
+ public BindingList<SourceMenuItem> Drives\r
+ {\r
+ get\r
+ {\r
+ return this.drives;\r
+ }\r
+ set\r
+ {\r
+ if (Equals(value, this.drives))\r
+ {\r
+ return;\r
+ }\r
+\r
+ this.drives = value;\r
+ this.NotifyOfPropertyChange(() => this.Drives);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Load and Shutdown Handling\r
{\r
VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };\r
dialog.ShowDialog();\r
+\r
+ ShowSourceSelection = false;\r
+\r
this.StartScan(dialog.SelectedPath, 0);\r
}\r
\r
{\r
OpenFileDialog dialog = new OpenFileDialog { Filter = "All files (*.*)|*.*" };\r
dialog.ShowDialog();\r
+\r
+ ShowSourceSelection = false;\r
+\r
this.StartScan(dialog.FileName, 0);\r
}\r
\r
MessageBoxImage.Information);\r
}\r
\r
+ /// <summary>\r
+ /// The select source window.\r
+ /// </summary>\r
+ public void SelectSourceWindow()\r
+ {\r
+ ShowSourceSelection = !ShowSourceSelection;\r
+ }\r
+\r
+ /// <summary>\r
+ /// The close source selection.\r
+ /// </summary>\r
+ public void CloseSourceSelection()\r
+ {\r
+ this.ShowSourceSelection = false;\r
+ }\r
+\r
#endregion\r
\r
#region Main Window Public Methods\r
{\r
if (item != null)\r
{\r
- this.StartScan(((DriveInformation)item).RootDirectory, 0);\r
+ if (item.GetType() == typeof(DriveInformation))\r
+ {\r
+ this.StartScan(((DriveInformation)item).RootDirectory, 0);\r
+ }\r
+ else if (item.GetType() == typeof(SourceMenuItem))\r
+ {\r
+ DriveInformation driveInfo = ((SourceMenuItem)item).Tag as DriveInformation;\r
+ if (driveInfo != null)\r
+ {\r
+ this.StartScan(driveInfo.RootDirectory, 0);\r
+ }\r
+\r
+ this.ShowSourceSelection = false;\r
+ }\r
}\r
}\r
\r
<StackPanel Grid.Row="0"\r
Height="30"\r
Margin="0,0,0,10"\r
- Background="White"\r
Orientation="Horizontal">\r
<Image Width="24"\r
Height="24"\r
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"\r
xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"\r
xmlns:attachedProperties="clr-namespace:HandBrakeWPF.AttachedProperties"\r
- xmlns:handBrakeWpf="clr-namespace:HandBrakeWPF"\r
AllowDrop="True"\r
FontSize="11"\r
Micro:Message.Attach="[Event Loaded] = [Action Load]"\r
ToolBar.OverflowMode="Never"\r
ToolBarTray.IsLocked="True"\r
>\r
- <Menu Background="Transparent">\r
+\r
+ <Button Name="SelectSource"\r
+ Micro:Message.Attach="[Event Click] = [Action SelectSourceWindow]">\r
+ <StackPanel Orientation="Horizontal">\r
+ <Image Width="32"\r
+ Height="32"\r
+ Source="Images/Movies.png"\r
+ />\r
+ <Label Margin="8,0,0,0"\r
+ VerticalAlignment="Center"\r
+ Content="Source"\r
+ />\r
+ </StackPanel>\r
+ </Button>\r
+ \r
+ \r
+ <Menu Background="Transparent" Visibility="Collapsed">\r
<MenuItem ItemsSource="{Binding SourceMenu}" attachedProperties:DriveMenu.ShowAvailableDrives="true">\r
<MenuItem.Header>\r
<StackPanel Orientation="Horizontal">\r
/>\r
</StackPanel>\r
</MenuItem.Header>\r
+ \r
<MenuItem.Resources>\r
<Image x:Key="Movie" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/file.png" />\r
<Image x:Key="Folder" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/folder.png" />\r
</Grid>\r
</GroupBox>\r
</Grid>\r
-\r
+ \r
+ <!-- Source Selection--> \r
+ <Controls:SourceSelection Grid.Row="1" Width="400" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="DarkGray"\r
+ Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}}" />\r
+ \r
<!-- StatusPanel -->\r
<Controls:StatusPanel x:Name="loadingPanel"\r
Grid.Row="1"\r
-<?xml version="1.0"?>\r
+<?xml version="1.0" encoding="utf-8" ?>\r
<configuration>\r
<startup>\r
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>\r