mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +03:00
Merge pull request #1183 from A-UNDERSCORE-D/fix/1182/Option-to-hide-private-group-name
Add options to hide private group name and multicrew commander name from UI
This commit is contained in:
commit
9a393af430
@ -1096,12 +1096,17 @@ class AppWindow(object):
|
||||
# Update main window
|
||||
self.cooldown()
|
||||
if monitor.cmdr and monitor.state['Captain']:
|
||||
if not config.get_bool('hide_multicrew_captain', default=False):
|
||||
self.cmdr['text'] = f'{monitor.cmdr} / {monitor.state["Captain"]}'
|
||||
|
||||
else:
|
||||
self.cmdr['text'] = f'{monitor.cmdr}'
|
||||
|
||||
self.ship_label['text'] = _('Role') + ':' # LANG: Multicrew role label in main window
|
||||
self.ship.configure(state=tk.NORMAL, text=crewroletext(monitor.state['Role']), url=None)
|
||||
|
||||
elif monitor.cmdr:
|
||||
if monitor.group:
|
||||
if monitor.group and not config.get_bool("hide_private_group", default=False):
|
||||
self.cmdr['text'] = f'{monitor.cmdr} / {monitor.group}'
|
||||
|
||||
else:
|
||||
|
@ -630,3 +630,15 @@
|
||||
|
||||
/* stats.py: Status dialog title; In files: stats.py:376; */
|
||||
"Ships" = "Ships";
|
||||
|
||||
/* prefs.py: UI elements privacy section header in privacy tab of preferences; In files: prefs.py:682; */
|
||||
"Main UI privacy options" = "Main UI privacy options";
|
||||
|
||||
/* prefs.py: Hide private group owner name from UI checkbox; In files: prefs.py:687; */
|
||||
"Hide private group name in UI" = "Hide private group name in UI";
|
||||
|
||||
/* prefs.py: Hide multicrew captain name from main UI checkbox; In files: prefs.py:691; */
|
||||
"Hide multi-crew captain name" = "Hide multi-crew captain name";
|
||||
|
||||
/* prefs.py: Preferences privacy tab title; In files: prefs.py:695; */
|
||||
"Privacy" = "Privacy";
|
||||
|
27
prefs.py
27
prefs.py
@ -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,28 @@ 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_captain = tk.BooleanVar(value=config.get_bool('hide_multicrew_captain', default=False))
|
||||
self.hide_private_group = tk.BooleanVar(value=config.get_bool('hide_private_group', default=False))
|
||||
row = AutoInc()
|
||||
|
||||
# LANG: UI elements privacy section header in privacy tab of preferences
|
||||
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'), # LANG: Hide private group owner name from UI checkbox
|
||||
variable=self.hide_private_group
|
||||
).grid(row=row.get(), column=0, padx=self.PADX, pady=self.PADY)
|
||||
nb.Checkbutton(
|
||||
frame, text=_('Hide multi-crew captain name'), # LANG: Hide multicrew captain name from main UI checkbox
|
||||
variable=self.hide_multicrew_captain
|
||||
).grid(row=row.get(), column=0, padx=self.PADX, pady=self.PADY)
|
||||
|
||||
notebook.add(frame, text=_('Privacy')) # LANG: Preferences privacy tab title
|
||||
|
||||
def __setup_appearance_tab(self, notebook: Notebook) -> None:
|
||||
self.languages = Translations.available_names()
|
||||
# Appearance theme and language setting
|
||||
@ -1234,6 +1257,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_captain', self.hide_multicrew_captain.get())
|
||||
|
||||
config.set('ui_scale', self.ui_scale.get())
|
||||
config.set('ui_transparency', self.transparency.get())
|
||||
config.set('always_ontop', self.always_ontop.get())
|
||||
|
Loading…
x
Reference in New Issue
Block a user