From 17a665306802caf2d1afa1ed72bd35fd96b8296c Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 19 Mar 2024 13:45:26 +0100 Subject: [PATCH] Improved message transfer feedback --- sbapp/ui/messages.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index 1ac5cc5..63bb2e6 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -141,12 +141,22 @@ class Messages(): txstr = time.strftime(ts_format, time.localtime(msg["sent"])) titlestr = "" prgstr = "" + sphrase = "Sending" prg = self.app.sideband.get_lxm_progress(msg["hash"]) if prg != None: prgstr = ", "+str(round(prg*100, 1))+"% done" + if prg <= 0.00: + sphrase = "Waiting for path" + elif prg <= 0.03: + sphrase = "Establishing link" + elif prg <= 0.05: + sphrase = "Link established" + elif prg >= 0.05: + sphrase = "Sending" + if msg["title"]: titlestr = "[b]Title[/b] "+msg["title"].decode("utf-8")+"\n" - w.heading = titlestr+"[b]Sent[/b] "+txstr+"\n[b]State[/b] Sending"+prgstr+" " + w.heading = titlestr+"[b]Sent[/b] "+txstr+"\n[b]State[/b] "+sphrase+prgstr+" " m["state"] = msg["state"] if msg["state"] == LXMF.LXMessage.DELIVERED: