Skip to content

Commit

Permalink
Show correct label for cloud saves in cloud saves game details
Browse files Browse the repository at this point in the history
  • Loading branch information
Dummerle committed Jan 2, 2025
1 parent d1e15e7 commit 20f6419
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rare/components/tabs/library/details/cloud_saves.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, parent=None):
self.sync_ui.setupUi(self.sync_widget)

self.info_label = QLabel(self.tr("<b>This game doesn't support cloud saves</b>"))
self.info_label_not_installed = QLabel(self.tr("<b>Install this game to see cloud saves</b>"))

self.rcore = RareCore.instance()
self.core = RareCore.instance().core()
Expand Down Expand Up @@ -86,6 +87,7 @@ def __init__(self, parent=None):
layout.addWidget(self.sync_widget)
layout.addWidget(self.cloud_widget)
layout.addWidget(self.info_label)
layout.addWidget(self.info_label_not_installed)
layout.addSpacerItem(QSpacerItem(0, 0, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding))

@staticmethod
Expand Down Expand Up @@ -169,16 +171,16 @@ def __on_wine_resolver_result(self, path, app_name):
self.cloud_save_path_edit.setText(path)

def __update_widget(self):
supports_saves = self.rgame.igame is not None and (
self.rgame.game.supports_cloud_saves or self.rgame.game.supports_mac_cloud_saves
)
supports_saves = self.rgame.game.supports_cloud_saves or self.rgame.game.supports_mac_cloud_saves
saves_ready = self.rgame.igame is not None and supports_saves

self.sync_widget.setEnabled(
bool(supports_saves and self.rgame.save_path)) # and not self.rgame.is_save_up_to_date))
bool(saves_ready and self.rgame.save_path)) # and not self.rgame.is_save_up_to_date))

self.cloud_widget.setEnabled(supports_saves)
self.info_label.setVisible(not supports_saves)
if not supports_saves:
self.cloud_widget.setEnabled(saves_ready)
self.info_label.setVisible(not saves_ready and not supports_saves)
self.info_label_not_installed.setVisible(supports_saves and not self.rgame.is_installed)
if not saves_ready:
self.sync_ui.date_info_local.setText("None")
self.sync_ui.age_label_local.setText("None")
self.sync_ui.date_info_remote.setText("None")
Expand Down

0 comments on commit 20f6419

Please sign in to comment.