diff --git a/nomadnet/NomadNetworkApp.py b/nomadnet/NomadNetworkApp.py index 6659e23..3a1cd2c 100644 --- a/nomadnet/NomadNetworkApp.py +++ b/nomadnet/NomadNetworkApp.py @@ -287,7 +287,8 @@ class NomadNetworkApp: RNS.log("Could not recall identity for autoselected LXMF propagation node "+RNS.prettyhexrep(selected_node.source_hash), RNS.LOG_WARNING) RNS.log("LXMF propagation will not be available until a trusted node announces on the network.", RNS.LOG_WARNING) - + def get_default_propagation_node(self): + return self.message_router.get_outbound_propagation_node() def save_peer_settings(self): file = open(self.peersettingspath, "wb") diff --git a/nomadnet/ui/textui/Conversations.py b/nomadnet/ui/textui/Conversations.py index d29b439..48151bb 100644 --- a/nomadnet/ui/textui/Conversations.py +++ b/nomadnet/ui/textui/Conversations.py @@ -358,14 +358,26 @@ class ConversationsDisplay(): button_columns = urwid.Columns([("weight", 0.45, sync_button), ("weight", 0.1, urwid.Text("")), ("weight", 0.45, cancel_button)]) real_sync_button.bc = button_columns - dialog = DialogLineBox( - urwid.Pile([ - urwid.Text(""), - sync_progress, - urwid.Text(""), - button_columns - ]), title="Message Sync" - ) + if self.app.get_default_propagation_node() != None: + dialog = DialogLineBox( + urwid.Pile([ + urwid.Text(""), + sync_progress, + urwid.Text(""), + button_columns + ]), title="Message Sync" + ) + else: + button_columns = urwid.Columns([("weight", 0.45, urwid.Text("" )), ("weight", 0.1, urwid.Text("")), ("weight", 0.45, cancel_button)]) + dialog = DialogLineBox( + urwid.Pile([ + urwid.Text(""), + urwid.Text("No trusted nodes found, cannot sync", align="center"), + urwid.Text(""), + button_columns + ]), title="Message Sync" + ) + dialog.delegate = self dialog.sync_progress = sync_progress dialog.cancel_button = cancel_button