Some fixes
This commit is contained in:
parent
72457c8b27
commit
beb181c175
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
import json
|
||||
import logging
|
||||
|
||||
from PyQt5 import QtGui
|
||||
|
|
|
@ -62,7 +62,6 @@ class ShopGameInfo(QWidget, Ui_shop_info):
|
|||
self.request.finished.connect(self.data_received)
|
||||
|
||||
def data_received(self):
|
||||
logging.info(f"Data of game {self.data['title']} received")
|
||||
if self.request:
|
||||
if self.request.error() == QNetworkReply.NoError:
|
||||
error = QJsonParseError()
|
||||
|
@ -80,12 +79,18 @@ class ShopGameInfo(QWidget, Ui_shop_info):
|
|||
return
|
||||
self.game = ShopGame.from_json(game, self.data)
|
||||
self.title.setText(self.game.title)
|
||||
self.price.setFont(QFont())
|
||||
if self.game.price != "0":
|
||||
self.price.setText(self.game.price)
|
||||
else:
|
||||
self.price.setText(self.tr("Free"))
|
||||
|
||||
if self.game.price != self.game.discount_price:
|
||||
self.discount_price.setText(self.game.discount_price)
|
||||
font = QFont()
|
||||
font.setStrikeOut(True)
|
||||
self.price.setFont(font)
|
||||
self.discount_price.setText(
|
||||
self.game.discount_price if self.game.discount_price != "0" else self.tr("Free"))
|
||||
self.discount_price.setVisible(True)
|
||||
else:
|
||||
self.discount_price.setVisible(False)
|
||||
|
@ -126,7 +131,6 @@ class ShopGameInfo(QWidget, Ui_shop_info):
|
|||
pass
|
||||
self.tags.setText(", ".join(self.game.tags))
|
||||
# self.price.setText(self.game.price)
|
||||
|
||||
self.request.deleteLater()
|
||||
|
||||
def button_clicked(self):
|
||||
|
|
Loading…
Reference in a new issue