From 3d4cec3b229007de1feda3f9fbf28d34eb983b22 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Tue, 22 Aug 2017 02:45:51 +0200 Subject: [PATCH] Remove update code that handles unsupported system check --- Core/Other/Settings/TabSettingsGeneral.cs | 11 +++-------- Resources/Scripts/update.js | 20 ++------------------ Updates/UpdateHandler.cs | 21 ++++++--------------- 3 files changed, 11 insertions(+), 41 deletions(-) diff --git a/Core/Other/Settings/TabSettingsGeneral.cs b/Core/Other/Settings/TabSettingsGeneral.cs index 43d2b548..bd2520dc 100644 --- a/Core/Other/Settings/TabSettingsGeneral.cs +++ b/Core/Other/Settings/TabSettingsGeneral.cs @@ -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){ diff --git a/Resources/Scripts/update.js b/Resources/Scripts/update.js index 05a5ba00..abcd2778 100644 --- a/Resources/Scripts/update.js +++ b/Resources/Scripts/update.js @@ -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 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); diff --git a/Updates/UpdateHandler.cs b/Updates/UpdateHandler.cs index 98e68001..f038a758 100644 --- a/Updates/UpdateHandler.cs +++ b/Updates/UpdateHandler.cs @@ -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){