diff options
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 9 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/GrowlCommunicator.cs | 124 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/NotificationService.cs | 13 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/OptionsView.xaml | 2 |
4 files changed, 5 insertions, 143 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index b3c73822b..6fd1bf6f9 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -88,14 +88,6 @@ <Reference Include="GongSolutions.Wpf.DragDrop">
<HintPath>..\libraries\WPFDragDrop\GongSolutions.Wpf.DragDrop.dll</HintPath>
</Reference>
- <Reference Include="Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\libraries\Growl.Connector.dll</HintPath>
- </Reference>
- <Reference Include="Growl.CoreLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=13e59d82e007b064, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\libraries\Growl.CoreLibrary.dll</HintPath>
- </Reference>
<Reference Include="LumenWorks.Framework.IO">
<HintPath>..\libraries\CsvReader\LumenWorks.Framework.IO.dll</HintPath>
</Reference>
@@ -180,7 +172,6 @@ <Compile Include="Converters\Video\VideoEncoderConverter.cs" />
<Compile Include="Converters\Video\EncoderOptionsTooltipConverter.cs" />
<Compile Include="Helpers\GrayscaleImage.cs" />
- <Compile Include="Helpers\GrowlCommunicator.cs" />
<Compile Include="Helpers\AppStyleHelper.cs" />
<Compile Include="Helpers\PictureSize.cs" />
<Compile Include="Model\OptionsTab.cs" />
diff --git a/win/CS/HandBrakeWPF/Helpers/GrowlCommunicator.cs b/win/CS/HandBrakeWPF/Helpers/GrowlCommunicator.cs deleted file mode 100644 index cd711b583..000000000 --- a/win/CS/HandBrakeWPF/Helpers/GrowlCommunicator.cs +++ /dev/null @@ -1,124 +0,0 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="GrowlCommunicator.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>
-// Provides all functionality for communicating with Growl for Windows.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Helpers
-{
- using System;
-
- using Growl.Connector;
-
- /// <summary>
- /// Provides all functionality for communicating with Growl for Windows.
- /// </summary>
- /// <remarks>
- /// This class is implemented as a static class because:
- /// 1. It allows nearly all of the Growl-related code to be in one place
- /// 2. It prevents the main form, queue handler, and any other part of Handbrake from having to declare
- /// or track any new instance variables
- /// </remarks>
- public static class GrowlCommunicator
- {
- /// <summary>
- /// The <see cref="GrowlConnector"/> that actually talks to Growl
- /// </summary>
- private static GrowlConnector growl;
-
- /// <summary>
- /// The Handbrake application instance that is registered with Growl
- /// </summary>
- private static Application application;
-
- /// <summary>
- /// Notification shown upon completion of encoding
- /// </summary>
- private static NotificationType encodeOrQueueCompleted = new NotificationType("EncodeOrQueue", "HandBrake Status");
-
- /// <summary>
- /// Checks to see if Growl is currently running on the local machine.
- /// </summary>
- /// <returns>
- /// <c>true</c> if Growl is running;
- /// <c>false</c> otherwise
- /// </returns>
- public static bool IsRunning()
- {
- Initialize();
-
- return GrowlConnector.IsGrowlRunningLocally();
- }
-
- /// <summary>
- /// Registers Handbrake with the local Growl instance
- /// </summary>
- /// <remarks>
- /// This should usually be called at application start-up
- /// </remarks>
- public static void Register()
- {
- Initialize();
- growl.Register(application, new[] {encodeOrQueueCompleted});
- }
-
- /// <summary>
- /// Sends a notification to Growl. (Since Handbrake currently only supports one type of notification with
- /// static text, this is a shortcut method).
- /// </summary>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="text">
- /// The text to display.
- /// </param>
- public static void Notify(string title, string text)
- {
- Notification notification = new Notification(application.Name, encodeOrQueueCompleted.Name, String.Empty,
- title, text);
- growl.Notify(notification);
- }
-
- /// <summary>
- /// Sends a notification to Growl. (This is the more generic version that could be used in the future if
- /// more notification types are implemented)
- /// </summary>
- /// <param name="notificationType">The <see cref="NotificationType">type</see> of notification to send</param>
- /// <param name="title">The notification title</param>
- /// <param name="text">The notification text</param>
- /// <param name="imageUrl">The notification image as a url</param>
- public static void Notify(NotificationType notificationType, string title, string text, string imageUrl)
- {
- Notification notification = new Notification(application.Name, notificationType.Name, String.Empty, title,
- text)
- {
- Icon = imageUrl
- };
-
- growl.Notify(notification);
- }
-
- /// <summary>
- /// Initializes the GrowlCommunicator
- /// </summary>
- private static void Initialize()
- {
- if (growl == null)
- {
- growl = new GrowlConnector
- {
- EncryptionAlgorithm = Cryptography.SymmetricAlgorithmType.PlainText,
- KeyHashAlgorithm = Cryptography.HashAlgorithmType.SHA1
- };
-
- application = new Application("Handbrake")
- {
- Icon = Properties.Resources.logo64
- };
- }
- }
- }
-}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/NotificationService.cs b/win/CS/HandBrakeWPF/Services/NotificationService.cs index 234130b72..306a2f5d2 100644 --- a/win/CS/HandBrakeWPF/Services/NotificationService.cs +++ b/win/CS/HandBrakeWPF/Services/NotificationService.cs @@ -11,7 +11,6 @@ namespace HandBrakeWPF.Services {
using HandBrake.ApplicationServices.Services.Interfaces;
- using HandBrakeWPF.Helpers;
using HandBrakeWPF.Services.Interfaces;
/// <summary>
@@ -39,9 +38,8 @@ namespace HandBrakeWPF.Services public NotificationService(IEncodeServiceWrapper encodeService, IQueueProcessor queueProcessor, IUserSettingService userSettingService)
{
this.userSettingService = userSettingService;
- encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
- queueProcessor.QueueCompleted += this.QueueProcessorQueueCompleted;
- GrowlCommunicator.Register();
+ // encodeService.EncodeCompleted += this.EncodeServiceEncodeCompleted;
+ // queueProcessor.QueueCompleted += this.QueueProcessorQueueCompleted;
}
/// <summary>
@@ -55,10 +53,9 @@ namespace HandBrakeWPF.Services /// </param>
private void QueueProcessorQueueCompleted(object sender, System.EventArgs e)
{
- // Growl
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlQueue))
{
- GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
+ // GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
}
}
@@ -73,11 +70,9 @@ namespace HandBrakeWPF.Services /// </param>
private void EncodeServiceEncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e)
{
- // Growl
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode))
{
- GrowlCommunicator.Notify(
- "Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done.");
+ // GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done.");
}
}
}
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 420615b46..87bdf42c4 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -109,7 +109,7 @@ <CheckBox Content="Reset to 'Do nothing' when the app is re-launched." VerticalAlignment="Center" IsChecked="{Binding ResetWhenDoneAction}" />
</StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
+ <StackPanel Orientation="Horizontal" Margin="0,5,0,0" Visibility="Collapsed">
<CheckBox Content="Growl after Queue Completes" IsChecked="{Binding GrowlAfterEncode}" Margin="0,0,5,0"/>
<CheckBox Content="Growl after Encode Completes" IsChecked="{Binding GrowlAfterQueue}" />
</StackPanel>
|