X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=gui%2Fqt%2Fmain_window.py;h=706c1f758515b3cbb6a87f5a3dc74936fce470ea;hb=6f246fe90e549760984fd3eb3baaef8979148291;hp=874b8e28c3956402c7dd3710e2a02f0a340b2990;hpb=81d1e67253c8ca581e821a6cd9e5ee1502fffd08;p=electrum-nvc.git diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 874b8e2..706c1f7 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1316,8 +1316,10 @@ class ElectrumWindow(QMainWindow): def create_invoices_tab(self): - l, w = self.create_list_tab([_('Requestor'), _('Memo'),_('Amount'), _('Status')]) + l, w = self.create_list_tab([_('Requestor'), _('Memo'), _('Date'), _('Amount'), _('Status')]) l.setColumnWidth(0, 150) + l.setColumnWidth(2, 150) + l.setColumnWidth(3, 150) h = l.header() h.setStretchLastSection(False) h.setResizeMode(1, QHeaderView.Stretch) @@ -1330,21 +1332,17 @@ class ElectrumWindow(QMainWindow): invoices = self.wallet.storage.get('invoices', {}) l = self.invoices_list l.clear() - for key, value in invoices.items(): - try: - domain, memo, amount, expiration_date, status, tx_hash = value - except: - invoices.pop(key) - continue + for value in sorted(invoices.values(), key=lambda x: -x[3]): + domain, memo, amount, expiration_date, status, tx_hash = value if status == PR_UNPAID and expiration_date and expiration_date < time.time(): status = PR_EXPIRED - item = QTreeWidgetItem( [ domain, memo, self.format_amount(amount), format_status(status)] ) + date_str = datetime.datetime.fromtimestamp(expiration_date).isoformat(' ')[:-3] + item = QTreeWidgetItem( [ domain, memo, date_str, self.format_amount(amount, whitespaces=True), format_status(status)] ) + item.setFont(0, QFont(MONOSPACE_FONT)) + item.setFont(3, QFont(MONOSPACE_FONT)) l.addTopLevelItem(item) - l.setCurrentItem(l.topLevelItem(0)) - - def delete_imported_key(self, addr): if self.question(_("Do you want to remove")+" %s "%addr +_("from your wallet?")): self.wallet.delete_imported_key(addr)