mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
Merge pull request #3 from greenshot/1.2
Merge from release/1.2 to master
This commit is contained in:
commit
8941d5ad4b
32 changed files with 500 additions and 260 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}</ProjectGuid>
|
<ProjectGuid>{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}</ProjectGuid>
|
||||||
|
@ -18,7 +18,8 @@
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation />
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="log4net">
|
<Reference Include="log4net">
|
||||||
|
|
|
@ -83,10 +83,15 @@ namespace Greenshot.Help
|
||||||
private static HttpStatusCode? GetHttpStatus(string url) {
|
private static HttpStatusCode? GetHttpStatus(string url) {
|
||||||
try {
|
try {
|
||||||
HttpWebRequest req = NetworkHelper.CreateWebRequest(url);
|
HttpWebRequest req = NetworkHelper.CreateWebRequest(url);
|
||||||
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
|
using (HttpWebResponse res = (HttpWebResponse)req.GetResponse())
|
||||||
return res.StatusCode;
|
{
|
||||||
} catch(WebException e) {
|
return res.StatusCode;
|
||||||
if(e.Response != null) return ((HttpWebResponse)e.Response).StatusCode;
|
}
|
||||||
|
} catch (WebException e) {
|
||||||
|
if (e.Response != null)
|
||||||
|
{
|
||||||
|
return ((HttpWebResponse)e.Response).StatusCode;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,7 @@ namespace Greenshot.Helpers {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pluginFiles"></param>
|
/// <param name="pluginFiles"></param>
|
||||||
/// <param name="path"></param>
|
/// <param name="path"></param>
|
||||||
private void findPluginsOnPath(List<string> pluginFiles, String path) {
|
private void findPluginsOnPath(List<string> pluginFiles, string path) {
|
||||||
if (Directory.Exists(path)) {
|
if (Directory.Exists(path)) {
|
||||||
try {
|
try {
|
||||||
foreach (string pluginFile in Directory.GetFiles(path, "*.gsp", SearchOption.AllDirectories)) {
|
foreach (string pluginFile in Directory.GetFiles(path, "*.gsp", SearchOption.AllDirectories)) {
|
||||||
|
|
|
@ -34,21 +34,20 @@ namespace Greenshot.Experimental {
|
||||||
/// Description of RssFeedHelper.
|
/// Description of RssFeedHelper.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class UpdateHelper {
|
public static class UpdateHelper {
|
||||||
private static ILog LOG = LogManager.GetLogger(typeof(UpdateHelper));
|
private static readonly ILog LOG = LogManager.GetLogger(typeof(UpdateHelper));
|
||||||
private static CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
|
private static CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
|
||||||
private const string STABLE_DOWNLOAD_LINK = "http://getgreenshot.org/downloads/";
|
private const string STABLE_DOWNLOAD_LINK = "http://getgreenshot.org/downloads/";
|
||||||
private const string VERSION_HISTORY_LINK = "http://getgreenshot.org/version-history/";
|
private const string VERSION_HISTORY_LINK = "http://getgreenshot.org/version-history/";
|
||||||
private static object lockObject = new object();
|
private static readonly object LockObject = new object();
|
||||||
private static SourceforgeFile latestGreenshot;
|
private static SourceforgeFile _latestGreenshot;
|
||||||
private static SourceforgeFile currentGreenshot;
|
private static string _downloadLink = STABLE_DOWNLOAD_LINK;
|
||||||
private static string downloadLink = STABLE_DOWNLOAD_LINK;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is an update check needed?
|
/// Is an update check needed?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>bool true if yes</returns>
|
/// <returns>bool true if yes</returns>
|
||||||
public static bool IsUpdateCheckNeeded() {
|
public static bool IsUpdateCheckNeeded() {
|
||||||
lock (lockObject) {
|
lock (LockObject) {
|
||||||
if (conf.UpdateCheckInterval == 0) {
|
if (conf.UpdateCheckInterval == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +59,7 @@ namespace Greenshot.Experimental {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LOG.DebugFormat("Update check is due, last check was {0} check needs to be made after {1} (which is one {2} later)", conf.LastUpdateCheck, checkTime, conf.UpdateCheckInterval);
|
LOG.DebugFormat("Update check is due, last check was {0} check needs to be made after {1} (which is one {2} later)", conf.LastUpdateCheck, checkTime, conf.UpdateCheckInterval);
|
||||||
if (!SourceForgeHelper.isRSSModifiedAfter(conf.LastUpdateCheck)) {
|
if (!SourceForgeHelper.IsRSSModifiedAfter(conf.LastUpdateCheck)) {
|
||||||
LOG.DebugFormat("RSS feed has not been updated since after {0}", conf.LastUpdateCheck);
|
LOG.DebugFormat("RSS feed has not been updated since after {0}", conf.LastUpdateCheck);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -73,18 +72,18 @@ namespace Greenshot.Experimental {
|
||||||
/// Read the RSS feed to see if there is a Greenshot update
|
/// Read the RSS feed to see if there is a Greenshot update
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void CheckAndAskForUpdate() {
|
public static void CheckAndAskForUpdate() {
|
||||||
lock (lockObject) {
|
lock (LockObject) {
|
||||||
Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
|
Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
// Test like this:
|
// Test like this:
|
||||||
// currentVersion = new Version("0.8.1.1198");
|
// currentVersion = new Version("0.8.1.1198");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
latestGreenshot = null;
|
_latestGreenshot = null;
|
||||||
ProcessRSSInfo(currentVersion);
|
ProcessRSSInfo(currentVersion);
|
||||||
if (latestGreenshot != null) {
|
if (_latestGreenshot != null) {
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClicked += HandleBalloonTipClick;
|
MainForm.Instance.NotifyIcon.BalloonTipClicked += HandleBalloonTipClick;
|
||||||
MainForm.Instance.NotifyIcon.BalloonTipClosed += CleanupBalloonTipClick;
|
MainForm.Instance.NotifyIcon.BalloonTipClosed += CleanupBalloonTipClick;
|
||||||
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", Language.GetFormattedString(LangKey.update_found, "'" + latestGreenshot.File + "'"), ToolTipIcon.Info);
|
MainForm.Instance.NotifyIcon.ShowBalloonTip(10000, "Greenshot", Language.GetFormattedString(LangKey.update_found, "'" + _latestGreenshot.File + "'"), ToolTipIcon.Info);
|
||||||
}
|
}
|
||||||
conf.LastUpdateCheck = DateTime.Now;
|
conf.LastUpdateCheck = DateTime.Now;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -100,14 +99,14 @@ namespace Greenshot.Experimental {
|
||||||
|
|
||||||
private static void HandleBalloonTipClick(object sender, EventArgs e) {
|
private static void HandleBalloonTipClick(object sender, EventArgs e) {
|
||||||
try {
|
try {
|
||||||
if (latestGreenshot != null) {
|
if (_latestGreenshot != null) {
|
||||||
// "Direct" download link
|
// "Direct" download link
|
||||||
// Process.Start(latestGreenshot.Link);
|
// Process.Start(latestGreenshot.Link);
|
||||||
// Go to getgreenshot.org
|
// Go to getgreenshot.org
|
||||||
Process.Start(downloadLink);
|
Process.Start(_downloadLink);
|
||||||
}
|
}
|
||||||
} catch (Exception) {
|
} catch (Exception) {
|
||||||
MessageBox.Show(Language.GetFormattedString(LangKey.error_openlink, downloadLink), Language.GetString(LangKey.error));
|
MessageBox.Show(Language.GetFormattedString(LangKey.error_openlink, _downloadLink), Language.GetString(LangKey.error));
|
||||||
} finally {
|
} finally {
|
||||||
CleanupBalloonTipClick(sender, e);
|
CleanupBalloonTipClick(sender, e);
|
||||||
}
|
}
|
||||||
|
@ -158,18 +157,17 @@ namespace Greenshot.Experimental {
|
||||||
int versionCompare = rssFile.Version.CompareTo(currentVersion);
|
int versionCompare = rssFile.Version.CompareTo(currentVersion);
|
||||||
if (versionCompare > 0) {
|
if (versionCompare > 0) {
|
||||||
LOG.DebugFormat("Found newer Greenshot '{0}' with version {1} published at {2} : {3}", file, rssFile.Version, rssFile.Pubdate.ToLocalTime(), rssFile.Link);
|
LOG.DebugFormat("Found newer Greenshot '{0}' with version {1} published at {2} : {3}", file, rssFile.Version, rssFile.Pubdate.ToLocalTime(), rssFile.Link);
|
||||||
if (latestGreenshot == null || rssFile.Version.CompareTo(latestGreenshot.Version) > 0) {
|
if (_latestGreenshot == null || rssFile.Version.CompareTo(_latestGreenshot.Version) > 0) {
|
||||||
latestGreenshot = rssFile;
|
_latestGreenshot = rssFile;
|
||||||
if (rssFile.isReleaseCandidate || rssFile.isUnstable) {
|
if (rssFile.isReleaseCandidate || rssFile.isUnstable) {
|
||||||
downloadLink = VERSION_HISTORY_LINK;
|
_downloadLink = VERSION_HISTORY_LINK;
|
||||||
} else {
|
} else {
|
||||||
downloadLink = STABLE_DOWNLOAD_LINK;
|
_downloadLink = STABLE_DOWNLOAD_LINK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (versionCompare < 0) {
|
} else if (versionCompare < 0) {
|
||||||
LOG.DebugFormat("Skipping older greenshot with version {0}", rssFile.Version);
|
LOG.DebugFormat("Skipping older greenshot with version {0}", rssFile.Version);
|
||||||
} else if (versionCompare == 0) {
|
} else if (versionCompare == 0) {
|
||||||
currentGreenshot = rssFile;
|
|
||||||
LOG.DebugFormat("Found current version as exe {0} with version {1} published at {2} : {3}", file, rssFile.Version, rssFile.Pubdate.ToLocalTime(), rssFile.Link);
|
LOG.DebugFormat("Found current version as exe {0} with version {1} published at {2} : {3}", file, rssFile.Version, rssFile.Pubdate.ToLocalTime(), rssFile.Link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,31 @@ All details to our tickets can be found here: https://greenshot.atlassian.net
|
||||||
|
|
||||||
@DETAILVERSION@
|
@DETAILVERSION@
|
||||||
|
|
||||||
|
There were some major issues with the authenticated (non anonymous) uploads to Imgur.
|
||||||
|
After contacting Imgur they told us that their old API was deprecated or disabled, unfortunately this was not communicated.
|
||||||
|
Although we are working hard on Greenshot 1.3, where we changed most of the Imgur code already, we can't release it.
|
||||||
|
We did see a need to fix the imgur uploads, so in this release we quickly updated the Imgur API.
|
||||||
|
This should resolve a lot of tickets that were reported to us.
|
||||||
|
|
||||||
|
Additionally our website http://getgreenshot.org is hosted by sourceforge and they seem to have a lot of stability problems.
|
||||||
|
Due to these problems a bug in the Greenshot update check manifested itself and causes Greenshot to get slow or even stop responding.
|
||||||
|
In this version we fix the bug in the update check, and we are also working on a solution for the instability with our website.
|
||||||
|
|
||||||
|
Here is the list of chances:
|
||||||
|
|
||||||
|
Bugs Resolved:
|
||||||
|
|
||||||
|
BUG-1527 / BUG-1848 / BUG-1850 / BUG-1851 / BUG-1859 : Greenshot stops responding, hangs or crashes
|
||||||
|
BUG-1843 / BUG-1844 / BUG-1846 : Imgur problems with authenticated uploads
|
||||||
|
BUG-1864: Imgur link wasn't copied to the clipboard
|
||||||
|
|
||||||
|
Features:
|
||||||
|
FEATURE-896: Use Imgur with HTTPS (with changing the Imgur API from V2 to V3 this was already required for the upload anyway.)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
1.2.7.2-342a506 RELEASE
|
||||||
|
|
||||||
Bugs Resolved:
|
Bugs Resolved:
|
||||||
* BUG-1809: OverflowException when changing the windows input language
|
* BUG-1809: OverflowException when changing the windows input language
|
||||||
* BUG-1835: Imgur: uploads were cancelled due to a timeout which was set too small
|
* BUG-1835: Imgur: uploads were cancelled due to a timeout which was set too small
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{697CF066-9077-4F22-99D9-D989CCE7282B}</ProjectGuid>
|
<ProjectGuid>{697CF066-9077-4F22-99D9-D989CCE7282B}</ProjectGuid>
|
||||||
|
@ -14,6 +14,11 @@
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<NoWarn>1685</NoWarn>
|
<NoWarn>1685</NoWarn>
|
||||||
<ProjectGuid>{C3052651-598A-44E2-AAB3-2E41311D50F9}</ProjectGuid>
|
<ProjectGuid>{C3052651-598A-44E2-AAB3-2E41311D50F9}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RootNamespace>GreenshotConfluencePlugin</RootNamespace>
|
<RootNamespace>GreenshotConfluencePlugin</RootNamespace>
|
||||||
|
@ -15,6 +15,11 @@
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}</ProjectGuid>
|
<ProjectGuid>{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}</ProjectGuid>
|
||||||
|
@ -14,6 +14,11 @@
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{47F23C86-604E-4CC3-8767-B3D4088F30BB}</ProjectGuid>
|
<ProjectGuid>{47F23C86-604E-4CC3-8767-B3D4088F30BB}</ProjectGuid>
|
||||||
|
@ -14,6 +14,11 @@
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace GreenshotFlickrPlugin
|
||||||
_config.ShowConfigDialog();
|
_config.ShowConfigDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Upload(ICaptureDetails captureDetails, ISurface surface, out String uploadUrl) {
|
public bool Upload(ICaptureDetails captureDetails, ISurface surface, out string uploadUrl) {
|
||||||
SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality, false);
|
SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality, false);
|
||||||
uploadUrl = null;
|
uploadUrl = null;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}</ProjectGuid>
|
<ProjectGuid>{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}</ProjectGuid>
|
||||||
|
@ -15,6 +15,10 @@
|
||||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}</ProjectGuid>
|
<ProjectGuid>{80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}</ProjectGuid>
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation />
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
* 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/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Greenshot.IniFile;
|
using Greenshot.IniFile;
|
||||||
|
@ -41,14 +43,26 @@ namespace GreenshotImgurPlugin {
|
||||||
public int UploadJpegQuality;
|
public int UploadJpegQuality;
|
||||||
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
|
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
|
||||||
public bool UploadReduceColors;
|
public bool UploadReduceColors;
|
||||||
|
[IniProperty("CopyLinkToClipboard", Description = "Copy the link, which one is controlled by the UsePageLink, on the clipboard", DefaultValue = "True")]
|
||||||
|
public bool CopyLinkToClipboard;
|
||||||
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
|
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
|
||||||
public bool UsePageLink;
|
public bool UsePageLink;
|
||||||
[IniProperty("AnonymousAccess", Description = "Use anonymous access to Imgur", DefaultValue="true")]
|
[IniProperty("AnonymousAccess", Description = "Use anonymous access to Imgur", DefaultValue="true")]
|
||||||
public bool AnonymousAccess;
|
public bool AnonymousAccess;
|
||||||
[IniProperty("ImgurToken", Description = "The Imgur token", Encrypted=true, ExcludeIfNull=true)]
|
|
||||||
public string ImgurToken;
|
[IniProperty("RefreshToken", Description = "Imgur refresh Token", Encrypted = true, ExcludeIfNull = true)]
|
||||||
[IniProperty("ImgurTokenSecret", Description = "The Imgur token secret", Encrypted=true, ExcludeIfNull=true)]
|
public string RefreshToken;
|
||||||
public string ImgurTokenSecret;
|
|
||||||
|
/// <summary>
|
||||||
|
/// AccessToken, not stored
|
||||||
|
/// </summary>
|
||||||
|
public string AccessToken;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// AccessTokenExpires, not stored
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset AccessTokenExpires;
|
||||||
|
|
||||||
[IniProperty("AddTitle", Description = "Is the title passed on to Imgur", DefaultValue = "False")]
|
[IniProperty("AddTitle", Description = "Is the title passed on to Imgur", DefaultValue = "False")]
|
||||||
public bool AddTitle;
|
public bool AddTitle;
|
||||||
[IniProperty("AddFilename", Description = "Is the filename passed on to Imgur", DefaultValue = "False")]
|
[IniProperty("AddFilename", Description = "Is the filename passed on to Imgur", DefaultValue = "False")]
|
||||||
|
|
|
@ -29,10 +29,11 @@ namespace GreenshotImgurPlugin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ImgurInfo : IDisposable {
|
public class ImgurInfo : IDisposable {
|
||||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurInfo));
|
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurInfo));
|
||||||
private string hash;
|
|
||||||
public string Hash {
|
public string Hash
|
||||||
get {return hash;}
|
{
|
||||||
set {hash = value;}
|
get;
|
||||||
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string deleteHash;
|
private string deleteHash;
|
||||||
|
@ -40,57 +41,58 @@ namespace GreenshotImgurPlugin
|
||||||
get {return deleteHash;}
|
get {return deleteHash;}
|
||||||
set {
|
set {
|
||||||
deleteHash = value;
|
deleteHash = value;
|
||||||
deletePage = "http://imgur.com/delete/" + value;
|
DeletePage = "https://imgur.com/delete/" + value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string title;
|
public string Title
|
||||||
public string Title {
|
{
|
||||||
get {return title;}
|
get;
|
||||||
set {title = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string imageType;
|
public string ImageType
|
||||||
public string ImageType {
|
{
|
||||||
get {return imageType;}
|
get;
|
||||||
set {imageType = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DateTime timestamp;
|
public DateTime Timestamp
|
||||||
public DateTime Timestamp {
|
{
|
||||||
get {return timestamp;}
|
get;
|
||||||
set {timestamp = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string original;
|
public string Original
|
||||||
public string Original {
|
{
|
||||||
get {return original;}
|
get;
|
||||||
set {original = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string page;
|
public string Page
|
||||||
public string Page {
|
{
|
||||||
get {return page;}
|
get;
|
||||||
set {page = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string smallSquare;
|
public string SmallSquare
|
||||||
public string SmallSquare {
|
{
|
||||||
get {return smallSquare;}
|
get;
|
||||||
set {smallSquare = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string largeThumbnail;
|
public string LargeThumbnail
|
||||||
public string LargeThumbnail {
|
{
|
||||||
get {return largeThumbnail;}
|
get;
|
||||||
set {largeThumbnail = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string deletePage;
|
public string DeletePage
|
||||||
public string DeletePage {
|
{
|
||||||
get {return deletePage;}
|
get;
|
||||||
set {deletePage = value;}
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Image image;
|
private Image image;
|
||||||
public Image Image {
|
public Image Image {
|
||||||
get {return image;}
|
get {return image;}
|
||||||
|
@ -166,48 +168,43 @@ namespace GreenshotImgurPlugin
|
||||||
}
|
}
|
||||||
nodes = doc.GetElementsByTagName("datetime");
|
nodes = doc.GetElementsByTagName("datetime");
|
||||||
if(nodes.Count > 0) {
|
if(nodes.Count > 0) {
|
||||||
try
|
// Version 3 has seconds since Epoch
|
||||||
|
double secondsSince;
|
||||||
|
if (double.TryParse(nodes.Item(0).InnerText, out secondsSince))
|
||||||
{
|
{
|
||||||
imgurInfo.Timestamp = DateTime.Parse(nodes.Item(0).InnerText);
|
var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
||||||
}
|
imgurInfo.Timestamp = epoch.AddSeconds(secondsSince).DateTime;
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// Version 3 has seconds since Epoch
|
|
||||||
double secondsSince;
|
|
||||||
if (double.TryParse(nodes.Item(0).InnerText, out secondsSince))
|
|
||||||
{
|
|
||||||
var epoch = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
|
||||||
imgurInfo.Timestamp = epoch.AddSeconds(secondsSince).DateTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes = doc.GetElementsByTagName("original");
|
nodes = doc.GetElementsByTagName("original");
|
||||||
if(nodes.Count > 0) {
|
if (nodes.Count > 0)
|
||||||
imgurInfo.Original = nodes.Item(0).InnerText;
|
{
|
||||||
|
imgurInfo.Original = nodes.Item(0).InnerText.Replace("http:", "https:");
|
||||||
}
|
}
|
||||||
// Version 3 API only has Link
|
// Version 3 API only has Link
|
||||||
nodes = doc.GetElementsByTagName("link");
|
nodes = doc.GetElementsByTagName("link");
|
||||||
if (nodes.Count > 0)
|
if (nodes.Count > 0)
|
||||||
{
|
{
|
||||||
imgurInfo.Original = nodes.Item(0).InnerText;
|
imgurInfo.Original = nodes.Item(0).InnerText.Replace("http:", "https:");
|
||||||
}
|
}
|
||||||
nodes = doc.GetElementsByTagName("imgur_page");
|
nodes = doc.GetElementsByTagName("imgur_page");
|
||||||
if (nodes.Count > 0)
|
if (nodes.Count > 0)
|
||||||
{
|
{
|
||||||
imgurInfo.Page = nodes.Item(0).InnerText;
|
imgurInfo.Page = nodes.Item(0).InnerText.Replace("http:", "https:");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Version 3 doesn't have a page link in the response
|
// Version 3 doesn't have a page link in the response
|
||||||
imgurInfo.Page = string.Format("http://imgur.com/{0}", imgurInfo.Hash);
|
imgurInfo.Page = string.Format("https://imgur.com/{0}", imgurInfo.Hash);
|
||||||
}
|
}
|
||||||
nodes = doc.GetElementsByTagName("small_square");
|
nodes = doc.GetElementsByTagName("small_square");
|
||||||
if(nodes.Count > 0) {
|
if(nodes.Count > 0) {
|
||||||
imgurInfo.SmallSquare = nodes.Item(0).InnerText;
|
imgurInfo.SmallSquare = nodes.Item(0).InnerText;
|
||||||
}
|
}
|
||||||
nodes = doc.GetElementsByTagName("large_thumbnail");
|
nodes = doc.GetElementsByTagName("large_thumbnail");
|
||||||
if(nodes.Count > 0) {
|
if(nodes.Count > 0)
|
||||||
imgurInfo.LargeThumbnail = nodes.Item(0).InnerText;
|
{
|
||||||
|
imgurInfo.LargeThumbnail = nodes.Item(0).InnerText.Replace("http:", "https:");
|
||||||
}
|
}
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
LOG.ErrorFormat("Could not parse Imgur response due to error {0}, response was: {1}", e.Message, response);
|
LOG.ErrorFormat("Could not parse Imgur response due to error {0}, response was: {1}", e.Message, response);
|
||||||
|
|
|
@ -194,17 +194,27 @@ namespace GreenshotImgurPlugin {
|
||||||
imgurInfo.Image = ImageHelper.CreateThumbnail(tmpImage, 90, 90);
|
imgurInfo.Image = ImageHelper.CreateThumbnail(tmpImage, 90, 90);
|
||||||
}
|
}
|
||||||
IniConfig.Save();
|
IniConfig.Save();
|
||||||
try {
|
|
||||||
if (config.UsePageLink) {
|
if (config.UsePageLink)
|
||||||
uploadURL = imgurInfo.Page;
|
{
|
||||||
ClipboardHelper.SetClipboardData(imgurInfo.Page);
|
uploadURL = imgurInfo.Page;
|
||||||
} else {
|
}
|
||||||
uploadURL = imgurInfo.Original;
|
else
|
||||||
ClipboardHelper.SetClipboardData(imgurInfo.Original);
|
{
|
||||||
|
uploadURL = imgurInfo.Original;
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(uploadURL) && config.CopyLinkToClipboard)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ClipboardHelper.SetClipboardData(uploadURL);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LOG.Error("Can't write to clipboard: ", ex);
|
||||||
|
uploadURL = null;
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
|
||||||
LOG.Error("Can't write to clipboard: ", ex);
|
|
||||||
uploadURL = null;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,38 +33,39 @@ namespace GreenshotImgurPlugin {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ImgurUtils {
|
public static class ImgurUtils {
|
||||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurUtils));
|
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurUtils));
|
||||||
private const string IMGUR_ANONYMOUS_API_KEY = "60e8838e21d6b66";
|
private const string SmallUrlPattern = "http://i.imgur.com/{0}s.jpg";
|
||||||
private const string SMALL_URL_PATTERN = "http://i.imgur.com/{0}s.png";
|
private static readonly ImgurConfiguration Config = IniConfig.GetIniSection<ImgurConfiguration>();
|
||||||
private static ImgurConfiguration config = IniConfig.GetIniSection<ImgurConfiguration>();
|
private const string AuthUrlPattern = "https://api.imgur.com/oauth2/authorize?response_type=code&client_id={ClientId}&redirect_uri={RedirectUrl}&state={State}";
|
||||||
|
private const string TokenUrl = "https://api.imgur.com/oauth2/token";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load the complete history of the imgur uploads, with the corresponding information
|
/// Load the complete history of the imgur uploads, with the corresponding information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LoadHistory() {
|
public static void LoadHistory() {
|
||||||
if (config.runtimeImgurHistory.Count == config.ImgurUploadHistory.Count) {
|
if (Config.runtimeImgurHistory.Count == Config.ImgurUploadHistory.Count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Load the ImUr history
|
// Load the ImUr history
|
||||||
List<string> hashes = new List<string>();
|
List<string> hashes = new List<string>();
|
||||||
foreach(string hash in config.ImgurUploadHistory.Keys) {
|
foreach(string hash in Config.ImgurUploadHistory.Keys) {
|
||||||
hashes.Add(hash);
|
hashes.Add(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool saveNeeded = false;
|
bool saveNeeded = false;
|
||||||
|
|
||||||
foreach(string hash in hashes) {
|
foreach(string hash in hashes) {
|
||||||
if (config.runtimeImgurHistory.ContainsKey(hash)) {
|
if (Config.runtimeImgurHistory.ContainsKey(hash)) {
|
||||||
// Already loaded
|
// Already loaded
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
ImgurInfo imgurInfo = RetrieveImgurInfo(hash, config.ImgurUploadHistory[hash]);
|
ImgurInfo imgurInfo = RetrieveImgurInfo(hash, Config.ImgurUploadHistory[hash]);
|
||||||
if (imgurInfo != null) {
|
if (imgurInfo != null) {
|
||||||
RetrieveImgurThumbnail(imgurInfo);
|
RetrieveImgurThumbnail(imgurInfo);
|
||||||
config.runtimeImgurHistory.Add(hash, imgurInfo);
|
Config.runtimeImgurHistory.Add(hash, imgurInfo);
|
||||||
} else {
|
} else {
|
||||||
LOG.DebugFormat("Deleting not found ImgUr {0} from config.", hash);
|
LOG.DebugFormat("Deleting not found ImgUr {0} from config.", hash);
|
||||||
config.ImgurUploadHistory.Remove(hash);
|
Config.ImgurUploadHistory.Remove(hash);
|
||||||
saveNeeded = true;
|
saveNeeded = true;
|
||||||
}
|
}
|
||||||
} catch (WebException wE) {
|
} catch (WebException wE) {
|
||||||
|
@ -74,7 +75,7 @@ namespace GreenshotImgurPlugin {
|
||||||
// Image no longer available
|
// Image no longer available
|
||||||
if (response.StatusCode == HttpStatusCode.Redirect) {
|
if (response.StatusCode == HttpStatusCode.Redirect) {
|
||||||
LOG.InfoFormat("ImgUr image for hash {0} is no longer available", hash);
|
LOG.InfoFormat("ImgUr image for hash {0} is no longer available", hash);
|
||||||
config.ImgurUploadHistory.Remove(hash);
|
Config.ImgurUploadHistory.Remove(hash);
|
||||||
redirected = true;
|
redirected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +97,7 @@ namespace GreenshotImgurPlugin {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="webRequest"></param>
|
/// <param name="webRequest"></param>
|
||||||
private static void SetClientId(HttpWebRequest webRequest) {
|
private static void SetClientId(HttpWebRequest webRequest) {
|
||||||
webRequest.Headers.Add("Authorization", "Client-ID " + IMGUR_ANONYMOUS_API_KEY);
|
webRequest.Headers.Add("Authorization", "Client-ID " + ImgurCredentials.CONSUMER_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -109,21 +110,20 @@ namespace GreenshotImgurPlugin {
|
||||||
/// <param name="filename">Filename</param>
|
/// <param name="filename">Filename</param>
|
||||||
/// <returns>ImgurInfo with details</returns>
|
/// <returns>ImgurInfo with details</returns>
|
||||||
public static ImgurInfo UploadToImgur(ISurface surfaceToUpload, SurfaceOutputSettings outputSettings, string title, string filename) {
|
public static ImgurInfo UploadToImgur(ISurface surfaceToUpload, SurfaceOutputSettings outputSettings, string title, string filename) {
|
||||||
IDictionary<string, object> uploadParameters = new Dictionary<string, object>();
|
|
||||||
IDictionary<string, object> otherParameters = new Dictionary<string, object>();
|
IDictionary<string, object> otherParameters = new Dictionary<string, object>();
|
||||||
// add title
|
// add title
|
||||||
if (title != null && config.AddTitle) {
|
if (title != null && Config.AddTitle) {
|
||||||
otherParameters.Add("title", title);
|
otherParameters.Add("title", title);
|
||||||
}
|
}
|
||||||
// add filename
|
// add filename
|
||||||
if (filename != null && config.AddFilename) {
|
if (filename != null && Config.AddFilename) {
|
||||||
otherParameters.Add("name", filename);
|
otherParameters.Add("name", filename);
|
||||||
}
|
}
|
||||||
string responseString = null;
|
string responseString;
|
||||||
if (config.AnonymousAccess) {
|
if (Config.AnonymousAccess) {
|
||||||
// add key, we only use the other parameters for the AnonymousAccess
|
// add key, we only use the other parameters for the AnonymousAccess
|
||||||
//otherParameters.Add("key", IMGUR_ANONYMOUS_API_KEY);
|
//otherParameters.Add("key", IMGUR_ANONYMOUS_API_KEY);
|
||||||
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(config.ImgurApi3Url + "/upload.xml?" + NetworkHelper.GenerateQueryParameters(otherParameters), HTTPMethod.POST);
|
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(Config.ImgurApi3Url + "/upload.xml?" + NetworkHelper.GenerateQueryParameters(otherParameters), HTTPMethod.POST);
|
||||||
webRequest.ContentType = "image/" + outputSettings.Format;
|
webRequest.ContentType = "image/" + outputSettings.Format;
|
||||||
webRequest.ServicePoint.Expect100Continue = false;
|
webRequest.ServicePoint.Expect100Continue = false;
|
||||||
|
|
||||||
|
@ -144,40 +144,38 @@ namespace GreenshotImgurPlugin {
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OAuthSession oAuth = new OAuthSession(ImgurCredentials.CONSUMER_KEY, ImgurCredentials.CONSUMER_SECRET);
|
|
||||||
oAuth.BrowserSize = new Size(650, 500);
|
var oauth2Settings = new OAuth2Settings();
|
||||||
oAuth.CallbackUrl = "http://getgreenshot.org";
|
oauth2Settings.AuthUrlPattern = AuthUrlPattern;
|
||||||
oAuth.AccessTokenUrl = "http://api.imgur.com/oauth/access_token";
|
oauth2Settings.TokenUrl = TokenUrl;
|
||||||
oAuth.AuthorizeUrl = "http://api.imgur.com/oauth/authorize";
|
oauth2Settings.RedirectUrl = "https://imgur.com";
|
||||||
oAuth.RequestTokenUrl = "http://api.imgur.com/oauth/request_token";
|
oauth2Settings.CloudServiceName = "Imgur";
|
||||||
oAuth.LoginTitle = "Imgur authorization";
|
oauth2Settings.ClientId = ImgurCredentials.CONSUMER_KEY;
|
||||||
oAuth.Token = config.ImgurToken;
|
oauth2Settings.ClientSecret = ImgurCredentials.CONSUMER_SECRET;
|
||||||
oAuth.TokenSecret = config.ImgurTokenSecret;
|
oauth2Settings.AuthorizeMode = OAuth2AuthorizeMode.EmbeddedBrowser;
|
||||||
if (string.IsNullOrEmpty(oAuth.Token)) {
|
oauth2Settings.BrowserSize = new Size(680, 880);
|
||||||
if (!oAuth.Authorize()) {
|
|
||||||
return null;
|
// Copy the settings from the config, which is kept in memory and on the disk
|
||||||
}
|
oauth2Settings.RefreshToken = Config.RefreshToken;
|
||||||
if (!string.IsNullOrEmpty(oAuth.Token)) {
|
oauth2Settings.AccessToken = Config.AccessToken;
|
||||||
config.ImgurToken = oAuth.Token;
|
oauth2Settings.AccessTokenExpires = Config.AccessTokenExpires;
|
||||||
}
|
|
||||||
if (!string.IsNullOrEmpty(oAuth.TokenSecret)) {
|
try
|
||||||
config.ImgurTokenSecret = oAuth.TokenSecret;
|
{
|
||||||
}
|
var webRequest = OAuth2Helper.CreateOAuth2WebRequest(HTTPMethod.POST, Config.ImgurApi3Url + "/upload.xml", oauth2Settings);
|
||||||
IniConfig.Save();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
otherParameters.Add("image", new SurfaceContainer(surfaceToUpload, outputSettings, filename));
|
otherParameters.Add("image", new SurfaceContainer(surfaceToUpload, outputSettings, filename));
|
||||||
responseString = oAuth.MakeOAuthRequest(HTTPMethod.POST, "http://api.imgur.com/2/account/images.xml", uploadParameters, otherParameters, null);
|
|
||||||
} catch (Exception ex) {
|
NetworkHelper.WriteMultipartFormData(webRequest, otherParameters);
|
||||||
LOG.Error("Upload to imgur gave an exeption: ", ex);
|
|
||||||
throw;
|
responseString = NetworkHelper.GetResponseAsString(webRequest);
|
||||||
} finally {
|
}
|
||||||
if (oAuth.Token != null) {
|
finally
|
||||||
config.ImgurToken = oAuth.Token;
|
{
|
||||||
}
|
// Copy the settings back to the config, so they are stored.
|
||||||
if (oAuth.TokenSecret != null) {
|
Config.RefreshToken = oauth2Settings.RefreshToken;
|
||||||
config.ImgurTokenSecret = oAuth.TokenSecret;
|
Config.AccessToken = oauth2Settings.AccessToken;
|
||||||
}
|
Config.AccessTokenExpires = oauth2Settings.AccessTokenExpires;
|
||||||
|
Config.IsDirty = true;
|
||||||
IniConfig.Save();
|
IniConfig.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -194,15 +192,17 @@ namespace GreenshotImgurPlugin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG.InfoFormat("Retrieving Imgur image for {0} with url {1}", imgurInfo.Hash, imgurInfo.SmallSquare);
|
LOG.InfoFormat("Retrieving Imgur image for {0} with url {1}", imgurInfo.Hash, imgurInfo.SmallSquare);
|
||||||
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(string.Format(SMALL_URL_PATTERN, imgurInfo.Hash), HTTPMethod.GET);
|
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(string.Format(SmallUrlPattern, imgurInfo.Hash), HTTPMethod.GET);
|
||||||
webRequest.ServicePoint.Expect100Continue = false;
|
webRequest.ServicePoint.Expect100Continue = false;
|
||||||
SetClientId(webRequest);
|
SetClientId(webRequest);
|
||||||
using (WebResponse response = webRequest.GetResponse()) {
|
using (WebResponse response = webRequest.GetResponse()) {
|
||||||
LogRateLimitInfo(response);
|
LogRateLimitInfo(response);
|
||||||
Stream responseStream = response.GetResponseStream();
|
Stream responseStream = response.GetResponseStream();
|
||||||
imgurInfo.Image = Image.FromStream(responseStream);
|
if (responseStream != null)
|
||||||
|
{
|
||||||
|
imgurInfo.Image = Image.FromStream(responseStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -212,7 +212,7 @@ namespace GreenshotImgurPlugin {
|
||||||
/// <param name="deleteHash"></param>
|
/// <param name="deleteHash"></param>
|
||||||
/// <returns>ImgurInfo</returns>
|
/// <returns>ImgurInfo</returns>
|
||||||
public static ImgurInfo RetrieveImgurInfo(string hash, string deleteHash) {
|
public static ImgurInfo RetrieveImgurInfo(string hash, string deleteHash) {
|
||||||
string url = config.ImgurApiUrl + "/image/" + hash;
|
string url = Config.ImgurApiUrl + "/image/" + hash;
|
||||||
LOG.InfoFormat("Retrieving Imgur info for {0} with url {1}", hash, url);
|
LOG.InfoFormat("Retrieving Imgur info for {0} with url {1}", hash, url);
|
||||||
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(url, HTTPMethod.GET);
|
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(url, HTTPMethod.GET);
|
||||||
webRequest.ServicePoint.Expect100Continue = false;
|
webRequest.ServicePoint.Expect100Continue = false;
|
||||||
|
@ -247,7 +247,7 @@ namespace GreenshotImgurPlugin {
|
||||||
LOG.InfoFormat("Deleting Imgur image for {0}", imgurInfo.DeleteHash);
|
LOG.InfoFormat("Deleting Imgur image for {0}", imgurInfo.DeleteHash);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string url = config.ImgurApiUrl + "/delete/" + imgurInfo.DeleteHash;
|
string url = Config.ImgurApiUrl + "/delete/" + imgurInfo.DeleteHash;
|
||||||
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(url, HTTPMethod.GET);
|
HttpWebRequest webRequest = NetworkHelper.CreateWebRequest(url, HTTPMethod.GET);
|
||||||
webRequest.ServicePoint.Expect100Continue = false;
|
webRequest.ServicePoint.Expect100Continue = false;
|
||||||
SetClientId(webRequest);
|
SetClientId(webRequest);
|
||||||
|
@ -268,8 +268,8 @@ namespace GreenshotImgurPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make sure we remove it from the history, if no error occured
|
// Make sure we remove it from the history, if no error occured
|
||||||
config.runtimeImgurHistory.Remove(imgurInfo.Hash);
|
Config.runtimeImgurHistory.Remove(imgurInfo.Hash);
|
||||||
config.ImgurUploadHistory.Remove(imgurInfo.Hash);
|
Config.ImgurUploadHistory.Remove(imgurInfo.Hash);
|
||||||
imgurInfo.Image = null;
|
imgurInfo.Image = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,9 +304,9 @@ namespace GreenshotImgurPlugin {
|
||||||
LogHeader(nameValues, "X-RateLimit-ClientRemaining");
|
LogHeader(nameValues, "X-RateLimit-ClientRemaining");
|
||||||
|
|
||||||
// Update the credits in the config, this is shown in a form
|
// Update the credits in the config, this is shown in a form
|
||||||
int credits = 0;
|
int credits;
|
||||||
if (nameValues.ContainsKey("X-RateLimit-Remaining") && int.TryParse(nameValues["X-RateLimit-Remaining"], out credits)) {
|
if (nameValues.ContainsKey("X-RateLimit-Remaining") && int.TryParse(nameValues["X-RateLimit-Remaining"], out credits)) {
|
||||||
config.Credits = credits;
|
Config.Credits = credits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{19FEEF09-313F-43C7-819D-F1BCA782B08B}</ProjectGuid>
|
<ProjectGuid>{19FEEF09-313F-43C7-819D-F1BCA782B08B}</ProjectGuid>
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation />
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -37,7 +38,9 @@
|
||||||
<Compile Include="Forms\JiraForm.Designer.cs">
|
<Compile Include="Forms\JiraForm.Designer.cs">
|
||||||
<DependentUpon>JiraForm.cs</DependentUpon>
|
<DependentUpon>JiraForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Forms\JiraFormBase.cs" />
|
<Compile Include="Forms\JiraFormBase.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Forms\SettingsForm.cs">
|
<Compile Include="Forms\SettingsForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||||
|
@ -20,6 +20,11 @@
|
||||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||||
<BaseAddress>4194304</BaseAddress>
|
<BaseAddress>4194304</BaseAddress>
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{C6988EE8-2FEE-4349-9F09-F9628A0D8965}</ProjectGuid>
|
<ProjectGuid>{C6988EE8-2FEE-4349-9F09-F9628A0D8965}</ProjectGuid>
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation />
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{92599C09-FF29-4ABD-B6E6-C48ECD781BAB}</ProjectGuid>
|
<ProjectGuid>{92599C09-FF29-4ABD-B6E6-C48ECD781BAB}</ProjectGuid>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
@ -15,6 +15,11 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
|
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
|
|
@ -31,7 +31,6 @@ namespace GreenshotOfficePlugin {
|
||||||
public class OfficePlugin : IGreenshotPlugin {
|
public class OfficePlugin : IGreenshotPlugin {
|
||||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficePlugin));
|
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficePlugin));
|
||||||
public static PluginAttribute Attributes;
|
public static PluginAttribute Attributes;
|
||||||
private IGreenshotHost host;
|
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
|
@ -42,11 +41,8 @@ namespace GreenshotOfficePlugin {
|
||||||
//if (disposing) {}
|
//if (disposing) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public OfficePlugin() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<IDestination> Destinations() {
|
public IEnumerable<IDestination> Destinations() {
|
||||||
IDestination destination = null;
|
IDestination destination;
|
||||||
try {
|
try {
|
||||||
destination = new ExcelDestination();
|
destination = new ExcelDestination();
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -100,12 +96,10 @@ namespace GreenshotOfficePlugin {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Implementation of the IGreenshotPlugin.Initialize
|
/// Implementation of the IGreenshotPlugin.Initialize
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
|
/// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param>
|
||||||
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
|
/// <param name="myAttributes">My own attributes</param>
|
||||||
/// <param name="pluginAttribute">My own attributes</param>
|
|
||||||
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
|
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
|
||||||
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
|
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
|
||||||
this.host = (IGreenshotHost)pluginHost;
|
|
||||||
Attributes = myAttributes;
|
Attributes = myAttributes;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{9C0ECC4C-7807-4111-916A-4F57BB29788A}</ProjectGuid>
|
<ProjectGuid>{9C0ECC4C-7807-4111-916A-4F57BB29788A}</ProjectGuid>
|
||||||
|
@ -14,6 +14,11 @@
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{1893A2E4-A78A-4713-A8E7-E70058DABEE0}</ProjectGuid>
|
<ProjectGuid>{1893A2E4-A78A-4713-A8E7-E70058DABEE0}</ProjectGuid>
|
||||||
|
@ -13,9 +13,12 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||||
<FileUpgradeFlags />
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -77,12 +77,18 @@ namespace GreenshotPlugin.Core {
|
||||||
Uri url = new Uri(baseUri, new Uri("favicon.ico"));
|
Uri url = new Uri(baseUri, new Uri("favicon.ico"));
|
||||||
try {
|
try {
|
||||||
HttpWebRequest request = CreateWebRequest(url);
|
HttpWebRequest request = CreateWebRequest(url);
|
||||||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||||
if (request.HaveResponse) {
|
{
|
||||||
using (Stream responseStream = response.GetResponseStream()) {
|
if (request.HaveResponse)
|
||||||
if (responseStream != null) {
|
{
|
||||||
using (Image image = Image.FromStream(responseStream)) {
|
using (Stream responseStream = response.GetResponseStream())
|
||||||
return (image.Height > 16 && image.Width > 16) ? new Bitmap(image, 16, 16) : new Bitmap(image);
|
{
|
||||||
|
if (responseStream != null)
|
||||||
|
{
|
||||||
|
using (Image image = Image.FromStream(responseStream))
|
||||||
|
{
|
||||||
|
return (image.Height > 16 && image.Width > 16) ? new Bitmap(image, 16, 16) : new Bitmap(image);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,6 +430,32 @@ namespace GreenshotPlugin.Core {
|
||||||
return GetResponseAsString(webRequest, false);
|
return GetResponseAsString(webRequest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Read the response as string
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="response"></param>
|
||||||
|
/// <returns>string or null</returns>
|
||||||
|
private static string GetResponseAsString(HttpWebResponse response)
|
||||||
|
{
|
||||||
|
string responseData = null;
|
||||||
|
if (response == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
using (response)
|
||||||
|
{
|
||||||
|
Stream responseStream = response.GetResponseStream();
|
||||||
|
if (responseStream != null)
|
||||||
|
{
|
||||||
|
using (StreamReader reader = new StreamReader(responseStream, true))
|
||||||
|
{
|
||||||
|
responseData = reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return responseData;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -431,40 +463,54 @@ namespace GreenshotPlugin.Core {
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetResponseAsString(HttpWebRequest webRequest, bool alsoReturnContentOnError) {
|
public static string GetResponseAsString(HttpWebRequest webRequest, bool alsoReturnContentOnError) {
|
||||||
string responseData = null;
|
string responseData = null;
|
||||||
try {
|
HttpWebResponse response = null;
|
||||||
HttpWebResponse response = (HttpWebResponse) webRequest.GetResponse();
|
bool isHttpError = false;
|
||||||
|
try {
|
||||||
|
response = (HttpWebResponse)webRequest.GetResponse();
|
||||||
LOG.InfoFormat("Response status: {0}", response.StatusCode);
|
LOG.InfoFormat("Response status: {0}", response.StatusCode);
|
||||||
bool isHttpError = (int) response.StatusCode >= 300;
|
isHttpError = (int)response.StatusCode >= 300;
|
||||||
DebugHeaders(response);
|
if (isHttpError)
|
||||||
Stream responseStream = response.GetResponseStream();
|
{
|
||||||
if (responseStream != null) {
|
|
||||||
using (StreamReader reader = new StreamReader(responseStream, true)) {
|
|
||||||
responseData = reader.ReadToEnd();
|
|
||||||
}
|
|
||||||
if (isHttpError) {
|
|
||||||
LOG.ErrorFormat("HTTP error {0} with content: {1}", response.StatusCode, responseData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (WebException e) {
|
|
||||||
HttpWebResponse response = (HttpWebResponse) e.Response;
|
|
||||||
if (response != null) {
|
|
||||||
LOG.ErrorFormat("HTTP error {0}", response.StatusCode);
|
LOG.ErrorFormat("HTTP error {0}", response.StatusCode);
|
||||||
using (Stream responseStream = response.GetResponseStream()) {
|
}
|
||||||
if (responseStream != null) {
|
DebugHeaders(response);
|
||||||
using (StreamReader streamReader = new StreamReader(responseStream, true)) {
|
responseData = GetResponseAsString(response);
|
||||||
string errorContent = streamReader.ReadToEnd();
|
if (isHttpError)
|
||||||
if (alsoReturnContentOnError) {
|
{
|
||||||
return errorContent;
|
LOG.ErrorFormat("HTTP response {0}", responseData);
|
||||||
}
|
}
|
||||||
LOG.ErrorFormat("Content: {0}", errorContent);
|
}
|
||||||
}
|
catch (WebException e) {
|
||||||
}
|
response = (HttpWebResponse) e.Response;
|
||||||
|
HttpStatusCode statusCode = HttpStatusCode.Unused;
|
||||||
|
if (response != null) {
|
||||||
|
statusCode = response.StatusCode;
|
||||||
|
LOG.ErrorFormat("HTTP error {0}", statusCode);
|
||||||
|
string errorContent = GetResponseAsString(response);
|
||||||
|
if (alsoReturnContentOnError)
|
||||||
|
{
|
||||||
|
return errorContent;
|
||||||
}
|
}
|
||||||
|
LOG.ErrorFormat("Content: {0}", errorContent);
|
||||||
}
|
}
|
||||||
LOG.Error("WebException: ", e);
|
LOG.Error("WebException: ", e);
|
||||||
|
if (statusCode == HttpStatusCode.Unauthorized)
|
||||||
|
{
|
||||||
|
throw new UnauthorizedAccessException(e.Message);
|
||||||
|
}
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (response != null)
|
||||||
|
{
|
||||||
|
if (isHttpError)
|
||||||
|
{
|
||||||
|
LOG.ErrorFormat("HTTP error {0} with content: {1}", response.StatusCode, responseData);
|
||||||
|
}
|
||||||
|
response.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
return responseData;
|
return responseData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,9 +523,11 @@ namespace GreenshotPlugin.Core {
|
||||||
try {
|
try {
|
||||||
HttpWebRequest webRequest = CreateWebRequest(uri);
|
HttpWebRequest webRequest = CreateWebRequest(uri);
|
||||||
webRequest.Method = HTTPMethod.HEAD.ToString();
|
webRequest.Method = HTTPMethod.HEAD.ToString();
|
||||||
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
|
using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
|
||||||
LOG.DebugFormat("RSS feed was updated at {0}", webResponse.LastModified);
|
{
|
||||||
return webResponse.LastModified;
|
LOG.DebugFormat("RSS feed was updated at {0}", webResponse.LastModified);
|
||||||
|
return webResponse.LastModified;
|
||||||
|
}
|
||||||
} catch (Exception wE) {
|
} catch (Exception wE) {
|
||||||
LOG.WarnFormat("Problem requesting HTTP - HEAD on uri {0}", uri);
|
LOG.WarnFormat("Problem requesting HTTP - HEAD on uri {0}", uri);
|
||||||
LOG.Warn(wE.Message);
|
LOG.Warn(wE.Message);
|
||||||
|
|
|
@ -476,7 +476,8 @@ namespace GreenshotPlugin.Core {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the request token using the consumer key and secret. Also initializes tokensecret
|
/// Get the request token using the consumer key and secret. Also initializes tokensecret
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void GetRequestToken() {
|
/// <returns>response, this doesn't need to be used!!</returns>
|
||||||
|
private string GetRequestToken() {
|
||||||
IDictionary<string, object> parameters = new Dictionary<string, object>();
|
IDictionary<string, object> parameters = new Dictionary<string, object>();
|
||||||
foreach(var value in _requestTokenParameters) {
|
foreach(var value in _requestTokenParameters) {
|
||||||
parameters.Add(value);
|
parameters.Add(value);
|
||||||
|
@ -493,15 +494,17 @@ namespace GreenshotPlugin.Core {
|
||||||
TokenSecret = _requestTokenResponseParameters[OAUTH_TOKEN_SECRET_KEY];
|
TokenSecret = _requestTokenResponseParameters[OAUTH_TOKEN_SECRET_KEY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Authorize the token by showing the dialog
|
/// Authorize the token by showing the dialog
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="requestTokenResponse">Pass the response from the server's request token, so if there is something wrong we can show it.</param>
|
||||||
/// <returns>The request token.</returns>
|
/// <returns>The request token.</returns>
|
||||||
private String GetAuthorizeToken() {
|
private string GetAuthorizeToken(string requestTokenResponse) {
|
||||||
if (string.IsNullOrEmpty(Token)) {
|
if (string.IsNullOrEmpty(Token)) {
|
||||||
Exception e = new Exception("The request token is not set");
|
Exception e = new Exception("The request token is not set, service responded with: " + requestTokenResponse);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
LOG.DebugFormat("Opening AuthorizationLink: {0}", AuthorizationLink);
|
LOG.DebugFormat("Opening AuthorizationLink: {0}", AuthorizationLink);
|
||||||
|
@ -532,7 +535,7 @@ namespace GreenshotPlugin.Core {
|
||||||
/// Get the access token
|
/// Get the access token
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The access token.</returns>
|
/// <returns>The access token.</returns>
|
||||||
private String GetAccessToken() {
|
private string GetAccessToken() {
|
||||||
if (string.IsNullOrEmpty(Token) || (CheckVerifier && string.IsNullOrEmpty(Verifier))) {
|
if (string.IsNullOrEmpty(Token) || (CheckVerifier && string.IsNullOrEmpty(Verifier))) {
|
||||||
Exception e = new Exception("The request token and verifier were not set");
|
Exception e = new Exception("The request token and verifier were not set");
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -567,13 +570,14 @@ namespace GreenshotPlugin.Core {
|
||||||
TokenSecret = null;
|
TokenSecret = null;
|
||||||
Verifier = null;
|
Verifier = null;
|
||||||
LOG.Debug("Creating Token");
|
LOG.Debug("Creating Token");
|
||||||
try {
|
string requestTokenResponse;
|
||||||
GetRequestToken();
|
try {
|
||||||
|
requestTokenResponse = GetRequestToken();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.Error(ex);
|
LOG.Error(ex);
|
||||||
throw new NotSupportedException("Service is not available: " + ex.Message);
|
throw new NotSupportedException("Service is not available: " + ex.Message);
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(GetAuthorizeToken())) {
|
if (string.IsNullOrEmpty(GetAuthorizeToken(requestTokenResponse))) {
|
||||||
LOG.Debug("User didn't authenticate!");
|
LOG.Debug("User didn't authenticate!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -666,36 +670,33 @@ namespace GreenshotPlugin.Core {
|
||||||
|
|
||||||
// Join all parameters
|
// Join all parameters
|
||||||
IDictionary<string, object> newParameters = new Dictionary<string, object>();
|
IDictionary<string, object> newParameters = new Dictionary<string, object>();
|
||||||
foreach(var parameter in parametersToSign) {
|
foreach (var parameter in parametersToSign) {
|
||||||
newParameters.Add(parameter);
|
newParameters.Add(parameter);
|
||||||
}
|
}
|
||||||
if (additionalParameters != null) {
|
if (additionalParameters != null) {
|
||||||
foreach(var parameter in additionalParameters) {
|
foreach (var parameter in additionalParameters) {
|
||||||
newParameters.Add(parameter);
|
newParameters.Add(parameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return MakeRequest(method, requestURL, headers, newParameters, postData);
|
return MakeRequest(method, requestURL, headers, newParameters, postData);
|
||||||
} catch (WebException wEx) {
|
} catch (UnauthorizedAccessException uaEx) {
|
||||||
lastException = wEx;
|
lastException = uaEx;
|
||||||
if (wEx.Response != null) {
|
Token = null;
|
||||||
HttpWebResponse response = wEx.Response as HttpWebResponse;
|
TokenSecret = null;
|
||||||
if (response != null && response.StatusCode == HttpStatusCode.Unauthorized) {
|
// Remove oauth keys, so they aren't added double
|
||||||
Token = null;
|
List<string> keysToDelete = new List<string>();
|
||||||
TokenSecret = null;
|
foreach (string parameterKey in parametersToSign.Keys)
|
||||||
// Remove oauth keys, so they aren't added double
|
{
|
||||||
List<string> keysToDelete = new List<string>();
|
if (parameterKey.StartsWith(OAUTH_PARAMETER_PREFIX))
|
||||||
foreach (string parameterKey in parametersToSign.Keys) {
|
{
|
||||||
if (parameterKey.StartsWith(OAUTH_PARAMETER_PREFIX)) {
|
keysToDelete.Add(parameterKey);
|
||||||
keysToDelete.Add(parameterKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach(string keyToDelete in keysToDelete) {
|
|
||||||
parametersToSign.Remove(keyToDelete);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw;
|
foreach (string keyToDelete in keysToDelete)
|
||||||
|
{
|
||||||
|
parametersToSign.Remove(keyToDelete);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lastException != null) {
|
if (lastException != null) {
|
||||||
|
|
|
@ -97,15 +97,21 @@ namespace GreenshotPlugin.Core {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SourceForgeHelper {
|
public class SourceForgeHelper {
|
||||||
private static ILog LOG = LogManager.GetLogger(typeof(SourceForgeHelper));
|
private static ILog LOG = LogManager.GetLogger(typeof(SourceForgeHelper));
|
||||||
private const String RSSFEED = "http://getgreenshot.org/project-feed/";
|
private const string RSSFEED = "http://getgreenshot.org/project-feed/";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is using the HTTP HEAD Method to check if the RSS Feed is modified after the supplied date
|
/// This is using the HTTP HEAD Method to check if the RSS Feed is modified after the supplied date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="updateTime">DateTime</param>
|
/// <param name="updateTime">DateTime</param>
|
||||||
/// <returns>true if the feed is newer</returns>
|
/// <returns>true if the feed is newer</returns>
|
||||||
public static bool isRSSModifiedAfter(DateTime updateTime) {
|
public static bool IsRSSModifiedAfter(DateTime updateTime) {
|
||||||
DateTime lastModified = NetworkHelper.GetLastModified(new Uri(RSSFEED));
|
DateTime lastModified = NetworkHelper.GetLastModified(new Uri(RSSFEED));
|
||||||
|
if (lastModified == DateTime.MinValue)
|
||||||
|
{
|
||||||
|
// Time could not be read, just take now and add one hour to it.
|
||||||
|
// This assist BUG-1850
|
||||||
|
lastModified = DateTime.Now.AddHours(1);
|
||||||
|
}
|
||||||
return updateTime.CompareTo(lastModified) < 0;
|
return updateTime.CompareTo(lastModified) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1490,7 +1490,7 @@ namespace GreenshotPlugin.Core {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hWnd">IntPtr with the windows handle</param>
|
/// <param name="hWnd">IntPtr with the windows handle</param>
|
||||||
/// <returns>String with ClassName</returns>
|
/// <returns>String with ClassName</returns>
|
||||||
public static String GetClassName(IntPtr hWnd) {
|
public static string GetClassName(IntPtr hWnd) {
|
||||||
StringBuilder classNameBuilder = new StringBuilder(260, 260);
|
StringBuilder classNameBuilder = new StringBuilder(260, 260);
|
||||||
User32.GetClassName(hWnd, classNameBuilder, classNameBuilder.Capacity);
|
User32.GetClassName(hWnd, classNameBuilder, classNameBuilder.Capacity);
|
||||||
return classNameBuilder.ToString();
|
return classNameBuilder.ToString();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="..\CommonProject.properties" />
|
<Import Project="..\CommonProject.properties" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>{5B924697-4DCD-4F98-85F1-105CB84B7341}</ProjectGuid>
|
<ProjectGuid>{5B924697-4DCD-4F98-85F1-105CB84B7341}</ProjectGuid>
|
||||||
|
@ -14,6 +14,11 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<FileUpgradeFlags>
|
||||||
|
</FileUpgradeFlags>
|
||||||
|
<UpgradeBackupLocation>
|
||||||
|
</UpgradeBackupLocation>
|
||||||
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -142,8 +142,6 @@ namespace GreenshotPlugin.UnmanagedHelpers {
|
||||||
public static extern bool ShowScrollBar(IntPtr hwnd, ScrollBarDirection scrollBar, bool show);
|
public static extern bool ShowScrollBar(IntPtr hwnd, ScrollBarDirection scrollBar, bool show);
|
||||||
[DllImport("user32", SetLastError = true)]
|
[DllImport("user32", SetLastError = true)]
|
||||||
public static extern int SetScrollPos(IntPtr hWnd, Orientation nBar, int nPos, bool bRedraw);
|
public static extern int SetScrollPos(IntPtr hWnd, Orientation nBar, int nPos, bool bRedraw);
|
||||||
[DllImport("user32", SetLastError=true)]
|
|
||||||
public static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
|
|
||||||
[DllImport("user32", SetLastError = true)]
|
[DllImport("user32", SetLastError = true)]
|
||||||
public static extern RegionResult GetWindowRgn(IntPtr hWnd, SafeHandle hRgn);
|
public static extern RegionResult GetWindowRgn(IntPtr hWnd, SafeHandle hRgn);
|
||||||
[DllImport("user32", SetLastError = true)]
|
[DllImport("user32", SetLastError = true)]
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
version: 1.2.7.{build}
|
version: 1.2.8.{build}
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- 1.2
|
- 1.2
|
||||||
skip_tags: true
|
skip_tags: true
|
||||||
configuration: Release
|
configuration: Release
|
||||||
platform: Any CPU
|
platform: Any CPU
|
||||||
|
shallow_clone: true
|
||||||
clone_depth: 1
|
clone_depth: 1
|
||||||
assembly_info:
|
assembly_info:
|
||||||
patch: true
|
patch: true
|
||||||
|
@ -26,9 +27,9 @@ environment:
|
||||||
credentials_flickr_consumer_secret:
|
credentials_flickr_consumer_secret:
|
||||||
secure: 9TthlljPHXWPkDDeG3uiFVJ9YJwHZOV0ZsojaIBBuvw=
|
secure: 9TthlljPHXWPkDDeG3uiFVJ9YJwHZOV0ZsojaIBBuvw=
|
||||||
credentials_imgur_consumer_key:
|
credentials_imgur_consumer_key:
|
||||||
secure: z8S4QZ3/InPe3dgCf0CNyS0VGKuRyjjP8WMAq+AkK5OZJxZcbIxwobjgelE5CWYL
|
secure: XRTg1Ecs6ER9m4779CJAng==
|
||||||
credentials_imgur_consumer_secret:
|
credentials_imgur_consumer_secret:
|
||||||
secure: ovfXJRorkkKUzbMXuZ4m0U6KF4icngmS+nzSljXJGSKfhI+GNXbMNa//mKYfTCXI
|
secure: gcCp/gJF8vqmnCUPKyb04H8Oz9mWmiB00U5X7iI/DGr5mxjoCG1khc6/zn6aSSqn
|
||||||
credentials_photobucket_consumer_key:
|
credentials_photobucket_consumer_key:
|
||||||
secure: oo9GD1Y8dkrli6hMfnnYsw==
|
secure: oo9GD1Y8dkrli6hMfnnYsw==
|
||||||
credentials_photobucket_consumer_secret:
|
credentials_photobucket_consumer_secret:
|
92
appveyor13.yml
Normal file
92
appveyor13.yml
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
version: 1.3.0.{build}
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- 1.3
|
||||||
|
skip_tags: true
|
||||||
|
configuration: Release
|
||||||
|
platform: Any CPU
|
||||||
|
shallow_clone: true
|
||||||
|
assembly_info:
|
||||||
|
patch: true
|
||||||
|
file: '**\AssemblyInfo.*'
|
||||||
|
assembly_version: '{version}'
|
||||||
|
assembly_file_version: '{version}'
|
||||||
|
assembly_informational_version: '{version}-$(build_type)-$(APPVEYOR_REPO_COMMIT)'
|
||||||
|
environment:
|
||||||
|
credentials_box_client_id:
|
||||||
|
secure: 8MKxTOowo2fat6cNXGbFfvn6typiEtmCKsrptrWiEFUEoKlT1DUn40iGNcIELRA1
|
||||||
|
credentials_box_client_secret:
|
||||||
|
secure: hJhzDVJuGd/WMnoSXhosvOM/1PGcYlKbtQjA6xyrmnmZcqCTMzqIdA6JXlo/V2Br
|
||||||
|
credentials_dropbox_consumer_key:
|
||||||
|
secure: Da/6KY1cu9CUM3iOqSpcUw==
|
||||||
|
credentials_dropbox_consumer_secret:
|
||||||
|
secure: KkyKyUY+buT/MZagXDP4cw==
|
||||||
|
credentials_flickr_consumer_key:
|
||||||
|
secure: fY8s0OkOMYwCjSZoL/6yZcP8xeT6J2EJLjbUMI5lAW42S5QT2U2B41KrmeP2NpnQ
|
||||||
|
credentials_flickr_consumer_secret:
|
||||||
|
secure: 9TthlljPHXWPkDDeG3uiFVJ9YJwHZOV0ZsojaIBBuvw=
|
||||||
|
credentials_imgur_consumer_key:
|
||||||
|
secure: XRTg1Ecs6ER9m4779CJAng==
|
||||||
|
credentials_imgur_consumer_secret:
|
||||||
|
secure: gcCp/gJF8vqmnCUPKyb04H8Oz9mWmiB00U5X7iI/DGr5mxjoCG1khc6/zn6aSSqn
|
||||||
|
credentials_photobucket_consumer_key:
|
||||||
|
secure: oo9GD1Y8dkrli6hMfnnYsw==
|
||||||
|
credentials_photobucket_consumer_secret:
|
||||||
|
secure: GiNPoe9klM/YkoHIA/YHqOYrIaYwSFK7Ph9m8jT9uPP1l6+Hd5K8dVMw5DNa50oG
|
||||||
|
credentials_picasa_consumer_key:
|
||||||
|
secure: bjKXhFZkDqaq98XBrz5oQKQfT8CLpuv2ZAiBIwkzloaAPUs97b5yx6h/xFaE4NLS
|
||||||
|
credentials_picasa_consumer_secret:
|
||||||
|
secure: yNptTpmJWypbu9alOQtetxU66drr2FKxoPflNgRJdag=
|
||||||
|
build_type: ALPHA
|
||||||
|
before_build:
|
||||||
|
- nuget restore
|
||||||
|
- ps: Build/prebuild.ps1
|
||||||
|
build:
|
||||||
|
project: greenshot.sln
|
||||||
|
verbosity: normal
|
||||||
|
after_build:
|
||||||
|
- ps: Build/build.ps1
|
||||||
|
test: off
|
||||||
|
artifacts:
|
||||||
|
- path: AssemblyDir\Greenshot*INSTALLER*.exe
|
||||||
|
name: Installer
|
||||||
|
- path: AssemblyDir\Greenshot*paf.exe
|
||||||
|
name: Portable
|
||||||
|
- path: AssemblyDir\Greenshot-NO*.zip
|
||||||
|
name: Zip
|
||||||
|
- path: Build\additional_files\readme.txt
|
||||||
|
name: Readme
|
||||||
|
- path: AssemblyDir\Greenshot-DEBUGSYMBOLS*.zip
|
||||||
|
name: DEBUGSYMBOLS
|
||||||
|
deploy:
|
||||||
|
- provider: GitHub
|
||||||
|
tag: Greenshot-$(build_type)-$(APPVEYOR_BUILD_VERSION)
|
||||||
|
description:
|
||||||
|
auth_token:
|
||||||
|
secure: h0R+O/UoDM5Fy9XBfpRWLxFdR4a6CS+hDxr/MUeiRSviAmUsSlvsGSyOG6KiAVrL
|
||||||
|
prerelease: true
|
||||||
|
on:
|
||||||
|
build_type: RELEASE_CANDIDATE
|
||||||
|
- provider: GitHub
|
||||||
|
tag: Greenshot-$(build_type)-$(APPVEYOR_BUILD_VERSION)
|
||||||
|
description:
|
||||||
|
auth_token:
|
||||||
|
secure: h0R+O/UoDM5Fy9XBfpRWLxFdR4a6CS+hDxr/MUeiRSviAmUsSlvsGSyOG6KiAVrL
|
||||||
|
prerelease: true
|
||||||
|
on:
|
||||||
|
build_type: BETA
|
||||||
|
- provider: GitHub
|
||||||
|
tag: Greenshot-$(build_type)-$(APPVEYOR_BUILD_VERSION)
|
||||||
|
auth_token:
|
||||||
|
secure: h0R+O/UoDM5Fy9XBfpRWLxFdR4a6CS+hDxr/MUeiRSviAmUsSlvsGSyOG6KiAVrL
|
||||||
|
on:
|
||||||
|
build_type: RELEASE
|
||||||
|
notifications:
|
||||||
|
- provider: Email
|
||||||
|
to:
|
||||||
|
- robin@getgreenshot.org
|
||||||
|
- jens@getgreenshot.org
|
||||||
|
- thomas@getgreenshot.org
|
||||||
|
on_build_success: true
|
||||||
|
on_build_failure: true
|
||||||
|
on_build_status_changed: true
|
|
@ -290,5 +290,3 @@ PackagePortable
|
||||||
echo "Generating Debug Symbols ZIP"
|
echo "Generating Debug Symbols ZIP"
|
||||||
PackageDbgSymbolsZip
|
PackageDbgSymbolsZip
|
||||||
|
|
||||||
echo "build successful, tagging with $fileversion"
|
|
||||||
TagCode
|
|
Loading…
Add table
Add a link
Reference in a new issue