Updated the Dapplo.Jira dependency, as this finally was usable without getting a huge list of dependencies with it.

This commit is contained in:
Robin Krom 2020-02-23 20:11:28 +01:00
commit bc2e991a2d
4 changed files with 37 additions and 37 deletions

View file

@ -1,20 +1,20 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -57,12 +57,12 @@ namespace Greenshot {
private Surface _surface; private Surface _surface;
private GreenshotToolStripButton[] _toolbarButtons; private GreenshotToolStripButton[] _toolbarButtons;
private static readonly string[] SupportedClipboardFormats = {typeof(string).FullName, "Text", typeof(IDrawableContainerList).FullName}; private static readonly string[] SupportedClipboardFormats = {typeof(string).FullName, "Text", typeof(IDrawableContainerList).FullName};
private bool _originalBoldCheckState; private bool _originalBoldCheckState;
private bool _originalItalicCheckState; private bool _originalItalicCheckState;
// whether part of the editor controls are disabled depending on selected item(s) // whether part of the editor controls are disabled depending on selected item(s)
private bool _controlsDisabledDueToConfirmable; private bool _controlsDisabledDueToConfirmable;
@ -216,7 +216,7 @@ namespace Greenshot {
panel1.Height = 10; panel1.Height = 10;
fontFamilyComboBox.PropertyChanged += FontPropertyChanged; fontFamilyComboBox.PropertyChanged += FontPropertyChanged;
obfuscateModeButton.DropDownItemClicked += FilterPresetDropDownItemClicked; obfuscateModeButton.DropDownItemClicked += FilterPresetDropDownItemClicked;
highlightModeButton.DropDownItemClicked += FilterPresetDropDownItemClicked; highlightModeButton.DropDownItemClicked += FilterPresetDropDownItemClicked;
@ -224,7 +224,7 @@ namespace Greenshot {
//toolbarDropDownButtons = new ToolStripDropDownButton[]{btnBlur, btnPixeliate, btnTextHighlighter, btnAreaHighlighter, btnMagnifier}; //toolbarDropDownButtons = new ToolStripDropDownButton[]{btnBlur, btnPixeliate, btnTextHighlighter, btnAreaHighlighter, btnMagnifier};
pluginToolStripMenuItem.Visible = pluginToolStripMenuItem.DropDownItems.Count > 0; pluginToolStripMenuItem.Visible = pluginToolStripMenuItem.DropDownItems.Count > 0;
// Workaround: for the MouseWheel event which doesn't get to the panel // Workaround: for the MouseWheel event which doesn't get to the panel
MouseWheel += PanelMouseWheel; MouseWheel += PanelMouseWheel;
@ -264,7 +264,7 @@ namespace Greenshot {
/// </summary> /// </summary>
private void AddDestinations() { private void AddDestinations() {
Invoke((MethodInvoker)delegate { Invoke((MethodInvoker)delegate {
// Create export buttons // Create export buttons
foreach(IDestination destination in DestinationHelper.GetAllDestinations()) { foreach(IDestination destination in DestinationHelper.GetAllDestinations()) {
if (destination.Priority <= 2) { if (destination.Priority <= 2) {
continue; continue;
@ -304,12 +304,12 @@ namespace Greenshot {
defaultItem.Click += delegate { defaultItem.Click += delegate {
toolstripDestination.ExportCapture(true, _surface, _surface.CaptureDetails); toolstripDestination.ExportCapture(true, _surface, _surface.CaptureDetails);
}; };
// The ButtonClick, this is for the icon, gets the current default item // The ButtonClick, this is for the icon, gets the current default item
destinationButton.ButtonClick += delegate { destinationButton.ButtonClick += delegate {
toolstripDestination.ExportCapture(true, _surface, _surface.CaptureDetails); toolstripDestination.ExportCapture(true, _surface, _surface.CaptureDetails);
}; };
// Generate the entries for the drop down // Generate the entries for the drop down
destinationButton.DropDownOpening += delegate destinationButton.DropDownOpening += delegate
{ {
@ -336,7 +336,7 @@ namespace Greenshot {
}; };
destinationsToolStrip.Items.Insert(destinationsToolStrip.Items.IndexOf(toolStripSeparator16), destinationButton); destinationsToolStrip.Items.Insert(destinationsToolStrip.Items.IndexOf(toolStripSeparator16), destinationButton);
} else { } else {
ToolStripButton destinationButton = new ToolStripButton(); ToolStripButton destinationButton = new ToolStripButton();
destinationsToolStrip.Items.Insert(destinationsToolStrip.Items.IndexOf(toolStripSeparator16), destinationButton); destinationsToolStrip.Items.Insert(destinationsToolStrip.Items.IndexOf(toolStripSeparator16), destinationButton);
@ -349,7 +349,7 @@ namespace Greenshot {
}; };
} }
} }
/// <summary> /// <summary>
/// According to some information I found, the clear doesn't work correctly when the shortcutkeys are set? /// According to some information I found, the clear doesn't work correctly when the shortcutkeys are set?
/// This helper method takes care of this. /// This helper method takes care of this.
@ -375,7 +375,7 @@ namespace Greenshot {
if (!destination.IsActive) { if (!destination.IsActive) {
continue; continue;
} }
ToolStripMenuItem item = destination.GetMenuItem(true, null, DestinationToolStripMenuItemClick); ToolStripMenuItem item = destination.GetMenuItem(true, null, DestinationToolStripMenuItemClick);
if (item != null) { if (item != null) {
item.ShortcutKeys = destination.EditorShortcutKeys; item.ShortcutKeys = destination.EditorShortcutKeys;
@ -503,11 +503,11 @@ namespace Greenshot {
/** /**
* Interfaces for plugins, see GreenshotInterface for more details! * Interfaces for plugins, see GreenshotInterface for more details!
*/ */
public Image GetImageForExport() { public Image GetImageForExport() {
return _surface.GetImageForExport(); return _surface.GetImageForExport();
} }
public ICaptureDetails CaptureDetails => _surface.CaptureDetails; public ICaptureDetails CaptureDetails => _surface.CaptureDetails;
public ToolStripMenuItem GetPluginMenuItem() { public ToolStripMenuItem GetPluginMenuItem() {
@ -605,7 +605,7 @@ namespace Greenshot {
UncheckAllToolButtons(); UncheckAllToolButtons();
btn.Checked = true; btn.Checked = true;
} }
private void UncheckAllToolButtons() { private void UncheckAllToolButtons() {
if (_toolbarButtons != null) { if (_toolbarButtons != null) {
foreach (GreenshotToolStripButton butt in _toolbarButtons) { foreach (GreenshotToolStripButton butt in _toolbarButtons) {
@ -776,7 +776,7 @@ namespace Greenshot {
// persist our geometry string. // persist our geometry string.
EditorConfiguration.SetEditorPlacement(new WindowDetails(Handle).WindowPlacement); EditorConfiguration.SetEditorPlacement(new WindowDetails(Handle).WindowPlacement);
IniConfig.Save(); IniConfig.Save();
// remove from the editor list // remove from the editor list
EditorList.Remove(this); EditorList.Remove(this);
@ -958,7 +958,7 @@ namespace Greenshot {
// check dependencies for the Surface // check dependencies for the Surface
bool hasItems = _surface.HasSelectedElements; bool hasItems = _surface.HasSelectedElements;
bool actionAllowedForSelection = hasItems && !_controlsDisabledDueToConfirmable; bool actionAllowedForSelection = hasItems && !_controlsDisabledDueToConfirmable;
// buttons // buttons
btnCut.Enabled = actionAllowedForSelection; btnCut.Enabled = actionAllowedForSelection;
btnCopy.Enabled = actionAllowedForSelection; btnCopy.Enabled = actionAllowedForSelection;
@ -1051,13 +1051,13 @@ namespace Greenshot {
} }
propertiesToolStrip.ResumeLayout(); propertiesToolStrip.ResumeLayout();
} }
private void HideToolstripItems() { private void HideToolstripItems() {
foreach(ToolStripItem toolStripItem in propertiesToolStrip.Items) { foreach(ToolStripItem toolStripItem in propertiesToolStrip.Items) {
toolStripItem.Visible = false; toolStripItem.Visible = false;
} }
} }
/// <summary> /// <summary>
/// refreshes all editor controls depending on selected elements and their fields /// refreshes all editor controls depending on selected elements and their fields
/// </summary> /// </summary>
@ -1095,11 +1095,11 @@ namespace Greenshot {
ToolStripItemEndisabler.Enable(toolsToolStrip); ToolStripItemEndisabler.Enable(toolsToolStrip);
_controlsDisabledDueToConfirmable = false; _controlsDisabledDueToConfirmable = false;
} }
// en/disable controls depending on whether an element is selected at all // en/disable controls depending on whether an element is selected at all
UpdateClipboardSurfaceDependencies(); UpdateClipboardSurfaceDependencies();
UpdateUndoRedoSurfaceDependencies(); UpdateUndoRedoSurfaceDependencies();
// en/disablearrage controls depending on hierarchy of selected elements // en/disablearrage controls depending on hierarchy of selected elements
bool actionAllowedForSelection = _surface.HasSelectedElements && !_controlsDisabledDueToConfirmable; bool actionAllowedForSelection = _surface.HasSelectedElements && !_controlsDisabledDueToConfirmable;
bool push = actionAllowedForSelection && _surface.CanPushSelectionDown(); bool push = actionAllowedForSelection && _surface.CanPushSelectionDown();
@ -1111,7 +1111,7 @@ namespace Greenshot {
downToBottomToolStripMenuItem.Enabled = push; downToBottomToolStripMenuItem.Enabled = push;
downOneLevelToolStripMenuItem.Enabled = push; downOneLevelToolStripMenuItem.Enabled = push;
} }
// finally show/hide field controls depending on the fields of selected elements // finally show/hide field controls depending on the fields of selected elements
RefreshFieldControls(); RefreshFieldControls();
} }
@ -1136,9 +1136,9 @@ namespace Greenshot {
{ {
fontItalicButton.Checked = _originalItalicCheckState; fontItalicButton.Checked = _originalItalicCheckState;
} }
var fontFamily = fontFamilyComboBox.FontFamily; var fontFamily = fontFamilyComboBox.FontFamily;
bool boldAvailable = fontFamily.IsStyleAvailable(FontStyle.Bold); bool boldAvailable = fontFamily.IsStyleAvailable(FontStyle.Bold);
if (fontBoldButton != null) if (fontBoldButton != null)
{ {
@ -1251,7 +1251,7 @@ namespace Greenshot {
_surface.Modified = false; _surface.Modified = false;
} }
} }
protected void FilterPresetDropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { protected void FilterPresetDropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) {
RefreshFieldControls(); RefreshFieldControls();
Invalidate(true); Invalidate(true);
@ -1275,7 +1275,7 @@ namespace Greenshot {
private void Insert_window_toolstripmenuitemMouseEnter(object sender, EventArgs e) { private void Insert_window_toolstripmenuitemMouseEnter(object sender, EventArgs e) {
ToolStripMenuItem captureWindowMenuItem = (ToolStripMenuItem)sender; ToolStripMenuItem captureWindowMenuItem = (ToolStripMenuItem)sender;
var mainForm = SimpleServiceProvider.Current.GetInstance<MainForm>(); var mainForm = SimpleServiceProvider.Current.GetInstance<MainForm>();
mainForm.AddCaptureWindowMenuItems(captureWindowMenuItem, Contextmenu_window_Click); mainForm.AddCaptureWindowMenuItems(captureWindowMenuItem, Contextmenu_window_Click);
} }
private void Contextmenu_window_Click(object sender, EventArgs e) { private void Contextmenu_window_Click(object sender, EventArgs e) {
@ -1366,7 +1366,7 @@ namespace Greenshot {
default: default:
return; return;
} }
if (apply) if (apply)
{ {
_surface.ApplyBitmapEffect(dropShadowEffect); _surface.ApplyBitmapEffect(dropShadowEffect);

View file

@ -1,20 +1,20 @@
/* /*
* Greenshot - a free and open source screenshot tool * Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
* *
* For more information see: http://getgreenshot.org/ * For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or * the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -33,7 +33,7 @@ namespace GreenshotFlickrPlugin {
/// <summary> /// <summary>
/// Description of FlickrUtils. /// Description of FlickrUtils.
/// </summary> /// </summary>
public class FlickrUtils { public static class FlickrUtils {
private static readonly ILog LOG = LogManager.GetLogger(typeof(FlickrUtils)); private static readonly ILog LOG = LogManager.GetLogger(typeof(FlickrUtils));
private static readonly FlickrConfiguration config = IniConfig.GetIniSection<FlickrConfiguration>(); private static readonly FlickrConfiguration config = IniConfig.GetIniSection<FlickrConfiguration>();
private const string FLICKR_API_BASE_URL = "https://api.flickr.com/services/"; private const string FLICKR_API_BASE_URL = "https://api.flickr.com/services/";

View file

@ -12,6 +12,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" /> <ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" />
<PackageReference Include="Dapplo.Jira" version="0.6.50" /> <PackageReference Include="Dapplo.Jira" version="0.9.19" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -38,7 +38,7 @@ namespace GreenshotJiraPlugin {
/// <summary> /// <summary>
/// This encapsulates the JiraClient to make it possible to change as less old Greenshot code as needed /// This encapsulates the JiraClient to make it possible to change as less old Greenshot code as needed
/// </summary> /// </summary>
public class JiraConnector : IDisposable { public sealed class JiraConnector : IDisposable {
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraConnector)); private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraConnector));
private static readonly JiraConfiguration JiraConfig = IniConfig.GetIniSection<JiraConfiguration>(); private static readonly JiraConfiguration JiraConfig = IniConfig.GetIniSection<JiraConfiguration>();
private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>(); private static readonly CoreConfiguration CoreConfig = IniConfig.GetIniSection<CoreConfiguration>();
@ -256,7 +256,7 @@ namespace GreenshotJiraPlugin {
public async Task<IList<Issue>> SearchAsync(Filter filter, CancellationToken cancellationToken = default) public async Task<IList<Issue>> SearchAsync(Filter filter, CancellationToken cancellationToken = default)
{ {
await CheckCredentialsAsync(cancellationToken); await CheckCredentialsAsync(cancellationToken);
var searchResult = await _jiraClient.Issue.SearchAsync(filter.Jql, 20, new[] { "summary", "reporter", "assignee", "created", "issuetype" }, cancellationToken).ConfigureAwait(false); var searchResult = await _jiraClient.Issue.SearchAsync(filter.Jql, null, new[] { "summary", "reporter", "assignee", "created", "issuetype" }, null, cancellationToken).ConfigureAwait(false);
return searchResult.Issues; return searchResult.Issues;
} }