]> granicus.if.org Git - handbrake/commitdiff
WinGui: Add a Mini Status Display window that can be accessed via the tray notify...
authorsr55 <sr55.hb@outlook.com>
Sat, 18 Jul 2015 20:10:15 +0000 (20:10 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 18 Jul 2015 20:10:15 +0000 (20:10 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7350 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/ViewModels/MiniViewModel.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/Views/MiniView.xaml [new file with mode: 0644]
win/CS/HandBrakeWPF/Views/ShellView.xaml.cs

index 096fdd3798cabaa0e64a7dd667c4d47955150e90..42f0bf99c66625959d9d5295f79fc6311096bd7a 100644 (file)
     </Compile>\r
     <Compile Include="ViewModels\Interfaces\IOverlayPanel.cs" />\r
     <Compile Include="ViewModels\Interfaces\IStaticPreviewViewModel.cs" />\r
+    <Compile Include="ViewModels\Interfaces\IMiniViewModel.cs" />\r
+    <Compile Include="ViewModels\MiniViewModel.cs" />\r
     <Compile Include="ViewModels\StaticPreviewViewModel.cs" />\r
     <Compile Include="Views\CountdownAlertView.xaml.cs">\r
       <DependentUpon>CountdownAlertView.xaml</DependentUpon>\r
     <Compile Include="Views\QueueSelectionView.xaml.cs">\r
       <DependentUpon>QueueSelectionView.xaml</DependentUpon>\r
     </Compile>\r
+    <Compile Include="Views\MiniView.xaml.cs">\r
+      <DependentUpon>MiniView.xaml</DependentUpon>\r
+    </Compile>\r
     <Compile Include="Views\ShellView.xaml.cs">\r
       <DependentUpon>ShellView.xaml</DependentUpon>\r
     </Compile>\r
       <Generator>MSBuild:Compile</Generator>\r
       <SubType>Designer</SubType>\r
     </Page>\r
+    <Page Include="Views\MiniView.xaml">\r
+      <Generator>MSBuild:Compile</Generator>\r
+      <SubType>Designer</SubType>\r
+    </Page>\r
     <Page Include="Views\ShellView.xaml">\r
       <SubType>Designer</SubType>\r
       <Generator>MSBuild:Compile</Generator>\r
index b0c768edfb4059426a0a759dcecdd159b23bcf6f..0052f94da940756d1c920b1876b134377a986255 100644 (file)
@@ -84,9 +84,9 @@ namespace HandBrakeWPF.Properties {
         ///\r
         ///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.\r
         ///\r
-        ///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.\r
+        ///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.\r
         ///\r
-        ///Source Maximum:  Always encode at the sources [rest of string was truncated]&quot;;.\r
+        ///Source Maximum:  Always encodeService  [rest of string was truncated]&quot;;.\r
         /// </summary>\r
         public static string AddPreset_PictureSizeMode {\r
             get {\r
@@ -166,7 +166,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Adaptive quantization controls how the encoder distributes bits across the frame.\r
+        ///   Looks up a localized string similar to Adaptive quantization controls how the encodeServicer distributes bits across the frame.\r
         ///Higher values take more bits away from edges and complex areas to improve areas with finer detail..\r
         /// </summary>\r
         public static string Advanced_AdaptiveQuantizationStrengthToolTip {\r
@@ -187,7 +187,7 @@ namespace HandBrakeWPF.Properties {
         \r
         /// <summary>\r
         ///   Looks up a localized string similar to Sane values are ~2-5.  \r
-        ///This specifies the maximum number of sequential B-frames that the encoder can use. \r
+        ///This specifies the maximum number of sequential B-frames that the encodeServicer can use. \r
         /// Large numbers generally won&apos;t help significantly unless Adaptive B-frames is set to Optimal.  \r
         ///Cel-animated source material and B-pyramid also significantly increase the usefulness of larger values. \r
         ///Baseline profile, as required for iPods and similar devices, requires B-frames to be set to 0 (off)..\r
@@ -199,7 +199,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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&apos;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..\r
+        ///   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&apos;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..\r
         /// </summary>\r
         public static string Advanced_CabacToolTip {\r
             get {\r
@@ -232,7 +232,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to The options passed to the x264 encoder. \r
+        ///   Looks up a localized string similar to The options passed to the x264 encodeServicer. \r
         ///The above controls are only a subset of useful x264 parameters. \r
         ///This box allows you to add or modify additional or current parameters as desired. .\r
         /// </summary>\r
@@ -243,15 +243,14 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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.  \r
+        ///   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.  \r
         ///A better motion search method improves compression at the cost of speed.\r
         ///\r
         ///Diamond: performs an extremely fast and simple search using a diamond pattern.\r
         ///\r
         ///Hexagon: performs a somewhat more effective but slightly slower search using a hexagon pattern.\r
         ///\r
-        ///Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex motion.\r
-        ///\r        /// [rest of string was truncated]&quot;;.\r
+        ///Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex mot [rest of string was truncated]&quot;;.\r
         /// </summary>\r
         public static string Advanced_MotionEstimationMethodToolTip {\r
             get {\r
@@ -282,9 +281,9 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to There is no options pane available for this encoder.\r
+        ///   Looks up a localized string similar to There is no options pane available for this encodeServicer.\r
         ///\r
-        ///Please use the &apos;Extra Options&apos; box on the &apos;Video&apos; tab to input any additional encoder parameters you may need..\r
+        ///Please use the &apos;Extra Options&apos; box on the &apos;Video&apos; tab to input any additional encodeServicer parameters you may need..\r
         /// </summary>\r
         public static string Advanced_NoOptionsPaneAvailable {\r
             get {\r
@@ -340,7 +339,7 @@ namespace HandBrakeWPF.Properties {
         /// <summary>\r
         ///   Looks up a localized string similar to Sane values are ~1-6.\r
         ///\r
-        ///The more you add, the better the compression, but the slower the encode.\r
+        ///The more you add, the better the compression, but the slower the encodeService.\r
         ///\r
         ///Cel animation tends to benefit from more reference frames a lot more than film content.\r
         ///\r
@@ -357,10 +356,10 @@ namespace HandBrakeWPF.Properties {
         ///\r
         ///Subpixel motion estimation is used for refining motion estimates beyond mere pixel accuracy, improving compression.\r
         ///\r
-        ///Mode decision is the method used to choose how to encode each block of the frame: a very important decision.\r
+        ///Mode decision is the method used to choose how to encodeService each block of the frame: a very important decision.\r
         ///\r
         ///SAD is the fastest method, followed by SATD, RD, RD refinement, and the slowest, QPRD.\r
-        ///6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps retain det [rest of string was truncated]&quot;;.\r
+        ///6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps ret [rest of string was truncated]&quot;;.\r
         /// </summary>\r
         public static string Advanced_SubpixelMotionEstimationToolTip {\r
             get {\r
@@ -439,7 +438,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Chapter marker names will NOT be saved in your encode..\r
+        ///   Looks up a localized string similar to Chapter marker names will NOT be saved in your encodeService..\r
         /// </summary>\r
         public static string ChaptersViewModel_UnableToExportChaptersMsg {\r
             get {\r
@@ -538,7 +537,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Please choose a destination for where you would like the encoded file to be saved..\r
+        ///   Looks up a localized string similar to Please choose a destination for where you would like the encodeServiced file to be saved..\r
         /// </summary>\r
         public static string Main_ChooseDestination {\r
             get {\r
@@ -583,7 +582,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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..\r
+        ///   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..\r
         /// </summary>\r
         public static string Main_MatchingFileOverwriteWarning {\r
             get {\r
@@ -637,7 +636,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Preparing to encode ....\r
+        ///   Looks up a localized string similar to Preparing to encodeService ....\r
         /// </summary>\r
         public static string Main_PreparingToEncode {\r
             get {\r
@@ -802,7 +801,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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. \r
+        ///   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. \r
         ///This could be due to one of the following reasons:\r
         ///- The source file is not a valid video file or is in a format that HandBrake does not support.\r
         ///- The source may be copy protected or include DRM. Please note that HandBrake does not support the removal of copy protections.\r
@@ -816,7 +815,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to You must first scan a source and setup your job before starting an encode. Click the &apos;Source&apos; button on the toolbar to continue..\r
+        ///   Looks up a localized string similar to You must first scan a source and setup your job before starting an encodeService. Click the &apos;Source&apos; button on the toolbar to continue..\r
         /// </summary>\r
         public static string Main_ScanSource {\r
             get {\r
@@ -1203,7 +1202,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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?.\r
+        ///   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?.\r
         /// </summary>\r
         public static string QueueViewModel_JobCurrentlyRunningWarning {\r
             get {\r
@@ -1230,7 +1229,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to No encodes pending.\r
+        ///   Looks up a localized string similar to No encodeServices pending.\r
         /// </summary>\r
         public static string QueueViewModel_NoEncodesPending {\r
             get {\r
@@ -1329,7 +1328,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to An Encode is currently running. Exiting HandBrake will stop this encode.\r
+        ///   Looks up a localized string similar to An Encode is currently running. Exiting HandBrake will stop this encodeService.\r
         ///Are you sure you wish to exit HandBrake?.\r
         /// </summary>\r
         public static string ShellViewModel_CanClose {\r
@@ -1357,7 +1356,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Handbrake is already encoding a video! Only one file can be encoded at any one time..\r
+        ///   Looks up a localized string similar to Handbrake is already encoding a video! Only one file can be encodeServiced at any one time..\r
         /// </summary>\r
         public static string StaticPreviewViewModel_AlreadyEncoding {\r
             get {\r
@@ -1366,7 +1365,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to You must first scan a source and setup your encode before creating a preview..\r
+        ///   Looks up a localized string similar to You must first scan a source and setup your encodeService before creating a preview..\r
         /// </summary>\r
         public static string StaticPreviewViewModel_ScanFirst {\r
             get {\r
@@ -1394,7 +1393,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   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..\r
+        ///   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..\r
         /// </summary>\r
         public static string StaticPreviewViewModel_UnableToPlayFile {\r
             get {\r
@@ -1478,7 +1477,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to The full list of encoder parameters: \r
+        ///   Looks up a localized string similar to The full list of encodeServicer parameters: \r
         ///{0}.\r
         /// </summary>\r
         public static string Video_EncoderExtraArgs {\r
@@ -1488,7 +1487,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Additional advanced arguments that can be passed to the video encoder..\r
+        ///   Looks up a localized string similar to Additional advanced arguments that can be passed to the video encodeServicer..\r
         /// </summary>\r
         public static string Video_EncoderExtraArgsTooltip {\r
             get {\r
@@ -1591,14 +1590,14 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Set the desired quality factor. The encoder targets a certain quality. \r
-        ///The scale used by each video encoder is different.\r
+        ///   Looks up a localized string similar to Set the desired quality factor. The encodeServicer targets a certain quality. \r
+        ///The scale used by each video encodeServicer is different.\r
         ///\r
         ///x264&apos;s scale is logarithmic and lower values correspond to higher quality. \r
         ///So small changes in value will result in progressively larger increases or decreases in the resulting file size. \r
         ///A value of 0 means lossless and will result in a file size that is larger than the original source, \r
         ///unless the source was also lossless. \r
-        ///Suggested values are: 18 to 20 for standard definiti [rest of string was truncated]&quot;;.\r
+        ///Suggested values are: 18 to 20 for sta [rest of string was truncated]&quot;;.\r
         /// </summary>\r
         public static string Video_QualitySlider {\r
             get {\r
@@ -1609,7 +1608,7 @@ namespace HandBrakeWPF.Properties {
         /// <summary>\r
         ///   Looks up a localized string similar to QuickSync hardware not detected or enabled! \r
         ///\r
-        ///In order to use the QuickSync encoder, you must:\r
+        ///In order to use the QuickSync encodeServicer, you must:\r
         ///\r
         ///- Have a Intel CPU with HD Graphics and QuickSync support. 4th Generation Haswell or newer parts are recommended for best quality.\r
         ///- Have the HD Graphics enabled.\r
index 3bc2d064ddacc343ad068382c8fa317e933cc5e8..7631d3a0e0484ef579699f398e7a4d116c22a513 100644 (file)
@@ -196,7 +196,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Otherwise use fallback encoder:.\r
+        ///   Looks up a localized string similar to Otherwise use fallback encodeServicer:.\r
         /// </summary>\r
         public static string AudioView_OtherwiseFallbackEncoder {\r
             get {\r
@@ -997,7 +997,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Always clear completed queue items after an encode completes.\r
+        ///   Looks up a localized string similar to Always clear completed queue items after an encodeService completes.\r
         /// </summary>\r
         public static string Options_ClearCompleted {\r
             get {\r
@@ -1015,7 +1015,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Put a copy of individual encode logs in a specified location:.\r
+        ///   Looks up a localized string similar to Put a copy of individual encodeService logs in a specified location:.\r
         /// </summary>\r
         public static string Options_CopyLogToDir {\r
             get {\r
@@ -1024,7 +1024,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Put a copy of individual encode logs in the same location as the encoded video.\r
+        ///   Looks up a localized string similar to Put a copy of individual encodeService logs in the same location as the encodeServiced video.\r
         /// </summary>\r
         public static string Options_CopyLogToEncDir {\r
             get {\r
@@ -1897,7 +1897,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Then choose the video(s) you&apos;d like to encode: .\r
+        ///   Looks up a localized string similar to Then choose the video(s) you&apos;d like to encodeService: .\r
         /// </summary>\r
         public static string SourceSelection_ChooseVideo {\r
             get {\r
index 34c80bc436e5f24a0e2377f4f9e1175e0b241659..cb4af42eedaa4921b59c1767e8dafb19b5c73d16 100644 (file)
     <value>Move Right</value>\r
   </data>\r
   <data name="AudioView_OtherwiseFallbackEncoder" xml:space="preserve">\r
-    <value>Otherwise use fallback encoder:</value>\r
+    <value>Otherwise use fallback encodeServicer:</value>\r
   </data>\r
   <data name="AudioView_ReloadDefaults" xml:space="preserve">\r
     <value>Reload Defaults</value>\r
     <value>Optionally choose a specific title: </value>\r
   </data>\r
   <data name="SourceSelection_ChooseVideo" xml:space="preserve">\r
-    <value>Then choose the video(s) you'd like to encode: </value>\r
+    <value>Then choose the video(s) you'd like to encodeService: </value>\r
   </data>\r
   <data name="SourceSelection_ChooseFolder" xml:space="preserve">\r
     <value>Choose Folder to Scan</value>\r
     <value>Check for Updates</value>\r
   </data>\r
   <data name="Options_ClearCompleted" xml:space="preserve">\r
-    <value>Always clear completed queue items after an encode completes</value>\r
+    <value>Always clear completed queue items after an encodeService completes</value>\r
   </data>\r
   <data name="Options_ClearLogs" xml:space="preserve">\r
     <value>Clear Log History</value>\r
   </data>\r
   <data name="Options_CopyLogToDir" xml:space="preserve">\r
-    <value>Put a copy of individual encode logs in a specified location:</value>\r
+    <value>Put a copy of individual encodeService logs in a specified location:</value>\r
   </data>\r
   <data name="Options_CopyLogToEncDir" xml:space="preserve">\r
-    <value>Put a copy of individual encode logs in the same location as the encoded video</value>\r
+    <value>Put a copy of individual encodeService logs in the same location as the encodeServiced video</value>\r
   </data>\r
   <data name="Options_CurVersion" xml:space="preserve">\r
     <value>Current Version</value>\r
index 0fd29950e35ce0167b427608ad2454201c5d6a95..4bb0a0cdaf5be0d7f1fcbfc5931527b6f98ca30f 100644 (file)
@@ -88,6 +88,7 @@ namespace HandBrakeWPF.Startup
             this.windsorContainer.Register(Component.For<ITitleSpecificViewModel>().ImplementedBy<TitleSpecificViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<IQueueSelectionViewModel>().ImplementedBy<QueueSelectionViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
             this.windsorContainer.Register(Component.For<ICountdownAlertViewModel>().ImplementedBy<CountdownAlertViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
+            this.windsorContainer.Register(Component.For<IMiniViewModel>().ImplementedBy<MiniViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
                  \r
             // Experimental Services and Windows.\r
             this.windsorContainer.Register(Component.For<IStaticPreviewViewModel>().ImplementedBy<StaticPreviewViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMiniViewModel.cs
new file mode 100644 (file)
index 0000000..dbc3d82
--- /dev/null
@@ -0,0 +1,22 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="IMiniViewModel.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
+//   The IMiniViewModel interface.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.ViewModels.Interfaces\r
+{\r
+    /// <summary>\r
+    /// The IMiniViewModel interface.\r
+    /// </summary>\r
+    public interface IMiniViewModel\r
+    {\r
+        /// <summary>\r
+        /// The activate.\r
+        /// </summary>\r
+        void Activate();\r
+    }\r
+}
\ 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 (file)
index 0000000..a532a99
--- /dev/null
@@ -0,0 +1,208 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="MiniViewModel.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
+//   The mini view model.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.ViewModels\r
+{\r
+    using System;\r
+\r
+    using HandBrake.ApplicationServices.Services.Encode.EventArgs;\r
+    using HandBrake.ApplicationServices.Services.Encode.Interfaces;\r
+\r
+    using HandBrakeWPF.EventArgs;\r
+    using HandBrakeWPF.Properties;\r
+    using HandBrakeWPF.Services.Queue.Interfaces;\r
+    using HandBrakeWPF.ViewModels.Interfaces;\r
+\r
+    /// <summary>\r
+    /// The mini view model.\r
+    /// </summary>\r
+    public class MiniViewModel : ViewModelBase, IMiniViewModel\r
+    {\r
+        private readonly IEncode encodeService;\r
+        private readonly IQueueProcessor queueProcessor;\r
+        private string queueStatus;\r
+        private string progress;\r
+        private string task;\r
+        private string windowTitle;\r
+\r
+        /// <summary>\r
+        /// Initializes a new instance of the <see cref="MiniViewModel"/> class.\r
+        /// </summary>\r
+        /// <param name="encodeService">\r
+        /// The encode Service.\r
+        /// </param>\r
+        /// <param name="queueProcessor">\r
+        /// The queue Processor.\r
+        /// </param>\r
+        public MiniViewModel(IEncode encodeService, IQueueProcessor queueProcessor)\r
+        {\r
+            this.encodeService = encodeService;\r
+            this.queueProcessor = queueProcessor;\r
+\r
+            this.Task = "Ready";\r
+            this.Progress = string.Empty;\r
+            this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the task.\r
+        /// </summary>\r
+        public string Task\r
+        {\r
+            get\r
+            {\r
+                return this.task;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.task)\r
+                {\r
+                    return;\r
+                }\r
+                this.task = value;\r
+                this.NotifyOfPropertyChange(() => this.Task);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the progress.\r
+        /// </summary>\r
+        public string Progress\r
+        {\r
+            get\r
+            {\r
+                return this.progress;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.progress)\r
+                {\r
+                    return;\r
+                }\r
+                this.progress = value;\r
+                this.NotifyOfPropertyChange(() => this.Progress);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the queue status.\r
+        /// </summary>\r
+        public string QueueStatus\r
+        {\r
+            get\r
+            {\r
+                return this.queueStatus;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.queueStatus)\r
+                {\r
+                    return;\r
+                }\r
+                this.queueStatus = value;\r
+                this.NotifyOfPropertyChange(() => this.QueueStatus);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets or sets the window title.\r
+        /// </summary>\r
+        public string WindowTitle\r
+        {\r
+            get\r
+            {\r
+                return this.windowTitle;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.windowTitle)\r
+                {\r
+                    return;\r
+                }\r
+                this.windowTitle = value;\r
+                this.NotifyOfPropertyChange(() => this.WindowTitle);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// The activate.\r
+        /// </summary>\r
+        public void Activate()\r
+        {\r
+            this.encodeService.EncodeStatusChanged += EncodeService_EncodeStatusChanged;\r
+            this.queueProcessor.QueueChanged += QueueProcessor_QueueChanged;\r
+            this.queueProcessor.QueueCompleted += QueueProcessor_QueueCompleted;\r
+            this.WindowTitle = "Mini Status Display";\r
+        }\r
+\r
+        /// <summary>\r
+        /// The tear down.\r
+        /// </summary>\r
+        public void Close()\r
+        {\r
+            this.encodeService.EncodeStatusChanged -= EncodeService_EncodeStatusChanged;\r
+            this.queueProcessor.QueueChanged -= QueueProcessor_QueueChanged;\r
+            this.queueProcessor.QueueCompleted -= QueueProcessor_QueueCompleted;\r
+            this.TryClose();\r
+        }\r
+\r
+        /// <summary>\r
+        /// The queue processor_ queue completed.\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        private void QueueProcessor_QueueCompleted(object sender, QueueCompletedEventArgs e)\r
+        {\r
+            this.Task = "Not Encoding.";\r
+            this.Progress = string.Empty;\r
+            this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);\r
+        }\r
+\r
+        /// <summary>\r
+        /// The queue processor_ queue changed.\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        private void QueueProcessor_QueueChanged(object sender, EventArgs e)\r
+        {\r
+            this.QueueStatus = string.Format("{0} jobs pending", this.queueProcessor.Count);\r
+        }\r
+\r
+        /// <summary>\r
+        /// The encode service_ encode status changed.\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        private void EncodeService_EncodeStatusChanged(object sender, EncodeProgressEventArgs e)\r
+        {\r
+            this.Task = queueProcessor.LastProcessedJob.ScannedSourcePath;\r
+\r
+            // {0:00.00}%   FPS: {1:000.0}   Avg FPS: {2:000.0}   Time Remaining: {3}   Elapsed: {4:hh\:mm\:ss}\r
+            this.Progress = string.Format(\r
+                Resources.MainViewModel_EncodeStatusChanged_StatusLabel, \r
+                e.PercentComplete, \r
+                e.CurrentFrameRate, \r
+                e.AverageFrameRate, \r
+                e.EstimatedTimeLeft, \r
+                e.ElapsedTime);\r
+        }\r
+    }\r
+}\r
diff --git a/win/CS/HandBrakeWPF/Views/MiniView.xaml b/win/CS/HandBrakeWPF/Views/MiniView.xaml
new file mode 100644 (file)
index 0000000..4069d3f
--- /dev/null
@@ -0,0 +1,34 @@
+<Window x:Class="HandBrakeWPF.Views.MiniView"\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
+        AllowDrop="True"\r
+        SnapsToDevicePixels="True"\r
+        UseLayoutRounding="True"\r
+        Width="300"\r
+        Height="165"\r
+        MinWidth="300"\r
+        MinHeight="165"\r
+        TextOptions.TextFormattingMode="Display" ShowActivated="True" ShowInTaskbar="True"\r
+        WindowStyle="ToolWindow"\r
+        x:Name="miniView"\r
+        Title="{Binding Path=WindowTitle}"\r
+        >\r
+    \r
+    <Grid Margin="5,0,5,0">\r
+        <Grid.RowDefinitions>\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+        </Grid.RowDefinitions>\r
+        <TextBlock Text="Status" FontSize="26" FontFamily="Segoe UI Light" FontWeight="Bold" Margin="5,0,10,5" Grid.Row="0" />\r
+        \r
+        <TextBlock Text="{Binding Task}" Grid.Row="1" Margin="10,0,0,5" TextWrapping="WrapWithOverflow" />\r
+        <TextBlock Text="{Binding Progress}" Grid.Row="2" Margin="10,0,0,5" TextWrapping="WrapWithOverflow" />\r
+        <TextBlock Text="{Binding QueueStatus}" Grid.Row="3" Margin="10,0,0,0" TextWrapping="WrapWithOverflow" />\r
+\r
+        <Button Content="Close" cal:Message.Attach="[Event Click] = [Action Close]" Grid.Row="3" HorizontalAlignment="Right" Margin="0,5,5,0" Padding="8,2" />\r
+    </Grid>\r
+</Window>\r
index fc5a141b93aeee4fd5ec7614e35e37c2d0cca67e..4071eeb3c517f345f6a5103e5bbf3ea27bd67fdc 100644 (file)
@@ -50,7 +50,7 @@ namespace HandBrakeWPF.Views
             if (minimiseToTray)\r
             {\r
                 this.notifyIcon = new NotifyIcon();\r
-                this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick) });\r
+                this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick), new MenuItem("Mini Status Display", ShowMiniStatusDisplay) });\r
 \r
                 StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/handbrakepineapple.ico"));\r
                 if (streamResourceInfo != null)\r
@@ -80,6 +80,27 @@ namespace HandBrakeWPF.Views
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// The show mini status display.\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        private void ShowMiniStatusDisplay(object sender, EventArgs e)\r
+        {\r
+            IMiniViewModel titleSpecificView = IoC.Get<IMiniViewModel>();\r
+            IWindowManager windowManager = IoC.Get<IWindowManager>();\r
+            Execute.OnUIThread(\r
+                () =>\r
+                {\r
+                    titleSpecificView.Activate();\r
+                    windowManager.ShowWindow(titleSpecificView);\r
+                });\r
+        }\r
+\r
         /// <summary>\r
         /// The notify icon_ click.\r
         /// </summary>\r