mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
request_list: select new items
This commit is contained in:
parent
d9e7807fff
commit
ef88bb1c28
2 changed files with 13 additions and 1 deletions
|
@ -1070,6 +1070,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
self.address_list.update()
|
||||
self.clear_receive_tab()
|
||||
self.request_list.update()
|
||||
self.request_list.select_key(key)
|
||||
|
||||
def create_bitcoin_request(self, amount, message, expiration):
|
||||
addr = self.wallet.get_unused_address()
|
||||
|
@ -1094,6 +1095,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
|||
else:
|
||||
self.sign_payment_request(addr)
|
||||
#self.save_request_button.setEnabled(False)
|
||||
return addr
|
||||
|
||||
def view_and_paste(self, title, msg, data):
|
||||
dialog = WindowModalDialog(self, title)
|
||||
|
|
|
@ -27,7 +27,7 @@ from enum import IntEnum
|
|||
|
||||
from PyQt5.QtGui import QStandardItemModel, QStandardItem
|
||||
from PyQt5.QtWidgets import QMenu, QHeaderView
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import Qt, QItemSelectionModel
|
||||
|
||||
from electrum.i18n import _
|
||||
from electrum.util import format_time, age
|
||||
|
@ -76,6 +76,16 @@ class RequestList(MyTreeView):
|
|||
self.selectionModel().currentRowChanged.connect(self.item_changed)
|
||||
self.setColumnWidth(self.Columns.ADDRESS, 250)
|
||||
|
||||
def select_key(self, key):
|
||||
for i in range(self.model().rowCount()):
|
||||
item = self.model().index(i, 0)
|
||||
row_key = item.data(ROLE_RHASH_OR_ADDR)
|
||||
if item.data(ROLE_REQUEST_TYPE) == REQUEST_TYPE_LN:
|
||||
row_key = self.wallet.lnworker.invoices[row_key][1]
|
||||
if key == row_key:
|
||||
self.selectionModel().setCurrentIndex(item, QItemSelectionModel.SelectCurrent | QItemSelectionModel.Rows)
|
||||
break
|
||||
|
||||
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()
|
||||
|
|
Loading…
Add table
Reference in a new issue