comparison frontends/wix/main_window.py @ 180:fdb961f27ae9

Primitivus: file sending and progress management - added "send file" in one2one chat's menu - new progress widget which is linked to the notification bar - the notification bar show the average progress of all the current progress bars, and is used to show progress details - if present, pudb is used for debugging (can continue without breaking terminal's setting)
author Goffi <goffi@goffi.org>
date Mon, 16 Aug 2010 21:16:43 +0800
parents 1ca5f254ce41
children 556c2bd7c344
comparison
equal deleted inserted replaced
179:d6c0c5dca9b9 180:fdb961f27ae9
322 322
323 323
324 def progressCB(self, id, title, message): 324 def progressCB(self, id, title, message):
325 data = self.bridge.getProgress(id) 325 data = self.bridge.getProgress(id)
326 if data: 326 if data:
327 if not data['position']:
328 data['position'] = '0'
329 if not self.pbar: 327 if not self.pbar:
330 #first answer, we must construct the bar 328 #first answer, we must construct the bar
331 self.pbar = wx.ProgressDialog(title, message, int(data['size']), None, 329 self.pbar = wx.ProgressDialog(title, message, float(data['size']), None,
332 wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME) 330 wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME)
333 self.pbar.finish_value = int(data['size']) 331 self.pbar.finish_value = float(data['size'])
334 332
335 self.pbar.Update(int(data['position'])) 333 self.pbar.Update(int(data['position']))
336 elif self.pbar: 334 elif self.pbar:
337 self.pbar.Update(self.pbar.finish_value) 335 self.pbar.Update(self.pbar.finish_value)
338 return 336 return