summaryrefslogtreecommitdiff
path: root/alot/buffers/thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/buffers/thread.py')
-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)