From 48a197b942ea2899c7a2e89281382af6b6631a3e Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Sat, 20 Mar 2021 19:49:19 +0100 Subject: [PATCH] Changed the Box destination to work via the Greenshot website, this solves issues with the embedded browser. --- GreenshotBoxPlugin/BoxDestination.cs | 12 ++---------- GreenshotBoxPlugin/BoxUtils.cs | 5 ++--- GreenshotDropboxPlugin/DropboxPlugin.cs | 13 ++++++------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/GreenshotBoxPlugin/BoxDestination.cs b/GreenshotBoxPlugin/BoxDestination.cs index 06402ca89..4283a178c 100644 --- a/GreenshotBoxPlugin/BoxDestination.cs +++ b/GreenshotBoxPlugin/BoxDestination.cs @@ -30,17 +30,9 @@ namespace GreenshotBoxPlugin { _plugin = plugin; } - public override string Designation { - get { - return "Box"; - } - } + public override string Designation => "Box"; - public override string Description { - get { - return Language.GetString("box", LangKey.upload_menu_item); - } - } + public override string Description => Language.GetString("box", LangKey.upload_menu_item); public override Image DisplayIcon { get { diff --git a/GreenshotBoxPlugin/BoxUtils.cs b/GreenshotBoxPlugin/BoxUtils.cs index 7b4d50756..dff0670c2 100644 --- a/GreenshotBoxPlugin/BoxUtils.cs +++ b/GreenshotBoxPlugin/BoxUtils.cs @@ -74,9 +74,8 @@ namespace GreenshotBoxPlugin { CloudServiceName = "Box", ClientId = BoxCredentials.ClientId, ClientSecret = BoxCredentials.ClientSecret, - RedirectUrl = "https://www.box.com/home/", - BrowserSize = new Size(1060, 600), - AuthorizeMode = OAuth2AuthorizeMode.EmbeddedBrowser, + RedirectUrl = "https://getgreenshot.org/authorize/box", + AuthorizeMode = OAuth2AuthorizeMode.JsonReceiver, RefreshToken = Config.RefreshToken, AccessToken = Config.AccessToken, AccessTokenExpires = Config.AccessTokenExpires diff --git a/GreenshotDropboxPlugin/DropboxPlugin.cs b/GreenshotDropboxPlugin/DropboxPlugin.cs index 476dfda54..2977c2d36 100644 --- a/GreenshotDropboxPlugin/DropboxPlugin.cs +++ b/GreenshotDropboxPlugin/DropboxPlugin.cs @@ -44,13 +44,12 @@ namespace GreenshotDropboxPlugin { GC.SuppressFinalize(this); } - protected void Dispose(bool disposing) { - if (disposing) { - if (_itemPlugInConfig != null) { - _itemPlugInConfig.Dispose(); - _itemPlugInConfig = null; - } - } + private void Dispose(bool disposing) + { + if (!disposing) return; + if (_itemPlugInConfig == null) return; + _itemPlugInConfig.Dispose(); + _itemPlugInConfig = null; } ///