mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-06-03 17:34:07 +02:00
Refactor UpdateHandler to not expose UpdaterSettings
This commit is contained in:
parent
8036659003
commit
d9b9afbf2d
@ -338,10 +338,7 @@ public void OpenSettings(int tabIndex){
|
|||||||
currentFormSettings = null;
|
currentFormSettings = null;
|
||||||
|
|
||||||
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
|
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
|
||||||
updates.Settings.DismissedUpdate = string.Empty;
|
updates.DismissUpdate(string.Empty);
|
||||||
Config.DismissedUpdate = string.Empty;
|
|
||||||
Config.Save();
|
|
||||||
|
|
||||||
updates.Check(false);
|
updates.Check(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +77,7 @@ private void btnCheckUpdates_Click(object sender, EventArgs e){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
btnCheckUpdates.Enabled = false;
|
btnCheckUpdates.Enabled = false;
|
||||||
|
updates.DismissUpdate(string.Empty);
|
||||||
updates.Settings.DismissedUpdate = string.Empty;
|
|
||||||
Config.DismissedUpdate = string.Empty;
|
|
||||||
Config.Save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,19 +8,13 @@
|
|||||||
using TweetDck.Updates.Events;
|
using TweetDck.Updates.Events;
|
||||||
|
|
||||||
namespace TweetDck.Updates{
|
namespace TweetDck.Updates{
|
||||||
class UpdateHandler{
|
sealed class UpdateHandler{
|
||||||
private static bool IsSystemSupported{
|
private static bool IsSystemSupported{
|
||||||
get{
|
get{
|
||||||
return true; // Environment.OSVersion.Version >= new Version("6.1"); // 6.1 NT version = Windows 7
|
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 ChromiumWebBrowser browser;
|
||||||
private readonly FormBrowser form;
|
private readonly FormBrowser form;
|
||||||
private readonly UpdaterSettings settings;
|
private readonly UpdaterSettings settings;
|
||||||
@ -65,6 +59,14 @@ public int Check(bool force){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DismissUpdate(string tag){
|
||||||
|
settings.DismissedUpdate = tag;
|
||||||
|
|
||||||
|
if (UpdateDismissed != null){
|
||||||
|
UpdateDismissed(this, new UpdateDismissedEventArgs(tag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
|
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
|
||||||
if (UpdateAccepted != null){
|
if (UpdateAccepted != null){
|
||||||
form.InvokeAsyncSafe(() => UpdateAccepted(this, args));
|
form.InvokeAsyncSafe(() => UpdateAccepted(this, args));
|
||||||
|
Loading…
Reference in New Issue
Block a user