summaryrefslogtreecommitdiff
path: root/alot/commands/envelope.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-04-23 14:33:51 +0200
committerAnton Khirnov <anton@khirnov.net>2020-04-23 14:33:51 +0200
commitcb069bdeab97bbe4be47e2a0041e5a4a404796fd (patch)
tree73c8bf673496cc09f9eb81f45f0f19bd21ad724d /alot/commands/envelope.py
parentaa2d9e486219aff9abb9c113ba3e3de19cbda3db (diff)
ui: rewrite notification/status bar handling
Do not recreate all the widgets on every update, just update the widget contents. Make the statusbar update async, since some calls to get_info() can take a long time (especially noticeable for counting threads for searches with many results).
Diffstat (limited to 'alot/commands/envelope.py')
-rw-r--r--alot/commands/envelope.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 17d32f89..5aebadc5 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -242,11 +242,11 @@ class SendCommand(Command):
self.mail = self.envelope.construct_mail()
self.mail = self.mail.as_string(policy=email.policy.SMTP)
except GPGProblem as e:
- ui.clear_notify([clearme])
+ ui.clear_notify(clearme)
ui.notify(str(e), priority='error')
return
- ui.clear_notify([clearme])
+ ui.clear_notify(clearme)
# determine account to use for sending
msg = self.mail
@@ -273,12 +273,12 @@ class SendCommand(Command):
if self.envelope is not None:
self.envelope.account = account
self.envelope.sending = False
- ui.clear_notify([clearme])
+ ui.clear_notify(clearme)
logging.error(traceback.format_exc())
errmsg = 'failed to send: {}'.format(e)
ui.notify(errmsg, priority='error', block=True)
except StoreMailError as e:
- ui.clear_notify([clearme])
+ ui.clear_notify(clearme)
logging.error(traceback.format_exc())
errmsg = 'could not store mail: {}'.format(e)
ui.notify(errmsg, priority='error', block=True)
@@ -289,7 +289,7 @@ class SendCommand(Command):
self.envelope.sent_time = datetime.datetime.now()
initial_tags = self.envelope.tags
logging.debug('mail sent successfully')
- ui.clear_notify([clearme])
+ ui.clear_notify(clearme)
if self.envelope_buffer is not None:
cmd = commands.globals.BufferCloseCommand(self.envelope_buffer)
await ui.apply_command(cmd)