Fix merge conflicts
authorMaran <maran.hidskes@gmail.com>
Thu, 16 Aug 2012 21:36:41 +0000 (23:36 +0200)
committerMaran <maran.hidskes@gmail.com>
Thu, 16 Aug 2012 21:36:41 +0000 (23:36 +0200)
TODO
data/noface.svg [new file with mode: 0644]
electrum
electrum.png
lib/gui_lite.py
lib/gui_qt.py

diff --git a/TODO b/TODO
index 89affcc..b5c8430 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,7 +3,6 @@ Client:
 - Wizard
 - Multiple wallets
 - Themes
-- Extend GUI with history view (View -> Show History)
 - Settings window
 
 Server:
diff --git a/data/noface.svg b/data/noface.svg
new file mode 100644 (file)
index 0000000..9956854
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="noface.svg">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="532.5838"
+     inkscape:cy="371.07669"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="776"
+     inkscape:window-x="0"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="opacity:1;fill:#d7d7d7;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 472.75139,908.92052 c 46.46702,-26.26397 56.56855,-68.69038 66.67007,-98.99495 10.10153,-30.30458 52.52793,-228.29448 42.42641,-347.49248 -10.10153,-119.198 -58.58885,-135.36044 -107.07617,-159.6041 -48.48732,-24.24366 -133.34014,-18.18275 -175.76654,8.08122 -42.42642,26.26397 -92.93405,60.60915 -101.01527,143.44166 -8.08122,82.83251 9.13377,276.70605 46.46702,371.73614 22.22336,56.56854 47.29278,70.95769 78.79191,84.85281 31.49913,13.89512 116.60088,16.01267 149.50257,-2.0203 z"
+       id="path3050"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="csssssszc"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.078413"
+       inkscape:export-ydpi="9.078413" />
+    <path
+       inkscape:connector-curvature="0"
+       style="opacity:0.83716048;fill:#ababab;fill-opacity:0.74885846;stroke:none"
+       d="m 492.99757,311.80631 c 11.23452,31.03781 23.13916,71.59216 24.1875,106.1875 2.02031,66.67006 5.54127,210.00456 -28.28125,357.59375 -10.92538,47.67439 -26.21568,100.16446 -38.96875,141.28125 8.92901,-2.00577 16.75879,-4.61954 22.8125,-7.9375 46.46702,-26.26397 56.58598,-68.69543 66.6875,-99 10.10153,-30.30458 52.50777,-228.302 42.40625,-347.5 -8.83005,-104.1945 -46.99116,-129.67233 -88.84375,-150.625 z"
+       id="path3820"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="fill:#a81ac6;fill-opacity:0.67579908;stroke:none"
+       d="m 472.36815,608.40014 c -4.54569,5.05077 -10.60661,24.74874 -10.60661,35.86042 0,11.11167 2.52538,74.24621 7.07107,78.79189 4.57367,4.57366 12.12183,0.50508 26.76904,-30.80965 14.64721,-31.31473 21.91152,-55.56287 16.66752,-78.28682 -1.51523,-6.56599 -4.50174,-10.38257 -16.16244,-11.11168 -14.45847,-0.90404 -19.19289,0.50507 -23.73858,5.55584 z"
+       id="path3845"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="zzszssz"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="fill:#a81ac6;fill-opacity:0.67579908;stroke:none"
+       d="m 286.37825,604.86461 c 7.07107,9.09137 8.08122,112.632 3.03045,117.68277 -5.05076,5.05076 -12.6269,1.51523 -23.23351,-16.66752 -10.6066,-18.18275 -20.20305,-64.64976 -18.18274,-81.31728 2.0203,-16.66752 1.51523,-25.25381 10.6066,-25.25381 9.09137,0 20.70813,-3.53553 27.7792,5.55584 z"
+       id="path3847"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="zssssz"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="fill:#a81ac6;fill-opacity:0.67579908;stroke:none"
+       d="m 462.83854,381.17677 c -8.66075,13.24483 -7.77299,51.73804 -2.02325,66.24003 5.74974,14.502 9.6608,10.52382 22.5255,9.96166 12.86469,-0.56214 19.26168,-1.19861 20.40396,-11.36163 1.14228,-10.16302 -2.04364,-34.96948 -13.76246,-51.74883 -11.71882,-16.77936 -18.48299,-26.33608 -27.14375,-13.09123 z"
+       id="path3853"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="zssszz"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="fill:#a81ac6;fill-opacity:0.67579908;stroke:none"
+       d="m 324.37703,377.77117 c 9.72067,11.6648 0.91396,64.28078 -12.14285,74.14286 -13.0568,9.86208 -22.85715,13.57143 -32.14286,5 -9.28571,-8.57143 -7.14286,-21.42857 -1.42857,-33.57143 5.71428,-12.14286 35.99361,-57.23623 45.71428,-45.57143 z"
+       id="path3855"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="zzssz"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#0a0a0a;fill-opacity:1;stroke:none"
+       d="m 547.2342,519.77115 c 0,11.44018 -31.18128,20.71428 -56.42858,20.71428 -25.2473,0 -35.87633,-9.30771 -35,-20.71428 0.71429,-9.29732 6.89556,-18.57143 30.71429,-18.57143 25.2473,0 60.71429,7.13125 60.71429,18.57143 z"
+       id="path3875"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#0a0a0a;fill-opacity:1;stroke:none"
+       d="m 327.23418,518.3426 c 0,11.44018 -13.32413,19.99999 -38.57143,19.99999 -25.2473,0 -52.85715,-8.55981 -52.85715,-19.99999 0,-11.44018 15.46699,-15 49.28572,-19.28572 25.04698,-3.1741 42.14286,7.84554 42.14286,19.28572 z"
+       id="path3875-7"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#686868;fill-opacity:1;stroke:none"
+       d="m 535.18812,558.75169 c 0,7.07211 -34.2757,11.37662 -49.88312,11.37662 -15.60742,0 -30.74952,-5.75386 -30.20779,-12.80519 0.44156,-5.74743 17.11985,0.66234 31.84416,0.66234 15.60742,0 48.24675,-6.30588 48.24675,0.76623 z"
+       id="path3875-8"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#686868;fill-opacity:1;stroke:none"
+       d="m 314.87059,558.28812 c 4.59886,6.2357 -11.88122,14.97403 -28.98054,14.97403 -17.09932,0 -47.2273,-7.2259 -47.2273,-14.97403 0,-7.74814 25.47538,4.1266 48.3799,1.224 16.96365,-2.14973 22.11365,-8.97214 27.82794,-1.224 z"
+       id="path3875-7-8"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#0a0a0a;fill-opacity:1;stroke:none"
+       d="m 473.66274,781.55688 c 6.65191,13.65366 -38.85529,27.5 -86.78571,27.5 -47.93043,0 -95.7096,-15.21039 -86.78572,-27.5 4.28571,-5.90212 38.141,-4.64286 86.07143,-4.64286 47.93042,0 83.92857,-2.68783 87.5,4.64286 z"
+       id="path3963"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+    <path
+       style="opacity:0.83716048;fill:#979797;fill-opacity:1;stroke:none"
+       d="m 411.80809,840.61364 c 2.26113,5.85484 -13.20775,11.79229 -29.50033,11.79229 -16.29259,0 -32.53376,-6.52237 -29.50034,-11.79229 1.45681,-2.53088 12.96495,-1.99091 29.25754,-1.99091 16.29258,0 28.52912,-1.15257 29.74313,1.99091 z"
+       id="path3963-0"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="sssss"
+       inkscape:export-filename="/tmp/noface.png"
+       inkscape:export-xdpi="9.0802708"
+       inkscape:export-ydpi="9.0802708" />
+  </g>
+</svg>
index 43c907c..967b5dc 100755 (executable)
--- a/electrum
+++ b/electrum
@@ -130,6 +130,7 @@ if __name__ == '__main__':
         firstarg = args[1] if len(args) > 1 else ''
         
     if cmd == 'gui':
+        
         if options.gui=='gtk':
             try:
                 import lib.gui as gui
@@ -141,6 +142,25 @@ if __name__ == '__main__':
             except ImportError:
                 import electrum.gui_qt as gui
         elif options.gui == 'lite':
+            # Let's do some dep checking and handle missing ones gracefully
+            try:
+              from PyQt4.QtCore import *
+              from PyQt4.QtGui import *
+            except ImportError:
+              print "You need to have PyQT installed to run Electrum in graphical mode."
+              print "If you have pip installed try 'sudo pip install pyqt' if you are on Debian/Ubuntu try 'sudo apt-get install python-qt4'."
+              sys.exit(0)
+
+            qtVersion = qVersion()
+            if not(int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7):
+              app = QApplication(sys.argv)
+
+              error_message = QErrorMessage()
+              error_message.setFixedSize(350,200)
+              error_message.showMessage("<p>Sorry, Electrum requires Qt >= 4.7 to run.</p><p>Check your distributions packages or download it at http://qt.nokia.com/downloads</p>")
+              app.exec_()
+              sys.exit(0)
+
             try:
                 import lib.gui_lite as gui
             except ImportError:
index a45fe95..f47d03b 100644 (file)
Binary files a/electrum.png and b/electrum.png differ
index b1675d9..8bd69c9 100644 (file)
@@ -1,5 +1,8 @@
+import sys
+
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
+
 from decimal import Decimal as D
 from util import appdata_dir, get_resource_path as rsrc
 from i18n import _
@@ -8,7 +11,6 @@ import exchange_rate
 import os.path
 import random
 import re
-import sys
 import time
 import wallet
 import webbrowser
@@ -124,7 +126,7 @@ class MiniWindow(QDialog):
         self.receive_button = QPushButton(_("&Receive"))
         self.receive_button.setObjectName("receive_button")
         self.receive_button.setDefault(True)
-        self.connect(self.receive_button, SIGNAL("clicked()"), self.copy_address)
+        self.receive_button.clicked.connect(self.copy_address)
 
         # Bitcoin address code
         self.address_input = QLineEdit()
@@ -132,8 +134,9 @@ class MiniWindow(QDialog):
         self.address_input.setObjectName("address_input")
 
 
-        self.connect(self.address_input, SIGNAL("textEdited(QString)"), self.address_field_changed)
-        resize_line_edit_width(self.address_input, "1BtaFUr3qVvAmwrsuDuu5zk6e4s2rxd2Gy")
+        self.address_input.textEdited.connect(self.address_field_changed)
+        resize_line_edit_width(self.address_input,
+                               "1BtaFUr3qVvAmwrsuDuu5zk6e4s2rxd2Gy")
 
         self.address_completions = QStringListModel()
         address_completer = QCompleter(self.address_input)
@@ -156,14 +159,12 @@ class MiniWindow(QDialog):
         # This removes the very ugly OSX highlighting, please leave this in :D
         self.address_input.setAttribute(Qt.WA_MacShowFocusRect, 0)
         self.amount_input.setAttribute(Qt.WA_MacShowFocusRect, 0)
-        
-        self.connect(self.amount_input, SIGNAL("textChanged(QString)"),
-                     self.amount_input_changed)
+        self.amount_input.textChanged.connect(self.amount_input_changed)
 
         self.send_button = QPushButton(_("&Send"))
         self.send_button.setObjectName("send_button")
         self.send_button.setDisabled(True);
-        self.connect(self.send_button, SIGNAL("clicked()"), self.send)
+        self.send_button.clicked.connect(self.send)
 
         main_layout = QGridLayout(self)
 
@@ -183,31 +184,37 @@ class MiniWindow(QDialog):
 
         menubar = QMenuBar()
         electrum_menu = menubar.addMenu(_("&Bitcoin"))
+        self.servers_menu = electrum_menu.addMenu(_("&Servers"))
+        self.servers_menu.addAction(_("Foo"))
+        electrum_menu.addSeparator()
+        brain_seed = electrum_menu.addAction(_("&BrainWallet Info"))
+        brain_seed.triggered.connect(self.actuator.show_seed_dialog)
+
         electrum_menu.addAction(_("&Quit"))
 
         view_menu = menubar.addMenu(_("&View"))
         expert_gui = view_menu.addAction(_("&Pro Mode"))
-        self.connect(expert_gui, SIGNAL("triggered()"), expand_callback)
-
+        expert_gui.triggered.connect(expand_callback)
+        view_menu.addMenu(_("&Themes"))
+        view_menu.addSeparator()
         show_history = view_menu.addAction(_("Show History"))
         show_history.setCheckable(True)
-        self.connect(show_history, SIGNAL("toggled(bool)"), self.show_history)
+        show_history.toggled.connect(self.show_history)
 
         help_menu = menubar.addMenu(_("&Help"))
         the_website = help_menu.addAction(_("&Website"))
-        self.connect(the_website, SIGNAL("triggered()"), self.the_website)
+        the_website.triggered.connect(self.the_website)
         help_menu.addSeparator()
         report_bug = help_menu.addAction(_("&Report Bug"))
-        self.connect(report_bug, SIGNAL("triggered()"), self.show_report_bug)
+        report_bug.triggered.connect(self.show_report_bug)
         show_about = help_menu.addAction(_("&About"))
-        self.connect(show_about, SIGNAL("triggered()"), self.show_about)
-
+        show_about.triggered.connect(self.show_about)
         main_layout.setMenuBar(menubar)
 
         quit_shortcut = QShortcut(QKeySequence("Ctrl+Q"), self)
-        self.connect(quit_shortcut, SIGNAL("activated()"), self.close)
+        quit_shortcut.activated.connect(self.close)
         close_shortcut = QShortcut(QKeySequence("Ctrl+W"), self)
-        self.connect(close_shortcut, SIGNAL("activated()"), self.close)
+        close_shortcut.activated.connect(self.close)
 
         self.setWindowIcon(QIcon(":electrum.png"))
         self.setWindowTitle("Electrum")
@@ -296,11 +303,11 @@ class MiniWindow(QDialog):
             self.amount_input.setText("")
 
     def check_button_status(self):
-      if (self.address_input.property("isValid") == True and
-          len(self.amount_input.text()) > 0):
-        self.send_button.setDisabled(False)
-      else:
-        self.send_button.setDisabled(True)
+        if (self.address_input.property("isValid") == True and
+            len(self.amount_input.text()) > 0):
+            self.send_button.setDisabled(False)
+        else:
+            self.send_button.setDisabled(True)
 
     def address_field_changed(self, address):
         if self.actuator.is_valid(address):
@@ -341,7 +348,7 @@ class MiniWindow(QDialog):
 
     def show_about(self):
         QMessageBox.about(self, "Electrum",
-            _("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjuction with high-performance servers that handle the most complicated parts of the Bitcoin system."))
+            _("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjuction with high-performance servers that handle the most complicated parts of the Bitcoin system.\n\nSend donations to 1JwTMv4GWaPdf931N6LNPJeZBfZgZJ3zX1"))
 
     def show_report_bug(self):
         QMessageBox.information(self, "Electrum - " + _("Reporting Bugs"),
@@ -556,6 +563,9 @@ class MiniActuator:
         url = "http://acceptbit.com/mpk/%s/%s" % (master_pubkey, currency)
         webbrowser.open(url)
 
+    def show_seed_dialog(self):
+        gui_qt.ElectrumWindow.show_seed_dialog(self.wallet)
+
 class MiniDriver(QObject):
 
     INITIALIZING = 0
index d8f26fc..0341097 100644 (file)
@@ -916,10 +916,12 @@ class ElectrumWindow(QMainWindow):
             QMessageBox.warning(parent, _('Error'), _('Incorrect Password'), _('OK'))
             return
 
-        msg = _("Your wallet generation seed is") + ":\n\n" + seed + "\n\n"\
-              + _("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.") + "\n\n" \
-              + _("Equivalently, your wallet seed can be stored and recovered with the following mnemonic code") + ":\n\n\"" \
-              + ' '.join(mnemonic.mn_encode(seed)) + "\"\n\n\n"
+        msg = '"' + ' '.join(mnemonic.mn_encode(seed)) + '"\n\n' + \
+              _("If you memorise or write down these 12 words, you will always be able to\nrecover your wallet.\n\nThis is called a 'BrainWallet'. The order of words is important. Case does not\nmatter (capitals or lowercase).")
+        #msg = _("Your wallet generation seed is") + ":\n\n" + seed + "\n\n"\
+        #      + _("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.") + "\n\n" \
+        #      + _("Equivalently, your wallet seed can be stored and recovered with the following mnemonic code") + ":\n\n\"" \
+        #      + ' '.join(mnemonic.mn_encode(seed)) + "\"\n\n\n"
 
         d = QDialog(None)
         d.setModal(1)
@@ -947,7 +949,7 @@ class ElectrumWindow(QMainWindow):
             app = QApplication
 
         b = QPushButton(_("Copy to Clipboard"))
-        b.clicked.connect(lambda: app.clipboard().setText(seed + ' "' + ' '.join(mnemonic.mn_encode(seed))+'"'))
+        b.clicked.connect(lambda: app.clipboard().setText(' '.join(mnemonic.mn_encode(seed))))
         hbox.addWidget(b)
         b = QPushButton(_("View as QR Code"))
         b.clicked.connect(lambda: ElectrumWindow.show_seed_qrcode(seed))