Prepare interface modularity. Fixed occasional missing view redraw on wake on Android.
This commit is contained in:
parent
6fb9a94a43
commit
9f86c4130c
|
@ -303,6 +303,7 @@ class SidebandApp(MDApp):
|
|||
self.hw_error_dialog = None
|
||||
|
||||
self.final_load_completed = False
|
||||
self.wants_wake_update = False
|
||||
self.service_last_available = 0
|
||||
self.closing_app = False
|
||||
|
||||
|
@ -699,6 +700,10 @@ class SidebandApp(MDApp):
|
|||
else:
|
||||
RNS.log("Conversations view did not exist", RNS.LOG_DEBUG)
|
||||
|
||||
def cb(dt):
|
||||
self.wants_wake_update = True
|
||||
Clock.schedule_once(cb, 1.2)
|
||||
|
||||
RNS.log("App resumed", RNS.LOG_DEBUG)
|
||||
|
||||
def on_stop(self):
|
||||
|
@ -972,6 +977,11 @@ class SidebandApp(MDApp):
|
|||
if self.conversations_view != None:
|
||||
self.conversations_view.update()
|
||||
|
||||
if self.wants_wake_update:
|
||||
self.wants_wake_update = False
|
||||
if self.conversations_view != None:
|
||||
self.conversations_view.update()
|
||||
|
||||
if self.sideband.getstate("app.flags.lxmf_sync_dialog_open", allow_cache=True) and self.sync_dialog != None:
|
||||
state = self.sideband.message_router.propagation_transfer_state
|
||||
|
||||
|
@ -993,6 +1003,11 @@ class SidebandApp(MDApp):
|
|||
if self.announces_view != None:
|
||||
self.announces_view.update()
|
||||
|
||||
if self.wants_wake_update:
|
||||
self.wants_wake_update = False
|
||||
if self.announces_view != None:
|
||||
self.announces_view.update()
|
||||
|
||||
elif self.root.ids.screen_manager.current == "map_screen":
|
||||
if self.map_screen and hasattr(self.map_screen.ids.map_layout, "map") and self.map_screen.ids.map_layout.map != None:
|
||||
self.sideband.config["map_lat"] = self.map_screen.ids.map_layout.map.lat
|
||||
|
@ -1003,6 +1018,10 @@ class SidebandApp(MDApp):
|
|||
if self.last_telemetry_received > self.last_map_update:
|
||||
self.map_update_markers()
|
||||
|
||||
if self.wants_wake_update:
|
||||
self.wants_wake_update = False
|
||||
self.map_update_markers()
|
||||
|
||||
if self.sideband.getstate("app.flags.new_conversations", allow_cache=True):
|
||||
if self.conversations_view != None:
|
||||
self.conversations_view.update()
|
||||
|
@ -2400,11 +2419,11 @@ class SidebandApp(MDApp):
|
|||
else:
|
||||
sl = None
|
||||
|
||||
sync_title = "LXMF Sync"
|
||||
if not hasattr(self, "message_sync_dialog") or self.message_sync_dialog == None:
|
||||
close_button = MDRectangleFlatButton(text="Close",font_size=dp(18))
|
||||
stop_button = MDRectangleFlatButton(text="Stop",font_size=dp(18), theme_text_color="Custom", line_color=self.color_reject, text_color=self.color_reject)
|
||||
|
||||
sync_title = "LXMF Sync"
|
||||
dialog_content = MsgSync()
|
||||
dialog = MDDialog(
|
||||
title=sync_title,
|
||||
|
|
|
@ -3437,11 +3437,12 @@ class SidebandCore():
|
|||
else:
|
||||
ifac_netkey = self.config["connect_local_ifac_passphrase"]
|
||||
|
||||
autointerface = RNS.Interfaces.AutoInterface.AutoInterface(
|
||||
RNS.Transport,
|
||||
name = "AutoInterface",
|
||||
group_id = group_id
|
||||
)
|
||||
interface_config = {
|
||||
"name": "AutoInterface",
|
||||
"group_id": group_id
|
||||
}
|
||||
|
||||
autointerface = RNS.Interfaces.AutoInterface.AutoInterface(RNS.Transport, interface_config)
|
||||
autointerface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
|
@ -3529,45 +3530,50 @@ class SidebandCore():
|
|||
else:
|
||||
atl_long = self.config["hw_rnode_atl_long"]
|
||||
|
||||
interface_config = None
|
||||
if rnode_allow_ble:
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
||||
RNS.Transport,
|
||||
"RNodeInterface",
|
||||
None,
|
||||
frequency = self.config["hw_rnode_frequency"],
|
||||
bandwidth = self.config["hw_rnode_bandwidth"],
|
||||
txpower = self.config["hw_rnode_tx_power"],
|
||||
sf = self.config["hw_rnode_spreading_factor"],
|
||||
cr = self.config["hw_rnode_coding_rate"],
|
||||
flow_control = None,
|
||||
id_interval = self.config["hw_rnode_beaconinterval"],
|
||||
id_callsign = self.config["hw_rnode_beacondata"],
|
||||
allow_bluetooth = False,
|
||||
st_alock = atl_short,
|
||||
lt_alock = atl_long,
|
||||
force_ble = True,
|
||||
ble_name = bt_device_name,
|
||||
)
|
||||
interface_config = {
|
||||
"name": "RNodeInterface",
|
||||
"port": None,
|
||||
"frequency": self.config["hw_rnode_frequency"],
|
||||
"bandwidth": self.config["hw_rnode_bandwidth"],
|
||||
"txpower": self.config["hw_rnode_tx_power"],
|
||||
"spreadingfactor": self.config["hw_rnode_spreading_factor"],
|
||||
"codingrate": self.config["hw_rnode_coding_rate"],
|
||||
"flow_control": False,
|
||||
"id_interval": self.config["hw_rnode_beaconinterval"],
|
||||
"id_callsign": self.config["hw_rnode_beacondata"],
|
||||
"st_alock": atl_short,
|
||||
"lt_alock": atl_long,
|
||||
"allow_bluetooth": False,
|
||||
"target_device_name": None,
|
||||
"force_ble": True,
|
||||
"ble_name": bt_device_name,
|
||||
"ble_addr": None,
|
||||
}
|
||||
|
||||
else:
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
||||
RNS.Transport,
|
||||
"RNodeInterface",
|
||||
target_port,
|
||||
frequency = self.config["hw_rnode_frequency"],
|
||||
bandwidth = self.config["hw_rnode_bandwidth"],
|
||||
txpower = self.config["hw_rnode_tx_power"],
|
||||
sf = self.config["hw_rnode_spreading_factor"],
|
||||
cr = self.config["hw_rnode_coding_rate"],
|
||||
flow_control = None,
|
||||
id_interval = self.config["hw_rnode_beaconinterval"],
|
||||
id_callsign = self.config["hw_rnode_beacondata"],
|
||||
allow_bluetooth = rnode_allow_bluetooth,
|
||||
target_device_name = bt_device_name,
|
||||
st_alock = atl_short,
|
||||
lt_alock = atl_long,
|
||||
)
|
||||
interface_config = {
|
||||
"name": "RNodeInterface",
|
||||
"port": target_port,
|
||||
"frequency": self.config["hw_rnode_frequency"],
|
||||
"bandwidth": self.config["hw_rnode_bandwidth"],
|
||||
"txpower": self.config["hw_rnode_tx_power"],
|
||||
"spreadingfactor": self.config["hw_rnode_spreading_factor"],
|
||||
"codingrate": self.config["hw_rnode_coding_rate"],
|
||||
"flow_control": False,
|
||||
"id_interval": self.config["hw_rnode_beaconinterval"],
|
||||
"id_callsign": self.config["hw_rnode_beacondata"],
|
||||
"st_alock": atl_short,
|
||||
"lt_alock": atl_long,
|
||||
"allow_bluetooth": rnode_allow_bluetooth,
|
||||
"target_device_name": bt_device_name,
|
||||
"force_ble": False,
|
||||
"ble_name": None,
|
||||
"ble_addr": None,
|
||||
}
|
||||
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(RNS.Transport, interface_config)
|
||||
rnodeinterface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
|
@ -3603,6 +3609,7 @@ class SidebandCore():
|
|||
|
||||
except Exception as e:
|
||||
RNS.log("Error while adding RNode Interface. The contained exception was: "+str(e))
|
||||
RNS.trace_exception(e)
|
||||
self.interface_rnode = None
|
||||
self.interface_rnode_adding = False
|
||||
|
||||
|
@ -3678,15 +3685,14 @@ class SidebandCore():
|
|||
else:
|
||||
ifac_size = None
|
||||
|
||||
tcpinterface = RNS.Interfaces.TCPInterface.TCPClientInterface(
|
||||
RNS.Transport,
|
||||
"TCPClientInterface",
|
||||
tcp_host,
|
||||
tcp_port,
|
||||
kiss_framing = False,
|
||||
i2p_tunneled = False
|
||||
)
|
||||
|
||||
interface_config = {
|
||||
"name": "TCPClientInterface",
|
||||
"target_host": tcp_host,
|
||||
"target_port": tcp_port,
|
||||
"kiss_framing": False,
|
||||
"i2p_tunneled": False,
|
||||
}
|
||||
tcpinterface = RNS.Interfaces.TCPInterface.TCPClientInterface(RNS.Transport, interface_config)
|
||||
tcpinterface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
|
@ -3730,13 +3736,14 @@ class SidebandCore():
|
|||
else:
|
||||
ifac_size = None
|
||||
|
||||
i2pinterface = RNS.Interfaces.I2PInterface.I2PInterface(
|
||||
RNS.Transport,
|
||||
"I2PInterface",
|
||||
RNS.Reticulum.storagepath,
|
||||
[self.config["connect_i2p_b32"]],
|
||||
connectable = False,
|
||||
)
|
||||
interface_config = {
|
||||
"name": "I2PInterface",
|
||||
"storagepath": RNS.Reticulum.storagepath,
|
||||
"peers": [self.config["connect_i2p_b32"]],
|
||||
"connectable": False,
|
||||
}
|
||||
|
||||
i2pinterface = RNS.Interfaces.I2PInterface.I2PInterface(RNS.Transport, interface_config)
|
||||
|
||||
i2pinterface.OUT = True
|
||||
|
||||
|
@ -3789,16 +3796,15 @@ class SidebandCore():
|
|||
else:
|
||||
ifac_netkey = self.config["connect_serial_ifac_passphrase"]
|
||||
|
||||
serialinterface = RNS.Interfaces.Android.SerialInterface.SerialInterface(
|
||||
RNS.Transport,
|
||||
"SerialInterface",
|
||||
target_device["port"],
|
||||
self.config["hw_serial_baudrate"],
|
||||
self.config["hw_serial_databits"],
|
||||
self.config["hw_serial_parity"],
|
||||
self.config["hw_serial_stopbits"],
|
||||
)
|
||||
|
||||
interface_config = {
|
||||
"name": "SerialInterface",
|
||||
"port": target_device["port"],
|
||||
"speed": self.config["hw_serial_baudrate"],
|
||||
"databits": self.config["hw_serial_databits"],
|
||||
"parity": self.config["hw_serial_parity"],
|
||||
"stopbits": self.config["hw_serial_stopbits"],
|
||||
}
|
||||
serialinterface = RNS.Interfaces.Android.SerialInterface.SerialInterface(RNS.Transport, interface_config)
|
||||
serialinterface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
|
@ -3842,23 +3848,22 @@ class SidebandCore():
|
|||
else:
|
||||
ifac_netkey = self.config["connect_modem_ifac_passphrase"]
|
||||
|
||||
modeminterface = RNS.Interfaces.Android.KISSInterface.KISSInterface(
|
||||
RNS.Transport,
|
||||
"ModemInterface",
|
||||
target_device["port"],
|
||||
self.config["hw_modem_baudrate"],
|
||||
self.config["hw_modem_databits"],
|
||||
self.config["hw_modem_parity"],
|
||||
self.config["hw_modem_stopbits"],
|
||||
self.config["hw_modem_preamble"],
|
||||
self.config["hw_modem_tail"],
|
||||
self.config["hw_modem_persistence"],
|
||||
self.config["hw_modem_slottime"],
|
||||
False, # flow control
|
||||
self.config["hw_modem_beaconinterval"],
|
||||
self.config["hw_modem_beacondata"],
|
||||
)
|
||||
|
||||
interface_config = {
|
||||
"name": "ModemInterface",
|
||||
"port": target_device["port"],
|
||||
"speed": self.config["hw_modem_baudrate"],
|
||||
"databits": self.config["hw_modem_databits"],
|
||||
"parity": self.config["hw_modem_parity"],
|
||||
"stopbits": self.config["hw_modem_stopbits"],
|
||||
"preamble": self.config["hw_modem_preamble"],
|
||||
"txtail": self.config["hw_modem_tail"],
|
||||
"persistence": self.config["hw_modem_persistence"],
|
||||
"slottime": self.config["hw_modem_slottime"],
|
||||
"flow_control": False,
|
||||
"beacon_interval": self.config["hw_modem_beaconinterval"],
|
||||
"beacon_data": self.config["hw_modem_beacondata"],
|
||||
}
|
||||
modeminterface = RNS.Interfaces.Android.KISSInterface.KISSInterface(RNS.Transport, interface_config)
|
||||
modeminterface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
|
|
Loading…
Reference in New Issue