1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-22 20:00:29 +03:00

passed only what was needed to StatsDialog

passing the entire AppWindow just made a mess of typing
This commit is contained in:
A_D 2020-10-12 19:54:30 +02:00 committed by Athanasius
parent 2819c92006
commit fe26359170
2 changed files with 6 additions and 11 deletions

View File

@ -386,7 +386,7 @@ class AppWindow(object):
self.menubar.add_cascade(menu=self.edit_menu)
self.w.bind('<Command-c>', self.copy)
self.view_menu = tk.Menu(self.menubar, name='view') # type: ignore # https://github.com/python/typeshed/issues/4658 # noqa: E501
self.view_menu.add_command(command=lambda: stats.StatsDialog(self))
self.view_menu.add_command(command=lambda: stats.StatsDialog(self.w, self.status))
self.menubar.add_cascade(menu=self.view_menu)
window_menu = tk.Menu(self.menubar, name='window') # type: ignore # https://github.com/python/typeshed/issues/4658 # noqa: E501
self.menubar.add_cascade(menu=window_menu)
@ -404,10 +404,9 @@ class AppWindow(object):
self.w.createcommand("::tk::mac::ReopenApplication", self.w.deiconify) # click on app in dock = restore
self.w.protocol("WM_DELETE_WINDOW", self.w.withdraw) # close button shouldn't quit app
self.w.resizable(tk.FALSE, tk.FALSE) # Can't be only resizable on one axis
else: # win32 or linux
else:
self.file_menu = self.view_menu = tk.Menu(self.menubar, tearoff=tk.FALSE) # type: ignore
self.file_menu.add_command(command=lambda: stats.StatsDialog(self))
self.file_menu.add_command(command=lambda: stats.StatsDialog(self.w, self.status))
self.file_menu.add_command(command=self.save_raw)
self.file_menu.add_command(command=lambda: prefs.PreferencesDialog(self.w, self.postprefs))
self.file_menu.add_separator()

View File

@ -1,20 +1,16 @@
"""CMDR Status information."""
import csv
from sys import platform
from typing import NamedTuple, TYPE_CHECKING, Any, AnyStr, Dict, List, Optional, Sequence, Tuple, Union, cast
if TYPE_CHECKING:
from EDMarketConnector import AppWindow
import tkinter as tk
from sys import platform
from tkinter import ttk
from typing import TYPE_CHECKING, Any, AnyStr, Dict, List, NamedTuple, Optional, Sequence, cast
import companion
import EDMCLogging
import myNotebook as nb # noqa: N813
from companion import ship_map
from l10n import Locale
from monitor import monitor
import EDMCLogging
logger = EDMCLogging.get_main_logger()