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

EDDN: Dummy tracking UI to determine layout

This commit is contained in:
Athanasius 2021-10-10 15:40:41 +01:00
parent 72f584481a
commit dd8ec061d3
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D
2 changed files with 37 additions and 1 deletions

View File

@ -189,6 +189,9 @@ if __name__ == '__main__': # noqa: C901
if args.eddn_url:
config.set_eddn_url(args.eddn_url)
if args.eddn_tracking_ui:
config.set_eddn_tracking_ui()
if args.force_edmc_protocol:
if sys.platform == 'win32':
config.set_auth_force_edmc_protocol()

View File

@ -79,6 +79,12 @@ class This:
self.eddn_delay: tk.IntVar
self.eddn_delay_button: nb.Checkbutton
# Tracking UI
self.ui: Optional[tk.Frame] = None
self.ui_j_body_name: Optional[tk.Label] = None
self.ui_j_body_id: Optional[tk.Label] = None
self.ui_s_body_name: Optional[tk.Label] = None
this = This()
@ -942,7 +948,7 @@ def plugin_start3(plugin_dir: str) -> str:
return 'EDDN'
def plugin_app(parent: tk.Tk) -> None:
def plugin_app(parent: tk.Tk) -> Optional[tk.Frame]:
"""
Set up any plugin-specific UI.
@ -953,6 +959,7 @@ def plugin_app(parent: tk.Tk) -> None:
necessary.
:param parent: tkinter parent frame.
:return: Optional tk.Frame, if the tracking UI is active.
"""
this.parent = parent
this.eddn = EDDN(parent)
@ -961,6 +968,32 @@ def plugin_app(parent: tk.Tk) -> None:
# Shouldn't happen - don't bother localizing
this.parent.children['status']['text'] = 'Error: Is another copy of this app already running?'
if config.eddn_tracking_ui:
this.ui = tk.Frame(parent)
row = this.ui.grid_size()[1]
journal_body_name_label = tk.Label(this.ui, text="J:BodyName:")
journal_body_name_label.grid(row=row, column=0, sticky=tk.W)
this.ui_j_body_name = tk.Label(this.ui, text='<>')
this.ui_j_body_name.grid(row=row, column=1, sticky=tk.E)
row += 1
journal_body_id_label = tk.Label(this.ui, text="J:BodyID:")
journal_body_id_label.grid(row=row, column=0, sticky=tk.W)
this.ui_j_body_id = tk.Label(this.ui, text='<>')
this.ui_j_body_id.grid(row=row, column=1, sticky=tk.E)
row += 1
status_body_name_label = tk.Label(this.ui, text="S:BodyName:")
status_body_name_label.grid(row=row, column=0, sticky=tk.W)
this.ui_s_body_name = tk.Label(this.ui, text='<>')
this.ui_s_body_name.grid(row=row, column=1, sticky=tk.E)
row += 1
return this.ui
return None
def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
"""