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

219 Commits

Author SHA1 Message Date
Sayak Mukhopadhyay
6c0437642e Formatting fixes 2021-04-26 14:03:22 +05:30
Sayak Mukhopadhyay
df31aed6c5 Added appearance config option and implementation for minimize to tray on close functionality 2021-04-26 01:22:01 +05:30
Athanasius
2f9789afdd Update all code to use config.appversion() as a function
This *also* caught some instances where appversion_nobuild should
already have been used, so those were both changed and updated to a
function call.
2021-04-01 14:45:52 +01:00
Athanasius
ba91aa4733 Two final s/getint/get_int/g instances.
Tested with firing up under debugger, switching to transparent theme,
repeatedly mousing in and out, switching back to Dark theme.
2021-04-01 14:45:50 +01:00
A_D
051245cf90 Renamed various config values to be backwards compatible 2021-04-01 14:45:48 +01:00
A_D
0035f69c18 Missed one _str 2021-04-01 14:45:48 +01:00
A_D
00629b7420 use _str versions of paths for string ops 2021-04-01 14:45:48 +01:00
A_D
4692a98f04 Removed warning from transparency slider 2021-04-01 14:45:47 +01:00
A_D
0258d881ea Localised options 2021-04-01 14:45:47 +01:00
A_D
5235019d2a Added warning
Using transparency options on windows may cause unexpected behaviour
2021-04-01 14:45:47 +01:00
A_D
ed7d79c2f7 Added UI transparency option 2021-04-01 14:45:47 +01:00
A_D
1e56f0046e Empty journal dir workaround 2021-04-01 14:45:46 +01:00
A_D
278480b99f replaced ors with defaults in config usage 2021-04-01 14:45:46 +01:00
Athanasius
25852997c5 Updated all source to use new config methods
# Conflicts:
#	monitor.py
2021-04-01 14:45:46 +01:00
Athanasius
462cd25312 config: Make config.shutting_down() a property, and change 'callers' 2021-01-11 16:54:09 +00:00
Athanasius
4bddc4c0cb prefs: Avoid Tk event_generate() calls during shutdown 2021-01-11 16:43:33 +00:00
Athanasius
5effd044ac try/except ctypes.windll.user32.CalculatePopupWindowPosition
As we can't rely on the is_wine check, use an exception for this.
2020-10-08 14:55:32 +01:00
Athanasius
2b65bbd768 Re-instate the non-tkinter file dialog.
* This will be gated behind win32 *and* not a UTF-8 encoding.  This way
  where we should be able to use tkinter.filedialog, we do.
2020-10-06 15:49:17 +01:00
Athanasius
46e3b3aff8 Implement a TRACE level of logging.
For things that are too spammy for DEBUG, but we might need them
sometimes.
2020-09-23 15:58:19 +01:00
Athanasius
20464b80c7
Merge branch 'develop' into cleanup/prefs 2020-09-22 16:59:44 +01:00
Athanasius
14b8565aff Add 'import logging' (back in?) to prefs.py 2020-09-22 15:50:06 +01:00
Athanasius
a883eb29b2 plug.py, prefs.py: Use get_main_logger() 2020-09-22 15:44:16 +01:00
A_D
9231fe96fc
removed unused configs 2020-09-16 22:26:32 +02:00
A_D
175d171924
replaced wine check, final cleanups 2020-09-16 22:15:40 +02:00
A_D
74372b997d
removed invalid magic import 2020-09-16 20:30:28 +02:00
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