1
0
Fork 0
mirror of synced 2024-06-24 01:00:43 +12:00

Some fixes

This commit is contained in:
Dummerle 2021-06-18 12:24:56 +02:00
parent 72457c8b27
commit beb181c175
2 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,4 @@
import json
import json
import logging
from PyQt5 import QtGui

View file

@ -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):