Skip to content

Commit

Permalink
Lots of bug fixes, and now a right-click menu
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipi committed Dec 15, 2012
1 parent b705dff commit 3a20870
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 24 deletions.
77 changes: 56 additions & 21 deletions ArmoryQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def __init__(self, parent=None):
self.ledgerView.hideColumn(LEDGERCOLS.toSelf)
self.ledgerView.hideColumn(LEDGERCOLS.DoubleSpend)


dateWidth = tightSizeStr(self.ledgerView, '_9999-Dec-99 99:99pm__')[0]
nameWidth = tightSizeStr(self.ledgerView, '9'*32)[0]
cWidth = 20 # num-confirm icon width
Expand All @@ -230,6 +231,8 @@ def __init__(self, parent=None):
self.connect(self.ledgerView, SIGNAL('doubleClicked(QModelIndex)'), \
self.dblClickLedger)

self.ledgerView.setContextMenuPolicy(Qt.CustomContextMenu)
self.ledgerView.customContextMenuRequested.connect(self.showContextMenuLedger)

btnAddWallet = QPushButton("Create New Wallet")
btnImportWlt = QPushButton("Import Wallet")
Expand Down Expand Up @@ -981,9 +984,9 @@ def setUserMode(self, mode):
LOGINFO(' To: %s', self.settings.get('User_Mode'))

if not self.firstModeSwitch:
QMessageBox.information(self,'Restart Required', \
'You must restart Armory in order for the user-mode switching '
'to take effect.', QMessageBox.Ok)
QMessageBox.information(self,'Restart Armory', \
'You may have to restart Armory for all aspects of '
'the new usermode to go into effect.', QMessageBox.Ok)

self.firstModeSwitch = False

Expand Down Expand Up @@ -2679,25 +2682,57 @@ def dblClickLedger(self, index):
if index.column()==LEDGERCOLS.Comment:
self.updateTxCommentFromView(self.ledgerView)
else:
row = index.row()
txHash = str(self.ledgerView.model().index(row, LEDGERCOLS.TxHash).data().toString())
wltID = str(self.ledgerView.model().index(row, LEDGERCOLS.WltID).data().toString())
txtime = unicode(self.ledgerView.model().index(row, LEDGERCOLS.DateStr).data().toString())

pytx = None
txHashBin = hex_to_binary(txHash)
if TheBDM.isInitialized():
cppTx = TheBDM.getTxByHash(txHashBin)
if cppTx.isInitialized():
pytx = PyTx().unserialize(cppTx.serialize())

if pytx==None:
QMessageBox.critical(self, 'Invalid Tx:',
'The transaction ID requested to be displayed does not exist in '
'the blockchain or the zero-conf tx list...?', QMessageBox.Ok)
return
self.showLedgerTx()


#############################################################################
def showLedgerTx(self):
row = self.ledgerView.selectedIndexes()[0].row()
txHash = str(self.ledgerView.model().index(row, LEDGERCOLS.TxHash).data().toString())
wltID = str(self.ledgerView.model().index(row, LEDGERCOLS.WltID).data().toString())
txtime = unicode(self.ledgerView.model().index(row, LEDGERCOLS.DateStr).data().toString())

pytx = None
txHashBin = hex_to_binary(txHash)
if TheBDM.isInitialized():
cppTx = TheBDM.getTxByHash(txHashBin)
if cppTx.isInitialized():
pytx = PyTx().unserialize(cppTx.serialize())

if pytx==None:
QMessageBox.critical(self, 'Invalid Tx:',
'The transaction you requested be displayed does not exist in '
'in Armory\'s database. This is unusual...', QMessageBox.Ok)
return

DlgDispTxInfo( pytx, self.walletMap[wltID], self, self, txtime=txtime).exec_()


#############################################################################
def showContextMenuLedger(self):
menu = QMenu(self.ledgerView)

actViewTx = menu.addAction("View Details")
actCopyTxID = menu.addAction("Copy Transaction ID")
actComment = menu.addAction("Change Comment")
actOpenWallet = menu.addAction("Open Relevant Wallet")
row = self.ledgerView.selectedIndexes()[0].row()
action = menu.exec_(QCursor.pos())

txHash = str(self.ledgerView.model().index(row, LEDGERCOLS.TxHash).data().toString())
wltID = str(self.ledgerView.model().index(row, LEDGERCOLS.WltID).data().toString())

if action==actViewTx:
self.showLedgerTx()
elif action==actCopyTxID:
clipb = QApplication.clipboard()
clipb.clear()
clipb.setText(hex_switchEndian(txHash))
elif action==actComment:
self.updateTxCommentFromView(self.ledgerView)
elif action==actOpenWallet:
DlgWalletDetails(self.walletMap[wltID], self.usermode, self, self).exec_()

DlgDispTxInfo( pytx, self.walletMap[wltID], self, self, txtime=txtime).exec_()


#############################################################################
Expand Down
7 changes: 4 additions & 3 deletions armoryengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


# Version Numbers
BTCARMORY_VERSION = (0, 86, 0, 0) # (Major, Minor, Minor++, even-more-minor)
BTCARMORY_VERSION = (0, 86, 1, 0) # (Major, Minor, Minor++, even-more-minor)
PYBTCWALLET_VERSION = (1, 35, 0, 0) # (Major, Minor, Minor++, even-more-minor)

ARMORY_DONATION_ADDR = '1ArmoryXcfq7TnCSuZa9fQjRYwJ4bkRKfv'
Expand Down Expand Up @@ -10885,8 +10885,9 @@ def getTopBlockHeight_bdm_direct(self):
#############################################################################
def getLoadProgress(self):
"""
This method does not actually work. The load progress in bytes is not
updated properly w
This method does not actually work! The load progress in bytes is not
updated properly while the BDM thread is scanning. It might have to
emit this information explicitly in order to be useful.
"""
return (self.bdm.getLoadProgressBytes(), self.bdm.getTotalBlockchainBytes())

Expand Down
7 changes: 7 additions & 0 deletions qtdialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6247,6 +6247,13 @@ def processTxDP(self):
self.makeReviewFrame()
return
elif not self.enoughSigs:
if not self.main.getSettingOrSetDefault('DNAA_ReviewOfflineTx', False):
result = MsgBoxWithDNAA(MSGBOX.Warning, title='Offline Warning', \
msg='<b>Please review your transaction carefully before '
'signing and broadcasting it!</b> The extra security of '
'using offline wallets is lost if you do '
'not confirm the transaction is correct!', dnaaMsg=None)
self.main.writeSetting('DNAA_ReviewOfflineTx', result[1])
self.lblStatus.setText('<b><font color="red">Unsigned</font></b>')
self.btnSign.setEnabled(True)
self.btnBroadcast.setEnabled(False)
Expand Down
23 changes: 23 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
# anyway...


#-------------------------------------------------------------------------------
VERSION 0.86.1

- Right-click Ledger Options
Added right-click menu to ledger for quick access to transaction
and wallet information.

- Offline-Sign Confirmation & Warnings
Offline signing now displays appropriate warnings about what users
should verify for before signing and broadcasting.

- Bugfix: Disappearing Addresses
Some startup operations were inadvertantly "rewinding" wallets with
unused addresses, causing those addresses to disappear from the
address list, and then shown again when the user requested another
address. Resolved.

- Bugfix: Ledger Sorting
All fields in the primary ledger are sortable. Some fields become
unsortable as a side-effect of ledger optimizations in v0.85.



#-------------------------------------------------------------------------------
VERSION 0.86

Expand Down

0 comments on commit 3a20870

Please sign in to comment.