comparison frontends/primitivus/progress.py @ 222:3198bfd66daa

primitivus: refactoring to use urwid-satext which is now a separate project
author Goffi <goffi@goffi.org>
date Tue, 28 Dec 2010 23:10:13 +0100
parents fdb961f27ae9
children
comparison
equal deleted inserted replaced
221:96186f36d8cb 222:3198bfd66daa
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. 19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 """ 20 """
21 21
22 import urwid 22 import urwid
23 import custom_widgets 23 from urwid_satext import sat_widgets
24 from tools.jid import JID 24 from tools.jid import JID
25 25
26 26
27 class Progress(urwid.WidgetWrap): 27 class Progress(urwid.WidgetWrap):
28 28
30 self.host = host 30 self.host = host
31 self.progress_list = urwid.SimpleListWalker([]) 31 self.progress_list = urwid.SimpleListWalker([])
32 self.progress_dict = {} 32 self.progress_dict = {}
33 listbox = urwid.ListBox(self.progress_list) 33 listbox = urwid.ListBox(self.progress_list)
34 buttons = [] 34 buttons = []
35 buttons.append(custom_widgets.CustomButton(_('Clear progress list'), self.__onClear)) 35 buttons.append(sat_widgets.CustomButton(_('Clear progress list'), self.__onClear))
36 max_len = max([button.getSize() for button in buttons]) 36 max_len = max([button.getSize() for button in buttons])
37 buttons_wid = urwid.GridFlow(buttons,max_len,1,0,'center') 37 buttons_wid = urwid.GridFlow(buttons,max_len,1,0,'center')
38 main_wid = custom_widgets.FocusFrame(listbox, footer=buttons_wid) 38 main_wid = sat_widgets.FocusFrame(listbox, footer=buttons_wid)
39 urwid.WidgetWrap.__init__(self, main_wid) 39 urwid.WidgetWrap.__init__(self, main_wid)
40 40
41 def addProgress(self, id, message): 41 def addProgress(self, id, message):
42 mess_wid = urwid.Text(message) 42 mess_wid = urwid.Text(message)
43 progr_wid = urwid.ProgressBar('progress_normal', 'progress_complete') 43 progr_wid = urwid.ProgressBar('progress_normal', 'progress_complete')