From 2a9ac882cd7c921929cabc12cf023500b95eacd4 Mon Sep 17 00:00:00 2001 From: A_D Date: Fri, 6 Nov 2020 16:20:58 +0200 Subject: [PATCH] Added reset UI flag Resets the ui theme to default and the transparency to default --- EDMarketConnector - reset-ui.bat | 1 + EDMarketConnector.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 EDMarketConnector - reset-ui.bat diff --git a/EDMarketConnector - reset-ui.bat b/EDMarketConnector - reset-ui.bat new file mode 100644 index 00000000..01db6dfb --- /dev/null +++ b/EDMarketConnector - reset-ui.bat @@ -0,0 +1 @@ +EDMarketConnector.exe --reset-ui diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 4daa26e8..72d26f7e 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1445,10 +1445,17 @@ if __name__ == "__main__": "such as EDSM, Inara.cz and EDDB." ) - parser.add_argument('--trace', - help='Set the Debug logging loglevel to TRACE', - action='store_true', - ) + parser.add_argument( + '--trace', + help='Set the Debug logging loglevel to TRACE', + action='store_true', + ) + + parser.add_argument( + '--reset-ui', + help='reset UI theme and transparency to defaults', + action='store_true' + ) args = parser.parse_args() @@ -1466,6 +1473,11 @@ executable: {sys.executable} sys.path: {sys.path}''' ) + if args.reset_ui: + config.set('theme', 0) # 'Default' theme uses ID 0 + config.set('ui_transparency', 100) # 100 is completely opaque + logger.info('reset theme and transparency to default.') + # We prefer a UTF-8 encoding gets set, but older Windows versions have # issues with this. From Windows 10 1903 onwards we can rely on the # manifest ActiveCodePage to set this, but that is silently ignored on