Improved sync UI

This commit is contained in:
Mark Qvist 2021-10-08 09:12:20 +02:00
parent 0bd7a9bdf5
commit 698b97f78c
2 changed files with 22 additions and 9 deletions

View File

@ -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")

View File

@ -358,6 +358,7 @@ 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
if self.app.get_default_propagation_node() != None:
dialog = DialogLineBox(
urwid.Pile([
urwid.Text(""),
@ -366,6 +367,17 @@ class ConversationsDisplay():
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