From 76140507f1d927f4faa4b7d806a5ddca4b5d7753 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 22 Oct 2011 16:38:47 +0000 Subject: WinGui: Initial layout of the WPF options window git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4306 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 7 +- win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs | 20 +- .../HandBrakeWPF/ViewModels/AddPresetViewModel.cs | 2 + .../ViewModels/Interfaces/IAboutViewModel.cs | 9 + .../ViewModels/Interfaces/IOptionsViewModel.cs | 9 + win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 22 +- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 20 +- win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs | 9 + .../Views/Controls/PictureSettingsView.xaml | 18 +- .../Views/Images/General Preferences.png | Bin 1490 -> 0 bytes win/CS/HandBrakeWPF/Views/Images/Preferences.png | Bin 0 -> 1490 bytes win/CS/HandBrakeWPF/Views/MainView.xaml | 14 +- win/CS/HandBrakeWPF/Views/OptionsView.xaml | 335 ++++++++++++++++++++- 13 files changed, 429 insertions(+), 36 deletions(-) create mode 100644 win/CS/HandBrakeWPF/ViewModels/Interfaces/IAboutViewModel.cs create mode 100644 win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs delete mode 100644 win/CS/HandBrakeWPF/Views/Images/General Preferences.png create mode 100644 win/CS/HandBrakeWPF/Views/Images/Preferences.png (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 59151234c..7eaa3b2fa 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -65,9 +65,6 @@ - - ..\libraries\WPFToolkit.Extended.dll - @@ -78,7 +75,9 @@ + + @@ -239,7 +238,7 @@ - + diff --git a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs index aff760ad7..759be462d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs @@ -5,15 +5,33 @@ namespace HandBrakeWPF.ViewModels { + using System.ComponentModel.Composition; + using Caliburn.Micro; + using HandBrakeWPF.ViewModels.Interfaces; + /// /// The About View Model /// - public class AboutViewModel : ViewModelBase + [Export(typeof(IAboutViewModel))] + public class AboutViewModel : ViewModelBase, IAboutViewModel { + /// + /// Initializes a new instance of the class. + /// + /// + /// The window manager. + /// public AboutViewModel(IWindowManager windowManager) : base(windowManager) { } + + /// + /// Close this window. + /// + public void Close() + { + } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index 0c9373b57..199e44be2 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -5,6 +5,8 @@ namespace HandBrakeWPF.ViewModels { + using System.ComponentModel.Composition; + using Caliburn.Micro; /// diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAboutViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAboutViewModel.cs new file mode 100644 index 000000000..7e592ccde --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAboutViewModel.cs @@ -0,0 +1,9 @@ +namespace HandBrakeWPF.ViewModels.Interfaces +{ + /// + /// The About View Model Interface + /// + public interface IAboutViewModel + { + } +} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs new file mode 100644 index 000000000..b6b75ad87 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs @@ -0,0 +1,9 @@ +namespace HandBrakeWPF.ViewModels.Interfaces +{ + /// + /// The Options Screen View Model Interface + /// + public interface IOptionsViewModel + { + } +} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index f833695c6..30c705381 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -63,6 +63,13 @@ namespace HandBrakeWPF.ViewModels #region Properties + /// + /// Initializes a new instance of the class. + /// The viewmodel for HandBrakes main window. + /// + /// + /// The window manager. + /// [ImportingConstructor] public MainViewModel(IWindowManager windowManager) : base(windowManager) { @@ -184,11 +191,21 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.EncodeService.EncodeStatusChanged -= this.EncodeStatusChanged; } - #region Menu and Taskbar - public void AboutApplication() + public void OpenAboutApplication() { + this.WindowManager.ShowWindow(new AboutViewModel(this.WindowManager)); + } + + public void OpenOptionsWindow() + { + this.WindowManager.ShowWindow(new OptionsViewModel(this.WindowManager)); + } + + public void OpenQueueWindow() + { + this.WindowManager.ShowWindow(new QueueViewModel(this.WindowManager)); } /// @@ -201,7 +218,6 @@ namespace HandBrakeWPF.ViewModels #endregion - #region Event Handlers /// /// Handle the Scan Status Changed Event. diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 5979cdf60..6b8e4d939 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -5,15 +5,33 @@ namespace HandBrakeWPF.ViewModels { + using System.ComponentModel.Composition; + using Caliburn.Micro; + using HandBrakeWPF.ViewModels.Interfaces; + /// /// The Options View Model /// - public class OptionsViewModel : ViewModelBase + [Export(typeof(IOptionsViewModel))] + public class OptionsViewModel : ViewModelBase, IOptionsViewModel { + /// + /// Initializes a new instance of the class. + /// + /// + /// The window manager. + /// public OptionsViewModel(IWindowManager windowManager) : base(windowManager) { } + + /// + /// Close this window. + /// + public void Close() + { + } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs index 29379938a..cc2d9307a 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs @@ -7,11 +7,20 @@ /// public class ViewModelBase : Screen { + /// + /// Initializes a new instance of the class. + /// + /// + /// The window manager. + /// public ViewModelBase(IWindowManager windowManager) { this.WindowManager = windowManager; } + /// + /// Gets WindowManager. + /// public IWindowManager WindowManager { get; private set; } } } diff --git a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml index f39f61528..0261513f8 100644 --- a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml @@ -1,10 +1,6 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -21,9 +17,9 @@ @@ -52,9 +48,9 @@ - + @@ -87,10 +83,10 @@