From e81a279dc2103ef3e259e13e9b4be9013a085ff4 Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Sat, 19 Mar 2011 12:38:55 +0100 Subject: [PATCH] fix naming issue with close callback in popups --- deluge/ui/console/modes/input_popup.py | 4 ++-- deluge/ui/console/modes/popup.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deluge/ui/console/modes/input_popup.py b/deluge/ui/console/modes/input_popup.py index 44f9de0c2..8c52f11a6 100644 --- a/deluge/ui/console/modes/input_popup.py +++ b/deluge/ui/console/modes/input_popup.py @@ -613,12 +613,12 @@ class InputPopup(Popup): elif c == curses.KEY_DOWN: self.current_input = min(len(self.inputs)-1,self.current_input+1) elif c == curses.KEY_ENTER or c == 10: - if self._close_cb: + if self.close_cb: vals = {} for ipt in self.inputs: vals[ipt.name] = ipt.get_value() curses.curs_set(0) - self._close_cb(vals) + self.close_cb(vals) return True # close the popup elif c == 27: # close on esc, no action return True diff --git a/deluge/ui/console/modes/popup.py b/deluge/ui/console/modes/popup.py index e74203059..f4d00d49e 100644 --- a/deluge/ui/console/modes/popup.py +++ b/deluge/ui/console/modes/popup.py @@ -78,7 +78,7 @@ class Popup: self.screen = curses.newwin(height_req,width_req,by,bx) self.title = title - self.__close_cb = close_cb + self.close_cb = close_cb self.height,self.width = self.screen.getmaxyx() self.divider = None self.lineoff = 0 @@ -130,13 +130,13 @@ class Popup: self.lineoff += 1 elif c == curses.KEY_ENTER or c == 10 or c == 27: # close on enter/esc - if self.__close_cb: - self.__close_cb() + if self.close_cb: + self.close_cb() return True # close the popup if c > 31 and c < 256 and chr(c) == 'q': - if self.__close_cb: - self.__close_cb() + if self.close_cb: + self.close_cb() return True # close the popup self.refresh()