mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Changes for Box Plugin so it can re-use the OAuthLoginForm. Also fixed a startup issue with some plug-ins.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2143 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
dc8a160c7f
commit
69d29992a2
8 changed files with 74 additions and 54 deletions
|
@ -35,24 +35,20 @@ namespace GreenshotPlugin.Controls {
|
|||
public partial class OAuthLoginForm : Form {
|
||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OAuthLoginForm));
|
||||
private string callbackUrl = null;
|
||||
private String _token;
|
||||
private String _verifier;
|
||||
|
||||
public String Token {
|
||||
private IDictionary<string, string> callbackParameters = null;
|
||||
|
||||
public IDictionary<string, string> CallbackParameters {
|
||||
get { return callbackParameters; }
|
||||
}
|
||||
|
||||
public bool isOk {
|
||||
get {
|
||||
return _token;
|
||||
return DialogResult == DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
public String Verifier {
|
||||
get {
|
||||
return _verifier;
|
||||
}
|
||||
}
|
||||
|
||||
public OAuthLoginForm(OAuthSession o, string browserTitle, Size size, string authorizationLink, string callbackUrl) {
|
||||
|
||||
public OAuthLoginForm(string browserTitle, Size size, string authorizationLink, string callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
_token = null;
|
||||
InitializeComponent();
|
||||
this.ClientSize = size;
|
||||
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
|
||||
|
@ -86,15 +82,9 @@ namespace GreenshotPlugin.Controls {
|
|||
if (queryParams.Length > 0) {
|
||||
queryParams = NetworkHelper.UrlDecode(queryParams);
|
||||
//Store the Token and Token Secret
|
||||
IDictionary<string, string> qs = NetworkHelper.ParseQueryString(queryParams);
|
||||
if (qs.ContainsKey("oauth_token") && qs["oauth_token"] != null) {
|
||||
_token = qs["oauth_token"];
|
||||
}
|
||||
if (qs.ContainsKey("oauth_verifier") && qs["oauth_verifier"] != null) {
|
||||
_verifier = qs["oauth_verifier"];
|
||||
}
|
||||
callbackParameters = NetworkHelper.ParseQueryString(queryParams);
|
||||
}
|
||||
this.Close();
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue