Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ddc committed May 18, 2020
1 parent f66d672 commit 33962dc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import logging.handlers
import os
import sys
import urllib.request

import requests
from PyQt5 import QtCore, QtGui, QtWidgets
Expand Down Expand Up @@ -328,8 +327,12 @@ def check_new_program_version(self):
################################################################################
def set_paypal_button(self):
url = constants.PAYPAL_REMOTE_FILENAME
data = urllib.request.urlopen(url).read()
pixmap = QtGui.QPixmap()
pixmap.loadFromData(data)
icon = QtGui.QIcon(pixmap)
self.qtObj.paypal_button.setIcon(icon)
data = requests.get(url, stream=True)
if data.status_code == 200:
pixmap = QtGui.QPixmap()
pixmap.loadFromData(data.content)
icon = QtGui.QIcon(pixmap)
self.qtObj.paypal_button.setIcon(icon)
else:
_translate = QtCore.QCoreApplication.translate
self.qtObj.paypal_button.setText(_translate("Main", "PayPal"))

0 comments on commit 33962dc

Please sign in to comment.