diff options
author | sr55 <[email protected]> | 2015-07-18 20:10:15 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-07-18 20:10:15 +0000 |
commit | 358cb88d56078fab57c5daf9493704b111217839 (patch) | |
tree | 4d16284ff2a4e69227b763f50d99b74826348dcb | |
parent | 074663b7aa8e85a85fd6d298ada3cd50500348c8 (diff) |
WinGui: Add a Mini Status Display window that can be accessed via the tray notify icon when the app is minimised to tray.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7350 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 63 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/ResourcesUI.resx | 10 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs | 22 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MiniViewModel.cs | 208 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MiniView.xaml | 34 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | 23 |
9 files changed, 337 insertions, 43 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 096fdd379..42f0bf99c 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -198,6 +198,8 @@ </Compile>
<Compile Include="ViewModels\Interfaces\IOverlayPanel.cs" />
<Compile Include="ViewModels\Interfaces\IStaticPreviewViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IMiniViewModel.cs" />
+ <Compile Include="ViewModels\MiniViewModel.cs" />
<Compile Include="ViewModels\StaticPreviewViewModel.cs" />
<Compile Include="Views\CountdownAlertView.xaml.cs">
<DependentUpon>CountdownAlertView.xaml</DependentUpon>
@@ -249,6 +251,9 @@ <Compile Include="Views\QueueSelectionView.xaml.cs">
<DependentUpon>QueueSelectionView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\MiniView.xaml.cs">
+ <DependentUpon>MiniView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\ShellView.xaml.cs">
<DependentUpon>ShellView.xaml</DependentUpon>
</Compile>
@@ -426,6 +431,10 @@ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\MiniView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\ShellView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index b0c768edf..0052f94da 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -84,9 +84,9 @@ namespace HandBrakeWPF.Properties { ///
///None: Picture settings are not stored in the preset. When loading a source, they will remain as-is within the bounds of the source resolution. This also affects Anamorphic, modulus, cropping etc.
///
- ///Custom: You can optionally set a Maximum width and Height. When doing this an encode will be less than or equal to these values. Keep Aspect Ratio will be automatically turned on.
+ ///Custom: You can optionally set a Maximum width and Height. When doing this an encodeService will be less than or equal to these values. Keep Aspect Ratio will be automatically turned on.
///
- ///Source Maximum: Always encode at the sources [rest of string was truncated]";.
+ ///Source Maximum: Always encodeService [rest of string was truncated]";.
/// </summary>
public static string AddPreset_PictureSizeMode {
get {
@@ -166,7 +166,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Adaptive quantization controls how the encoder distributes bits across the frame.
+ /// Looks up a localized string similar to Adaptive quantization controls how the encodeServicer distributes bits across the frame.
///Higher values take more bits away from edges and complex areas to improve areas with finer detail..
/// </summary>
public static string Advanced_AdaptiveQuantizationStrengthToolTip {
@@ -187,7 +187,7 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to Sane values are ~2-5.
- ///This specifies the maximum number of sequential B-frames that the encoder can use.
+ ///This specifies the maximum number of sequential B-frames that the encodeServicer can use.
/// Large numbers generally won't help significantly unless Adaptive B-frames is set to Optimal.
///Cel-animated source material and B-pyramid also significantly increase the usefulness of larger values.
///Baseline profile, as required for iPods and similar devices, requires B-frames to be set to 0 (off)..
@@ -199,7 +199,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to After the encoder has done its work, it has a bunch of data that needs to be compressed losslessly, similar to ZIP or RAR. H.264 provides two options for this: CAVLC and CABAC. CABAC decodes a lot slower but compresses significantly better (10-30%), especially at lower bitrates. If you're looking to minimize CPU requirements for video playback, disable this option. Baseline profile, as required for iPods and similar devices, requires CABAC to be disabled..
+ /// Looks up a localized string similar to After the encodeServicer has done its work, it has a bunch of data that needs to be compressed losslessly, similar to ZIP or RAR. H.264 provides two options for this: CAVLC and CABAC. CABAC decodes a lot slower but compresses significantly better (10-30%), especially at lower bitrates. If you're looking to minimize CPU requirements for video playback, disable this option. Baseline profile, as required for iPods and similar devices, requires CABAC to be disabled..
/// </summary>
public static string Advanced_CabacToolTip {
get {
@@ -232,7 +232,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to The options passed to the x264 encoder.
+ /// Looks up a localized string similar to The options passed to the x264 encodeServicer.
///The above controls are only a subset of useful x264 parameters.
///This box allows you to add or modify additional or current parameters as desired. .
/// </summary>
@@ -243,15 +243,14 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Controls the motion estimation method. Motion estimation is how the encoder estimates how each block of pixels in a frame has moved.
+ /// Looks up a localized string similar to Controls the motion estimation method. Motion estimation is how the encodeServicer estimates how each block of pixels in a frame has moved.
///A better motion search method improves compression at the cost of speed.
///
///Diamond: performs an extremely fast and simple search using a diamond pattern.
///
///Hexagon: performs a somewhat more effective but slightly slower search using a hexagon pattern.
///
- ///Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex motion.
- ///
/// [rest of string was truncated]";.
+ ///Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex mot [rest of string was truncated]";.
/// </summary>
public static string Advanced_MotionEstimationMethodToolTip {
get {
@@ -282,9 +281,9 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to There is no options pane available for this encoder.
+ /// Looks up a localized string similar to There is no options pane available for this encodeServicer.
///
- ///Please use the 'Extra Options' box on the 'Video' tab to input any additional encoder parameters you may need..
+ ///Please use the 'Extra Options' box on the 'Video' tab to input any additional encodeServicer parameters you may need..
/// </summary>
public static string Advanced_NoOptionsPaneAvailable {
get {
@@ -340,7 +339,7 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to Sane values are ~1-6.
///
- ///The more you add, the better the compression, but the slower the encode.
+ ///The more you add, the better the compression, but the slower the encodeService.
///
///Cel animation tends to benefit from more reference frames a lot more than film content.
///
@@ -357,10 +356,10 @@ namespace HandBrakeWPF.Properties { ///
///Subpixel motion estimation is used for refining motion estimates beyond mere pixel accuracy, improving compression.
///
- ///Mode decision is the method used to choose how to encode each block of the frame: a very important decision.
+ ///Mode decision is the method used to choose how to encodeService each block of the frame: a very important decision.
///
///SAD is the fastest method, followed by SATD, RD, RD refinement, and the slowest, QPRD.
- ///6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps retain det [rest of string was truncated]";.
+ ///6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps ret [rest of string was truncated]";.
/// </summary>
public static string Advanced_SubpixelMotionEstimationToolTip {
get {
@@ -439,7 +438,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Chapter marker names will NOT be saved in your encode..
+ /// Looks up a localized string similar to Chapter marker names will NOT be saved in your encodeService..
/// </summary>
public static string ChaptersViewModel_UnableToExportChaptersMsg {
get {
@@ -538,7 +537,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Please choose a destination for where you would like the encoded file to be saved..
+ /// Looks up a localized string similar to Please choose a destination for where you would like the encodeServiced file to be saved..
/// </summary>
public static string Main_ChooseDestination {
get {
@@ -583,7 +582,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to You cannot encode to a file with the same path and filename as the source file. Please update the destination filename so that it does not match the source file..
+ /// Looks up a localized string similar to You cannot encodeService to a file with the same path and filename as the source file. Please update the destination filename so that it does not match the source file..
/// </summary>
public static string Main_MatchingFileOverwriteWarning {
get {
@@ -637,7 +636,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Preparing to encode ....
+ /// Looks up a localized string similar to Preparing to encodeService ....
/// </summary>
public static string Main_PreparingToEncode {
get {
@@ -802,7 +801,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to HandBrake will not be able to encode the seleteced source as it did not find a valid source with titles to encode.
+ /// Looks up a localized string similar to HandBrake will not be able to encodeService the seleteced source as it did not find a valid source with titles to encodeService.
///This could be due to one of the following reasons:
///- The source file is not a valid video file or is in a format that HandBrake does not support.
///- The source may be copy protected or include DRM. Please note that HandBrake does not support the removal of copy protections.
@@ -816,7 +815,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to You must first scan a source and setup your job before starting an encode. Click the 'Source' button on the toolbar to continue..
+ /// Looks up a localized string similar to You must first scan a source and setup your job before starting an encodeService. Click the 'Source' button on the toolbar to continue..
/// </summary>
public static string Main_ScanSource {
get {
@@ -1203,7 +1202,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to This encode is currently in progress. If you delete it, the encode will be stopped. Are you sure you wish to proceed?.
+ /// Looks up a localized string similar to This encodeService is currently in progress. If you delete it, the encodeService will be stopped. Are you sure you wish to proceed?.
/// </summary>
public static string QueueViewModel_JobCurrentlyRunningWarning {
get {
@@ -1230,7 +1229,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to No encodes pending.
+ /// Looks up a localized string similar to No encodeServices pending.
/// </summary>
public static string QueueViewModel_NoEncodesPending {
get {
@@ -1329,7 +1328,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to An Encode is currently running. Exiting HandBrake will stop this encode.
+ /// Looks up a localized string similar to An Encode is currently running. Exiting HandBrake will stop this encodeService.
///Are you sure you wish to exit HandBrake?.
/// </summary>
public static string ShellViewModel_CanClose {
@@ -1357,7 +1356,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Handbrake is already encoding a video! Only one file can be encoded at any one time..
+ /// Looks up a localized string similar to Handbrake is already encoding a video! Only one file can be encodeServiced at any one time..
/// </summary>
public static string StaticPreviewViewModel_AlreadyEncoding {
get {
@@ -1366,7 +1365,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to You must first scan a source and setup your encode before creating a preview..
+ /// Looks up a localized string similar to You must first scan a source and setup your encodeService before creating a preview..
/// </summary>
public static string StaticPreviewViewModel_ScanFirst {
get {
@@ -1394,7 +1393,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details..
+ /// Looks up a localized string similar to Unable to find the preview file. Either the file was deleted or the encodeService failed. Check the activity log for details..
/// </summary>
public static string StaticPreviewViewModel_UnableToPlayFile {
get {
@@ -1478,7 +1477,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to The full list of encoder parameters:
+ /// Looks up a localized string similar to The full list of encodeServicer parameters:
///{0}.
/// </summary>
public static string Video_EncoderExtraArgs {
@@ -1488,7 +1487,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Additional advanced arguments that can be passed to the video encoder..
+ /// Looks up a localized string similar to Additional advanced arguments that can be passed to the video encodeServicer..
/// </summary>
public static string Video_EncoderExtraArgsTooltip {
get {
@@ -1591,14 +1590,14 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Set the desired quality factor. The encoder targets a certain quality.
- ///The scale used by each video encoder is different.
+ /// Looks up a localized string similar to Set the desired quality factor. The encodeServicer targets a certain quality.
+ ///The scale used by each video encodeServicer is different.
///
///x264's scale is logarithmic and lower values correspond to higher quality.
///So small changes in value will result in progressively larger increases or decreases in the resulting file size.
///A value of 0 means lossless and will result in a file size that is larger than the original source,
///unless the source was also lossless.
- ///Suggested values are: 18 to 20 for standard definiti [rest of string was truncated]";.
+ ///Suggested values are: 18 to 20 for sta [rest of string was truncated]";.
/// </summary>
public static string Video_QualitySlider {
get {
@@ -1609,7 +1608,7 @@ namespace HandBrakeWPF.Properties { /// <summary>
/// Looks up a localized string similar to QuickSync hardware not detected or enabled!
///
- ///In order to use the QuickSync encoder, you must:
+ ///In order to use the QuickSync encodeServicer, you must:
///
///- Have a Intel CPU with HD Graphics and QuickSync support. 4th Generation Haswell or newer parts are recommended for best quality.
///- Have the HD Graphics enabled.
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 3bc2d064d..7631d3a0e 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -196,7 +196,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Otherwise use fallback encoder:.
+ /// Looks up a localized string similar to Otherwise use fallback encodeServicer:.
/// </summary>
public static string AudioView_OtherwiseFallbackEncoder {
get {
@@ -997,7 +997,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Always clear completed queue items after an encode completes.
+ /// Looks up a localized string similar to Always clear completed queue items after an encodeService completes.
/// </summary>
public static string Options_ClearCompleted {
get {
@@ -1015,7 +1015,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Put a copy of individual encode logs in a specified location:.
+ /// Looks up a localized string similar to Put a copy of individual encodeService logs in a specified location:.
/// </summary>
public static string Options_CopyLogToDir {
get {
@@ -1024,7 +1024,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Put a copy of individual encode logs in the same location as the encoded video.
+ /// Looks up a localized string similar to Put a copy of individual encodeService logs in the same location as the encodeServiced video.
/// </summary>
public static string Options_CopyLogToEncDir {
get {
@@ -1897,7 +1897,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Then choose the video(s) you'd like to encode: .
+ /// Looks up a localized string similar to Then choose the video(s) you'd like to encodeService: .
/// </summary>
public static string SourceSelection_ChooseVideo {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 34c80bc43..cb4af42ee 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -352,7 +352,7 @@ <value>Move Right</value>
</data>
<data name="AudioView_OtherwiseFallbackEncoder" xml:space="preserve">
- <value>Otherwise use fallback encoder:</value>
+ <value>Otherwise use fallback encodeServicer:</value>
</data>
<data name="AudioView_ReloadDefaults" xml:space="preserve">
<value>Reload Defaults</value>
@@ -655,7 +655,7 @@ <value>Optionally choose a specific title: </value>
</data>
<data name="SourceSelection_ChooseVideo" xml:space="preserve">
- <value>Then choose the video(s) you'd like to encode: </value>
+ <value>Then choose the video(s) you'd like to encodeService: </value>
</data>
<data name="SourceSelection_ChooseFolder" xml:space="preserve">
<value>Choose Folder to Scan</value>
@@ -709,16 +709,16 @@ <value>Check for Updates</value>
</data>
<data name="Options_ClearCompleted" xml:space="preserve">
- <value>Always clear completed queue items after an encode completes</value>
+ <value>Always clear completed queue items after an encodeService completes</value>
</data>
<data name="Options_ClearLogs" xml:space="preserve">
<value>Clear Log History</value>
</data>
<data name="Options_CopyLogToDir" xml:space="preserve">
- <value>Put a copy of individual encode logs in a specified location:</value>
+ <value>Put a copy of individual encodeService logs in a specified location:</value>
</data>
<data name="Options_CopyLogToEncDir" xml:space="preserve">
- <value>Put a copy of individual encode logs in the same location as the encoded video</value>
+ <value>Put a copy of individual encodeService logs in the same location as the encodeServiced video</value>
</data>
<data name="Options_CurVersion" xml:space="preserve">
<value>Current Version</value>
diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs index 0fd29950e..4bb0a0cda 100644 --- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs @@ -88,6 +88,7 @@ namespace HandBrakeWPF.Startup this.windsorContainer.Register(Component.For<ITitleSpecificViewModel>().ImplementedBy<TitleSpecificViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IQueueSelectionViewModel>().ImplementedBy<QueueSelectionViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<ICountdownAlertViewModel>().ImplementedBy<CountdownAlertViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IMiniViewModel>().ImplementedBy<MiniViewModel>().LifeStyle.Is(LifestyleType.Singleton));
// Experimental Services and Windows.
this.windsorContainer.Register(Component.For<IStaticPreviewViewModel>().ImplementedBy<StaticPreviewViewModel>().LifeStyle.Is(LifestyleType.Singleton));
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs new file mode 100644 index 000000000..dbc3d8259 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs @@ -0,0 +1,22 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IMiniViewModel.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>
+// The IMiniViewModel interface.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The IMiniViewModel interface.
+ /// </summary>
+ public interface IMiniViewModel
+ {
+ /// <summary>
+ /// The activate.
+ /// </summary>
+ void Activate();
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MiniViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MiniViewModel.cs new file mode 100644 index 000000000..a532a990a --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/MiniViewModel.cs @@ -0,0 +1,208 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="MiniViewModel.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>
+// The mini view model.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System;
+
+ using HandBrake.ApplicationServices.Services.Encode.EventArgs;
+ using HandBrake.ApplicationServices.Services.Encode.Interfaces;
+
+ using HandBrakeWPF.EventArgs;
+ using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Queue.Interfaces;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The mini view model.
+ /// </summary>
+ public class MiniViewModel : ViewModelBase, IMiniViewModel
+ {
+ private readonly IEncode encodeService;
+ private readonly IQueueProcessor queueProcessor;
+ private string queueStatus;
+ private string progress;
+ private string task;
+ private string windowTitle;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MiniViewModel"/> class.
+ /// </summary>
+ /// <param name="encodeService">
+ /// The encode Service.
+ /// </param>
+ /// <param name="queueProcessor">
+ /// The queue Processor.
+ /// </param>
+ public MiniViewModel(IEncode encodeService, IQueueProcessor queueProcessor)
+ {
+ this.encodeService = encodeService;
+ this.queueProcessor = queueProcessor;
+
+ this.Task = "Ready";
+ this.Progress = string.Empty;
+ this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ }
+
+ /// <summary>
+ /// Gets or sets the task.
+ /// </summary>
+ public string Task
+ {
+ get
+ {
+ return this.task;
+ }
+ set
+ {
+ if (value == this.task)
+ {
+ return;
+ }
+ this.task = value;
+ this.NotifyOfPropertyChange(() => this.Task);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the progress.
+ /// </summary>
+ public string Progress
+ {
+ get
+ {
+ return this.progress;
+ }
+ set
+ {
+ if (value == this.progress)
+ {
+ return;
+ }
+ this.progress = value;
+ this.NotifyOfPropertyChange(() => this.Progress);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the queue status.
+ /// </summary>
+ public string QueueStatus
+ {
+ get
+ {
+ return this.queueStatus;
+ }
+ set
+ {
+ if (value == this.queueStatus)
+ {
+ return;
+ }
+ this.queueStatus = value;
+ this.NotifyOfPropertyChange(() => this.QueueStatus);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the window title.
+ /// </summary>
+ public string WindowTitle
+ {
+ get
+ {
+ return this.windowTitle;
+ }
+ set
+ {
+ if (value == this.windowTitle)
+ {
+ return;
+ }
+ this.windowTitle = value;
+ this.NotifyOfPropertyChange(() => this.WindowTitle);
+ }
+ }
+
+ /// <summary>
+ /// The activate.
+ /// </summary>
+ public void Activate()
+ {
+ this.encodeService.EncodeStatusChanged += EncodeService_EncodeStatusChanged;
+ this.queueProcessor.QueueChanged += QueueProcessor_QueueChanged;
+ this.queueProcessor.QueueCompleted += QueueProcessor_QueueCompleted;
+ this.WindowTitle = "Mini Status Display";
+ }
+
+ /// <summary>
+ /// The tear down.
+ /// </summary>
+ public void Close()
+ {
+ this.encodeService.EncodeStatusChanged -= EncodeService_EncodeStatusChanged;
+ this.queueProcessor.QueueChanged -= QueueProcessor_QueueChanged;
+ this.queueProcessor.QueueCompleted -= QueueProcessor_QueueCompleted;
+ this.TryClose();
+ }
+
+ /// <summary>
+ /// The queue processor_ queue completed.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void QueueProcessor_QueueCompleted(object sender, QueueCompletedEventArgs e)
+ {
+ this.Task = "Not Encoding.";
+ this.Progress = string.Empty;
+ this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ }
+
+ /// <summary>
+ /// The queue processor_ queue changed.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void QueueProcessor_QueueChanged(object sender, EventArgs e)
+ {
+ this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);
+ }
+
+ /// <summary>
+ /// The encode service_ encode status changed.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)
+ {
+ this.Task = queueProcessor.LastProcessedJob.ScannedSourcePath;
+
+ // {0:00.00}% FPS: {1:000.0} Avg FPS: {2:000.0} Time Remaining: {3} Elapsed: {4:hh\:mm\:ss}
+ this.Progress = string.Format(
+ Resources.MainViewModel_EncodeStatusChanged_StatusLabel,
+ e.PercentComplete,
+ e.CurrentFrameRate,
+ e.AverageFrameRate,
+ e.EstimatedTimeLeft,
+ e.ElapsedTime);
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/MiniView.xaml b/win/CS/HandBrakeWPF/Views/MiniView.xaml new file mode 100644 index 000000000..4069d3ffa --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/MiniView.xaml @@ -0,0 +1,34 @@ +<Window x:Class="HandBrakeWPF.Views.MiniView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:cal="http://www.caliburnproject.org"
+ AllowDrop="True"
+ SnapsToDevicePixels="True"
+ UseLayoutRounding="True"
+ Width="300"
+ Height="165"
+ MinWidth="300"
+ MinHeight="165"
+ TextOptions.TextFormattingMode="Display" ShowActivated="True" ShowInTaskbar="True"
+ WindowStyle="ToolWindow"
+ x:Name="miniView"
+ Title="{Binding Path=WindowTitle}"
+ >
+
+ <Grid Margin="5,0,5,0">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <TextBlock Text="Status" FontSize="26" FontFamily="Segoe UI Light" FontWeight="Bold" Margin="5,0,10,5" Grid.Row="0" />
+
+ <TextBlock Text="{Binding Task}" Grid.Row="1" Margin="10,0,0,5" TextWrapping="WrapWithOverflow" />
+ <TextBlock Text="{Binding Progress}" Grid.Row="2" Margin="10,0,0,5" TextWrapping="WrapWithOverflow" />
+ <TextBlock Text="{Binding QueueStatus}" Grid.Row="3" Margin="10,0,0,0" TextWrapping="WrapWithOverflow" />
+
+ <Button Content="Close" cal:Message.Attach="[Event Click] = [Action Close]" Grid.Row="3" HorizontalAlignment="Right" Margin="0,5,5,0" Padding="8,2" />
+ </Grid>
+</Window>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index fc5a141b9..4071eeb3c 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -50,7 +50,7 @@ namespace HandBrakeWPF.Views if (minimiseToTray)
{
this.notifyIcon = new NotifyIcon();
- this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick) });
+ this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick), new MenuItem("Mini Status Display", ShowMiniStatusDisplay) });
StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/handbrakepineapple.ico"));
if (streamResourceInfo != null)
@@ -81,6 +81,27 @@ namespace HandBrakeWPF.Views }
/// <summary>
+ /// The show mini status display.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void ShowMiniStatusDisplay(object sender, EventArgs e)
+ {
+ IMiniViewModel titleSpecificView = IoC.Get<IMiniViewModel>();
+ IWindowManager windowManager = IoC.Get<IWindowManager>();
+ Execute.OnUIThread(
+ () =>
+ {
+ titleSpecificView.Activate();
+ windowManager.ShowWindow(titleSpecificView);
+ });
+ }
+
+ /// <summary>
/// The notify icon_ click.
/// </summary>
/// <param name="sender">
|