1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00
This commit is contained in:
Dummerle 2021-12-26 23:03:50 +01:00
parent 8f89eb6e88
commit 4820719bef
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1
2 changed files with 20 additions and 11 deletions

View file

@ -190,10 +190,12 @@ class GamesTab(QStackedWidget, Ui_GamesTab):
logger.info(app_name + " has a corrupt image.")
download_image(self.core.get_game(app_name), force=True)
pixmap = get_pixmap(app_name)
icon_widget = InstalledIconWidget(app_name, pixmap, self.game_utils)
list_widget = InstalledListWidget(app_name, pixmap, self.game_utils)
try:
icon_widget = InstalledIconWidget(app_name, pixmap, self.game_utils)
list_widget = InstalledListWidget(app_name, pixmap, self.game_utils)
except Exception as e:
logger.error(app_name + " is broken. Don't add it to game list: " + str(e))
return
self.widgets[app_name] = (icon_widget, list_widget)
@ -202,7 +204,6 @@ class GamesTab(QStackedWidget, Ui_GamesTab):
if icon_widget.update_available:
self.updates.add(app_name)
return icon_widget, list_widget
def add_uninstalled_widget(self, game):
@ -214,11 +215,14 @@ class GamesTab(QStackedWidget, Ui_GamesTab):
img = pixmap.toImage()
img = img.convertToFormat(QImage.Format_Grayscale8)
pixmap = QPixmap.fromImage(img)
try:
icon_widget = IconWidgetUninstalled(game, self.core, pixmap)
list_widget = ListWidgetUninstalled(self.core, game, pixmap)
except Exception as e:
logger.error(game.app_name + " is broken. Don't add it to game list: " + str(e))
return
icon_widget = IconWidgetUninstalled(game, self.core, pixmap)
icon_widget.show_uninstalled_info.connect(self.show_uninstalled_info)
list_widget = ListWidgetUninstalled(self.core, game, pixmap)
list_widget.show_uninstalled_info.connect(self.show_uninstalled_info)
self.widgets[game.app_name] = (icon_widget, list_widget)

View file

@ -176,11 +176,11 @@ class EGLSyncListItem(QListWidgetItem):
self.export = export
if export:
self.setText(game.title)
else:
else: # import
self.setText(shared.core.get_game(game.app_name).app_title)
def is_checked(self) -> bool:
return True if self.checkState() == Qt.Checked else False
return self.checkState() == Qt.Checked
def action(self) -> None:
if self.export:
@ -244,7 +244,12 @@ class EGLSyncListGroup(QGroupBox, Ui_EGLSyncListGroup):
if enabled:
self.list.clear()
for item in self.list_func():
self.list.addItem(EGLSyncListItem(item, self.export, self.list))
try:
i = EGLSyncListItem(item, self.export, self.list)
except AttributeError:
logger.error(item.app_name + " does not work. Ignoring")
else:
self.list.addItem(i)
self.label.setVisible(not enabled or not bool(self.list.count()))
self.list.setVisible(enabled and bool(self.list.count()))
self.buttons_widget.setVisible(enabled and bool(self.list.count()))