Merge pull request 'misc-cleanups' (#8) from devrtz/satellite:misc-cleanups into main

Reviewed-on: https://codeberg.org/tpikonen/satellite/pulls/8
This commit is contained in:
Teemu Ikonen 2022-11-16 15:19:30 +01:00
commit 21857aa3f4

View file

@ -216,7 +216,7 @@ class SatelliteApp(Gtk.Application):
GLib.timeout_add(self.refresh_rate * 1000, self.timeout_cb, None)
return False # Remove from idle_add
return GLib.SOURCE_REMOVE
def init_gnss_share_source(self):
try:
@ -367,19 +367,16 @@ class SatelliteApp(Gtk.Application):
def leaflet_forward_cb(self, button):
self.leaflet.navigate(Handy.NavigationDirection.FORWARD)
return True
def leaflet_back_cb(self, button):
self.leaflet.navigate(Handy.NavigationDirection.BACK)
return True
def infolabel_released_cb(self, gesture, n_press, x, y):
if n_press != 1 or self.carousel.get_position() > 0.5:
return False
return
self.chart_size = self.chart_small if (
self.chart_size == self.chart_large) else self.chart_large
self.set_barchart(self.last_data)
return True
def carousel_page_changed_cb(self, carousel, index):
if index == 1 and self.chart_size == self.chart_large:
@ -532,7 +529,7 @@ class SatelliteApp(Gtk.Application):
if dt > 2 * self.refresh_rate:
self.main_box.set_sensitive(False)
self.update()
return True
return GLib.SOURCE_CONTINUE
def location_update_cb(self, *args):
self.last_update = time.time()
@ -574,10 +571,10 @@ class SatelliteApp(Gtk.Application):
return
elif dtext is not None:
self.log_msg(dtext)
return True
return
if not nmeas:
return True
return
if self.source_lost:
self.log_msg("Modem appeared")
@ -618,5 +615,3 @@ class SatelliteApp(Gtk.Application):
self.gpx_update(data)
self.last_data = data
return True