From fe327606aba90578ac5cdd11342efdaa2530bfc1 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 15 Dec 2023 11:51:53 -0500 Subject: [PATCH] [1801] Add Warning for FDevIDs --- EDMarketConnector.py | 31 +++++++++++++++++++++++++++++++ L10n/en.template | 6 ++++++ 2 files changed, 37 insertions(+) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 596f0423..66c9cb67 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -2318,6 +2318,35 @@ sys.path: {sys.path}''' ) config.set('plugins_not_py3_last', int(time())) + def check_fdev_ids(): + """Display message about missing FDEVID files""" + fdev_files = {'commodity.csv', 'rare_commodity.csv'} + for file in fdev_files: + file = pathlib.Path(config.respath_path / 'FDevIDs' / file) + if file.is_file(): + continue + # LANG: Popup-text about missing FDEVID Files + popup_text = _( + "FDevID Files not found! Some functionality regarding commodities " + r"may be disabled.\r\n\r\n Do you want to open the Wiki page on " + "how to set up submodules?" + ) + # And now we do need these to be actual \r\n + popup_text = popup_text.replace('\\n', '\n') + popup_text = popup_text.replace('\\r', '\r') + + openwikipage = tk.messagebox.askquestion( + # LANG: Popup window title for missing FDEVID files + _('FDevIDs: Missing Commodity Files'), + popup_text + ) + if openwikipage == "yes": + webbrowser.open( + "https://github.com/EDCD/EDMarketConnector/wiki/Running-from-source" + "#obtain-a-copy-of-the-application-source" + ) + break + # UI Transparency ui_transparency = config.get_int('ui_transparency') if ui_transparency == 0: @@ -2331,6 +2360,8 @@ sys.path: {sys.path}''' root.after(1, messagebox_not_py3) # Show warning popup for killswitches matching current version root.after(2, show_killswitch_poppup, root) + # Check for FDEV IDs + root.after(3, check_fdev_ids) # Start the main event loop root.mainloop() diff --git a/L10n/en.template b/L10n/en.template index f89873af..3aed0952 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -213,6 +213,12 @@ /* EDMarketConnector.py: Popup-text about 'active' plugins without Python 3.x support; In files: EDMarketConnector.py:2253:2259; */ "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name."; +/* EDMarketConnector.py: Popup-text about missing FDEVID Files; In files: EDMarketConnector.py:2329; */ +"FDevID Files not found! Some functionality regarding commodities may be disabled.\r\n\r\n Do you want to open the Wiki page on how to set up submodules?" = "FDevID Files not found! Some functionality regarding commodities may be disabled.\r\n\r\n Do you want to open the Wiki page on how to set up submodules?"; + +/* EDMarketConnector.py: Popup window title for missing FDEVID files; In files: EDMarketConnector.py:2340; */ +"FDevIDs: Missing Commodity Files" = "FDevIDs: Missing Commodity Files"; + /* EDMarketConnector.py: Settings > Plugins tab; prefs.py: Label on Settings > Plugins tab; In files: EDMarketConnector.py:2263; prefs.py:986; */ "Plugins" = "Plugins";