mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-22 21:40:36 +01:00
Display RNode hardware errors if available
This commit is contained in:
parent
ca21e47910
commit
86c3b18f84
@ -300,6 +300,7 @@ class SidebandApp(MDApp):
|
|||||||
self.hardware_rnode_ready = False
|
self.hardware_rnode_ready = False
|
||||||
self.hardware_modem_ready = False
|
self.hardware_modem_ready = False
|
||||||
self.hardware_serial_ready = False
|
self.hardware_serial_ready = False
|
||||||
|
self.hw_error_dialog = None
|
||||||
|
|
||||||
self.final_load_completed = False
|
self.final_load_completed = False
|
||||||
self.service_last_available = 0
|
self.service_last_available = 0
|
||||||
@ -432,22 +433,25 @@ class SidebandApp(MDApp):
|
|||||||
|
|
||||||
def check_errors(dt):
|
def check_errors(dt):
|
||||||
if self.sideband.getpersistent("startup.errors.rnode") != None:
|
if self.sideband.getpersistent("startup.errors.rnode") != None:
|
||||||
description = self.sideband.getpersistent("startup.errors.rnode")["description"]
|
if self.hw_error_dialog == None or (self.hw_error_dialog != None and not self.hw_error_dialog.is_open):
|
||||||
self.sideband.setpersistent("startup.errors.rnode", None)
|
description = self.sideband.getpersistent("startup.errors.rnode")["description"]
|
||||||
yes_button = MDRectangleFlatButton(
|
self.sideband.setpersistent("startup.errors.rnode", None)
|
||||||
text="OK",
|
yes_button = MDRectangleFlatButton(
|
||||||
font_size=dp(18),
|
text="OK",
|
||||||
)
|
font_size=dp(18),
|
||||||
self.hw_error_dialog = MDDialog(
|
)
|
||||||
title="Hardware Error",
|
self.hw_error_dialog = MDDialog(
|
||||||
text="When starting a connected RNode, Reticulum reported the following error:\n\n[i]"+str(description)+"[/i]",
|
title="Hardware Error",
|
||||||
buttons=[ yes_button ],
|
text="When starting a connected RNode, Reticulum reported the following error:\n\n[i]"+str(description)+"[/i]",
|
||||||
# elevation=0,
|
buttons=[ yes_button ],
|
||||||
)
|
# elevation=0,
|
||||||
def dl_yes(s):
|
)
|
||||||
self.hw_error_dialog.dismiss()
|
def dl_yes(s):
|
||||||
yes_button.bind(on_release=dl_yes)
|
self.hw_error_dialog.is_open = False
|
||||||
self.hw_error_dialog.open()
|
self.hw_error_dialog.dismiss()
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
self.hw_error_dialog.open()
|
||||||
|
self.hw_error_dialog.is_open = True
|
||||||
|
|
||||||
Clock.schedule_once(check_errors, 1.5)
|
Clock.schedule_once(check_errors, 1.5)
|
||||||
|
|
||||||
@ -936,22 +940,25 @@ class SidebandApp(MDApp):
|
|||||||
if RNS.vendor.platformutils.is_android():
|
if RNS.vendor.platformutils.is_android():
|
||||||
rnode_errors = self.sideband.getpersistent("runtime.errors.rnode")
|
rnode_errors = self.sideband.getpersistent("runtime.errors.rnode")
|
||||||
if rnode_errors != None:
|
if rnode_errors != None:
|
||||||
description = rnode_errors["description"]
|
if self.hw_error_dialog == None or (self.hw_error_dialog != None and not self.hw_error_dialog.is_open):
|
||||||
self.sideband.setpersistent("runtime.errors.rnode", None)
|
description = rnode_errors["description"]
|
||||||
yes_button = MDRectangleFlatButton(
|
self.sideband.setpersistent("runtime.errors.rnode", None)
|
||||||
text="OK",
|
yes_button = MDRectangleFlatButton(
|
||||||
font_size=dp(18),
|
text="OK",
|
||||||
)
|
font_size=dp(18),
|
||||||
self.hw_error_dialog = MDDialog(
|
)
|
||||||
title="Hardware Error",
|
self.hw_error_dialog = MDDialog(
|
||||||
text="While connecting an RNode, Reticulum reported the following error:\n\n[i]"+str(description)+"[/i]",
|
title="Hardware Error",
|
||||||
buttons=[ yes_button ],
|
text="While communicating with an RNode, Reticulum reported the following error:\n\n[i]"+str(description)+"[/i]",
|
||||||
# elevation=0,
|
buttons=[ yes_button ],
|
||||||
)
|
# elevation=0,
|
||||||
def dl_yes(s):
|
)
|
||||||
self.hw_error_dialog.dismiss()
|
def dl_yes(s):
|
||||||
yes_button.bind(on_release=dl_yes)
|
self.hw_error_dialog.dismiss()
|
||||||
self.hw_error_dialog.open()
|
self.hw_error_dialog.is_open = False
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
self.hw_error_dialog.open()
|
||||||
|
self.hw_error_dialog.is_open = True
|
||||||
|
|
||||||
|
|
||||||
if self.root.ids.screen_manager.current == "messages_screen":
|
if self.root.ids.screen_manager.current == "messages_screen":
|
||||||
|
Loading…
Reference in New Issue
Block a user