summaryrefslogtreecommitdiff
path: root/alot/buffers
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-02-25 18:30:31 +0100
committerAnton Khirnov <anton@khirnov.net>2020-02-25 18:30:31 +0100
commit8422972845bed9253d7a5dad2b901fa4247708cd (patch)
treece3341e823d39f752a1ee31c55e480383b0d9894 /alot/buffers
parentc3bd46cd204466038401365ef229c747b2c4242c (diff)
thread buffer: make attachments work again
Diffstat (limited to 'alot/buffers')
-rw-r--r--alot/buffers/thread.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py
index 6c92fe64..8615b37d 100644
--- a/alot/buffers/thread.py
+++ b/alot/buffers/thread.py
@@ -86,6 +86,17 @@ class ThreadBuffer(Buffer):
"""Return focussed :class:`~alot.db.message.Message`."""
return self.get_selected_message_widget().get_message()
+ def get_selected_attachment(self):
+ """
+ If an attachment widget is currently in focus, return the associated
+ Attachment. Otherwise return None.
+ """
+ msg_wgt = self.get_selected_message_widget()
+ att = msg_wgt.get_selected_attachment()
+ if att is not None:
+ return att
+ return None
+
def message_widgets(self):
"""
Iterate over all the message widgets in this buffer
@@ -93,11 +104,6 @@ class ThreadBuffer(Buffer):
for w in self._msg_widgets:
yield w
- # needed for ui.get_deep_focus..
- def get_focus(self):
- "Get the focus from the underlying body widget."
- return self.body.focus
-
def set_focus(self, pos):
"Set the focus in the underlying body widget."
logging.debug('setting focus to %s ', pos)