1. EDDB plugin needs to track the system name, but we're moving all of that
into monitor.py.
2. monitor.py was tracking this in monitor.system, but it needs to be in
monitor.state['SystemName'] in order for plugins to access it.
So, move monitor.system to monitor.state['SystemName'] and update all uses.
1. `io.edcd.EDMarketConnector.desktop` based on the flathub one, but with
reference to v1.5 of the spec (linked in a file comment).
2. As the Icon is specified using `io.edcd.EDMarketConnector`, not only
`EDMarketConnector`, renamed the .png file and updated the single code
reference to it.
It was observed that some text in the EDMC-Canonn plugin was wrapping in
this branch when the same text doesn't in `develop. So, tweaked the
plugin_frame setup to match the main UI frame setup:
* `tk.NSEW` not `tk.EW` - didn't fix the problem, but we should match this.
* `.columnconfigure(1, weight=1)` - this actually fixed the problem.
These are used in the non-default themes, as the OS ones are hidden and
replaced by them.
They're created after the rest of the main UI, so come last in the 'children'
list.
Unfortunately we can't name the plugin ones, as that's entirely up to their
`plugin_app()` code, and widget names can't be changed after creation.
NB: Each `plugin_hr_X` frame is `grid()`'d to be *before* the plugin in
question, despite being listed *after* in:
>>> self.w.children['edmarketconnector'].children
Typing this as `update.Updater | None` and having the check
`if self.updater is not None:` causes the menu entry to not even get added,
because `import update` was coming later.
I can't recall why that import/setup was later, but I might be about to find
out again....
In testing the *first* hit on this does have `monitor.cmdr` set, but neither
`monitor.system` or `monitor.station`. So:
1. Allow those to be `None` in the function signature,
2. Guard against only `monitor.cmdr` being falsey before the call.
3. Move the `if err:` to the same scope.
Technically `theme.startup_ui_scale` should be `float` to match with
`default_ui_scale` from tkinter, but we store it in the config as `int`,
so go with that.
Also, the killswitch popup ends up un-themed *anyway*, so don't even call
`theme.apply()`. That function expects a `tk.Tk` not, `Toplevel`, and
doesn't even do anything for a `Toplevel` anyway.
* When PyCharm made a mess I accidentally undid two renames in
EDMarketConnector.py...
* ... but one of those actually *does* need to only close the session. So
made a new Session.close() that performs only the closing, with
Session.reinit_session() now utilising that.
* Added `capi.request.<endpoint>` killswitches at appropriate call points.
* Added `eddn.capi_export.<type>` killswitches. This allows for killing
just the EDDN export of such CAPI-derived data, without stopping the actual
queries, as other plugins/functionality might still have harmless use of
the data.
* PLUGINS.md: Actually describe the contents of `data` passed to plugins, and
point out it might not always contain market or shipyard data. This is
not only because of the new killswitches, but could already have happened
if the station/port docked at didn't have the services.
* Some misc typing cleanups.
* New CL arge `--killswitches-file`. This needs to reference a file either
with an absolute path, or relative to the CWD of the process.
* Internally if the argument is provided it is prefixed with `"file:"` in
order to actually be loaded. This is because `requests` doesn't have an
adapter for `file:` URLs.
* Also fixes a visual bug with reporting of active killswitches. The entire
SingleKill object was used instead of just its `reason` property. mypy
type checks caught this.
It can be `tk.NORMAL` or `tk.DISABLED`. Why `True` was ever used I don't
know, possibly relying on undefined behaviour.
However, those 'types' end up as `Literal['normal']` and `Literal['disabled']`
and the only way to declare a Union of those is to be explicit with the
actual strings. tk.(NORMAL|DISABLED) are not a types.
* Renames `plug.notify_newdata()` to the more precise `notify_capidata()`.
* If CAPI data was from SERVER_LEGACY, then use plugin `cmdr_data_legacy()`
instead of `cmdr_data()`.
* Move it later, after CLI args processing. This would allow for a magic
'override' this, providing a key or similar.
* Correct text 'XAthan' to 'Athan' in 'win32' check.
* If `git_branch != 'develop'` check if `-alpha0` is in the app version.
Such version strings are never in any pre-release or release.