BUG-1894: Postponing history loading as long as possible, this reduces the Imgur activity dramatically (as it's not loaded during start) and should at least prevent a 429 early on... hopefully. It would be better to cache everything locally on the user's PC, but this is unrealistic with .NET 2.0 technology (not impossible, but so time consuming that it would be better to wait for the next Greenshot version with 4.5).

This commit is contained in:
Robin 2016-11-16 09:09:28 +01:00
commit ede5bfef97
8 changed files with 85 additions and 52 deletions

View file

@ -25,7 +25,7 @@ namespace GreenshotImgurPlugin {
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : ImgurForm {
public SettingsForm(ImgurConfiguration config)
public SettingsForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
@ -34,9 +34,7 @@ namespace GreenshotImgurPlugin {
CancelButton = buttonCancel;
AcceptButton = buttonOK;
ImgurUtils.LoadHistory();
historyButton.Enabled = config.runtimeImgurHistory.Count > 0;
historyButton.Enabled = ImgurUtils.IsHistoryLoadingNeeded();
}
private void ButtonHistoryClick(object sender, EventArgs e) {