migration to PyQt5. initial commit.
This commit is contained in:
@@ -35,10 +35,11 @@ from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.base import MIMEBase
|
||||
from email.encoders import encode_base64
|
||||
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
import PyQt4.QtCore as QtCore
|
||||
import PyQt4.QtGui as QtGui
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtCore import *
|
||||
import PyQt5.QtCore as QtCore
|
||||
import PyQt5.QtGui as QtGui
|
||||
from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QLineEdit)
|
||||
|
||||
from electrum.plugins import BasePlugin, hook
|
||||
from electrum.paymentrequest import PaymentRequest
|
||||
@@ -102,6 +103,10 @@ class Processor(threading.Thread):
|
||||
s.quit()
|
||||
|
||||
|
||||
class QEmailSignalObject(QObject):
|
||||
email_new_invoice_signal = pyqtSignal()
|
||||
|
||||
|
||||
class Plugin(BasePlugin):
|
||||
|
||||
def fullname(self):
|
||||
@@ -121,13 +126,13 @@ class Plugin(BasePlugin):
|
||||
if self.imap_server and self.username and self.password:
|
||||
self.processor = Processor(self.imap_server, self.username, self.password, self.on_receive)
|
||||
self.processor.start()
|
||||
self.obj = QObject()
|
||||
self.obj.connect(self.obj, SIGNAL('email:new_invoice'), self.new_invoice)
|
||||
self.obj = QEmailSignalObject()
|
||||
self.obj.email_new_invoice_signal(self.new_invoice)
|
||||
|
||||
def on_receive(self, pr_str):
|
||||
self.print_error('received payment request')
|
||||
self.pr = PaymentRequest(pr_str)
|
||||
self.obj.emit(SIGNAL('email:new_invoice'))
|
||||
self.obj.email_new_invoice_signal.emit()
|
||||
|
||||
def new_invoice(self):
|
||||
self.parent.invoices.add(self.pr)
|
||||
|
||||
Reference in New Issue
Block a user