electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 175fd47130e91d40f885465aa9b0153f00357c0c
parent 00097a23de8d923be1cd2371750feb0212da9552
Author: Maran <maran.hidskes@gmail.com>
Date:   Thu, 16 Aug 2012 11:28:20 +0200

Changing around where we issue the messages

Diffstat:
Melectrum | 19+++++++++++++++++++
Mlib/gui_lite.py | 15++-------------
2 files changed, 21 insertions(+), 13 deletions(-)

diff --git 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,24 @@ 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.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: diff --git a/lib/gui_lite.py b/lib/gui_lite.py @@ -1,12 +1,7 @@ import sys -try: - from PyQt4.QtCore import * - from PyQt4.QtGui import * -except ImportError: - print "You need to have PyQT installed to run Electrum" - 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(1) +from PyQt4.QtCore import * +from PyQt4.QtGui import * from decimal import Decimal as D from util import appdata_dir, get_resource_path as rsrc @@ -58,12 +53,6 @@ def cd_data_dir(): class ElectrumGui: def __init__(self, wallet): - qtVersion = qVersion() - if not(int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7): - print "Sorry, Electrum requires Qt >= 4.7 to run" - print "Check your distributions packages or download it at http://qt.nokia.com/downloads" - sys.exit(0) - self.wallet = wallet self.app = QApplication(sys.argv) # Should probably not modify the current path but instead