mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-12 04:53:09 +02:00
Configuration
Core
Bridge
Controls
Handling
Notification
Other
Settings
Dialogs
Export
BaseTabSettings.Designer.cs
BaseTabSettings.cs
TabSettingsAdvanced.Designer.cs
TabSettingsAdvanced.cs
TabSettingsGeneral.Designer.cs
TabSettingsGeneral.cs
TabSettingsNotifications.Designer.cs
TabSettingsNotifications.cs
TabSettingsUpdates.Designer.cs
TabSettingsUpdates.cs
FormAbout.Designer.cs
FormAbout.cs
FormAbout.resx
FormMessage.Designer.cs
FormMessage.cs
FormPlugins.Designer.cs
FormPlugins.cs
FormPlugins.resx
FormSettings.Designer.cs
FormSettings.cs
FormSettings.resx
Utils
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
FormNotification.Designer.cs
FormNotification.cs
TrayIcon.Designer.cs
TrayIcon.cs
Libraries
Plugins
Properties
Resources
Updates
bld
tests
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDck.csproj
TweetDck.sln
TweetDck.sln.DotSettings
_postbuild.bat
55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using TweetDck.Updates;
|
|
using TweetDck.Updates.Events;
|
|
|
|
namespace TweetDck.Core.Other.Settings{
|
|
partial class TabSettingsUpdates : BaseTabSettings{
|
|
private readonly UpdateHandler updates;
|
|
private int updateCheckEventId = -1;
|
|
|
|
public TabSettingsUpdates(UpdateHandler updates){
|
|
InitializeComponent();
|
|
|
|
this.updates = updates;
|
|
|
|
this.updates.CheckFinished += updates_CheckFinished;
|
|
Disposed += (sender, args) => this.updates.CheckFinished -= updates_CheckFinished;
|
|
|
|
checkUpdateNotifications.Checked = Config.EnableUpdateCheck;
|
|
}
|
|
|
|
private void checkUpdateNotifications_CheckedChanged(object sender, EventArgs e){
|
|
if (!Ready)return;
|
|
|
|
Config.EnableUpdateCheck = checkUpdateNotifications.Checked;
|
|
}
|
|
|
|
private void btnCheckUpdates_Click(object sender, EventArgs e){
|
|
if (!Ready)return;
|
|
|
|
updateCheckEventId = updates.Check(true);
|
|
|
|
if (updateCheckEventId == -1){
|
|
MessageBox.Show("Sorry, your system is no longer supported.", "Unsupported System", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
}
|
|
else{
|
|
btnCheckUpdates.Enabled = false;
|
|
|
|
Config.DismissedUpdate = string.Empty;
|
|
Config.Save();
|
|
}
|
|
}
|
|
|
|
private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){
|
|
if (e.EventId == updateCheckEventId){
|
|
btnCheckUpdates.Enabled = true;
|
|
|
|
if (!e.UpdateAvailable){
|
|
MessageBox.Show("Your version of "+Program.BrandName+" is up to date.", "No Updates Available", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|