From 945fd1db463b988714299ead31dfc5cf1104ec66 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 17 Aug 2016 14:37:00 +0200 Subject: [PATCH] Added missing files from pull-request and updated the readme.txt --- .../additional_files/readme.txt.template | 1 + .../releases/innosetup/setup.iss.template | 7 ++++- .../Forms/JiraForm.Designer.cs | 6 ++--- GreenshotJiraPlugin/Forms/JiraForm.cs | 26 +++++-------------- .../GreenshotJiraPlugin.csproj | 23 ++++++++++------ GreenshotJiraPlugin/JiraPlugin.cs | 12 +++------ GreenshotJiraPlugin/packages.config | 4 +-- 7 files changed, 38 insertions(+), 41 deletions(-) diff --git a/Greenshot/releases/additional_files/readme.txt.template b/Greenshot/releases/additional_files/readme.txt.template index 7d6b75922..641f96dc2 100644 --- a/Greenshot/releases/additional_files/readme.txt.template +++ b/Greenshot/releases/additional_files/readme.txt.template @@ -16,6 +16,7 @@ Fixed: * BUG-1887: hang on exit - hang time proportional to number of objects * BUG-1890: Slight cropping around window on Windows 10 * BUG-1892: Greenshot saves blank JPG file with reduce colors +* BUG-1896: Greenshot doesn't support the new Jira API, SOAP is deprecated. * BUG-1898: Specify GPLv3 in the license text * BUG-1910: Error occurs after adding 10+ text boxes with arrows * BUG-1918: Speechbubble issue: Artifacts appeared when shadow is on and transparency is used diff --git a/Greenshot/releases/innosetup/setup.iss.template b/Greenshot/releases/innosetup/setup.iss.template index 398410fbf..79d79d3b1 100644 --- a/Greenshot/releases/innosetup/setup.iss.template +++ b/Greenshot/releases/innosetup/setup.iss.template @@ -348,7 +348,7 @@ Name: "custom"; Description: "{code:CustomInstall}"; Flags: iscustom Name: "greenshot"; Description: "Greenshot"; Types: default full compact custom; Flags: fixed Name: "plugins\office"; Description: {cm:office}; Types: default full custom; Flags: disablenouninstallwarning Name: "plugins\ocr"; Description: {cm:ocr}; Types: default full custom; Flags: disablenouninstallwarning -Name: "plugins\jira"; Description: {cm:jira}; Types: full custom; Flags: disablenouninstallwarning +Name: "plugins\jira"; Description: {cm:jira}; Types: full custom; Flags: disablenouninstallwarning Check: hasDotNet45OrHigher() Name: "plugins\imgur"; Description: {cm:imgur}; Types: default full custom; Flags: disablenouninstallwarning Name: "plugins\confluence"; Description: {cm:confluence}; Types: full custom; Flags: disablenouninstallwarning; Check: hasDotNet35FullOrHigher() Name: "plugins\externalcommand"; Description: {cm:externalcommand}; Types: default full custom; Flags: disablenouninstallwarning @@ -582,6 +582,11 @@ begin Result := netfxinstalled(NetFX35, '') or netfxinstalled(NetFX40Full, ''); end; +function hasDotNet45OrHigher() : boolean; +begin + Result := netfxinstalled(NetFX4x, ''); +end; + function getNGENPath(argument: String) : String; var installPath: string; diff --git a/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs b/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs index 18cc71047..65fe4ab92 100644 --- a/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs +++ b/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs @@ -67,7 +67,7 @@ namespace GreenshotJiraPlugin.Forms { this.jiraFilterBox.Name = "jiraFilterBox"; this.jiraFilterBox.Size = new System.Drawing.Size(604, 21); this.jiraFilterBox.TabIndex = 5; - this.jiraFilterBox.SelectedIndexChanged += new System.EventHandler(this.jiraFilterBox_SelectedIndexChanged); + this.jiraFilterBox.SelectedIndexChanged += new System.EventHandler(this.JiraFilterBox_SelectedIndexChanged); // // label_jirafilter // @@ -112,8 +112,8 @@ namespace GreenshotJiraPlugin.Forms { this.jiraListView.TabIndex = 4; this.jiraListView.UseCompatibleStateImageBehavior = false; this.jiraListView.View = System.Windows.Forms.View.Details; - this.jiraListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.jiraListView_ColumnClick); - this.jiraListView.SelectedIndexChanged += new System.EventHandler(this.jiraListView_SelectedIndexChanged); + this.jiraListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.JiraListView_ColumnClick); + this.jiraListView.SelectedIndexChanged += new System.EventHandler(this.JiraListView_SelectedIndexChanged); // // jiraFilenameBox // diff --git a/GreenshotJiraPlugin/Forms/JiraForm.cs b/GreenshotJiraPlugin/Forms/JiraForm.cs index 56cf7a3e9..3b5b458e2 100644 --- a/GreenshotJiraPlugin/Forms/JiraForm.cs +++ b/GreenshotJiraPlugin/Forms/JiraForm.cs @@ -29,6 +29,7 @@ using GreenshotPlugin.Core; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Dapplo.Jira; namespace GreenshotJiraPlugin.Forms { public partial class JiraForm : Form { @@ -111,10 +112,6 @@ namespace GreenshotJiraPlugin.Forms { jiraFilenameBox.Text = filename; } - public void SetComment(string comment) { - jiraCommentBox.Text = comment; - } - public Issue GetJiraIssue() { return _selectedIssue; } @@ -133,13 +130,7 @@ namespace GreenshotJiraPlugin.Forms { } } - private void selectJiraToolStripMenuItem_Click(object sender, EventArgs e) { - ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; - _selectedIssue = (Issue)clickedItem.Tag; - jiraKey.Text = _selectedIssue.Key; - } - - private async void jiraFilterBox_SelectedIndexChanged(object sender, EventArgs e) { + private async void JiraFilterBox_SelectedIndexChanged(object sender, EventArgs e) { if (_jiraConnector.IsLoggedIn) { uploadButton.Enabled = false; @@ -150,7 +141,8 @@ namespace GreenshotJiraPlugin.Forms { IList issues = null; try { - var searchResult = await _jiraConnector.SearchAsync(filter.Jql); + JiraConfig.ExpandSearch = new[] { "*all" }; + var searchResult = await _jiraConnector.SearchAsync(filter.Jql, fields: new [] { "summary,reporter,assignee,created"}); issues = searchResult.Issues; } catch (Exception ex) @@ -187,7 +179,7 @@ namespace GreenshotJiraPlugin.Forms { } } - private void jiraListView_SelectedIndexChanged(object sender, EventArgs e) { + private void JiraListView_SelectedIndexChanged(object sender, EventArgs e) { if (jiraListView.SelectedItems.Count > 0) { _selectedIssue = (Issue)jiraListView.SelectedItems[0].Tag; jiraKey.Text = _selectedIssue.Key; @@ -197,15 +189,11 @@ namespace GreenshotJiraPlugin.Forms { } } - private void jiraListView_ColumnClick(object sender, ColumnClickEventArgs e) { + private void JiraListView_ColumnClick(object sender, ColumnClickEventArgs e) { // Determine if clicked column is already the column that is being sorted. if (e.Column == _columnSorter.SortColumn) { // Reverse the current sort direction for this column. - if (_columnSorter.Order == SortOrder.Ascending) { - _columnSorter.Order = SortOrder.Descending; - } else { - _columnSorter.Order = SortOrder.Ascending; - } + _columnSorter.Order = _columnSorter.Order == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending; } else { // Set the column number that is to be sorted; default to ascending. _columnSorter.SortColumn = e.Column; diff --git a/GreenshotJiraPlugin/GreenshotJiraPlugin.csproj b/GreenshotJiraPlugin/GreenshotJiraPlugin.csproj index d70a3c9c4..2a8352d14 100644 --- a/GreenshotJiraPlugin/GreenshotJiraPlugin.csproj +++ b/GreenshotJiraPlugin/GreenshotJiraPlugin.csproj @@ -34,8 +34,8 @@ - - ..\packages\Dapplo.HttpExtensions.0.5.30\lib\net45\Dapplo.HttpExtensions.dll + + ..\packages\Dapplo.HttpExtensions.0.5.31\lib\net45\Dapplo.HttpExtensions.dll True @@ -46,10 +46,6 @@ ..\packages\Dapplo.Log.Facade.0.5.4\lib\net45\Dapplo.Log.Facade.dll True - - ..\packages\Dapplo.Utils.0.1.113\lib\net45\Dapplo.Utils.dll - True - ..\Greenshot\Lib\log4net.dll @@ -81,6 +77,7 @@ + Always @@ -108,9 +105,19 @@ mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)" +"$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" +del /q /s "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)"\* + +if "$(ConfigurationName)" == "Release" ( + ..\..\..\packages\LibZ.Tool.1.2.0.0\tools\libz.exe inject-dll --assembly $(ProjectDir)bin\$(Configuration)\$(TargetFileName) --include $(ProjectDir)bin\$(Configuration)\dapplo*.dll --move +) copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" -copy "$(ProjectDir)bin\$(Configuration)\Dapplo.*" "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\" -copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\" + +if "$(ConfigurationName)" == "Debug" ( + copy "$(ProjectDir)bin\$(Configuration)\Dapplo.*" "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\" + copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)Greenshot\bin\$(Configuration)\Plugins\$(ProjectName)\" +) + mkdir "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\Plugins\$(ProjectName)" copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" diff --git a/GreenshotJiraPlugin/JiraPlugin.cs b/GreenshotJiraPlugin/JiraPlugin.cs index 3f2cdc969..af210db7b 100644 --- a/GreenshotJiraPlugin/JiraPlugin.cs +++ b/GreenshotJiraPlugin/JiraPlugin.cs @@ -24,6 +24,8 @@ using Greenshot.IniFile; using Greenshot.Plugin; using System; using System.Threading.Tasks; +using Dapplo.HttpExtensions.ContentConverter; +using Dapplo.Log.Facade; using GreenshotJiraPlugin.Forms; namespace GreenshotJiraPlugin { @@ -67,14 +69,7 @@ namespace GreenshotJiraPlugin { //Needed for a fail-fast public JiraConnector CurrentJiraConnector => _jiraConnector; - public JiraConnector JiraConnector { - get { - if (_jiraConnector == null) { - _jiraConnector = new JiraConnector(); - } - return _jiraConnector; - } - } + public JiraConnector JiraConnector => _jiraConnector ?? (_jiraConnector = new JiraConnector()); /// /// Implementation of the IGreenshotPlugin.Initialize @@ -85,6 +80,7 @@ namespace GreenshotJiraPlugin { public bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { // Register configuration (don't need the configuration itself) _config = IniConfig.GetIniSection(); + LogSettings.RegisterDefaultLogger(); return true; } diff --git a/GreenshotJiraPlugin/packages.config b/GreenshotJiraPlugin/packages.config index 9baf9d660..3a2206f53 100644 --- a/GreenshotJiraPlugin/packages.config +++ b/GreenshotJiraPlugin/packages.config @@ -1,7 +1,7 @@  - + - + \ No newline at end of file