Hacked the Imgur plugin to partly work with the version 3, so AnonymousAccess works. Added a more rough filtering for the language issues, fixed an update check, fixed a problem when closing the history and updated the readme.txt

This commit is contained in:
RKrom 2015-10-08 22:33:43 +02:00
commit 45c0e1efed
8 changed files with 59 additions and 39 deletions

View file

@ -29,39 +29,39 @@ using log4net;
namespace GreenshotPlugin.Core {
public class SourceforgeFile {
private string file;
private readonly string _file;
public string File {
get {return file;}
get {return _file;}
}
private DateTime pubdate;
private readonly DateTime _pubdate;
public DateTime Pubdate {
get {return pubdate;}
get {return _pubdate;}
}
private string link;
private readonly string _link;
public string Link {
get {return link;}
get {return _link;}
}
private string directLink;
private readonly string _directLink;
public string DirectLink {
get {return directLink;}
get {return _directLink;}
}
private Version version;
private Version _version;
public Version Version {
get {return version;}
get {return _version;}
set {
version = value;
_version = value;
}
}
private string language;
private string _language;
public string Language {
get {return language;}
set {language = value;}
get {return _language;}
set {_language = value;}
}
public bool isExe {
get {
if (file != null) {
return file.ToLower().EndsWith(".exe");
if (_file != null) {
return _file.ToLower().EndsWith(".exe");
}
return false;
}
@ -69,8 +69,8 @@ namespace GreenshotPlugin.Core {
public bool isUnstable {
get {
if (file != null) {
return file.ToLower().Contains("unstable");
if (_file != null) {
return _file.ToLower().Contains("unstable");
}
return false;
}
@ -78,18 +78,18 @@ namespace GreenshotPlugin.Core {
public bool isReleaseCandidate {
get {
if (file != null) {
return Regex.IsMatch(file.ToLower(), "rc[0-9]+");
if (_file != null) {
return Regex.IsMatch(_file.ToLower(), "rc[0-9]+");
}
return false;
}
}
public SourceforgeFile(string file, string pubdate, string link, string directLink) {
this.file = file;
this.pubdate = DateTime.Parse(pubdate);
this.link = link;
this.directLink = directLink;
this._file = file;
DateTime.TryParse(pubdate, out _pubdate);
this._link = link;
this._directLink = directLink;
}
}
/// <summary>

View file

@ -21,6 +21,7 @@
using GreenshotPlugin.UnmanagedHelpers;
using System.Windows.Forms;
using log4net;
namespace GreenshotPlugin.Core
{
@ -31,11 +32,15 @@ namespace GreenshotPlugin.Core
/// </summary>
public class WmInputLangChangeRequestFilter : IMessageFilter
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(WmInputLangChangeRequestFilter));
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == (int)WindowsMessages.WM_INPUTLANGCHANGEREQUEST || m.Msg == (int)WindowsMessages.WM_INPUTLANGCHANGE)
WindowsMessages message = (WindowsMessages)m.Msg;
if (message == WindowsMessages.WM_INPUTLANGCHANGEREQUEST || message == WindowsMessages.WM_INPUTLANGCHANGE)
{
return m.LParam.ToInt64() > 0x7FFFFFFF;
LOG.WarnFormat("Filtering: {0}, {1:X} - {2:X} - {3:X}", message, m.LParam.ToInt64(), m.WParam.ToInt64(), m.HWnd.ToInt64());
return (m.LParam.ToInt64() | 0xFFFFFFFF) != 0;
}
return false;
}