Fix some small issues
- shop: fix overlaying widgets - launch_dialog.py dlg: error when catching exception - fix exit in offline mode
This commit is contained in:
parent
080c8f8831
commit
78c0a74692
|
@ -12,7 +12,6 @@ from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QMessageBox
|
|||
from requests import HTTPError
|
||||
|
||||
import legendary
|
||||
|
||||
# noinspection PyUnresolvedReferences
|
||||
import rare.resources.resources
|
||||
import rare.shared as shared
|
||||
|
@ -208,7 +207,7 @@ class App(QApplication):
|
|||
def exit_app(self, exit_code=0):
|
||||
# FIXME: Fix this with the downlaod tab redesign
|
||||
if self.mainwindow is not None:
|
||||
if self.mainwindow.tab_widget.downloadTab.is_download_active:
|
||||
if not shared.args.offline and self.mainwindow.tab_widget.downloadTab.is_download_active:
|
||||
question = QMessageBox.question(
|
||||
self.mainwindow,
|
||||
self.tr("Close"),
|
||||
|
|
|
@ -3,7 +3,7 @@ import platform
|
|||
from logging import getLogger
|
||||
|
||||
from PyQt5.QtCore import Qt, pyqtSignal, QRunnable, QObject, QThreadPool
|
||||
from PyQt5.QtWidgets import QDialog
|
||||
from PyQt5.QtWidgets import QDialog, QApplication
|
||||
from requests.exceptions import ConnectionError, HTTPError
|
||||
|
||||
from legendary.core import LegendaryCore
|
||||
|
@ -43,13 +43,13 @@ class ApiRequestWorker(QRunnable):
|
|||
def run(self) -> None:
|
||||
try:
|
||||
result = shared.core.get_game_and_dlc_list(True, "Mac")
|
||||
except HTTPError():
|
||||
except HTTPError:
|
||||
result = [], {}
|
||||
self.signals.result.emit(result, "mac")
|
||||
|
||||
try:
|
||||
result = shared.core.get_game_and_dlc_list(True, "Win32")
|
||||
except HTTPError():
|
||||
except HTTPError:
|
||||
result = [], {}
|
||||
self.signals.result.emit(result, "32bit")
|
||||
|
||||
|
@ -103,6 +103,7 @@ class LaunchDialog(QDialog, Ui_LaunchDialog):
|
|||
if self.offline:
|
||||
pass
|
||||
else:
|
||||
QApplication.processEvents()
|
||||
if self.core.login():
|
||||
logger.info("You are logged in")
|
||||
else:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import datetime
|
||||
import logging
|
||||
import random
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from PyQt5.QtWidgets import (
|
||||
|
@ -86,6 +85,7 @@ class ShopWidget(QScrollArea, Ui_ShopWidget):
|
|||
item = self.discount_widget.layout().itemAt(i)
|
||||
if item:
|
||||
item.widget().deleteLater()
|
||||
|
||||
if wishlist and wishlist[0] == "error":
|
||||
self.discount_widget.layout().addWidget(
|
||||
QLabel(self.tr("Failed to get wishlist: ") + wishlist[1])
|
||||
|
@ -112,8 +112,9 @@ class ShopWidget(QScrollArea, Ui_ShopWidget):
|
|||
logger.warning(str(game) + str(e))
|
||||
continue
|
||||
self.discounts_gb.setVisible(discounts > 0)
|
||||
self.discount_widget.update()
|
||||
self.discount_stack.setCurrentIndex(0)
|
||||
# fix widget overlay
|
||||
self.discount_widget.layout().update()
|
||||
|
||||
def add_free_games(self, free_games: list):
|
||||
for i in range(self.free_widget.layout().count()):
|
||||
|
|
Loading…
Reference in a new issue