fix auto sync saves
This commit is contained in:
parent
3874fac402
commit
554d3557d3
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -23,3 +23,4 @@ __pycache__
|
|||
/rare.bin
|
||||
/rare.cmd
|
||||
/rare.exe
|
||||
/poetry.lock
|
|
@ -188,9 +188,9 @@ class CloudSaves(QWidget, SideTabContents):
|
|||
self.sync_ui.download_button.setDisabled(button_disabled)
|
||||
self.sync_ui.upload_button.setDisabled(button_disabled)
|
||||
|
||||
self.cloud_ui.cloud_sync.setChecked(
|
||||
self.settings.value(f"{self.rgame.app_name}/auto_sync_cloud", False, bool)
|
||||
)
|
||||
self.cloud_ui.cloud_sync.blockSignals(True)
|
||||
self.cloud_ui.cloud_sync.setChecked(self.rgame.auto_sync_saves)
|
||||
self.cloud_ui.cloud_sync.blockSignals(False)
|
||||
self.cloud_save_path_edit.setText(self.rgame.save_path if self.rgame.save_path else "")
|
||||
|
||||
def update_game(self, rgame: RareGame):
|
||||
|
|
|
@ -44,7 +44,7 @@ class RareSettings(QWidget, Ui_RareSettings):
|
|||
(self.sys_tray, "sys_tray", True),
|
||||
(self.auto_update, "auto_update", False),
|
||||
(self.confirm_start, "confirm_start", False),
|
||||
(self.auto_sync_cloud, "auto_sync_cloud", True),
|
||||
(self.auto_sync_cloud, "auto_sync_cloud", False),
|
||||
(self.notification, "notification", True),
|
||||
(self.save_size, "save_size", False),
|
||||
(self.log_games, "show_console", False),
|
||||
|
|
|
@ -218,7 +218,7 @@ class RareLauncher(RareApp):
|
|||
def game_finished(self, exit_code):
|
||||
self.logger.info("Game finished")
|
||||
|
||||
if self.rgame.supports_cloud_saves:
|
||||
if self.rgame.auto_sync_saves:
|
||||
self.check_saves_finished(exit_code)
|
||||
else:
|
||||
self.on_exit(exit_code)
|
||||
|
|
|
@ -161,9 +161,11 @@ class RareGameSlim(RareGameBase):
|
|||
|
||||
@property
|
||||
def auto_sync_saves(self):
|
||||
return (
|
||||
self.game.supports_cloud_saves or self.game.supports_mac_cloud_saves
|
||||
) and QSettings().value(f"{self.app_name}/auto_sync_cloud", True, bool)
|
||||
return self.supports_cloud_saves and QSettings().value(
|
||||
f"{self.app_name}/auto_sync_cloud",
|
||||
QSettings().value("auto_sync_cloud", False, bool),
|
||||
bool
|
||||
)
|
||||
|
||||
@property
|
||||
def save_path(self) -> Optional[str]:
|
||||
|
@ -200,7 +202,7 @@ class RareGameSlim(RareGameBase):
|
|||
self.state = RareGameSlim.State.IDLE
|
||||
self.update_saves()
|
||||
|
||||
if not self.game.supports_cloud_saves and not self.game.supports_mac_cloud_saves:
|
||||
if not self.supports_cloud_saves:
|
||||
return
|
||||
if status == SaveGameStatus.NO_SAVE or not dt_local:
|
||||
logger.warning("Can't upload non existing save")
|
||||
|
@ -225,7 +227,7 @@ class RareGameSlim(RareGameBase):
|
|||
self.state = RareGameSlim.State.IDLE
|
||||
self.update_saves()
|
||||
|
||||
if not self.game.supports_cloud_saves and not self.game.supports_mac_cloud_saves:
|
||||
if not self.supports_cloud_saves:
|
||||
return
|
||||
if status == SaveGameStatus.NO_SAVE or not dt_remote:
|
||||
logger.error("Can't download non existing save")
|
||||
|
|
Loading…
Reference in a new issue