Added EULA window! No liability!
authoretotheipi <etotheipi@gmail.com>
Tue, 10 Jul 2012 05:07:18 +0000 (01:07 -0400)
committeretotheipi <etotheipi@gmail.com>
Tue, 10 Jul 2012 05:07:18 +0000 (01:07 -0400)
ArmoryQt.py
LICENSE
imgList.xml
qtdialogs.py

index 324f1e9..1924e32 100644 (file)
@@ -62,6 +62,8 @@ class ArmoryMainWindow(QMainWindow):
    def __init__(self, parent=None):
       super(ArmoryMainWindow, self).__init__(parent)
 
+
+
       # SETUP THE WINDOWS DECORATIONS
       self.lblLogoIcon = QLabel()
       if USE_TESTNET:
@@ -87,10 +89,16 @@ class ArmoryMainWindow(QMainWindow):
       
       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
@@ -685,6 +693,8 @@ class ArmoryMainWindow(QMainWindow):
 
    #############################################################################
    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')
@@ -692,6 +702,7 @@ class ArmoryMainWindow(QMainWindow):
          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', \
@@ -730,6 +741,7 @@ class ArmoryMainWindow(QMainWindow):
    #############################################################################
    def setupNetworking(self):
 
+      LOGINFO('Setting up networking...')
       self.internetAvail = False
       self.satoshiAvail  = False
 
@@ -2101,6 +2113,7 @@ class ArmoryMainWindow(QMainWindow):
 
    #############################################################################
    def clickReceiveCoins(self):
+      LOGDEBUG('Clicked "Receive Bitcoins Button"')
       wltID = None
       selectionMade = True
       if len(self.walletMap)==0:
@@ -2148,6 +2161,7 @@ class ArmoryMainWindow(QMainWindow):
 
    #############################################################################
    def minimizeArmory(self):
+      LOGDEBUG('Minimizing Armory')
       self.hide()
       self.sysTray.show()
 
@@ -2180,6 +2194,7 @@ class ArmoryMainWindow(QMainWindow):
                                   defaultFilename=defaultFn)
          if len(str(logfn)) > 0:
             shutil.copy(ARMORY_LOG_FILE, logfn)
+            LOGINFO('Log saved to %s', logfn)
 
    #############################################################################
    def blinkTaskbar(self):
@@ -2200,6 +2215,7 @@ class ArmoryMainWindow(QMainWindow):
          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())
@@ -2208,7 +2224,6 @@ class ArmoryMainWindow(QMainWindow):
                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()
@@ -2420,6 +2435,7 @@ class ArmoryListenerFactory(ClientFactory):
 ############################################
 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);
@@ -2470,7 +2486,8 @@ if 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()
diff --git a/LICENSE b/LICENSE
index 1930b70..6023ac7 100755 (executable)
--- a/LICENSE
+++ b/LICENSE
     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.
 
 ********************************************************************************
 
index 9406172..7af1465 100644 (file)
@@ -97,5 +97,6 @@
       <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>
index 25aa521..73d3ed0 100755 (executable)
@@ -3220,6 +3220,67 @@ class DlgShowKeys(ArmoryDialog):
       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):