1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-13 18:15:48 +02:00

Remove update code that handles unsupported system check

This commit is contained in:
chylex 2017-08-22 02:45:51 +02:00
parent 5ed970b5a0
commit 3d4cec3b22
3 changed files with 11 additions and 41 deletions
Core/Other/Settings
Resources/Scripts
Updates

View File

@ -91,15 +91,10 @@ private void checkUpdateNotifications_CheckedChanged(object sender, EventArgs e)
}
private void btnCheckUpdates_Click(object sender, EventArgs e){
updateCheckEventId = updates.Check(true);
btnCheckUpdates.Enabled = false;
if (updateCheckEventId == -1){
FormMessage.Warning("Unsupported System", "Sorry, your system is no longer supported.", FormMessage.OK);
}
else{
btnCheckUpdates.Enabled = false;
updates.DismissUpdate(string.Empty);
}
updates.DismissUpdate(string.Empty);
updateCheckEventId = updates.Check(true);
}
private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){

View File

@ -28,8 +28,6 @@
// Function: Creates the update notification element. Removes the old one if already exists.
//
var displayNotification = function(version, download, changelog){
var outdated = version === "unsupported";
// styles
var css = $("#tweetduck-update-css");
@ -183,16 +181,7 @@
ele.remove();
}
ele = $(outdated ? `
<div id='tweetduck-update'>
<p class='tdu-title'>Unsupported System</p>
<p class='tdu-info'>You will not receive updates</p>
<div class='tdu-buttons'>
<button class='tdu-btn-unsupported'>Read more</button>
<button class='tdu-btn-ignore'>Dismiss</button>
</div>
</div>
` : `
ele = $(`
<div id='tweetduck-update'>
<p class='tdu-title'>T&#8202;weetDuck Update ${version}</p>
<p class='tdu-info tdu-showlog'>View update information</p>
@ -244,11 +233,7 @@
slide();
});
buttonDiv.children(".tdu-btn-unsupported").click(function(){
$TDU.openBrowser("https://github.com/chylex/TweetDuck/wiki/Supported-Systems");
});
buttonDiv.children(".tdu-btn-ignore,.tdu-btn-unsupported").click(function(){
buttonDiv.children(".tdu-btn-ignore").click(function(){
$TDU.onUpdateDismissed();
slide();
});
@ -318,6 +303,5 @@
//
// Block: Setup global functions.
//
window.TDUF_displayNotification = displayNotification;
window.TDUF_runUpdateCheck = runUpdateCheck;
})($, $TDU);

View File

@ -9,8 +9,6 @@
namespace TweetDuck.Updates{
sealed class UpdateHandler{
private static bool IsSystemSupported => true; // Environment.OSVersion.Version >= new Version("6.1"); // 6.1 NT version = Windows 7
private readonly ChromiumWebBrowser browser;
private readonly UpdaterSettings settings;
@ -37,21 +35,14 @@ private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
}
public int Check(bool force){
if (IsSystemSupported){
if (Program.UserConfig.EnableUpdateCheck || force){
string dismissedUpdate = force || settings.DismissedUpdate == null ? string.Empty : settings.DismissedUpdate;
if (Program.UserConfig.EnableUpdateCheck || force){
string dismissedUpdate = force || settings.DismissedUpdate == null ? string.Empty : settings.DismissedUpdate;
browser.ExecuteScriptAsync("TDUF_runUpdateCheck", ++lastEventId, Program.VersionTag, dismissedUpdate, settings.AllowPreReleases);
return lastEventId;
}
browser.ExecuteScriptAsync("TDUF_runUpdateCheck", ++lastEventId, Program.VersionTag, dismissedUpdate, settings.AllowPreReleases);
return lastEventId;
}
return 0;
}
else if (settings.DismissedUpdate != "unsupported"){
browser.ExecuteScriptAsync("TDUF_displayNotification", "unsupported");
}
return -1;
return 0;
}
public void BeginUpdateDownload(Form ownerForm, UpdateInfo updateInfo, Action<UpdateInfo> onSuccess){