mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
BUG-2016: Added favicon support.
This commit is contained in:
parent
8b5708e862
commit
9bf9c0e4e6
4 changed files with 27 additions and 5 deletions
|
@ -34,8 +34,8 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Dapplo.HttpExtensions, Version=0.5.32.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Dapplo.HttpExtensions, Version=0.5.33.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Dapplo.HttpExtensions.0.5.32\lib\net45\Dapplo.HttpExtensions.dll</HintPath>
|
<HintPath>..\packages\Dapplo.HttpExtensions.0.5.33\lib\net45\Dapplo.HttpExtensions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Dapplo.Jira, Version=0.1.59.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Dapplo.Jira, Version=0.1.59.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
|
|
@ -81,6 +81,7 @@ namespace GreenshotJiraPlugin {
|
||||||
{
|
{
|
||||||
Task.Run(async () => await LogoutAsync()).Wait();
|
Task.Run(async () => await LogoutAsync()).Wait();
|
||||||
}
|
}
|
||||||
|
FavIcon?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -97,6 +98,8 @@ namespace GreenshotJiraPlugin {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public JiraMonitor Monitor { get; private set; }
|
public JiraMonitor Monitor { get; private set; }
|
||||||
|
|
||||||
|
public Bitmap FavIcon { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Internal login which catches the exceptions
|
/// Internal login which catches the exceptions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -115,6 +118,17 @@ namespace GreenshotJiraPlugin {
|
||||||
loginInfo = await _jiraApi.StartSessionAsync(user, password);
|
loginInfo = await _jiraApi.StartSessionAsync(user, password);
|
||||||
Monitor = new JiraMonitor();
|
Monitor = new JiraMonitor();
|
||||||
await Monitor.AddJiraInstanceAsync(_jiraApi);
|
await Monitor.AddJiraInstanceAsync(_jiraApi);
|
||||||
|
|
||||||
|
var favIconUri = _jiraApi.JiraBaseUri.AppendSegments("favicon.ico");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FavIcon = await _jiraApi.GetUriContentAsync<Bitmap>(favIconUri);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WarnFormat("Couldn't load favicon from {0}", favIconUri);
|
||||||
|
Log.Warn("Exception details: ", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,9 +73,17 @@ namespace GreenshotJiraPlugin {
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Image displayIcon = null;
|
Image displayIcon = null;
|
||||||
if (_jiraIssue != null && JiraPlugin.Instance.CurrentJiraConnector != null)
|
var jiraConnector = JiraPlugin.Instance.CurrentJiraConnector;
|
||||||
|
if (jiraConnector != null)
|
||||||
{
|
{
|
||||||
displayIcon = JiraPlugin.Instance.CurrentJiraConnector.GetIssueTypeBitmapAsync(_jiraIssue).Result;
|
if (_jiraIssue != null)
|
||||||
|
{
|
||||||
|
displayIcon = jiraConnector.GetIssueTypeBitmapAsync(_jiraIssue).Result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
displayIcon = jiraConnector.FavIcon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (displayIcon == null)
|
if (displayIcon == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Dapplo.HttpExtensions" version="0.5.32" targetFramework="net45" />
|
<package id="Dapplo.HttpExtensions" version="0.5.33" targetFramework="net45" />
|
||||||
<package id="Dapplo.Jira" version="0.1.59" targetFramework="net45" />
|
<package id="Dapplo.Jira" version="0.1.59" targetFramework="net45" />
|
||||||
<package id="Dapplo.Log.Facade" version="0.5.4" targetFramework="net45" />
|
<package id="Dapplo.Log.Facade" version="0.5.4" targetFramework="net45" />
|
||||||
<package id="LibZ.Tool" version="1.2.0.0" targetFramework="net45" />
|
<package id="LibZ.Tool" version="1.2.0.0" targetFramework="net45" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue