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

244 Commits

Author SHA1 Message Date
A_D
0fec834fb9
fixed always on top location 2020-09-16 20:27:03 +02:00
A_D
315258d3e7
Added row tracking variables to config tabs
This adds a new class called AutoInc, which is a self-incrementing
integer that supports use as a context manager. AutoInc is used to keep
track of row numbers automatically for easy addition to config panes,
and the context manager adds a visual clue to where entries are on the
same row but different columns
2020-09-16 19:43:02 +02:00
A_D
871838106f
Broke __init__ into multiple methods
Each tab now has its own method, rather than them all being in one giant
unmaintainable blob in the middle of the init method
2020-09-14 17:23:54 +02:00
A_D
fc431e457d
refactored logic 2020-09-14 17:21:41 +02:00
A_D
f9f6907a2c
renamed variables to reduce ambiguity 2020-09-14 17:21:20 +02:00
A_D
df554ec8b3
Added docstrings 2020-09-14 17:21:09 +02:00
A_D
2459de4893
Added spacing around scope changes 2020-09-14 17:20:38 +02:00
A_D
ef359395ec
Removed object subclass 2020-09-14 17:19:58 +02:00
A_D
b85b0622f5
Fixed some type issues 2020-09-14 17:19:57 +02:00
A_D
3010f21965
Added some type comments to appease pylance 2020-09-14 17:19:57 +02:00
A_D
742709c431
Replaced modulo-formatting with fstrings 2020-09-14 17:19:56 +02:00
A_D
d77cfd0e7a
removed bare excepts 2020-09-14 17:19:56 +02:00
A_D
9f8d8a9052
cleaned up overlong lines 2020-09-14 17:19:55 +02:00
A_D
ebc34d858c
autoformatted and sorted imports 2020-09-14 17:19:55 +02:00
Athanasius
52dcd3b28a Use tkinter.filedialog on win32, because we now fix locale encoding
tkinter ends up calling something where utf8 characters won't work
because of the windows encoding, e.g. cp1252.

We can't set encoding just for the dialogs, as it's not thread safe.  So
we'll just set it at startup instead.  Utilising:

	locale.setlocale(locale.LC_ALL, '')

to get things set up initially, so we can properly retrieve the language
to go with the encoding on the subsequent setlocale() call.
2020-09-14 15:16:26 +01:00
Athanasius
cd24db88a9 UI Scaling: Size the Scale bar as per our startup value
If we use the last configured value then the width of the Scale bar
changes as per the user's last setting, even though they might not have
yet restarted for all the rest of the UI to resize.
2020-09-11 11:14:19 +01:00
Athanasius
0a5bbad55b UI Scaling: Change our %age scaling to be relative to base tk-scaling
So if at startup tk-scaling is 1.33 then a user configured 200(%) will
set it to 2.66 for this run.

* Low end of scale bar set to 10, not 0, because now 0 makes absolutely
  no sense.
* In theory the width of the scale bar, in pixels, is now also correctly
  scaled.
2020-09-11 09:26:01 +01:00
Athanasius
f2ab8f0fd1 UI Scaling: Switch to using integers to avoid tk bug
Using a Tk.DoubleVar() with a locale where a comma is used as the
decimals separator leads to internal tk code recording values with the
comma but then other tk code not accepting that back, so it always
thinks the value is zero and the scale slider can't be moved.

Ref: https://stackoverflow.com/questions/45289237/tkinter-scale-slider-with-float-values-doesnt-work-with-locale-of-language-that

* Change to storing as a REG_DWORD under 'ui_scale' not 'ui_scaling'.
* Change all the code, except the call to *set* the tk scaling to use an
  integer, with 100 = 100%, i.e. equivalent to the old 1.0.
* Update strings slightly, so translations will need updating too.

NB: The theme.default_ui_scale value for plugin authors to query is
still the float that tk returns.
2020-09-10 16:54:14 +01:00
Athanasius
174e169469 UI Scaling: Add text stating changes require a restart.
Also updates the translation text.
2020-09-10 16:35:59 +01:00
Athanasius
6484540263 UI Scaling: Add new strings to translation template 2020-09-09 13:35:05 +01:00
Athanasius
94607bf55f UI Scaling: Use a tk.Scale instead, allowing for finer grained setting.
* NB: Windows Registry has no type for 'Float', so we use a string.
* We now store '0.0' to mean 'default'.
2020-09-09 13:31:36 +01:00
Athanasius
957d11c84b prefs.py: Minor comment format change 2020-09-08 13:16:07 +01:00
Athanasius
1850354b8d UI Scaling: Implement a 'default' option
* If no ui_scaling yet set, set it to 'default'.
* 'default' added to dropdown choices.

Note that you still need an application restart for this to take effect.
2020-09-08 12:27:57 +01:00
Athanasius
ea53a60596 UI Scaling: Option added to Appearance tab of Settings 2020-09-08 12:18:48 +01:00
Athanasius
09add21a1a Logging: DEBUG always to rotated files, configured level to stdout/err
* EDMCLogging.Logger.get_streamhandler() method to get the
  logger_channel so prefs.py can call setLevel() on it.
* The top-level Logger level is always DEBUG.
* The RotatingFileHandler level is always DEBUG.
* The StreamHandler level is as configured by the user.
* EDMCLogging now creates a singleton of EDMCLogging.Logger and its
  associated Logger.
* plug.py tweaked to only import EDMCLogging where it's needed for
  getting/creating plugin loggers, else `import logging`.
2020-09-08 10:03:16 +01:00
Athanasius
bebe162071 logging: Now setting loglevel from Settings, and loading at start 2020-09-06 18:29:26 +01:00
Athanasius
fa7b6b4daf logging: 'loglevel' preference now saved. 2020-09-06 18:22:10 +01:00
Athanasius
0deeeb5799 logging: Added Settings>Configuration 'Loglevel' option.
Not yet functional, but dropdown is there and properly populated.
2020-09-06 18:19:55 +01:00
Athanasius
b61645ab06 shipyard: Add UI to toggle option for alternate URL opening
* Added checkbox next to shipyard choice dropdown.
* Also a TODO for using an incrementing 'row' variable throughout.
2020-07-23 14:36:02 +01:00
Athanasius
71bb14a737 Document allowed imports for PLUGINS
* List added in 'Available imports' section of PLUGINS.md
* Various *.py files now have comments about things being allowed for
 plugin import.
2020-07-12 19:25:47 +01:00
Athanasius
ae62bec63d Remove extraneous 'e '
*shakes fist at PyCharm*
2020-07-12 16:07:19 +01:00
Athanasius
690b8b0da3 Use 'main' branch for 'migrate plugins' URL 2020-07-12 15:59:40 +01:00
Athanasius
89f113e190 Use Preferences Save Serial Number instead of flag
* new class `PrefsVersion` in prefs.py.  A singleton `prefsSaved` (note
   case) is created.
 * When new preferences are added and require defaults on first run the
   code should use:

     `if prefsVersion.shouldSetDefaults(<prior release version>, [<optional old test>]):`

   to check if defaults should be set in preferences.  So if prior release
   was '3.4.6.0' and you've added a new preference with defaults you should
   call this with '3.4.6.0' as the first argument.
   The <optional old test> is really only for historical purposes, as a
   fallback in case no 'PrefsVersion' has yet been set in the user's
   Registry/settings file.
 * Any code that adds such a new preference **MUST** make changes to the
   `versions` dictionary in the PrefsVersion class.
     1. Add the predicted next version to the dictionary, with number one
        higher than 'current'
     2. Set 'current' equal to that new value.
   Obviously if other post-last-release code has already done this then you
   don't need to.

   Failure to update the versions dictionary in this manner will lead to an
   Exception being raised, and the code the preferences are for failing
   (i.e. EDDN means no EDDN tab on Settings).

Closes #407
2020-07-01 15:33:42 +01:00
Athanasius
ecdd65e0ac prefs.py change for that output settings fix
Addresses #407
2020-06-30 15:22:50 +01:00
Athanasius
a40b0e33ca Detect plugins without Python 3.x support and warn user.
To allow users to sort out their plugins before EDMC itself moves to
Python 3.x warn them if any of their enabled, non-stock, plugins do not
have a plugin_start3() method.

  * If any are found without support there's a popup triggered at the
    end of AppWindow initialisation.
  * Then the user can check Settings > Plugins to see a list of the
    plugins without Python 3.x support.
2020-06-21 16:57:37 +01:00
Athanasius
259bb3bbd6 Merge branch 'release-final-python27' into python3 2020-06-21 16:43:02 +01:00
Jonathan Harris
3c46e8d5fa All executable files invoked with #!/usr/bin/env python3 2020-06-21 16:28:30 +01:00
Athanasius
a8c0ec3ab9 Updates prefs.py for "import tkinter.filedialog" 2020-06-21 16:23:01 +01:00
Athanasius
e7545e174f Use .items() instead of .iteritems() 2020-06-21 16:23:00 +01:00
Athanasius
d0ae621387 Running EDMarketConnector.py 'works'.
First pass utilising 'futurize' to do most of the work.

  There's an issue with ur'\"' in l10n.py which I'm not sure how to
properly fix.

  This now has errors when hitting the 'Update' button.
2020-06-21 16:23:00 +01:00
Athanasius
4d5fa590af New option to NOT check for app updates automatically if in-game.
* Stores disable_autoappupdatecheckingame in settings.
  * If 'disable' is active then once you're in-game WinSparkle auto
    check for updates is disabled.
  * Whatever the state of the option WinSparkle auto updates are
    (re-)enabled when you exit the game to Main Menu or fully.
  * Using 'Help' > 'Check for updates' manually will still always work.

It has been difficult to test the code fully because it isn't easy to
get WinSparkle's registry data about last update check time set just right
to not check immediately, but to do so some reasonable time after you're
in-game and have confirmed the new option setting isn't easy.
  Worst case people won't learn about an update until the next time they
run EDMC.
2020-06-20 20:46:05 +01:00
Athanasius
670842e8f6 Adds link to plugin migration guide to Settings > Plugins 2020-06-19 19:43:12 +01:00
Athanasius
d3abb6fa1f Detect plugins without Python 3.x support and warn user.
To allow users to sort out their plugins before EDMC itself moves to
Python 3.x warn them if any of their enabled, non-stock, plugins do not
have a plugin_start3() method.

  * If any are found without support there's a popup triggered at the
    end of AppWindow initialisation.
  * Then the user can check Settings > Plugins to see a list of the
    plugins without Python 3.x support.
2020-06-18 19:40:46 +01:00
Jonathan Harris
a6ce9edc1d Fix running under Wine 2019-06-19 12:09:26 +01:00
Jonathan Harris
2dd6c4d008 Support not always on top with dark theme on Linux
Fixes #421
2019-05-28 00:06:33 +01:00
Jonathan Harris
aac2f838f3 Fix for preferences windows on macOS Mojave 2019-01-10 00:04:14 +00:00
Jonathan Harris
7cca099699 Remove redundant code 2019-01-05 17:35:16 +00:00
Jonathan Harris
f17f5d3f25 PKCE OAuth2 access to cAPI 2018-12-28 03:32:26 +00:00
Jonathan Harris
cc4390de49 Switch EDDN integration to a plugin 2018-11-18 01:52:05 +00:00
Jonathan Harris
96ffc82ca7 Support accessing Journal on macOS remotely over SMB 2018-10-30 19:33:40 +00:00