diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-08 18:33:25 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-08 18:33:25 +0000 |
commit | e5d2f3bfaf0bbe72aa23d5134b2a446b7e31b4c8 (patch) | |
tree | bbf63f202bd9733938ec30758f4dd2f77b061b00 /alot | |
parent | c9cd9d36b6103f17a265b334397af88655797e19 (diff) |
fix widget updating for thread retag
issue #236
Diffstat (limited to 'alot')
-rw-r--r-- | alot/buffers.py | 2 | ||||
-rw-r--r-- | alot/commands/thread.py | 7 | ||||
-rw-r--r-- | alot/message.py | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/alot/buffers.py b/alot/buffers.py index c55096c7..bf16d1d4 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -274,7 +274,7 @@ class ThreadBuffer(Buffer): (messagewidget, size) = self.body.get_focus() return messagewidget - def get_messagewidgets(): + def get_messagewidgets(self): """returns all message widgets contained in this list""" return self.body.body.contents diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 07edfefe..ee0c2416 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -624,7 +624,7 @@ class ThreadSelectCommand(Command): (['--all'], {'action': 'store_true', 'help':'tag all messages in thread'}), (['tags'], {'help':'comma separated list of tags'})]) @registerCommand(MODE, 'retag', forced={'action': 'set'}, arguments=[ - (['--all'], {'action': 'store_true', 'help':'retag all messages in thread'}), + (['--all'], {'action': 'store_true', 'help':'tag all messages in thread'}), (['tags'], {'help':'comma separated list of tags'})]) @registerCommand(MODE, 'untag', forced={'action': 'remove'}, arguments=[ (['--all'], {'action': 'store_true', 'help':'tag all messages in thread'}), @@ -651,15 +651,16 @@ class TagCommand(Command): Command.__init__(self, **kwargs) def apply(self, ui): + all_message_widgets = ui.current_buffer.get_messagewidgets() if self.all: - mwidgets = ui.current_buffer.get_messagewidgets() + mwidgets = all_message_widgets else: mwidgets = [ui.current_buffer.get_selection()] messages = [mw.get_message() for mw in mwidgets] logging.debug('TAG %s' % str(messages)) def refresh_widgets(): - for mw in mwidgets: + for mw in all_message_widgets: mw.rebuild() tags = filter(lambda x: x, self.tagsstring.split(',')) diff --git a/alot/message.py b/alot/message.py index c87e1bba..b254230c 100644 --- a/alot/message.py +++ b/alot/message.py @@ -179,7 +179,10 @@ class Message(object): :type remove_rest: bool """ def myafterwards(): - self._tags = self._tags.union(tags) + if remove_rest: + self._tags = set(tags) + else: + self._tags = self._tags.union(tags) if callable(afterwards): afterwards() |