def OnRefresh(self, e): x = 0 lst = currencies.m_currencies max = len(lst) keepGoing = True if self.hasFocus(): dlg = wx.ProgressDialog(message('currency_refreshing'), "", max, self, wx.PD_CAN_ABORT | wx.PD_APP_MODAL) else: dlg = None for eachKey in lst: if not keepGoing: break curTo = eachKey[:3] curFrom = eachKey[3:] if dlg: (keepGoing, skip) = dlg.Update(x, "%s -> %s" % (curFrom, curTo)) currencies.get(curTo, curFrom) self.refreshLine(eachKey, x, True) x = x + 1 currencies.save() if dlg: dlg.Destroy()
def OnRefresh(self,e): x = 0 lst = currencies.m_currencies max = len(lst) keepGoing = True if self.hasFocus(): dlg = wx.ProgressDialog(message('currency_refreshing'),"",max,self,wx.PD_CAN_ABORT | wx.PD_APP_MODAL) else: dlg = None for eachKey in lst: if keepGoing: curTo = eachKey[:3] curFrom = eachKey[3:] if dlg: keepGoing = dlg.Update(x,"%s -> %s" % (curFrom,curTo)) currencies.get(curTo,curFrom) self.refreshLine(eachKey,x,True) x = x + 1 currencies.save() if dlg: dlg.Destroy()
def OnCloseWindow(self, evt): self.stopLiveCurrency(bBusy=False) self.unregisterLiveCurrency() self.saveConfig() currencies.save() self.Destroy()