Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Qt5 Support #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Building on Windows

- Download and install the latest Python 2.7 version from https://www.python.org/downloads/windows/
- Install Microsoft Visual C++ Compiler for Python 2.7 from http://www.microsoft.com/en-us/download/details.aspx?id=44266
- Download and install PyQt4 for Python 2.7 from https://www.riverbankcomputing.com/software/pyqt/download
- Download and install PyQt5 for Python 2.7 from https://www.riverbankcomputing.com/software/pyqt/download5
- Install the btchip library (open a command prompt and enter c:\python27\scripts\pip install btchip)

Building/Installing on FreeBSD
Expand Down
24 changes: 12 additions & 12 deletions btchip/btchipPersoWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import sys

from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QDialog, QMessageBox
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QDialog, QMessageBox

try:
from mnemonic import Mnemonic
Expand Down Expand Up @@ -72,7 +72,7 @@ def waitDongle(currentDialog, persoData):
raise Exception("Aborted by user")


class StartBTChipPersoDialog(QtGui.QDialog):
class StartBTChipPersoDialog(QDialog):

def __init__(self):
QDialog.__init__(self, None)
Expand All @@ -94,7 +94,7 @@ def processNext(self):
def processCancel(self):
self.reject()

class SeedDialog(QtGui.QDialog):
class SeedDialog(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand Down Expand Up @@ -146,7 +146,7 @@ def processCancel(self):
self.reject()
self.persoData['main'].reject()

class SecurityDialog(QtGui.QDialog):
class SecurityDialog(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand Down Expand Up @@ -179,7 +179,7 @@ def processCancel(self):
self.reject()
self.persoData['main'].reject()

class ConfigDialog(QtGui.QDialog):
class ConfigDialog(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand Down Expand Up @@ -229,7 +229,7 @@ def processCancel(self):
self.reject()
self.persoData['main'].reject()

class FinalizeDialog(QtGui.QDialog):
class FinalizeDialog(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand Down Expand Up @@ -288,7 +288,7 @@ def finish(self):
self.accept()
self.persoData['main'].accept()

class SeedBackupStart(QtGui.QDialog):
class SeedBackupStart(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand All @@ -302,7 +302,7 @@ def processNext(self):
self.hide()
dialog.exec_()

class SeedBackupUnplug(QtGui.QDialog):
class SeedBackupUnplug(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand All @@ -316,7 +316,7 @@ def processNext(self):
self.hide()
dialog.exec_()

class SeedBackupInstructions(QtGui.QDialog):
class SeedBackupInstructions(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand All @@ -330,7 +330,7 @@ def processNext(self):
self.hide()
dialog.exec_()

class SeedBackupVerify(QtGui.QDialog):
class SeedBackupVerify(QDialog):

def __init__(self, persoData, parent = None):
QDialog.__init__(self, parent)
Expand Down Expand Up @@ -370,7 +370,7 @@ def seedKO(self):

if __name__ == "__main__":

app = QtGui.QApplication(sys.argv)
app = QtWidgets.QApplication(sys.argv)
dialog = StartBTChipPersoDialog()
dialog.show()
app.exec_()
45 changes: 20 additions & 25 deletions btchip/ui/personalization00start.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,49 @@

# Form implementation generated from reading ui file 'personalization-00-start.ui'
#
# Created: Fri Sep 19 15:03:25 2014
# by: PyQt4 UI code generator 4.9.1
# Created by: PyQt5 UI code generator 5.7
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.setObjectName("Dialog")
Dialog.resize(400, 231)
self.TitleLabel = QtGui.QLabel(Dialog)
self.TitleLabel = QtWidgets.QLabel(Dialog)
self.TitleLabel.setGeometry(QtCore.QRect(120, 20, 231, 31))
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.TitleLabel.setFont(font)
self.TitleLabel.setObjectName(_fromUtf8("TitleLabel"))
self.IntroLabel = QtGui.QLabel(Dialog)
self.TitleLabel.setObjectName("TitleLabel")
self.IntroLabel = QtWidgets.QLabel(Dialog)
self.IntroLabel.setGeometry(QtCore.QRect(20, 60, 351, 61))
self.IntroLabel.setWordWrap(True)
self.IntroLabel.setObjectName(_fromUtf8("IntroLabel"))
self.NextButton = QtGui.QPushButton(Dialog)
self.IntroLabel.setObjectName("IntroLabel")
self.NextButton = QtWidgets.QPushButton(Dialog)
self.NextButton.setGeometry(QtCore.QRect(310, 200, 75, 25))
self.NextButton.setObjectName(_fromUtf8("NextButton"))
self.arningLabel = QtGui.QLabel(Dialog)
self.NextButton.setObjectName("NextButton")
self.arningLabel = QtWidgets.QLabel(Dialog)
self.arningLabel.setGeometry(QtCore.QRect(20, 120, 351, 81))
self.arningLabel.setWordWrap(True)
self.arningLabel.setObjectName(_fromUtf8("arningLabel"))
self.CancelButton = QtGui.QPushButton(Dialog)
self.arningLabel.setObjectName("arningLabel")
self.CancelButton = QtWidgets.QPushButton(Dialog)
self.CancelButton.setGeometry(QtCore.QRect(20, 200, 75, 25))
self.CancelButton.setObjectName(_fromUtf8("CancelButton"))
self.CancelButton.setObjectName("CancelButton")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "BTChip setup", None, QtGui.QApplication.UnicodeUTF8))
self.TitleLabel.setText(QtGui.QApplication.translate("Dialog", "BTChip setup", None, QtGui.QApplication.UnicodeUTF8))
self.IntroLabel.setText(QtGui.QApplication.translate("Dialog", "Your BTChip dongle is not set up - you\'ll be able to create a new wallet, or restore an existing one, and choose your security profile.", None, QtGui.QApplication.UnicodeUTF8))
self.NextButton.setText(QtGui.QApplication.translate("Dialog", "Next", None, QtGui.QApplication.UnicodeUTF8))
self.arningLabel.setText(QtGui.QApplication.translate("Dialog", "Sensitive information including your dongle PIN will be exchanged during this setup phase - it is recommended to execute it on a secure computer, disconnected from any network, especially if you restore a wallet backup.", None, QtGui.QApplication.UnicodeUTF8))
self.CancelButton.setText(QtGui.QApplication.translate("Dialog", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "BTChip setup"))
self.TitleLabel.setText(_translate("Dialog", "BTChip setup"))
self.IntroLabel.setText(_translate("Dialog", "Your BTChip dongle is not set up - you\'ll be able to create a new wallet, or restore an existing one, and choose your security profile."))
self.NextButton.setText(_translate("Dialog", "Next"))
self.arningLabel.setText(_translate("Dialog", "Sensitive information including your dongle PIN will be exchanged during this setup phase - it is recommended to execute it on a secure computer, disconnected from any network, especially if you restore a wallet backup."))
self.CancelButton.setText(_translate("Dialog", "Cancel"))

69 changes: 32 additions & 37 deletions btchip/ui/personalization01seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,71 @@

# Form implementation generated from reading ui file 'personalization-01-seed.ui'
#
# Created: Thu Aug 28 22:26:22 2014
# by: PyQt4 UI code generator 4.9.1
# Created by: PyQt5 UI code generator 5.7
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.setObjectName("Dialog")
Dialog.resize(400, 300)
self.TitleLabel = QtGui.QLabel(Dialog)
self.TitleLabel = QtWidgets.QLabel(Dialog)
self.TitleLabel.setGeometry(QtCore.QRect(50, 20, 311, 31))
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.TitleLabel.setFont(font)
self.TitleLabel.setObjectName(_fromUtf8("TitleLabel"))
self.IntroLabel = QtGui.QLabel(Dialog)
self.TitleLabel.setObjectName("TitleLabel")
self.IntroLabel = QtWidgets.QLabel(Dialog)
self.IntroLabel.setGeometry(QtCore.QRect(20, 60, 351, 61))
self.IntroLabel.setWordWrap(True)
self.IntroLabel.setObjectName(_fromUtf8("IntroLabel"))
self.NewWalletButton = QtGui.QRadioButton(Dialog)
self.IntroLabel.setObjectName("IntroLabel")
self.NewWalletButton = QtWidgets.QRadioButton(Dialog)
self.NewWalletButton.setGeometry(QtCore.QRect(20, 130, 94, 21))
self.NewWalletButton.setChecked(True)
self.NewWalletButton.setObjectName(_fromUtf8("NewWalletButton"))
self.buttonGroup = QtGui.QButtonGroup(Dialog)
self.buttonGroup.setObjectName(_fromUtf8("buttonGroup"))
self.NewWalletButton.setObjectName("NewWalletButton")
self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
self.buttonGroup.setObjectName("buttonGroup")
self.buttonGroup.addButton(self.NewWalletButton)
self.RestoreWalletButton = QtGui.QRadioButton(Dialog)
self.RestoreWalletButton = QtWidgets.QRadioButton(Dialog)
self.RestoreWalletButton.setGeometry(QtCore.QRect(20, 180, 171, 21))
self.RestoreWalletButton.setObjectName(_fromUtf8("RestoreWalletButton"))
self.RestoreWalletButton.setObjectName("RestoreWalletButton")
self.buttonGroup.addButton(self.RestoreWalletButton)
self.seed = QtGui.QLineEdit(Dialog)
self.seed = QtWidgets.QLineEdit(Dialog)
self.seed.setEnabled(False)
self.seed.setGeometry(QtCore.QRect(50, 210, 331, 21))
self.seed.setEchoMode(QtGui.QLineEdit.Normal)
self.seed.setObjectName(_fromUtf8("seed"))
self.CancelButton = QtGui.QPushButton(Dialog)
self.seed.setEchoMode(QtWidgets.QLineEdit.Normal)
self.seed.setObjectName("seed")
self.CancelButton = QtWidgets.QPushButton(Dialog)
self.CancelButton.setGeometry(QtCore.QRect(10, 270, 75, 25))
self.CancelButton.setObjectName(_fromUtf8("CancelButton"))
self.NextButton = QtGui.QPushButton(Dialog)
self.CancelButton.setObjectName("CancelButton")
self.NextButton = QtWidgets.QPushButton(Dialog)
self.NextButton.setGeometry(QtCore.QRect(320, 270, 75, 25))
self.NextButton.setObjectName(_fromUtf8("NextButton"))
self.mnemonicNotAvailableLabel = QtGui.QLabel(Dialog)
self.NextButton.setObjectName("NextButton")
self.mnemonicNotAvailableLabel = QtWidgets.QLabel(Dialog)
self.mnemonicNotAvailableLabel.setGeometry(QtCore.QRect(130, 240, 171, 31))
font = QtGui.QFont()
font.setItalic(True)
self.mnemonicNotAvailableLabel.setFont(font)
self.mnemonicNotAvailableLabel.setWordWrap(True)
self.mnemonicNotAvailableLabel.setObjectName(_fromUtf8("mnemonicNotAvailableLabel"))
self.mnemonicNotAvailableLabel.setObjectName("mnemonicNotAvailableLabel")

self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "BTChip setup - seed", None, QtGui.QApplication.UnicodeUTF8))
self.TitleLabel.setText(QtGui.QApplication.translate("Dialog", "BTChip setup - seed (1/3)", None, QtGui.QApplication.UnicodeUTF8))
self.IntroLabel.setText(QtGui.QApplication.translate("Dialog", "Please select an option : either create a new wallet or restore an existing one", None, QtGui.QApplication.UnicodeUTF8))
self.NewWalletButton.setText(QtGui.QApplication.translate("Dialog", "New Wallet", None, QtGui.QApplication.UnicodeUTF8))
self.RestoreWalletButton.setText(QtGui.QApplication.translate("Dialog", "Restore wallet backup", None, QtGui.QApplication.UnicodeUTF8))
self.seed.setPlaceholderText(QtGui.QApplication.translate("Dialog", "Enter an hexadecimal seed or a BIP 39 mnemonic code", None, QtGui.QApplication.UnicodeUTF8))
self.CancelButton.setText(QtGui.QApplication.translate("Dialog", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
self.NextButton.setText(QtGui.QApplication.translate("Dialog", "Next", None, QtGui.QApplication.UnicodeUTF8))
self.mnemonicNotAvailableLabel.setText(QtGui.QApplication.translate("Dialog", "Mnemonic API is not available", None, QtGui.QApplication.UnicodeUTF8))
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "BTChip setup - seed"))
self.TitleLabel.setText(_translate("Dialog", "BTChip setup - seed (1/3)"))
self.IntroLabel.setText(_translate("Dialog", "Please select an option : either create a new wallet or restore an existing one"))
self.NewWalletButton.setText(_translate("Dialog", "New Wallet"))
self.RestoreWalletButton.setText(_translate("Dialog", "Restore wallet backup"))
self.seed.setPlaceholderText(_translate("Dialog", "Enter an hexadecimal seed or a BIP 39 mnemonic code"))
self.CancelButton.setText(_translate("Dialog", "Cancel"))
self.NextButton.setText(_translate("Dialog", "Next"))
self.mnemonicNotAvailableLabel.setText(_translate("Dialog", "Mnemonic API is not available"))

Loading