diff --git a/rare/app.py b/rare/app.py index f59b14e0..a8524c89 100644 --- a/rare/app.py +++ b/rare/app.py @@ -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"), diff --git a/rare/components/dialogs/launch_dialog.py b/rare/components/dialogs/launch_dialog.py index 98b4e470..591243a4 100644 --- a/rare/components/dialogs/launch_dialog.py +++ b/rare/components/dialogs/launch_dialog.py @@ -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: diff --git a/rare/components/tabs/shop/shop_widget.py b/rare/components/tabs/shop/shop_widget.py index 39b0986d..25d842ec 100644 --- a/rare/components/tabs/shop/shop_widget.py +++ b/rare/components/tabs/shop/shop_widget.py @@ -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()):