Module: deluge Branch: master Commit: cdcab320fbf6603fe6b7500918270b94d13f2c1b
Author: Nick <[email protected]> Date: Thu Feb 10 01:11:31 2011 +0100 add current_selection to SelectablePopup --- deluge/ui/console/modes/popup.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/deluge/ui/console/modes/popup.py b/deluge/ui/console/modes/popup.py index bd5bf78..7cc468a 100644 --- a/deluge/ui/console/modes/popup.py +++ b/deluge/ui/console/modes/popup.py @@ -206,6 +206,11 @@ class SelectablePopup(Popup): self.parent.add_string(crow,"- %s%s"%(colorstr,line),self.screen,1,False,True) crow+=1 + def current_selection(self): + "Returns a tuple of (selected index, selected data)" + idx = self._selectable_lines.index(self._selected) + return (idx,self._select_data[idx]) + def add_divider(self,color="white"): if not self._divider: self._divider = "-"*(self.width-6)+" -" -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
