Added a way to disable destinations in the configuration, for now OneNote is disabled by default. (As I am not satisfied with the way it works)

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1830 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-04 08:36:25 +00:00
commit 6e95cf210d
13 changed files with 16 additions and 32 deletions

View file

@ -29,6 +29,7 @@ using System.Reflection;
using Microsoft.Win32;
using Greenshot.Plugin;
using Greenshot.IniFile;
namespace GreenshotPlugin.Core {
/// <summary>
@ -37,6 +38,7 @@ namespace GreenshotPlugin.Core {
public abstract class AbstractDestination : IDestination {
private const string PATH_KEY = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\";
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(AbstractDestination));
private static CoreConfiguration configuration = IniConfig.GetIniSection<CoreConfiguration>();
public static string GetExePath(string exeName) {
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(PATH_KEY + exeName, false)) {
@ -168,6 +170,9 @@ namespace GreenshotPlugin.Core {
public virtual bool isActive {
get {
if (configuration.ExcludeDestinations != null && configuration.ExcludeDestinations.Contains(Designation)) {
return false;
}
return true;
}
}

View file

@ -148,6 +148,8 @@ namespace GreenshotPlugin.Core {
public List<string> IncludePlugins;
[IniProperty("ExcludePlugins", Description="Comma separated list of Plugins which are NOT allowed.")]
public List<string> ExcludePlugins;
[IniProperty("ExcludeDestinations", Description = "Comma separated list of destinations which should be disabled.", DefaultValue = "OneNote")]
public List<string> ExcludeDestinations;
[IniProperty("UpdateCheckInterval", Description="How many days between every update check? (0=no checks)", DefaultValue="1")]
public int UpdateCheckInterval;