1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-30 14:34:09 +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){ private void btnCheckUpdates_Click(object sender, EventArgs e){
updateCheckEventId = updates.Check(true);
if (updateCheckEventId == -1){
FormMessage.Warning("Unsupported System", "Sorry, your system is no longer supported.", FormMessage.OK);
}
else{
btnCheckUpdates.Enabled = false; btnCheckUpdates.Enabled = false;
updates.DismissUpdate(string.Empty); updates.DismissUpdate(string.Empty);
} updateCheckEventId = updates.Check(true);
} }
private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){ 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. // Function: Creates the update notification element. Removes the old one if already exists.
// //
var displayNotification = function(version, download, changelog){ var displayNotification = function(version, download, changelog){
var outdated = version === "unsupported";
// styles // styles
var css = $("#tweetduck-update-css"); var css = $("#tweetduck-update-css");
@ -183,16 +181,7 @@
ele.remove(); ele.remove();
} }
ele = $(outdated ? ` ele = $(`
<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>
` : `
<div id='tweetduck-update'> <div id='tweetduck-update'>
<p class='tdu-title'>T&#8202;weetDuck Update ${version}</p> <p class='tdu-title'>T&#8202;weetDuck Update ${version}</p>
<p class='tdu-info tdu-showlog'>View update information</p> <p class='tdu-info tdu-showlog'>View update information</p>
@ -244,11 +233,7 @@
slide(); slide();
}); });
buttonDiv.children(".tdu-btn-unsupported").click(function(){ buttonDiv.children(".tdu-btn-ignore").click(function(){
$TDU.openBrowser("https://github.com/chylex/TweetDuck/wiki/Supported-Systems");
});
buttonDiv.children(".tdu-btn-ignore,.tdu-btn-unsupported").click(function(){
$TDU.onUpdateDismissed(); $TDU.onUpdateDismissed();
slide(); slide();
}); });
@ -318,6 +303,5 @@
// //
// Block: Setup global functions. // Block: Setup global functions.
// //
window.TDUF_displayNotification = displayNotification;
window.TDUF_runUpdateCheck = runUpdateCheck; window.TDUF_runUpdateCheck = runUpdateCheck;
})($, $TDU); })($, $TDU);

View File

@ -9,8 +9,6 @@
namespace TweetDuck.Updates{ namespace TweetDuck.Updates{
sealed class UpdateHandler{ 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 ChromiumWebBrowser browser;
private readonly UpdaterSettings settings; private readonly UpdaterSettings settings;
@ -37,7 +35,6 @@ private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){
} }
public int Check(bool force){ public int Check(bool force){
if (IsSystemSupported){
if (Program.UserConfig.EnableUpdateCheck || force){ if (Program.UserConfig.EnableUpdateCheck || force){
string dismissedUpdate = force || settings.DismissedUpdate == null ? string.Empty : settings.DismissedUpdate; string dismissedUpdate = force || settings.DismissedUpdate == null ? string.Empty : settings.DismissedUpdate;
@ -47,12 +44,6 @@ public int Check(bool force){
return 0; return 0;
} }
else if (settings.DismissedUpdate != "unsupported"){
browser.ExecuteScriptAsync("TDUF_displayNotification", "unsupported");
}
return -1;
}
public void BeginUpdateDownload(Form ownerForm, UpdateInfo updateInfo, Action<UpdateInfo> onSuccess){ public void BeginUpdateDownload(Form ownerForm, UpdateInfo updateInfo, Action<UpdateInfo> onSuccess){
if (updateInfo.DownloadStatus == UpdateDownloadStatus.Done){ if (updateInfo.DownloadStatus == UpdateDownloadStatus.Done){