Skip to content

Commit

Permalink
[1801] Add Warning for FDevIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rixxan committed Dec 15, 2023
1 parent a38cf5a commit fe32760
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions EDMarketConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2318,6 +2318,35 @@ def messagebox_not_py3():
)
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:
Expand All @@ -2331,6 +2360,8 @@ def messagebox_not_py3():
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()

Expand Down
6 changes: 6 additions & 0 deletions L10n/en.template
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit fe32760

Please sign in to comment.