mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
qt gui
This commit is contained in:
parent
fca264f3b1
commit
1c00fda189
1 changed files with 23 additions and 10 deletions
|
@ -36,7 +36,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
self.setCentralWidget(tabs)
|
self.setCentralWidget(tabs)
|
||||||
self.create_status_bar()
|
self.create_status_bar()
|
||||||
self.setGeometry(100,100,750,400)
|
self.setGeometry(100,100,750,400)
|
||||||
self.setWindowTitle( 'Electrum ' + self.wallet.electrum_version )
|
self.setWindowTitle( 'Electrum ' + self.wallet.electrum_version + ' - Qt')
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
QShortcut(QKeySequence("Ctrl+W"), self, self.close)
|
QShortcut(QKeySequence("Ctrl+W"), self, self.close)
|
||||||
|
@ -72,7 +72,10 @@ class ElectrumWindow(QMainWindow):
|
||||||
def create_history_tab(self):
|
def create_history_tab(self):
|
||||||
self.history_list = w = QTreeWidget(self)
|
self.history_list = w = QTreeWidget(self)
|
||||||
w.setColumnCount(5)
|
w.setColumnCount(5)
|
||||||
w.setHeaderLabels( ['conf', 'Date','Description','Amount','Balance'] )
|
w.setColumnWidth(0, 40)
|
||||||
|
w.setColumnWidth(1, 140)
|
||||||
|
w.setColumnWidth(2, 340)
|
||||||
|
w.setHeaderLabels( ['', 'Date', 'Description', 'Amount', 'Balance'] )
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def update_history_tab(self):
|
def update_history_tab(self):
|
||||||
|
@ -83,16 +86,20 @@ class ElectrumWindow(QMainWindow):
|
||||||
if tx['height']:
|
if tx['height']:
|
||||||
conf = self.wallet.interface.blocks - tx['height'] + 1
|
conf = self.wallet.interface.blocks - tx['height'] + 1
|
||||||
time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3]
|
time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3]
|
||||||
|
icon = QIcon("icons/gtk-apply.svg")
|
||||||
else:
|
else:
|
||||||
conf = 0
|
conf = 0
|
||||||
time_str = 'pending'
|
time_str = 'pending'
|
||||||
|
icon = QIcon("icons/gtk-execute")
|
||||||
v = tx['value']
|
v = tx['value']
|
||||||
balance += v
|
balance += v
|
||||||
label = self.wallet.labels.get(tx_hash)
|
label = self.wallet.labels.get(tx_hash)
|
||||||
is_default_label = (label == '') or (label is None)
|
is_default_label = (label == '') or (label is None)
|
||||||
if is_default_label: label = tx['default_label']
|
if is_default_label: label = tx['default_label']
|
||||||
item = QTreeWidgetItem( [ "%d"%conf, time_str, label, format_satoshis(v,True), format_satoshis(balance)] )
|
item = QTreeWidgetItem( [ '', time_str, label, format_satoshis(v,True), format_satoshis(balance)] )
|
||||||
self.history_list.addTopLevelItem(item)
|
|
||||||
|
item.setIcon(0, icon)
|
||||||
|
self.history_list.insertTopLevelItem(0,item)
|
||||||
|
|
||||||
|
|
||||||
def create_send_tab(self):
|
def create_send_tab(self):
|
||||||
|
@ -129,12 +136,20 @@ class ElectrumWindow(QMainWindow):
|
||||||
|
|
||||||
return w2
|
return w2
|
||||||
|
|
||||||
def create_receive_tab(self):
|
def make_address_list(self, is_recv):
|
||||||
self.receive_list = w = QTreeWidget(self)
|
w = QTreeWidget(self)
|
||||||
w.setColumnCount(3)
|
w.setColumnCount(3)
|
||||||
|
w.setColumnWidth(0, 330)
|
||||||
|
w.setColumnWidth(1, 330)
|
||||||
|
w.setColumnWidth(2, 20)
|
||||||
w.setHeaderLabels( ['Address', 'Label','Tx'])
|
w.setHeaderLabels( ['Address', 'Label','Tx'])
|
||||||
return w
|
return w
|
||||||
|
|
||||||
|
def create_receive_tab(self):
|
||||||
|
self.receive_list = self.make_address_list(True)
|
||||||
|
return self.receive_list
|
||||||
|
|
||||||
|
|
||||||
def update_receive_tab(self):
|
def update_receive_tab(self):
|
||||||
self.receive_list.clear()
|
self.receive_list.clear()
|
||||||
for address in self.wallet.all_addresses():
|
for address in self.wallet.all_addresses():
|
||||||
|
@ -149,10 +164,8 @@ class ElectrumWindow(QMainWindow):
|
||||||
self.receive_list.addTopLevelItem(item)
|
self.receive_list.addTopLevelItem(item)
|
||||||
|
|
||||||
def create_contacts_tab(self):
|
def create_contacts_tab(self):
|
||||||
self.contacts_list = w = QTreeWidget(self)
|
self.contacts_list = self.make_address_list(False)
|
||||||
w.setColumnCount(3)
|
return self.contacts_list
|
||||||
w.setHeaderLabels( ['Address', 'Label','Tx'])
|
|
||||||
return w
|
|
||||||
|
|
||||||
def update_contacts_tab(self):
|
def update_contacts_tab(self):
|
||||||
self.contacts_list.clear()
|
self.contacts_list.clear()
|
||||||
|
|
Loading…
Add table
Reference in a new issue