From 338f6083827de1bc5e37863816713504a5c7cb0a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 24 Oct 2023 01:28:49 +0200 Subject: [PATCH] Fixed button race --- sbapp/sideband/core.py | 8 +++++++- sbapp/ui/objectdetails.py | 14 +++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 12b3667..4d8c41c 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -674,7 +674,13 @@ class SidebandCore(): return "" def peer_appearance(self, context_dest): - return self._db_get_appearance(context_dest) or SidebandCore.DEFAULT_APPEARANCE + appearance = self._db_get_appearance(context_dest) + if appearance == None: + return SidebandCore.DEFAULT_APPEARANCE + for e in appearance: + if e == None: + return SidebandCore.DEFAULT_APPEARANCE + return appearance def peer_display_name(self, context_dest): if context_dest == self.lxmf_destination.hash: diff --git a/sbapp/ui/objectdetails.py b/sbapp/ui/objectdetails.py index 2c70a83..84833e4 100644 --- a/sbapp/ui/objectdetails.py +++ b/sbapp/ui/objectdetails.py @@ -8,6 +8,7 @@ from kivymd.uix.recycleview import MDRecycleView from kivymd.uix.list import OneLineIconListItem from kivy.properties import StringProperty, BooleanProperty from kivy.effects.scroll import ScrollEffect +from kivy.clock import Clock from sideband.sense import Telemeter import threading import webbrowser @@ -72,11 +73,18 @@ class ObjectDetails(): rendered_telemetry = telemeter.render() if "location" in telemeter.sensors: - self.screen.ids.coordinates_button.disabled = False + def job(dt): + self.screen.ids.coordinates_button.disabled = False + Clock.schedule_once(job, 0.01) + self.telemetry_list.update_source(rendered_telemetry) - self.screen.ids.telemetry_button.disabled = False + def job(dt): + self.screen.ids.telemetry_button.disabled = False + Clock.schedule_once(job, 0.01) else: - self.screen.ids.telemetry_button.disabled = True + def job(dt): + self.screen.ids.telemetry_button.disabled = True + Clock.schedule_once(job, 0.01) self.telemetry_list.update_source(None) def reload(self):