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

added config option and prefs page

This commit is contained in:
A_D 2021-06-28 10:28:56 +02:00
parent fe7b8dbc6c
commit b42fcf1d4f
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4
2 changed files with 25 additions and 1 deletions

View File

@ -1095,7 +1095,7 @@ class AppWindow(object):
self.ship.configure(state=tk.NORMAL, text=crewroletext(monitor.state['Role']), url=None)
elif monitor.cmdr:
if monitor.group and not config.get_bool("hide_group", default=False):
if monitor.group and not config.get_bool("hide_private_group", default=False):
self.cmdr['text'] = f'{monitor.cmdr} / {monitor.group}'
else:

View File

@ -289,6 +289,7 @@ class PreferencesDialog(tk.Toplevel):
self.__setup_output_tab(notebook)
self.__setup_plugin_tabs(notebook)
self.__setup_config_tab(notebook)
self.__setup_privacy_tab(notebook)
self.__setup_appearance_tab(notebook)
self.__setup_plugin_tab(notebook)
@ -671,6 +672,25 @@ class PreferencesDialog(tk.Toplevel):
# LANG: Label for 'Configuration' tab in Settings
notebook.add(config_frame, text=_('Configuration'))
def __setup_privacy_tab(self, notebook: Notebook) -> None:
frame = nb.Frame(notebook)
self.hide_multicrew_captian = tk.BooleanVar(value=config.get_bool('hide_multicrew_captian', default=False))
self.hide_private_group = tk.BooleanVar(value=config.get_bool('hide_private_group', default=False))
row = AutoInc()
nb.Label(frame, text=_('Main UI privacy options')).grid(
row=row.get(), column=0, sticky=tk.W, padx=self.PADX, pady=self.PADY
)
nb.Checkbutton(
frame, text=_('Hide private group name in UI'), variable=self.hide_private_group
).grid(row=row.get(), column=0, padx=self.PADX, pady=self.PADY)
nb.Checkbutton(
frame, text=_('Hide multi-crew captian name'), variable=self.hide_multicrew_captian
).grid(row=row.get(), column=0, padx=self.PADX, pady=self.PADY)
notebook.add(frame, text=_('Privacy'))
def __setup_appearance_tab(self, notebook: Notebook) -> None:
self.languages = Translations.available_names()
# Appearance theme and language setting
@ -1234,6 +1254,10 @@ class PreferencesDialog(tk.Toplevel):
config.set('language', lang_codes.get(self.lang.get()) or '') # or '' used here due to Default being None above
Translations.install(config.get_str('language', default=None)) # type: ignore # This sets self in weird ways.
# Privacy options
config.set('hide_private_group', self.hide_private_group.get())
config.set('hide_multicrew_captian', self.hide_multicrew_captian.get())
config.set('ui_scale', self.ui_scale.get())
config.set('ui_transparency', self.transparency.get())
config.set('always_ontop', self.always_ontop.get())