Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tinywallet: migrate from PyQt5 to PySide2 #170

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ The [`decred`](./decred) package contains everything needed to create wallets
to send and receive DCR.

The [`tinywallet`](./tinywallet) package contains a wallet based on the
`decred` toolkit.
`decred` toolkit and on the Qt toolkit via the PySide2 bindings, which are
licensed under LGPLv3.

Each package may be installed from the [Python Package Index](https://pypi.org/)
using the [`pip`](https://pip.pypa.io/) command as usual.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE → decred/LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ISC License

Copyright (c) 2019, Brian Stafford
Copyright (c) 2019, The Decred developers
Copyright (c) 2019-2020, The Decred developers

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
3 changes: 2 additions & 1 deletion tinywallet/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# TinyWallet

TinyWallet is a light [Decred](https://decred.org/) wallet GUI application
based on PyQt5.
based on the Qt toolkit via the PySide2 bindings, which are licensed under
LGPLv3.

**The light wallet is experimental, and should not be used on mainnet.**

Expand Down
139 changes: 65 additions & 74 deletions tinywallet/poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tinywallet/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.6"
python = "^3.6, <3.9"
decred = {path = "../decred/"}
pyqt5 = "=5.12.3"
pyside2 = "^5.14.2"

[tool.poetry.dev-dependencies]
pytest = "^5.3.5"
Expand Down
15 changes: 8 additions & 7 deletions tinywallet/tinywallet/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Copyright (c) 2019, the Decred developers
See LICENSE for details

A PyQt light wallet.
A Qt-based light wallet.
"""

import os
from pathlib import Path
import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from PySide2 import QtCore, QtGui, QtWidgets

from decred.dcr import constants as DCR
from decred.dcr.dcrdata import DcrdataBlockchain
Expand Down Expand Up @@ -56,23 +56,24 @@ def __init__(self, balance=None, working=None, done=None, spentTickets=None):

class TinyWallet(QtCore.QObject, Q.ThreadUtilities):
"""
TinyWallet is an PyQt application for interacting with the Decred
TinyWallet is a Qt application for interacting with the Decred
blockchain. TinyWallet currently implements a UI for creating and
controlling a rudimentary, non-staking, Decred testnet light wallet.

TinyWallet is a system tray application.
"""

qRawSignal = QtCore.pyqtSignal(tuple)
homeSig = QtCore.pyqtSignal(Q.PyObj)
walletSig = QtCore.pyqtSignal(Q.PyObj)
qRawSignal = QtCore.Signal(tuple)
homeSig = QtCore.Signal(object)
walletSig = QtCore.Signal(object)

def __init__(self, qApp):
"""
Args:
qApp (QApplication): An initialized QApplication.
"""
super().__init__()
QtCore.QObject.__init__(self)
Q.ThreadUtilities.__init__(self)
self.qApp = qApp
self.cfg = config.load()
self.log = self.initLogging()
Expand Down
8 changes: 3 additions & 5 deletions tinywallet/tinywallet/qutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Copyright (c) 2019, the Decred developers
See LICENSE for detail

PyQt5 utilities.
Qt utilities.
"""

import re

from PyQt5 import QtCore, QtGui, QtWidgets
from PySide2 import QtCore, QtGui, QtWidgets

from decred.util import helpers

Expand Down Expand Up @@ -37,8 +37,6 @@

STRETCH = "stretch"

PyObj = "PyQt_PyObject"


class ThreadUtilities:
"""
Expand Down Expand Up @@ -314,7 +312,7 @@ def getOffset(self):
"""
return self.xPos

pqProp = QtCore.pyqtProperty(int, fget=getOffset, fset=setOffset)
pqProp = QtCore.Property(int, fget=getOffset, fset=setOffset)

def set(self, on):
"""
Expand Down
12 changes: 6 additions & 6 deletions tinywallet/tinywallet/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from urllib.parse import urlsplit, urlunsplit
import webbrowser

from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from PySide2 import QtCore, QtGui, QtSvg, QtWidgets

from decred import DecredError
from decred.crypto import crypto
Expand Down Expand Up @@ -109,11 +109,11 @@ class TinyDialog(QtWidgets.QFrame):
maxWidth = 525
maxHeight = 375
targetPadding = 15
popSig = QtCore.pyqtSignal(Q.PyObj)
stackSig = QtCore.pyqtSignal(Q.PyObj)
popSig = QtCore.Signal(object)
stackSig = QtCore.Signal(object)
topMenuHeight = 26
successSig = QtCore.pyqtSignal(str)
errorSig = QtCore.pyqtSignal(str)
successSig = QtCore.Signal(str)
errorSig = QtCore.Signal(str)

def __init__(self, twApp):
"""
Expand Down Expand Up @@ -1825,7 +1825,7 @@ def __init__(self, acct):

def paintEvent(self, e):
"""
Paint the lock icon. This is an overloaded PyQt method.
Paint the lock icon. This is an overloaded PySide2 method.
"""
super().paintEvent(e)
painter = QtGui.QPainter(self)
Expand Down