diff options
author | pazz <patricktotzke@gmail.com> | 2011-08-04 23:02:41 +0100 |
---|---|---|
committer | pazz <patricktotzke@gmail.com> | 2011-08-04 23:02:41 +0100 |
commit | 88efcc516968b67fa365168cd6f231e5e91449e7 (patch) | |
tree | 0709776bcb3a8e85832f28add2c6b7d5c5a7264a | |
parent | 951a85424bba4691545ab7087f290d7c1b1adbe7 (diff) |
move removal of unread tag to unfold cmd, maps R/M
issue #47
-rw-r--r-- | alot/command.py | 22 | ||||
-rw-r--r-- | alot/settings.py | 2 | ||||
-rw-r--r-- | alot/widgets.py | 1 |
3 files changed, 15 insertions, 10 deletions
diff --git a/alot/command.py b/alot/command.py index 8bc31a95..949d012a 100644 --- a/alot/command.py +++ b/alot/command.py @@ -69,12 +69,6 @@ class OpenThreadCommand(Command): self.thread = ui.current_buffer.get_selected_thread() ui.logger.info('open thread view for %s' % self.thread) - # in case the thread is yet unread, remove this tag - if 'unread' in self.thread.get_tags(): - self.thread.remove_tags(['unread'], sync_maildir_flags=True) - ui.apply_command(FlushCommand()) - self.thread.refresh() - sb = buffer.ThreadBuffer(ui, self.thread) ui.buffer_open(sb) @@ -604,12 +598,20 @@ class FoldMessagesCommand(Command): Command.__init__(self, **kwargs) def apply(self, ui): + lines = [] if not self.all: - msg_wg = ui.current_buffer.get_selection() - msg_wg.fold(self.visible) + lines.append(ui.current_buffer.get_selection()) else: - for widget in ui.current_buffer.get_message_widgets(): - widget.fold(self.visible) + lines = ui.current_buffer.get_message_widgets() + + for widget in lines: + # in case the thread is yet unread, remove this tag + msg = widget.get_message() + if 'unread' in msg.get_tags(): + msg.remove_tags(['unread']) + ui.apply_command(FlushCommand()) + widget.rebuild() + widget.fold(self.visible) ### ENVELOPE diff --git a/alot/settings.py b/alot/settings.py index 62eb5eda..d34d949e 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -229,6 +229,8 @@ DEFAULTS = { 'f': 'forward', 'g': 'groupreply', 'r': 'reply', + 'R': 'unfold all', + 'M': 'fold all', }, 'taglist-maps': { 'enter': 'select', diff --git a/alot/widgets.py b/alot/widgets.py index 8f8a5bbe..c2db75eb 100644 --- a/alot/widgets.py +++ b/alot/widgets.py @@ -224,6 +224,7 @@ class MessageWidget(urwid.WidgetWrap): self.pile = urwid.Pile(self.displayed_list) urwid.WidgetWrap.__init__(self, self.pile) + #TODO re-read tags def rebuild(self): self.pile = urwid.Pile(self.displayed_list) self._w = self.pile |