mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Add preference for enabling / disabling CAPI fleetcarrier endpoint
This commit is contained in:
parent
16055a311f
commit
4a2401983d
@ -1582,7 +1582,7 @@ class AppWindow(object):
|
|||||||
if not should_return:
|
if not should_return:
|
||||||
self.w.after(int(SERVER_RETRY * 1000), self.capi_request_data)
|
self.w.after(int(SERVER_RETRY * 1000), self.capi_request_data)
|
||||||
|
|
||||||
if entry['event'] in ('CarrierBuy', 'CarrierStats'):
|
if entry['event'] in ('CarrierBuy', 'CarrierStats') and config.get_int('capi_fleetcarrier') == 1:
|
||||||
should_return, new_data = killswitch.check_killswitch('capi.request.fleetcarrier', {})
|
should_return, new_data = killswitch.check_killswitch('capi.request.fleetcarrier', {})
|
||||||
if not should_return:
|
if not should_return:
|
||||||
self.w.after(int(SERVER_RETRY * 1000), self.capi_request_fleetcarrier_data)
|
self.w.after(int(SERVER_RETRY * 1000), self.capi_request_fleetcarrier_data)
|
||||||
|
21
prefs.py
21
prefs.py
@ -470,6 +470,25 @@ class PreferencesDialog(tk.Toplevel):
|
|||||||
state=tk.NORMAL if config.get_str('journaldir') else tk.DISABLED
|
state=tk.NORMAL if config.get_str('journaldir') else tk.DISABLED
|
||||||
).grid(column=2, pady=self.PADY, sticky=tk.EW, row=row.get())
|
).grid(column=2, pady=self.PADY, sticky=tk.EW, row=row.get())
|
||||||
|
|
||||||
|
# CAPI settings
|
||||||
|
self.capi_fleetcarrier = tk.IntVar(value=config.get_int('capi_fleetcarrier'))
|
||||||
|
|
||||||
|
ttk.Separator(config_frame, orient=tk.HORIZONTAL).grid(
|
||||||
|
columnspan=4, padx=self.PADX, pady=self.PADY*4, sticky=tk.EW, row=row.get()
|
||||||
|
)
|
||||||
|
|
||||||
|
nb.Label(
|
||||||
|
config_frame,
|
||||||
|
text=_('CAPI Settings') # LANG: Settings > Configuration - Label for CAPI section
|
||||||
|
).grid(padx=self.PADX, sticky=tk.W, row=row.get())
|
||||||
|
|
||||||
|
nb.Checkbutton(
|
||||||
|
config_frame,
|
||||||
|
# LANG: Configuration - Enable or disable the Fleet Carrier CAPI calls
|
||||||
|
text=_('Enable Fleetcarrier CAPI Queries'),
|
||||||
|
variable=self.capi_fleetcarrier
|
||||||
|
).grid(columnspan=4, padx=self.PADX, pady=(5, 0), sticky=tk.W, row=row.get())
|
||||||
|
|
||||||
if sys.platform in ('darwin', 'win32'):
|
if sys.platform in ('darwin', 'win32'):
|
||||||
ttk.Separator(config_frame, orient=tk.HORIZONTAL).grid(
|
ttk.Separator(config_frame, orient=tk.HORIZONTAL).grid(
|
||||||
columnspan=4, padx=self.PADX, pady=self.PADY*4, sticky=tk.EW, row=row.get()
|
columnspan=4, padx=self.PADX, pady=self.PADY*4, sticky=tk.EW, row=row.get()
|
||||||
@ -1244,6 +1263,8 @@ class PreferencesDialog(tk.Toplevel):
|
|||||||
else:
|
else:
|
||||||
config.set('journaldir', logdir)
|
config.set('journaldir', logdir)
|
||||||
|
|
||||||
|
config.set('capi_fleetcarrier', int(self.capi_fleetcarrier.get()))
|
||||||
|
|
||||||
if sys.platform in ('darwin', 'win32'):
|
if sys.platform in ('darwin', 'win32'):
|
||||||
config.set('hotkey_code', self.hotkey_code)
|
config.set('hotkey_code', self.hotkey_code)
|
||||||
config.set('hotkey_mods', self.hotkey_mods)
|
config.set('hotkey_mods', self.hotkey_mods)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user