From cdcab320fbf6603fe6b7500918270b94d13f2c1b Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 10 Feb 2011 01:11:31 +0100 Subject: [PATCH] add current_selection to SelectablePopup --- deluge/ui/console/modes/popup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deluge/ui/console/modes/popup.py b/deluge/ui/console/modes/popup.py index bd5bf7858..7cc468a1d 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)+" -"