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

Fix an Output/EDDN option combination causing defaults to get re-set

Change Output and EDDN options to only get set to defaults if key 'PrefsDidSave' is not present and true.  This gets a value of 0x1 saved any time preferences are applied.

The issue was that if you had sufficient options set such that the saved 'output' value was 0x0 then that would evaluate to false and cause the defaults to get set.

Fixes #407
This commit is contained in:
Athanasius 2020-06-29 14:28:20 +01:00
parent 60d58fd852
commit 63c2ff52e9

View File

@ -347,7 +347,10 @@ def plugin_prefs(parent, cmdr, is_beta):
BUTTONX = 12 # indent Checkbuttons and Radiobuttons
PADY = 2 # close spacing
output = config.getint('output') or (config.OUT_MKT_EDDN | config.OUT_SYS_EDDN) # default settings
if not config.getint('PrefsDidSave'):
output = (config.OUT_MKT_EDDN | config.OUT_SYS_EDDN) # default settings
else:
output = config.getint('output')
eddnframe = nb.Frame(parent)
@ -371,7 +374,7 @@ def prefsvarchanged(event=None):
def prefs_changed(cmdr, is_beta):
config.set('output',
(config.getint('output') & (config.OUT_MKT_TD | config.OUT_MKT_CSV | config.OUT_SHIP |config. OUT_MKT_MANUAL)) +
(config.getint('output') & (config.OUT_MKT_TD | config.OUT_MKT_CSV | config.OUT_SHIP |config.OUT_MKT_MANUAL)) +
(this.eddn_station.get() and config.OUT_MKT_EDDN) +
(this.eddn_system.get() and config.OUT_SYS_EDDN) +
(this.eddn_delay.get() and config.OUT_SYS_DELAY))