diff --git a/rare/components/tabs/cloud_saves/sync_widget.py b/rare/components/tabs/cloud_saves/sync_widget.py index 46ccdd5a..889a7ee3 100644 --- a/rare/components/tabs/cloud_saves/sync_widget.py +++ b/rare/components/tabs/cloud_saves/sync_widget.py @@ -1,7 +1,7 @@ import os from logging import getLogger -from PyQt5.QtCore import QThread, pyqtSignal, Qt +from PyQt5.QtCore import QThread, pyqtSignal, Qt, QSettings from PyQt5.QtWidgets import QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QGroupBox from custom_legendary.core import LegendaryCore @@ -167,6 +167,11 @@ class SyncWidget(QGroupBox): self.layout.addStretch(1) self.setLayout(self.layout) + if self.res == SaveGameStatus.REMOTE_NEWER: + settings = QSettings() + if settings.value(f"{igame.app_name}/auto_sync_cloud", False, bool): + self.download() + def change_path(self): path = PathInputDialog("Select directory", "Select savepath. Warning: Do not change if you are not sure", self.igame.save_path).get_path() diff --git a/rare/languages/de.ts b/rare/languages/de.ts index 0c7262a6..862212dd 100644 --- a/rare/languages/de.ts +++ b/rare/languages/de.ts @@ -830,7 +830,7 @@ Installationsgröße: {} GB MainWindow - + There is a download active. Do you really want to exit app? Ein Download läuft noch. Möchtest du die App wirklich beenden? @@ -938,85 +938,90 @@ Installationsgröße: {} GB RareSettings - + Rare settings Rare Einstellungen - + Save Speichern - + Image Directory Ordner für Bilder - + Language Sprache - + Restart Application to activate changes Starte die App neu um die Änderungen zu aktivieren - + Confirm launch of game Start des Spiels bestätigen - + Exit to System Tray Icon Beim verlassen auf das System Tray Icon minimieren - + Hide to System Tray Icon In das System Tray Icon minimieren - + Auto sync with cloud Speicherstände automatisch mit der Cloud synchronisieren - + Sync with cloud Automatisch Synchronisieren - + Save size Größe Speichern - + Save size of window after restart Die Fenstergröße nach dem Beenden speichern - + Automatically update Games on startup Spiele automatisch updaten - + Auto updates Automatische Updates - + Show Notifications after Downloads Benachrichtigung nach Abschluss des Downloads anzeigen - + Show notification Benachrichtigung anzeigen + + + Open Log directory + + SyncSaves @@ -1134,22 +1139,22 @@ Installationsgröße: {} GB Pfad ändern - + Uploading... Hochladen... - + Upload finished Hochladen abgeschlossen - + Downloading... Runterladen... - + Download finished Download abgeschlossen diff --git a/rare/utils/utils.py b/rare/utils/utils.py index 303d260d..62177aec 100644 --- a/rare/utils/utils.py +++ b/rare/utils/utils.py @@ -11,14 +11,15 @@ from PyQt5.QtCore import pyqtSignal, QLocale, QSettings # Windows if os.name == "nt": from win32com.client import Dispatch +# Mac not supported -from rare import lang_path, __version__, style_path + +from rare import lang_path from custom_legendary.core import LegendaryCore logger = getLogger("Utils") s = QSettings("Rare", "Rare") IMAGE_DIR = s.value("img_dir", os.path.expanduser("~/.cache/rare/images"), type=str) -logger.info("IMAGE DIRECTORY: " + IMAGE_DIR) def download_images(signal: pyqtSignal, core: LegendaryCore): @@ -38,7 +39,7 @@ def download_images(signal: pyqtSignal, core: LegendaryCore): except json.decoder.JSONDecodeError: shutil.rmtree(f"{IMAGE_DIR}/{game.app_name}") download_image(game) - signal.emit(i/len(game_list)*100) + signal.emit(i / len(game_list) * 100) def download_image(game, force=False): @@ -69,7 +70,7 @@ def download_image(game, force=False): f.write(requests.get(url).content) try: img = Image.open(f"{IMAGE_DIR}/{game.app_name}/{image['type']}.png") - img = img.resize((200, int(200*4/3))) + img = img.resize((200, int(200 * 4 / 3))) img.save(f"{IMAGE_DIR}/{game.app_name}/{image['type']}.png") except UnidentifiedImageError as e: logger.warning(e) @@ -84,7 +85,7 @@ def download_image(game, force=False): bg = Image.open(f"{IMAGE_DIR}/{game.app_name}/DieselGameBoxTall.png") uninstalledArt = bg.convert('L') - uninstalledArt = uninstalledArt.resize((200, int(200*4/3))) + uninstalledArt = uninstalledArt.resize((200, int(200 * 4 / 3))) uninstalledArt.save(f'{IMAGE_DIR}/{game.app_name}/UninstalledArt.png') elif os.path.isfile(f"{IMAGE_DIR}/{game.app_name}/DieselGameBoxLogo.png"): bg: Image.Image = Image.open(f"{IMAGE_DIR}/{game.app_name}/DieselGameBoxLogo.png") @@ -202,9 +203,11 @@ def create_desktop_link(app_name, core: LegendaryCore, type_of_link="desktop"): shortcut.WorkingDirectory = os.getcwd() # Icon - if not os.path.exists(icon+".ico"): - img = Image.open(icon+".png") - img.save(icon+".ico") + if not os.path.exists(icon + ".ico"): + img = Image.open(icon + ".png") + img.save(icon + ".ico") logger.info("Create Icon") - shortcut.IconLocation = os.path.join(icon+ ".ico") + shortcut.IconLocation = os.path.join(icon + ".ico") + + # Save shortcut shortcut.save()