def __init__(self, parent=None):
super(ArmoryMainWindow, self).__init__(parent)
+
+
# SETUP THE WINDOWS DECORATIONS
self.lblLogoIcon = QLabel()
if USE_TESTNET:
self.settingsPath = CLI_OPTIONS.settingsPath
self.loadWalletsAndSettings()
+
+ eulaAgreed = self.settings.getSettingOrSetDefault('Agreed_to_EULA', False)
+ if not eulaAgreed:
+ DlgEULA(self,self).exec_()
+
self.setupNetworking()
# setupNetworking may have set this flag if something went wrong
if self.abortLoad:
+ LOGWARN('Armory startup was aborted. Closing.')
os._exit(0)
# Setup system tray and register "bitcoin:" URLs with the OS
#############################################################################
def setUserMode(self, mode):
+ LOGINFO('Changing usermode:')
+ LOGINFO(' From: %s', self.settings.get('User_Mode'))
self.usermode = mode
if mode==USERMODE.Standard:
self.settings.set('User_Mode', 'Standard')
self.settings.set('User_Mode', 'Advanced')
if mode==USERMODE.Expert:
self.settings.set('User_Mode', 'Expert')
+ LOGINFO(' To: %s', self.settings.get('User_Mode'))
if not self.firstModeSwitch:
QMessageBox.information(self,'Restart Required', \
#############################################################################
def setupNetworking(self):
+ LOGINFO('Setting up networking...')
self.internetAvail = False
self.satoshiAvail = False
#############################################################################
def clickReceiveCoins(self):
+ LOGDEBUG('Clicked "Receive Bitcoins Button"')
wltID = None
selectionMade = True
if len(self.walletMap)==0:
#############################################################################
def minimizeArmory(self):
+ LOGDEBUG('Minimizing Armory')
self.hide()
self.sysTray.show()
defaultFilename=defaultFn)
if len(str(logfn)) > 0:
shutil.copy(ARMORY_LOG_FILE, logfn)
+ LOGINFO('Log saved to %s', logfn)
#############################################################################
def blinkTaskbar(self):
if newBlks>0:
self.ledgerModel.reset()
self.latestBlockNum = TheBDM.getTopBlockHeader().getBlockHeight()
+ LOGINFO('New Block! : %d', self.latestBlockNum)
didAffectUs = False
for wltID in self.walletMap.keys():
prevLedgerSize = len(self.walletMap[wltID].getTxLedger())
newLedgerSize = len(self.walletMap[wltID].getTxLedger())
didAffectUs = (prevLedgerSize != newLedgerSize)
- LOGINFO('New Block! : %d', self.latestBlockNum)
if didAffectUs:
LOGINFO('New Block contained a transaction relevant to us!')
self.walletListChanged()
############################################
def checkForAlreadyOpen():
import socket
+ LOGDEBUG('Checking for already open socket...')
try:
# If create doesn't throw an error, there's another Armory open already!
sock = socket.create_connection(('127.0.0.1',CLI_OPTIONS.interport), 0.1);
from twisted.internet import reactor
def endProgram():
- LOGWARN('Resetting BlockDataMgr, freeing memory')
+ print 'Resetting BlockDataMgr, freeing memory'
+ LOGINFO('Resetting BlockDataMgr, freeing memory')
TheBDM.Reset()
if reactor.threadpool is not None:
reactor.threadpool.stop()
This license applies to all works under this directory tree EXCEPT for:
cppForSwig/cryptopp/*
+ cppForSwig/leveldb/*
qtreactor4.py
qrcodenative.py
Everything in the cryptopp directory is considered public domain according
- to http://www.cryptopp.com/ and included here only for convenience. Please
- contact me at alan.reiner@gmail.com if you believe that I am not in
- compliance with the crypto++ licence.
+ to http://www.cryptopp.com/ and included with the source distribution
+ as a convenience to the user. The leveldb library has been included,
+ unmodified, in compliance with its license that can be found in the
+ cppForSwig/leveldb directory.
********************************************************************************
*** If you wish to use this work in a way not compliant with the
AGPLv3 license, please contact me to work out an agreement for
- dual-licensing. alan.reiner@gmail.com
+ dual-licensing. Contact information is at the top.
********************************************************************************
<file alias="unlockedIcon.png">img/unlockedIcon.png</file>
<file alias="view-refresh-4.png">img/view-refresh-4.png</file>
<file alias="wallet_16x12.png">img/wallet_16x12.png</file>
+ <file alias="LICENSE">LICENSE</file>
</qresource>
</RCC>
self.setLayout(dlgLayout)
self.setWindowTitle('Address Key Information')
+#############################################################################
+class DlgEULA(ArmoryDialog):
+ def __init__(self, parent=None, main=None):
+ super(DlgEULA, self).__init__(parent, main)
+
+ txtWidth,txtHeight = tightSizeNChar(self, 110)
+ txtLicense = QTextEdit()
+ txtLicense.sizeHint = lambda: QSize(txtWidth, 14*txtHeight)
+ txtLicense.setReadOnly(True)
+
+ licFile = QFile(":/LICENSE")
+ licFile.open(QIODevice.ReadOnly | QIODevice.Text)
+ txtLicense.setText(str(licFile.readData(UINT32_MAX)))
+ licFile.close()
+
+ self.chkAgree = QCheckBox('I agree to all the terms of the license above')
+
+ self.btnCancel = QPushButton("Cancel")
+ self.btnAccept = QPushButton("Accept")
+ self.btnAccept.setEnabled(False)
+ self.connect(self.btnCancel, SIGNAL('clicked()'), self.reject)
+ self.connect(self.btnAccept, SIGNAL('clicked()'), self.accept)
+ self.connect(self.chkAgree, SIGNAL('toggled(bool)'), self.toggleChkBox)
+ btnBox = makeHorizFrame(['Stretch', self.btnCancel, self.btnAccept])
+
+
+ lblPleaseAgree = QRichLabel( \
+ '<b>Armory Bitcoin Client is licensed under the <i>Affero General '
+ 'Public License, Version 3 (AGPLv3)</i></b>'
+ '<br><br>'
+ 'Among other things, this '
+ 'license states as a condition of receiving this software '
+ 'for free, you accept all risks associated with using it '
+ 'and the developers of Armory will not be held liable for any '
+ 'loss of money due to software defects.'
+ '<br><br>'
+ '<b>Please read the full terms of the license indicate your '
+ 'agreement with its terms.</b>')
+
+
+ dlgLayout = QVBoxLayout()
+ frmChk = makeHorizFrame([self.chkAgree, 'Stretch'])
+ frmBtn = makeHorizFrame(['Stretch', self.btnCancel, self.btnAccept])
+ frmAll = makeVertFrame([lblPleaseAgree, txtLicense, frmChk, frmBtn])
+
+ dlgLayout.addWidget(frmAll)
+ self.setLayout(dlgLayout)
+ self.setWindowTitle('Armory License Agreement')
+ self.setWindowIcon(QIcon(self.main.iconfile))
+
+
+ def reject(self):
+ self.main.abortLoad = True
+ super(DlgEULA, self).reject()
+
+ def accept(self):
+ self.main.settings.set('Agreed_to_EULA', True)
+ super(DlgEULA, self).accept()
+
+ def toggleChkBox(self, isEnabled):
+ self.btnAccept.setEnabled(isEnabled)
#############################################################################
class DlgIntroMessage(ArmoryDialog):