From 31364d29a2f9e8bcbc8ebc624d9ff895fd7c3d44 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Mon, 25 Jul 2016 19:51:50 +0100 Subject: [PATCH] Make EDSM log entry automatically on system entry Don't make log entry at stations. --- EDMarketConnector.py | 10 +++------- L10n/cs.strings | 3 --- L10n/de.strings | 3 --- L10n/en.template | 3 --- L10n/es.strings | 3 --- L10n/fr.strings | 3 --- L10n/it.strings | 3 --- L10n/ja.strings | 3 --- L10n/lv.strings | 3 --- L10n/nl.strings | 3 --- L10n/pl.strings | 3 --- L10n/ru.strings | 3 --- L10n/sl.strings | 3 --- L10n/uk.strings | 3 --- config.py | 2 +- prefs.py | 20 +++++++------------- 16 files changed, 11 insertions(+), 60 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index c73c7788..3ba66845 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -378,15 +378,11 @@ class AppWindow: if config.getint('output') & config.OUT_SHIP_CORIOLIS: coriolis.export(data) if config.getint('output') & config.OUT_SYS_EDSM: - # Catch any EDSM errors here so that they don't prevent station update + # Silently catch any EDSM errors here so that they don't prevent station update try: - self.status['text'] = _('Sending data to EDSM...') - self.w.update_idletasks() - edsm.export(data, lambda:self.edsm.lookup(self.system['text'], EDDB.system(self.system['text']))) # Do EDSM lookup during EDSM export - self.status['text'] = '' + self.edsm.lookup(self.system['text'], EDDB.system(self.system['text'])) except Exception as e: if __debug__: print_exc() - self.status['text'] = unicode(e) else: self.edsm.link(self.system['text']) self.edsmpoll() @@ -492,7 +488,7 @@ class AppWindow: plug.notify_system_changed(timestamp, system, coordinates) - if config.getint('output') & (config.OUT_SYS_EDSM | config.OUT_SYS_AUTO) == (config.OUT_SYS_EDSM | OUT_SYS_AUTO): + if config.getint('output') & config.OUT_SYS_EDSM: try: self.status['text'] = _('Sending data to EDSM...') self.w.update_idletasks() diff --git a/L10n/cs.strings b/L10n/cs.strings index 9f891998..d67ae838 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Vzhled"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Automaticky vytvořit záznam při vstoupení do systému"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "Automaticky aktualizovat při zadokování"; diff --git a/L10n/de.strings b/L10n/de.strings index 2c1e3b52..8b75be1b 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Aussehen"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Automatisch Logbucheintrag bei Systemeintritt anlegen"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "Automatisch beim Andocken aktualisieren"; diff --git a/L10n/en.template b/L10n/en.template index fe00545b..88012a9c 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Appearance"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Automatically make a log entry on entering a system"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "Automatically update on docking"; diff --git a/L10n/es.strings b/L10n/es.strings index 82a6fc64..4c5a3ad2 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Apariencia"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Crear automáticamente una entrada en el registro al entrar en un sistema"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "Actualizar automáticamente al atracar"; diff --git a/L10n/fr.strings b/L10n/fr.strings index 95234ef3..73f5d99b 100644 --- a/L10n/fr.strings +++ b/L10n/fr.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Apparence"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Ajouter automatiquement une entrée au journal en entrant dans un système"; - /* Cmdr stats. [stats.py] */ "Balance" = "Solde"; diff --git a/L10n/it.strings b/L10n/it.strings index 55e4c5dc..0bcab641 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Aspetto"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Inserisce automaticamente una log entry entrando in un sistema"; - /* Cmdr stats. [stats.py] */ "Balance" = "Saldo"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 83cc0e56..f63f6fec 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "表示"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "別の星系に移動したら自動的にフライトログを記録する"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "ドッキングした際に自動でデータを更新する"; diff --git a/L10n/lv.strings b/L10n/lv.strings index 0ae09f4e..59338d0b 100644 --- a/L10n/lv.strings +++ b/L10n/lv.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Izskats"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Automātiski veikt ierakstu ierodoties sistēmā"; - /* Cmdr stats. [stats.py] */ "Balance" = "Bilance"; diff --git a/L10n/nl.strings b/L10n/nl.strings index 3b4bfe52..6d820833 100644 --- a/L10n/nl.strings +++ b/L10n/nl.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Vormgeving"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Automatisch een log regel aanmaken bij het binnengaan van een stelsel"; - /* Output setting. [prefs.py] */ "Automatically update on docking" = "Automatisch bijwerken na landing"; diff --git a/L10n/pl.strings b/L10n/pl.strings index 5909f705..40754598 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Wygląd"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Stwórz automatycznie wpis w logu po wejściu do systemu"; - /* Cmdr stats. [stats.py] */ "Balance" = "Saldo"; diff --git a/L10n/ru.strings b/L10n/ru.strings index eae5f4ed..1c980650 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Внешний вид"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Автоматически заносить в журнал полета каждую посещённую систему"; - /* Cmdr stats. [stats.py] */ "Balance" = "Баланс"; diff --git a/L10n/sl.strings b/L10n/sl.strings index e5ecbc05..52206c91 100644 --- a/L10n/sl.strings +++ b/L10n/sl.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Videz"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Shrani podatke v dnevnik leta, ko prispeš v sistem"; - /* Cmdr stats. [stats.py] */ "Balance" = "Ravnotežje"; diff --git a/L10n/uk.strings b/L10n/uk.strings index 552350d4..063c41eb 100644 --- a/L10n/uk.strings +++ b/L10n/uk.strings @@ -25,9 +25,6 @@ /* Tab heading in settings. [prefs.py] */ "Appearance" = "Зовнішній вигляд"; -/* Output setting. [prefs.py] */ -"Automatically make a log entry on entering a system" = "Автоматично робити запис у журналі на вході в систему"; - /* Cmdr stats. [stats.py] */ "Balance" = "Баланс"; diff --git a/config.py b/config.py index ae14dc11..4e9c650a 100644 --- a/config.py +++ b/config.py @@ -79,7 +79,7 @@ class Config: # OUT_STAT = 64 # No longer available OUT_SHIP_CORIOLIS = 128 OUT_SYS_EDSM = 256 - OUT_SYS_AUTO = 512 + # OUT_SYS_AUTO = 512 # Now always automatic OUT_MKT_MANUAL = 1024 if platform=='darwin': diff --git a/prefs.py b/prefs.py index 3acb533c..9900ce42 100644 --- a/prefs.py +++ b/prefs.py @@ -153,10 +153,8 @@ class PreferencesDialog(tk.Toplevel): HyperlinkLabel(edsmframe, text='Elite Dangerous Star Map', background=nb.Label().cget('background'), url='https://www.edsm.net/', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W) # Don't translate self.edsm_log = tk.IntVar(value = (output & config.OUT_SYS_EDSM) and 1) - nb.Checkbutton(edsmframe, text=_('Send flight log to Elite Dangerous Star Map'), variable=self.edsm_log, command=self.outvarchanged).grid(columnspan=2, padx=BUTTONX, sticky=tk.W) - self.edsm_log_auto = tk.IntVar(value = output & config.OUT_SYS_AUTO and 1 or 0) - self.edsm_log_auto_button = nb.Checkbutton(edsmframe, text=_('Automatically make a log entry on entering a system'), variable=self.edsm_log_auto, command=self.outvarchanged) # Output setting - self.edsm_log_auto_button.grid(columnspan=2, padx=BUTTONX, sticky=tk.W) + self.edsm_log_button = nb.Checkbutton(edsmframe, text=_('Send flight log to Elite Dangerous Star Map'), variable=self.edsm_log, command=self.outvarchanged) + self.edsm_log_button.grid(columnspan=2, padx=BUTTONX, sticky=tk.W) nb.Label(edsmframe).grid(sticky=tk.W) # big spacer self.edsm_label = HyperlinkLabel(edsmframe, text=_('Elite Dangerous Star Map credentials'), background=nb.Label().cget('background'), url='https://www.edsm.net/settings/api', underline=True) # Section heading in settings @@ -275,11 +273,15 @@ class PreferencesDialog(tk.Toplevel): def outvarchanged(self): + self.out_auto_button['state'] = monitor.logdir and tk.NORMAL or tk.DISABLED + local = self.out_bpc.get() or self.out_td.get() or self.out_csv.get() or self.out_ship_eds.get() or self.out_ship_coriolis.get() self.outdir_label['state'] = local and tk.NORMAL or tk.DISABLED self.outbutton['state'] = local and tk.NORMAL or tk.DISABLED self.outdir['state'] = local and 'readonly' or tk.DISABLED + self.edsm_log_button['state'] = monitor.logdir and tk.NORMAL or tk.DISABLED + edsm_state = self.edsm_log.get() and tk.NORMAL or tk.DISABLED self.edsm_label['state'] = edsm_state self.edsm_cmdr_label['state'] = edsm_state @@ -287,13 +289,6 @@ class PreferencesDialog(tk.Toplevel): self.edsm_cmdr['state'] = edsm_state self.edsm_apikey['state'] = edsm_state - if monitor.logdir: - self.out_auto_button['state'] = tk.NORMAL - self.edsm_log_auto_button['state'] = edsm_state - else: - self.out_auto_button['state'] = tk.DISABLED - self.edsm_log_auto_button['state'] = tk.DISABLED - def outbrowse(self): if platform != 'win32': import tkFileDialog @@ -402,8 +397,7 @@ class PreferencesDialog(tk.Toplevel): (config.OUT_MKT_MANUAL if not self.out_auto.get() else 0) + (self.out_ship_eds.get() and config.OUT_SHIP_EDS) + (self.out_ship_coriolis.get() and config.OUT_SHIP_CORIOLIS) + - (self.edsm_log.get() and config.OUT_SYS_EDSM) + - (self.edsm_log_auto.get() and config.OUT_SYS_AUTO)) + (self.edsm_log.get() and config.OUT_SYS_EDSM)) config.set('outdir', self.outdir.get().startswith('~') and join(config.home, self.outdir.get()[2:]) or self.outdir.get()) config.set('edsm_cmdrname', self.edsm_cmdr.get().strip())