<Compile Include="Services\Encode\Model\Models\Video\VideoPreset.cs" />\r
<Compile Include="Services\Encode\Model\Models\Video\VideoProfile.cs" />\r
<Compile Include="Services\Encode\Model\Models\Video\VideoTune.cs" />\r
+ <Compile Include="Services\Interfaces\INotifyIconService.cs" />\r
<Compile Include="Services\Presets\Factories\JsonPresetFactory.cs" />\r
<Compile Include="Services\Presets\Interfaces\IPresetObject.cs" />\r
<Compile Include="Services\Presets\Model\PresetDisplayCategory.cs" />\r
<Compile Include="Services\Scan\Model\Source.cs" />\r
<Compile Include="Services\Scan\Model\Subtitle.cs" />\r
<Compile Include="Services\Scan\Model\Title.cs" />\r
+ <Compile Include="Services\NotifyIconService.cs" />\r
<Compile Include="Services\UserSettingService.cs" />\r
<Compile Include="Startup\StartupOptions.cs" />\r
<Compile Include="Utilities\AppcastReader.cs" />\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to {1}%, Pass {2} of {3}\r
+ ///Remaining Time: {4}.\r
+ /// </summary>\r
+ public static string TaskTrayStatusTitle {\r
+ get {\r
+ return ResourceManager.GetString("TaskTrayStatusTitle", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Unknown Error.\r
/// </summary>\r
return ResourceManager.GetString("Warning", resourceCulture);\r
}\r
}\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to {0} - ({1}%, Pass {2} of {3}).\r
+ /// </summary>\r
+ public static string WindowTitleStatus {\r
+ get {\r
+ return ResourceManager.GetString("WindowTitleStatus", resourceCulture);\r
+ }\r
+ }\r
}\r
}\r
<data name="NoAdditionalInformation" xml:space="preserve">\r
<value>No Additional Information</value>\r
</data>\r
+ <data name="WindowTitleStatus" xml:space="preserve">\r
+ <value>{0} - ({1}%, Pass {2} of {3})</value>\r
+ </data>\r
+ <data name="TaskTrayStatusTitle" xml:space="preserve">\r
+ <value>{1}%, Pass {2} of {3}\r
+Remaining Time: {4}</value>\r
+ </data>\r
</root>
\ No newline at end of file
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Show the encode status in the application title bar..\r
+ /// </summary>\r
+ public static string OptionsView_ShowStatusInTitleBar {\r
+ get {\r
+ return ResourceManager.GetString("OptionsView_ShowStatusInTitleBar", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Anamorphic:.\r
/// </summary>\r
<data name="Options_LowDiskspaceSize" xml:space="preserve">\r
<value>Low diskspace warning level (GB):</value>\r
</data>\r
+ <data name="OptionsView_ShowStatusInTitleBar" xml:space="preserve">\r
+ <value>Show the encode status in the application title bar.</value>\r
+ </data>\r
</root>
\ No newline at end of file
--- /dev/null
+// <copyright file="INotifyIconService.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>
+
+namespace HandBrakeWPF.Services.Interfaces
+{
+ using System.Windows.Forms;
+
+ public interface INotifyIconService
+ {
+ void RegisterNotifyIcon(NotifyIcon ni);
+
+ void SetTooltip(string text);
+ }
+}
\ No newline at end of file
--- /dev/null
+// <copyright file="NotifyIconService.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>
+
+namespace HandBrakeWPF.Services
+{
+ using System.Windows.Forms;
+
+ using HandBrakeWPF.Services.Interfaces;
+
+ public class NotifyIconService : INotifyIconService
+ {
+ private NotifyIcon notifyIcon;
+
+ public void RegisterNotifyIcon(NotifyIcon ni)
+ {
+ this.notifyIcon = ni;
+ }
+
+ public void SetTooltip(string text)
+ {
+ this.notifyIcon.Text = text;
+ }
+ }
+}
\r
// Shell\r
this.container.Singleton<IShellViewModel, ShellViewModel>();\r
+ this.container.Singleton<INotifyIconService, NotifyIconService>();\r
\r
base.Configure();\r
}\r
/// </summary>\r
public const string PresetExpandedStateList = "PresetExpandedStateList";\r
\r
+ /// <summary>\r
+ /// Setting to turn on/off the ability to show status in the title bar.\r
+ /// </summary>\r
+ public const string ShowStatusInTitleBar = "ShowStatusInTitleBar";\r
+\r
#endregion\r
}\r
}
\ No newline at end of file
private readonly IErrorService errorService;\r
private readonly IUpdateService updateService;\r
private readonly IWindowManager windowManager;\r
+ private readonly INotifyIconService notifyIconService;\r
private readonly IUserSettingService userSettingService;\r
private readonly IScan scanService;\r
private readonly IEncode encodeService;\r
/// <param name="metaDataViewModel">\r
/// The Meta Data View Model\r
/// </param>\r
+ /// <param name="notifyIconService">Wrapper around the WinForms NotifyIcon for this app. </param>\r
public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService, \r
IErrorService errorService, IUpdateService updateService, \r
IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, \r
IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,\r
IX264ViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,\r
- IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel)\r
+ IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel, INotifyIconService notifyIconService)\r
{\r
this.scanService = scanService;\r
this.encodeService = encodeService;\r
this.errorService = errorService;\r
this.updateService = updateService;\r
this.windowManager = windowManager;\r
+ this.notifyIconService = notifyIconService;\r
this.QueueViewModel = queueViewModel;\r
this.userSettingService = userSettingService;\r
this.queueProcessor = IoC.Get<IQueueProcessor>();\r
if (!Equals(this.windowName, value))\r
{\r
this.windowName = value;\r
+ this.NotifyOfPropertyChange(() => this.WindowTitle);\r
}\r
}\r
}\r
lastEncodePercentage = percent;\r
this.ProgressPercentage = percent;\r
this.NotifyOfPropertyChange(() => ProgressPercentage);\r
+\r
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowStatusInTitleBar))\r
+ {\r
+ this.WindowTitle = string.Format(Resources.WindowTitleStatus, Resources.HandBrake_Title, this.ProgressPercentage, e.Task, e.TaskCount);\r
+ this.notifyIconService.SetTooltip(string.Format(Resources.TaskTrayStatusTitle, Resources.HandBrake_Title, this.ProgressPercentage, e.Task, e.TaskCount, e.EstimatedTimeLeft));\r
+ }\r
}\r
else\r
{\r
this.ProgramStatusLabel = Resources.Main_QueueFinished;\r
this.IsEncoding = false;\r
+ this.WindowTitle = Resources.HandBrake_Title;\r
+ this.notifyIconService.SetTooltip(this.WindowTitle);\r
\r
if (this.windowsSeven.IsWindowsSeven)\r
{\r
private bool showQueueInline;\r
private bool pauseOnLowDiskspace;\r
private long pauseOnLowDiskspaceLevel;\r
- private bool useQsvDecodeForNonQsvEnc; \r
+ private bool useQsvDecodeForNonQsvEnc;\r
+\r
+ private bool showStatusInTitleBar;\r
\r
#endregion\r
\r
}\r
}\r
\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether to show encode status in the tile bar.\r
+ /// </summary>\r
+ public bool ShowStatusInTitleBar\r
+ {\r
+ get\r
+ {\r
+ return this.showStatusInTitleBar;\r
+ }\r
+ set\r
+ {\r
+ if (value == this.showStatusInTitleBar) return;\r
+ this.showStatusInTitleBar = value;\r
+ this.NotifyOfPropertyChange(() => this.ShowStatusInTitleBar);\r
+ }\r
+ }\r
+ \r
#endregion\r
\r
#region Output Files\r
this.Arguments = this.userSettingService.GetUserSetting<string>(UserSettingConstants.SendFileToArgs) ?? string.Empty;\r
this.ResetWhenDoneAction = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ResetWhenDoneAction);\r
this.ShowQueueInline = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowQueueInline);\r
+ this.ShowStatusInTitleBar = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowStatusInTitleBar);\r
\r
// #############################\r
// Output Settings\r
this.userSettingService.SetUserSetting(UserSettingConstants.SendFileToArgs, this.Arguments);\r
this.userSettingService.SetUserSetting(UserSettingConstants.ResetWhenDoneAction, this.ResetWhenDoneAction);\r
this.userSettingService.SetUserSetting(UserSettingConstants.ShowQueueInline, this.ShowQueueInline);\r
+ this.userSettingService.SetUserSetting(UserSettingConstants.ShowStatusInTitleBar, this.ShowStatusInTitleBar);\r
\r
/* Output Files */\r
this.userSettingService.SetUserSetting(UserSettingConstants.AutoNaming, this.AutomaticallyNameFiles);\r
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_ClearCompleted}" IsChecked="{Binding ClearQueueOnEncodeCompleted}" />\r
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_AdvancedTab}" IsChecked="{Binding ShowAdvancedTab}" />\r
<CheckBox Content="{x:Static Properties:ResourcesUI.Options_ShowQueueInline}" IsChecked="{Binding ShowQueueInline}" />\r
+ <CheckBox Content="{x:Static Properties:ResourcesUI.OptionsView_ShowStatusInTitleBar}" IsChecked="{Binding ShowStatusInTitleBar}" />\r
</StackPanel>\r
</StackPanel>\r
</StackPanel>\r
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"\r
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"\r
xmlns:cal="http://www.caliburnproject.org"\r
- Title="{Data:Binding Path=WindowTitle}"\r
+ Title="{Data:Binding Path=MainViewModel.WindowTitle}"\r
Width="1015"\r
Height="675"\r
MinWidth="750"\r
{\r
this.InitializeComponent();\r
\r
+\r
+\r
IUserSettingService userSettingService = IoC.Get<IUserSettingService>();\r
bool minimiseToTray = userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);\r
\r
if (minimiseToTray)\r
{\r
+\r
+ INotifyIconService notifyIconService = IoC.Get<INotifyIconService>();\r
this.notifyIcon = new NotifyIcon();\r
this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick), new MenuItem("Mini Status Display", ShowMiniStatusDisplay) });\r
+ notifyIconService.RegisterNotifyIcon(this.notifyIcon);\r
\r
StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/handbrakepineapple.ico"));\r
if (streamResourceInfo != null)\r
if (this.WindowState == WindowState.Minimized)\r
{\r
this.ShowInTaskbar = false;\r
- notifyIcon.Visible = true;\r
-\r
- // notifyIcon.ShowBalloonTip(5000, "HandBrake", "Application Minimised", ToolTipIcon.Info); \r
+ notifyIcon.Visible = true; \r
}\r
else if (this.WindowState == WindowState.Normal)\r
{\r
<value>\r
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
</value>\r
- </item> \r
+ </item>\r
+ <item>\r
+ <key>\r
+ <string>ShowStatusInTitleBar</string>\r
+ </key>\r
+ <value>\r
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+ </value>\r
+ </item>\r
</dictionary>
\ No newline at end of file