From cb069bdeab97bbe4be47e2a0041e5a4a404796fd Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 23 Apr 2020 14:33:51 +0200 Subject: 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). --- alot/commands/envelope.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'alot/commands/envelope.py') 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) -- cgit v1.2.3