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:
RKrom 2012-10-14 12:34:31 +00:00
commit 69d29992a2
8 changed files with 74 additions and 54 deletions

View file

@ -295,11 +295,20 @@ namespace GreenshotPlugin.Core {
Exception e = new Exception("The request token is not set");
throw e;
}
Token = null;
Verifier = null;
LOG.DebugFormat("Opening AuthorizationLink: {0}", authorizationLink);
OAuthLoginForm oAuthLoginForm = new OAuthLoginForm(this, LoginTitle, BrowserSize, authorizationLink, CallbackUrl);
oAuthLoginForm.ShowDialog();
Token = oAuthLoginForm.Token;
Verifier = oAuthLoginForm.Verifier;
OAuthLoginForm oAuthLoginForm = new OAuthLoginForm(LoginTitle, BrowserSize, authorizationLink, CallbackUrl);
if (oAuthLoginForm.isOk) {
if (oAuthLoginForm.CallbackParameters != null) {
if (oAuthLoginForm.CallbackParameters.ContainsKey(OAUTH_TOKEN_KEY)) {
Token = oAuthLoginForm.CallbackParameters[OAUTH_TOKEN_KEY];
}
if (oAuthLoginForm.CallbackParameters.ContainsKey(OAUTH_VERIFIER_KEY)) {
Verifier = oAuthLoginForm.CallbackParameters[OAUTH_VERIFIER_KEY];
}
}
}
if (CheckVerifier) {
if (!string.IsNullOrEmpty(Verifier)) {
return Token;