Example #1
0
    def outvarchanged(self):
        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() or self.out_log_file.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

        edsm_state = self.out_log_edsm.get() and tk.NORMAL or tk.DISABLED
        self.edsm_autoopen_button['state'] = edsm_state
        self.edsm_label['state']        = edsm_state
        self.edsm_cmdr_label['state']   = edsm_state
        self.edsm_apikey_label['state'] = edsm_state
        self.edsm_cmdr['state']         = edsm_state
        self.edsm_apikey['state']       = edsm_state

        if monitor.logdir:
            log = self.out_log_file.get()
            self.out_log_auto_button['state']  = log and tk.NORMAL or tk.DISABLED

            self.out_log_auto_text['text'] = ''
            if log and self.out_log_auto.get():
                if not monitor.enable_logging():
                    self.out_log_auto_text['text'] = "Can't enable automatic logging!"	# Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.out_log_auto_text['text'] = _('Re-start Elite: Dangerous to use this feature')	# Output settings prompt

            self.edsm_log_auto_button['state']  = edsm_state

            self.edsm_log_auto_text['text'] = ''
            if self.out_log_edsm.get() and self.out_log_auto.get():
                if not monitor.enable_logging():
                    self.edsm_log_auto_text['text'] = "Can't enable automatic logging!"	# Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.edsm_log_auto_text['text'] = _('Re-start Elite: Dangerous to use this feature')	# Output settings prompt
Example #2
0
    def outvarchanged(self):
        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()
            or self.out_log_file.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

        edsm_state = self.out_log_edsm.get() and tk.NORMAL or tk.DISABLED
        self.edsm_autoopen_button["state"] = edsm_state
        self.edsm_label["state"] = edsm_state
        self.edsm_cmdr_label["state"] = edsm_state
        self.edsm_apikey_label["state"] = edsm_state
        self.edsm_cmdr["state"] = edsm_state
        self.edsm_apikey["state"] = edsm_state

        proxyaddr = edproxy.status()
        self.out_log_auto_text["text"] = ""
        self.edsm_log_auto_text["text"] = ""
        if monitor.logdir or proxyaddr:
            log = self.out_log_file.get()
            self.out_log_auto_button["state"] = log and tk.NORMAL or tk.DISABLED

            if log and self.out_log_auto.get():
                if proxyaddr:
                    self.out_log_auto_text["text"] = _("Connected to {EDPROXY} at {ADDR}").format(
                        EDPROXY="edproxy", ADDR=proxyaddr
                    )  # Output settings
                elif not monitor.enable_logging():
                    self.out_log_auto_text[
                        "text"
                    ] = "Can't enable automatic logging!"  # Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.out_log_auto_text["text"] = _(
                        "Re-start Elite: Dangerous to use this feature"
                    )  # Output settings prompt

            self.edsm_log_auto_button["state"] = edsm_state

            if self.out_log_edsm.get() and self.out_log_auto.get():
                if proxyaddr:
                    self.edsm_log_auto_text["text"] = _("Connected to {EDPROXY} at {ADDR}").format(
                        EDPROXY="edproxy", ADDR=proxyaddr
                    )  # Output settings
                elif not monitor.enable_logging():
                    self.edsm_log_auto_text[
                        "text"
                    ] = "Can't enable automatic logging!"  # Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.edsm_log_auto_text["text"] = _(
                        "Re-start Elite: Dangerous to use this feature"
                    )  # Output settings prompt
        else:
            self.out_log_auto_button["state"] = tk.DISABLED
            self.edsm_log_auto_button["state"] = tk.DISABLED
    def login(self):
        self.status['text'] = _('Logging in...')
        self.button['state'] = tk.DISABLED
        self.w.update_idletasks()
        try:
            self.session.login(config.get('username'), config.get('password'))
            self.view_menu.entryconfigure(_('Status'), state=tk.NORMAL)
            self.status['text'] = ''
        except companion.VerificationRequired:
            # don't worry about authentication now - prompt on query
            self.status['text'] = ''
        except companion.ServerError as e:
            self.status['text'] = unicode(e)
        except Exception as e:
            if __debug__: print_exc()
            self.status['text'] = unicode(e)

        # Try to obtain exclusive lock on flight log ASAP
        if config.getint('output') & config.OUT_LOG_FILE:
            try:
                flightlog.openlog()
            except Exception as e:
                if __debug__: print_exc()
                if not self.status['text']:
                    self.status['text'] = unicode(e)

        if not self.status['text'] and monitor.restart_required():
            self.status['text'] = _(
                'Re-start Elite: Dangerous for automatic log entries'
            )  # Status bar message on launch
        elif not getattr(sys, 'frozen', False):
            self.updater.checkForUpdates(
            )  # Sparkle / WinSparkle does this automatically for packaged apps

        self.cooldown()
    def login(self):
        self.status['text'] = _('Logging in...')
        self.button['state'] = tk.DISABLED
        self.w.update_idletasks()
        try:
            self.session.login(config.get('username'), config.get('password'))
            self.view_menu.entryconfigure(_('Status'), state=tk.NORMAL)
            self.status['text'] = ''
        except companion.VerificationRequired:
            # don't worry about authentication now - prompt on query
            self.status['text'] = ''
        except companion.ServerError as e:
            self.status['text'] = unicode(e)
        except Exception as e:
            if __debug__: print_exc()
            self.status['text'] = unicode(e)

        # Try to obtain exclusive lock on flight log ASAP
        if config.getint('output') & config.OUT_LOG_FILE:
            try:
                flightlog.openlog()
            except Exception as e:
                if __debug__: print_exc()
                if not self.status['text']:
                    self.status['text'] = unicode(e)

        if not self.status['text'] and monitor.restart_required():
            self.status['text'] = _('Re-start Elite: Dangerous for automatic log entries')	# Status bar message on launch
        elif not getattr(sys, 'frozen', False):
            self.updater.checkForUpdates()	# Sparkle / WinSparkle does this automatically for packaged apps

        self.cooldown()
Example #5
0
    def outvarchanged(self):
        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() or self.out_log_file.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

        edsm_state = self.out_log_edsm.get() and tk.NORMAL or tk.DISABLED
        self.edsm_autoopen_button['state'] = edsm_state
        self.edsm_label['state'] = edsm_state
        self.edsm_cmdr_label['state'] = edsm_state
        self.edsm_apikey_label['state'] = edsm_state
        self.edsm_cmdr['state'] = edsm_state
        self.edsm_apikey['state'] = edsm_state

        if monitor.logdir:
            log = self.out_log_file.get()
            self.out_log_auto_button[
                'state'] = log and tk.NORMAL or tk.DISABLED

            self.out_log_auto_text['text'] = ''
            if log and self.out_log_auto.get():
                if not monitor.enable_logging():
                    self.out_log_auto_text[
                        'text'] = "Can't enable automatic logging!"  # Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.out_log_auto_text['text'] = _(
                        'Re-start Elite: Dangerous to use this feature'
                    )  # Output settings prompt

            self.edsm_log_auto_button['state'] = edsm_state

            self.edsm_log_auto_text['text'] = ''
            if self.out_log_edsm.get() and self.out_log_auto.get():
                if not monitor.enable_logging():
                    self.edsm_log_auto_text[
                        'text'] = "Can't enable automatic logging!"  # Shouldn't happen - don't translate
                elif monitor.restart_required():
                    self.edsm_log_auto_text['text'] = _(
                        'Re-start Elite: Dangerous to use this feature'
                    )  # Output settings prompt