From 1d052e493043fec14949f9c0c1d7a6267d50b612 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 5 May 2024 18:17:00 -0400 Subject: [PATCH] [519] Add Downgrade Warning --- EDMarketConnector.py | 20 +++++++++++++++++++- L10n/en.template | 13 +++++++++++++ config/__init__.py | 8 +++----- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 150332a6..cdfa7480 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -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.""" diff --git a/L10n/en.template b/L10n/en.template index 200743c8..ca080296 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -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."; diff --git a/config/__init__.py b/config/__init__.py index 8ed6209f..fabf3eab 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -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()