Skip to content

Commit

Permalink
Some tiny little bug fixes...
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipi committed Jul 14, 2012
1 parent 913cf8a commit 7276e7b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 36 deletions.
44 changes: 29 additions & 15 deletions ArmoryQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,7 @@ def popNextLine(currIdx):
return None


#thisVerString = getVersionString(BTCARMORY_VERSION)
thisVerString = '0.80'
thisVerString = getVersionString(BTCARMORY_VERSION)
changeLog = []
vernum = ''

Expand Down Expand Up @@ -2257,27 +2256,42 @@ def minimizeArmory(self):

#############################################################################
def exportLogFile(self):
reply = QMessageBox.warning(self, 'Export Log File', \
'The log file contains information about recent transactions and '
'general usage information about your interactions wth Armory. This '
extraStr = ''
if self.usermode in (USERMODE.Advanced, USERMODE.Expert):
extraStr = ( \
'<br><br><b><u>Advanced tip:</u></b> The log file is maintained at '
'the following location on your hard drive:'
'<br><br>'
'%s'
'<br><br>'
'You can manually edit this file to remove information that '
'does not seem relevant for debugging purposes, or simply '
'copy the error messages inline to an email.' % ARMORY_LOG_FILE)

#reply = QMessageBox.warning(self, 'Export Log File', \
reply = MsgBoxCustom(MSGBOX.Warning, 'Privacy Warning', \
'The log file contains information about your interactions '
'with Armory and recent transactions. This '
'includes error messages produced by Armory that the developers need '
'to help diagnose problems with the software.'
'to help diagnose bugs.'
'<br><br>'
'This information may be considered sensitive to some users. '
'This information may be considered sensitive by some users. '
'Log files should be protected the same '
'way you would protect a watcing-only wallet, even though it '
'typically will not even contain that much information.'
'<br><br>'
'Note that <i>no private key data is ever written to the log file</i>,'
' and all other information included is related strictly to your '
'<i>No private key data is ever written to the log file</i>, '
'and all other logged information is related only to your '
'<i>usage</i> of Armory. There is no intention to record any '
'information about what addresses you own or their balances, but some '
'of that information may be deducible from this file.'
'information about your addresses, wallets or balances, but fragments '
'of that information may be in this file.'
'<br><br>'
'If this makes you uncomfortable, please press "Cancel" below.', \
QMessageBox.Cancel, QMessageBox.Ok)
'Please do not send the log file to the Armory developers if you are not '
'comfortable with the privacy implications.' + extraStr, \
wCancel=True, yesStr='Export', noStr='Cancel')


if reply==QMessageBox.Ok:
if reply:
defaultFn = 'armorylog_%s.txt' % unixTimeToFormatStr(RightNow(), '%Y%m%d_%H%M')
logfn = self.getFileSave(title='Export Log File', \
ffilter=['Text Files (*.txt)'], \
Expand Down Expand Up @@ -2495,7 +2509,7 @@ def closeForReal(self, event=None):
pass

from twisted.internet import reactor
LOGWARN('Attempting to close the main window!')
LOGINFO('Attempting to close the main window!')
reactor.stop()
if event:
event.accept()
Expand Down
2 changes: 1 addition & 1 deletion armoryengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def LOGRAWDATA(rawStr, loglevel=DEFAULT_RAWDATA_LOGLEVEL):
rootLogger.disabled = True

# For now, ditch the C++-console-catching. Logging python is enough
# My attempt at C++ logging too was becoming a hack...
# My attempt at C++ logging too was becoming a hardcore hack...
"""
elif CLI_OPTIONS.logcpp:
# In order to catch C++ output, we have to redirect ALL stdout
Expand Down
24 changes: 14 additions & 10 deletions qtdefines.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,13 @@ def createToolTipObject(tiptext, iconSz=2):


################################################################################
def MsgBoxCustom(wtype, title, msg, wCancel=False, yesStr='Yes', noStr='No'):
def MsgBoxCustom(wtype, title, msg, wCancel=False, yesStr=None, noStr=None):
"""
Creates a warning/question/critical dialog, but with a "Do not ask again"
checkbox. Will return a pair (response, DNAA-is-checked)
Creates a message box with custom button text and icon
"""

class dlgWarn(QDialog):
def __init__(self, dtype, dtitle, wmsg, withCancel=False):
def __init__(self, dtype, dtitle, wmsg, withCancel=False, yesStr=None, noStr=None):
super(dlgWarn, self).__init__(None)

msgIcon = QLabel()
Expand All @@ -292,7 +291,7 @@ def __init__(self, dtype, dtitle, wmsg, withCancel=False):

if len(fpix)>0:
msgIcon.setPixmap(QPixmap(fpix))
msgIcon.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
msgIcon.setAlignment(Qt.AlignHCenter | Qt.AlignTop)

lblMsg = QLabel(msg)
lblMsg.setTextFormat(Qt.RichText)
Expand All @@ -304,20 +303,24 @@ def __init__(self, dtype, dtitle, wmsg, withCancel=False):
buttonbox = QDialogButtonBox()

if dtype==MSGBOX.Question:
if not yesStr: yesStr = '&Yes'
if not noStr: noStr = '&No'
btnYes = QPushButton(yesStr)
btnNo = QPushButton(noStr)
self.connect(btnYes, SIGNAL('clicked()'), self.accept)
self.connect(btnNo, SIGNAL('clicked()'), self.reject)
buttonbox.addButton(btnYes,QDialogButtonBox.AcceptRole)
buttonbox.addButton(btnNo, QDialogButtonBox.RejectRole)
else:
btnOk = QPushButton('Ok')
if not yesStr: yesStr = '&OK'
if not noStr: noStr = '&Cancel'
btnOk = QPushButton(yesStr)
self.connect(btnOk, SIGNAL('clicked()'), self.accept)
buttonbox.addButton(btnOk, QDialogButtonBox.AcceptRole)
if withCancel:
btnOk = QPushButton('Cancel')
self.connect(btnOk, SIGNAL('clicked()'), self.reject)
buttonbox.addButton(btnOk, QDialogButtonBox.RejectRole)
btnCancel = QPushButton(noStr)
self.connect(btnCancel, SIGNAL('clicked()'), self.reject)
buttonbox.addButton(btnCancel, QDialogButtonBox.RejectRole)


spacer = QSpacerItem(20, 10, QSizePolicy.Fixed, QSizePolicy.Expanding)
Expand All @@ -332,11 +335,12 @@ def __init__(self, dtype, dtitle, wmsg, withCancel=False):
self.setLayout(layout)
self.setWindowTitle(dtitle)

dlg = dlgWarn(wtype, title, msg, wCancel)
dlg = dlgWarn(wtype, title, msg, wCancel, yesStr, noStr)
result = dlg.exec_()

return result


################################################################################
def MsgBoxWithDNAA(wtype, title, msg, dnaaMsg, wCancel=False, yesStr='Yes', noStr='No'):
"""
Expand Down
21 changes: 11 additions & 10 deletions qtdialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,15 @@ def execImportAddress(self):
self.main.settings.set('DNAA_ImportWarning', result[1])

# Now we are past the [potential] warning box. Actually open
# The import dialog, now
# the import dialog
dlg = DlgImportAddress(self.wlt, self, self.main)
dlg.exec_()

try:
self.parent.wltAddrModel.reset()
except AttributeError:
pass



def saveWalletCopy(self):
Expand Down Expand Up @@ -4113,13 +4118,7 @@ def removeAddress(self):

if reply==QMessageBox.Yes:
self.wlt.deleteImportedAddress(self.addr.getAddr160())

if self.main.isOnline:
TheBDM.registerWallet( self.wlt.cppWallet )
self.wlt.syncWithBlockchain(0)

try:
#self.parent.accept()
self.parent.wltAddrModel.reset()
except AttributeError:
pass
Expand Down Expand Up @@ -9884,10 +9883,13 @@ def setLabels(self):
self.btnCopyRaw.setEnabled(False)
self.btnCopyHtml.setEnabled(False)
self.btnCopyAll.setEnabled(False)
self.lblLink.setText('<br>'.join(str(self.lblLink.text()).split('<br>')[1:]))
#self.lblLink.setText('<br>'.join(str(self.lblLink.text()).split('<br>')[1:]))
self.lblLink.setEnabled(False)
self.lblLink.setTextInteractionFlags(Qt.NoTextInteraction)
return

self.lblLink.setTextInteractionFlags(Qt.TextSelectableByMouse | \
Qt.TextSelectableByKeyboard)
self.rawHtml = '<a href="%s">%s</a>' % (self.rawURI, str(self.edtLinkText.text()))
self.lblWarn.setText('')
self.dispText = self.rawHtml[:]
Expand Down Expand Up @@ -9943,8 +9945,7 @@ class DlgVersionNotify(ArmoryDialog):
def __init__(self, parent, main, changelog, wasRequested=False):
super(DlgVersionNotify, self).__init__(parent, main)

#self.myVersion = getVersionString(BTCARMORY_VERSION)
self.myVersion = '0.80'
self.myVersion = getVersionString(BTCARMORY_VERSION)
self.latestVer = changelog[0][0]
lblDescr = QRichLabel('')

Expand Down
3 changes: 3 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ VERSION 0.83
- Version 0.82.1 is still the latest version
This fake version was added solely for testing the version notification
window. Version 0.83 does not actually exist yet!

- Manually check for new versions
Use "Help"->"Armory Versions" from the main window!


#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 7276e7b

Please sign in to comment.