1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

[519] Add Downgrade Warning

This commit is contained in:
David Sangrey 2024-05-05 18:17:00 -04:00
parent 2482b32b60
commit 1d052e4930
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC
3 changed files with 35 additions and 6 deletions

View File

@ -854,9 +854,27 @@ class AppWindow:
self.login() # Login if not already logged in with this Cmdr
if postargs.get('Update') and postargs.get('Track'):
track = postargs.get('Track')
# LANG: Inform the user the Update Track has changed
self.status['text'] = tr.tl('Update Track Changed to {TRACK}').format(TRACK=postargs.get('Track'))
self.status['text'] = tr.tl('Update Track Changed to {TRACK}').format(TRACK=track)
self.updater.check_for_updates()
if track == "Stable":
# LANG: Inform the user the Update Track has changed
title = tr.tl('Update Track Changed to {TRACK}').format(TRACK=track)
update_msg = tr.tl( # LANG: Inform User of Beta -> Stable Transition Risks
'Update track changed to Stable from Beta. '
'You will no longer receive Beta updates. You will stay on your current Beta '
r'version until the next Stable release.\r\n\r\n'
'You can manually revert to the latest Stable version. To do so, you must download and install '
'the latest Stable version manually. Note that this may introduce bugs or break completely'
r' if downgrading between major versions with significant changes.\r\n\r\n'
'Do you want to open GitHub to download the latest release?'
)
update_msg = update_msg.replace('\\n', '\n')
update_msg = update_msg.replace('\\r', '\r')
stable_popup = tk.messagebox.askyesno(title=title, message=update_msg)
if stable_popup:
webbrowser.open("https://github.com/edCD/eDMarketConnector/releases/latest")
def set_labels(self):
"""Set main window labels, e.g. after language change."""

View File

@ -780,5 +780,18 @@
/* update.py: Update Available Text; In files: update.py:229; */
"{NEWVER} is available" = "{NEWVER} is available";
/* prefs.py: Stable Version of EDMC; */
"Stable" = "Stable";
/* prefs.py: Select the Update Track (Beta, Stable); */
"Update Track" = "Update Track";
/* EDMarketConnector.py: Inform the user the Update Track has changed; */
"Update Track Changed to {TRACK}" = "Update Track Changed to {TRACK}";
/* EDMarketConnector.py: Inform User of Beta -> Stable Transition Risks; */
"Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?" = "Update track changed to Stable from Beta. You will no longer receive Beta updates. You will stay on your current Beta version until the next Stable release.\r\n\r\nYou can manually revert to the latest Stable version. To do so, you must download and install the latest Stable version manually. Note that this may introduce bugs or break completely if downgrading between major versions with significant changes.\r\n\r\nDo you want to open GitHub to download the latest release?";
/* myNotebook.py: Can't Paste Images or Files in Text; */
"Cannot paste non-text content." = "Cannot paste non-text content.";

View File

@ -482,15 +482,13 @@ def get_config(*args, **kwargs) -> AbstractConfig:
config = get_config()
# TODO: Set Proper Beta XML, Bring XML from Releases to Live, Translations, wiki on Updates (WILL NOT DOWNGRADE), link in label
# TODO: Wiki on Updates (WILL NOT DOWNGRADE)
def get_update_feed() -> str:
"""Select the proper update feed for the current update track."""
if config.get_bool('beta_optin'):
print("Checking Using Beta")
return 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml'
print("Checking Live")
return 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/beta/edmarketconnector.xml'
return 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml'
# TODO: Add Dep Warning
# WARNING: update_feed is deprecated, and will be removed in 6.0 or later. Please migrate to get_update_feed()
update_feed = get_update_feed()