diff --git a/Greenshot-OCR-Plugin/Properties/AssemblyInfo.cs.template b/Greenshot-OCR-Plugin/Properties/AssemblyInfo.cs.template index 3670fe3b4..e21f04c2d 100644 --- a/Greenshot-OCR-Plugin/Properties/AssemblyInfo.cs.template +++ b/Greenshot-OCR-Plugin/Properties/AssemblyInfo.cs.template @@ -34,7 +34,7 @@ using Greenshot.Plugin; [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("GreenshotOCR")] +[assembly: AssemblyProduct("OCR Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Greenshot/Destinations/PickerDestination.cs b/Greenshot/Destinations/PickerDestination.cs index 5e143bda4..8b6e25050 100644 --- a/Greenshot/Destinations/PickerDestination.cs +++ b/Greenshot/Destinations/PickerDestination.cs @@ -61,7 +61,7 @@ namespace Greenshot.Destinations { public override bool isActive { get { - return conf.isExperimentalFeatureEnabled("Picker"); + return true; } } diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index 7454728a0..ef41c23e7 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -28,6 +28,7 @@ using System.IO; using System.Windows.Forms; using Greenshot.Configuration; +using Greenshot.Destinations; using Greenshot.Drawing; using Greenshot.Drawing.Fields; using Greenshot.Drawing.Fields.Binding; @@ -49,7 +50,7 @@ namespace Greenshot { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImageEditorForm)); private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection(); private static CoreConfiguration coreConf = IniConfig.GetIniSection(); - private static List ignoreDestinations = new List() {"Picker", "Editor"}; + private static List ignoreDestinations = new List() {PickerDestination.DESIGNATION, EditorDestination.DESIGNATION}; private static List editorList = new List(); private ILanguage lang; diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index cf6803b83..c860dacab 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -40,6 +40,7 @@ using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using Greenshot.IniFile; +using Greenshot.Destinations; namespace Greenshot { /// @@ -957,12 +958,12 @@ namespace Greenshot { void QuickSettingDestinationChanged(object sender, EventArgs e) { ToolStripMenuSelectListItem item = ((ItemCheckedChangedEventArgs)e).Item; IDestination selectedDestination = (IDestination)item.Data; - if (item.Checked && selectedDestination.Designation.Equals("Picker")) { + if (item.Checked && selectedDestination.Designation.Equals(PickerDestination.DESIGNATION)) { foreach(ToolStripMenuSelectList ddi in contextmenu_quicksettings.DropDownItems) { if (ddi.Identifier.Equals("destinations")) { foreach(ToolStripMenuSelectListItem dropDownItem in ddi.DropDownItems) { IDestination destination = dropDownItem.Data as IDestination; - if (!destination.Designation.Equals("Picker")) { + if (!destination.Designation.Equals(PickerDestination.DESIGNATION)) { if (dropDownItem.CheckState == CheckState.Checked) { dropDownItem.CheckState = CheckState.Unchecked; } diff --git a/Greenshot/Forms/SettingsForm.cs b/Greenshot/Forms/SettingsForm.cs index 28b36e350..138523348 100644 --- a/Greenshot/Forms/SettingsForm.cs +++ b/Greenshot/Forms/SettingsForm.cs @@ -25,6 +25,7 @@ using System.IO; using System.Windows.Forms; using Greenshot.Configuration; +using Greenshot.Destinations; using Greenshot.Helpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; @@ -133,7 +134,7 @@ namespace Greenshot { listview_plugins.BeginUpdate(); listview_plugins.Items.Clear(); listview_plugins.Columns.Clear(); - string[] columns = { "Name", "Version", "DLL Path"}; + string[] columns = { "Name", "Version", "Created by", "DLL path"}; foreach (string column in columns) { listview_plugins.Columns.Add(column); } @@ -487,17 +488,17 @@ namespace Greenshot { bool clipboardDestinationChecked = false; bool pickerSelected = false; foreach(IDestination destination in checkedDestinationsListBox.CheckedItems) { - if (destination.Designation.Equals("Clipboard")) { + if (destination.Designation.Equals(ClipboardDestination.DESIGNATION)) { clipboardDestinationChecked = true; } - if (destination.Designation.Equals("Picker")) { + if (destination.Designation.Equals(PickerDestination.DESIGNATION)) { pickerSelected = true; } } if (pickerSelected) { foreach(int index in checkedDestinationsListBox.CheckedIndices) { IDestination destination = (IDestination)checkedDestinationsListBox.Items[index]; - if (!destination.Designation.Equals("Picker")) { + if (!destination.Designation.Equals(PickerDestination.DESIGNATION)) { checkedDestinationsListBox.SetItemCheckState(index, CheckState.Indeterminate); } } diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index 2842e07c4..c77184cc7 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -29,6 +29,7 @@ using System.Threading; using System.Windows.Forms; using Greenshot.Configuration; +using Greenshot.Destinations; using Greenshot.Drawing; using Greenshot.Forms; using Greenshot.Helpers; @@ -266,13 +267,13 @@ namespace Greenshot.Helpers { capture = new Capture(fileBitmap); } // Force Editor, keep picker, this is currently the only usefull destination - if (capture.CaptureDetails.HasDestination("Picker")) { + if (capture.CaptureDetails.HasDestination(PickerDestination.DESIGNATION)) { capture.CaptureDetails.ClearDestinations(); - capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(Destinations.EditorDestination.DESIGNATION)); - capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(Destinations.PickerDestination.DESIGNATION)); + capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(EditorDestination.DESIGNATION)); + capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(PickerDestination.DESIGNATION)); } else { capture.CaptureDetails.ClearDestinations(); - capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(Destinations.EditorDestination.DESIGNATION)); + capture.CaptureDetails.AddDestination(DestinationHelper.GetDestination(EditorDestination.DESIGNATION)); } HandleCapture(); } @@ -499,7 +500,7 @@ namespace Greenshot.Helpers { // Flag to detect if we need to create a temp file for the email // or use the file that was written foreach(IDestination destination in captureDetails.CaptureDestinations) { - if ("Picker".Equals(destination.Designation)) { + if (PickerDestination.DESIGNATION.Equals(destination.Designation)) { continue; } LOG.InfoFormat("Calling destination {0}", destination.Description); diff --git a/Greenshot/Helpers/PluginHelper.cs b/Greenshot/Helpers/PluginHelper.cs index 3a3058495..b97ea0186 100644 --- a/Greenshot/Helpers/PluginHelper.cs +++ b/Greenshot/Helpers/PluginHelper.cs @@ -44,7 +44,7 @@ namespace Greenshot.Helpers { public static string pafPath = Path.Combine(Application.StartupPath, @"App\Greenshot"); public static readonly PluginHelper instance = new PluginHelper(); - private static Dictionary plugins = new Dictionary(); + private static IDictionary plugins = new SortedDictionary(); private PluginHelper() { } @@ -65,6 +65,7 @@ namespace Greenshot.Helpers { foreach(PluginAttribute pluginAttribute in plugins.Keys) { ListViewItem item = new ListViewItem(pluginAttribute.Name); item.SubItems.Add(pluginAttribute.Version); + item.SubItems.Add(pluginAttribute.CreatedBy); item.SubItems.Add(pluginAttribute.DllFile); item.Tag = pluginAttribute; listview.Items.Add(item); @@ -141,7 +142,7 @@ namespace Greenshot.Helpers { get { return mainMenu;} } - public Dictionary Plugins { + public IDictionary Plugins { get {return plugins;} } @@ -238,12 +239,22 @@ namespace Greenshot.Helpers { PluginAttribute[] pluginAttributes = assembly.GetCustomAttributes(typeof(PluginAttribute), false) as PluginAttribute[]; if (pluginAttributes.Length > 0) { PluginAttribute pluginAttribute = pluginAttributes[0]; - - AssemblyProductAttribute[] assemblyProductAttributes = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[]; - if (assemblyProductAttributes.Length > 0) { - pluginAttribute.Name = assemblyProductAttributes[0].Product; - } else { - continue; + + if (string.IsNullOrEmpty(pluginAttribute.Name)) { + AssemblyProductAttribute[] assemblyProductAttributes = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[]; + if (assemblyProductAttributes.Length > 0) { + pluginAttribute.Name = assemblyProductAttributes[0].Product; + } else { + continue; + } + } + if (string.IsNullOrEmpty(pluginAttribute.CreatedBy)) { + AssemblyCompanyAttribute[] assemblyCompanyAttributes = assembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false) as AssemblyCompanyAttribute[]; + if (assemblyCompanyAttributes.Length > 0) { + pluginAttribute.CreatedBy = assemblyCompanyAttributes[0].Company; + } else { + continue; + } } pluginAttribute.Version = assembly.GetName().Version.ToString(); pluginAttribute.DllFile = pluginFile; diff --git a/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template b/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template index d9c9345e6..93376f5e4 100644 --- a/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template @@ -34,7 +34,7 @@ using Greenshot.Plugin; [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("GreenshotConfluencePlugin")] +[assembly: AssemblyProduct("Confluence Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template b/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template index 92c7fff75..caf92e1ca 100644 --- a/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template @@ -33,8 +33,8 @@ using Greenshot.Plugin; [assembly: AssemblyTitle("GreenshotExternalCommandPlugin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GreenshotExternalCommandPlugin")] +[assembly: AssemblyCompany("Greenshot")] +[assembly: AssemblyProduct("External command Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template b/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template index 25fcb95bb..3d69f8f6c 100644 --- a/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template @@ -34,7 +34,7 @@ using Greenshot.Plugin; [assembly: AssemblyDescription("A plugin to upload images to Imgur")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("Greenshot-Imgur-Plugin")] +[assembly: AssemblyProduct("Imgur Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template index 59f0f5749..5391c1313 100644 --- a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template @@ -34,7 +34,7 @@ using Greenshot.Plugin; [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("GreenshotJiraPlugin")] +[assembly: AssemblyProduct("Jira Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template b/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template index 6870a427e..f8dbc4b26 100644 --- a/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template @@ -33,8 +33,8 @@ using Greenshot.Plugin; [assembly: AssemblyTitle("GreenshotNetworkImportPlugin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GreenshotNetworkImportPlugin")] +[assembly: AssemblyCompany("Greenshot")] +[assembly: AssemblyProduct("Network import Plugin")] [assembly: AssemblyCopyright("Copyright (C) 2007-2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs b/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs index f80121bdf..49af370b4 100644 --- a/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs +++ b/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs @@ -29,11 +29,15 @@ using GreenshotPlugin.Core; namespace Greenshot.Plugin { [Serializable] [AttributeUsageAttribute(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)] - sealed public class PluginAttribute : Attribute { + sealed public class PluginAttribute : Attribute, IComparable { public string Name { get; set; } + public string CreatedBy { + get; + set; + } public string Version { get; set; @@ -56,6 +60,14 @@ namespace Greenshot.Plugin { this.EntryType = entryType; this.Configurable = configurable; } + + public int CompareTo(object obj) { + PluginAttribute other = obj as PluginAttribute; + if (other != null) { + return Name.CompareTo(other.Name); + } + throw new ArgumentException("object is not a PluginAttribute"); + } } // Delegates for hooking up events. @@ -118,7 +130,7 @@ namespace Greenshot.Plugin { /// List of available plugins with their PluginAttributes /// This can be usefull for a plugin manager plugin... /// - Dictionary Plugins { + IDictionary Plugins { get; } diff --git a/PluginExample/Properties/AssemblyInfo.cs.template b/PluginExample/Properties/AssemblyInfo.cs.template index 8dea77a44..2595c5c0e 100644 --- a/PluginExample/Properties/AssemblyInfo.cs.template +++ b/PluginExample/Properties/AssemblyInfo.cs.template @@ -33,8 +33,8 @@ using Greenshot.Plugin; [assembly: AssemblyTitle("PluginExample")] [assembly: AssemblyDescription("An example plugin")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PluginExample")] +[assembly: AssemblyCompany("Greenshot")] +[assembly: AssemblyProduct("Example Plugin")] [assembly: AssemblyCopyright("Copyright 2007-2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]