1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-01-23 18:46:02 +01:00

Refactor UpdateHandler to not expose UpdaterSettings

This commit is contained in:
chylex 2017-03-22 12:49:10 +01:00
parent 8036659003
commit d9b9afbf2d
3 changed files with 11 additions and 15 deletions

View File

@ -338,10 +338,7 @@ public void OpenSettings(int tabIndex){
currentFormSettings = null;
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
updates.Settings.DismissedUpdate = string.Empty;
Config.DismissedUpdate = string.Empty;
Config.Save();
updates.DismissUpdate(string.Empty);
updates.Check(false);
}

View File

@ -77,10 +77,7 @@ private void btnCheckUpdates_Click(object sender, EventArgs e){
}
else{
btnCheckUpdates.Enabled = false;
updates.Settings.DismissedUpdate = string.Empty;
Config.DismissedUpdate = string.Empty;
Config.Save();
updates.DismissUpdate(string.Empty);
}
}

View File

@ -8,19 +8,13 @@
using TweetDck.Updates.Events;
namespace TweetDck.Updates{
class UpdateHandler{
sealed class UpdateHandler{
private static bool IsSystemSupported{
get{
return true; // Environment.OSVersion.Version >= new Version("6.1"); // 6.1 NT version = Windows 7
}
}
public UpdaterSettings Settings{
get{
return settings;
}
}
private readonly ChromiumWebBrowser browser;
private readonly FormBrowser form;
private readonly UpdaterSettings settings;
@ -65,6 +59,14 @@ public int Check(bool force){
return -1;
}
public void DismissUpdate(string tag){
settings.DismissedUpdate = tag;
if (UpdateDismissed != null){
UpdateDismissed(this, new UpdateDismissedEventArgs(tag));
}
}
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
if (UpdateAccepted != null){
form.InvokeAsyncSafe(() => UpdateAccepted(this, args));