def update_history(self, tx_history): self.history_list.empty() for item in tx_history[-10:]: tx_hash, conf, value, timestamp, balance = item label = self.actuator.g.wallet.get_label(tx_hash)[0] v_str = self.actuator.g.format_amount(value, True) self.history_list.append(label, v_str, age(timestamp))
def item_changed(self, item): if item is None: return if not item.isSelected(): return addr = str(item.text(1)) req = self.wallet.receive_requests[addr] expires = age(req['time'] + req['exp']) if req.get('exp') else _('Never') amount = req['amount'] message = self.wallet.labels.get(addr, '') self.parent.receive_address_e.setText(addr) self.parent.receive_message_e.setText(message) self.parent.receive_amount_e.setAmount(amount) self.parent.expires_combo.hide() self.parent.expires_label.show() self.parent.expires_label.setText(expires) self.parent.new_request_button.setEnabled(True)
def item_changed(self, idx): # TODO use siblingAtColumn when min Qt version is >=5.11 addr = self.model().itemFromIndex( idx.sibling(idx.row(), self.Columns.ADDRESS)).text() req = self.wallet.receive_requests.get(addr) if req is None: self.update() return expires = age(req['time'] + req['exp']) if req.get('exp') else _('Never') amount = req['amount'] message = req['memo'] self.parent.receive_address_e.setText(addr) self.parent.receive_message_e.setText(message) self.parent.receive_amount_e.setAmount(amount) self.parent.expires_combo.hide() self.parent.expires_label.show() self.parent.expires_label.setText(expires) self.parent.new_request_button.setEnabled(True)
def item_changed(self, item): if item is None: return if not item.isSelected(): return addr = str(item.text(1)) req = self.wallet.receive_requests.get(addr) if req is None: self.update() return expires = age(req['time'] + req['exp']) if req.get('exp') else _('Never') amount = req['amount'] message = self.wallet.labels.get(addr, '') self.parent.receive_address_e.setText(addr) self.parent.receive_message_e.setText(message) self.parent.receive_amount_e.setAmount(amount) self.parent.expires_combo.hide() self.parent.expires_label.show() self.parent.expires_label.setText(expires) self.parent.new_request_button.setEnabled(True)