Use Custom legendary version, cloud saves bug
This commit is contained in:
parent
f7dc0cf090
commit
90b7d109cc
|
@ -3,7 +3,7 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton, QLabel, QLineEdit
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
logger = getLogger("BrowserLogin")
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton, QLabel, QButtonGroup, QRadioButton
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
logger = getLogger("Import")
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QLabel, QStackedLayout, QWidget, QPushButton
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
# Login Opportunities: Browser, Import
|
||||
from Rare.Components.Dialogs.Login.BrowserLogin import BrowserLogin
|
||||
|
|
|
@ -2,7 +2,7 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import QThread, pyqtSignal
|
||||
from PyQt5.QtWidgets import QDialog, QLabel, QProgressBar, QVBoxLayout
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
from Rare.Components.Dialogs.Login.LoginDialog import LoginDialog
|
||||
from Rare.utils.utils import download_images
|
||||
|
@ -27,7 +27,7 @@ class LaunchThread(QThread):
|
|||
|
||||
class LoginThread(QThread):
|
||||
login = pyqtSignal()
|
||||
start_app = pyqtSignal(LegendaryCore)
|
||||
start_app = pyqtSignal()
|
||||
|
||||
def __init__(self, core: LegendaryCore):
|
||||
super(LoginThread, self).__init__()
|
||||
|
@ -38,7 +38,7 @@ class LoginThread(QThread):
|
|||
try:
|
||||
if self.core.login():
|
||||
logger.info("You are logged in")
|
||||
self.start_app.emit(self.core)
|
||||
self.start_app.emit()
|
||||
else:
|
||||
self.run()
|
||||
except ValueError:
|
||||
|
@ -72,8 +72,8 @@ class LaunchDialog(QDialog):
|
|||
else:
|
||||
exit(0)
|
||||
|
||||
def launch(self, core: LegendaryCore):
|
||||
self.core = core
|
||||
def launch(self):
|
||||
#self.core = core
|
||||
self.info_pb.setMaximum(len(self.core.get_game_list()))
|
||||
self.info_text.setText(self.tr("Downloading Images"))
|
||||
self.thread = LaunchThread(self.core, self)
|
||||
|
|
|
@ -2,7 +2,7 @@ from PyQt5.QtCore import QSize
|
|||
from PyQt5.QtGui import QFont
|
||||
from PyQt5.QtWidgets import QTabWidget, QTabBar, QWidget, QToolButton, QWidgetAction, QMenu
|
||||
from Rare.Components.Tabs.CloudSaves.CloudSaves import SyncSaves
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from qtawesome import icon
|
||||
|
||||
# from Rare.Components.Tabs.Account.AccountWidget import MiniWidget
|
||||
|
|
|
@ -2,7 +2,7 @@ import webbrowser
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QMessageBox, QLabel, QPushButton
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
|
||||
class MiniWidget(QWidget):
|
||||
|
|
|
@ -2,8 +2,8 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, Qt
|
||||
from PyQt5.QtWidgets import *
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import SaveGameStatus
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import SaveGameStatus
|
||||
|
||||
from Rare.Components.Dialogs.PathInputDialog import PathInputDialog
|
||||
from Rare.Components.Tabs.CloudSaves.SyncWidget import SyncWidget
|
||||
|
|
|
@ -3,9 +3,9 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import QThread, pyqtSignal
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton, QHBoxLayout, QLabel
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import InstalledGame, SaveGameStatus
|
||||
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame, SaveGameStatus
|
||||
|
||||
|
||||
class _UploadThread(QThread):
|
||||
|
@ -48,7 +48,11 @@ class SyncWidget(QWidget):
|
|||
self.igame = igame
|
||||
self.has_save_path = True
|
||||
if not igame.save_path:
|
||||
save_path = self.core.get_save_path(igame.app_name)
|
||||
try:
|
||||
save_path = self.core.get_save_path(igame.app_name)
|
||||
except Exception as e:
|
||||
self.logger.error(e)
|
||||
return
|
||||
if '%' in save_path or '{' in save_path:
|
||||
status = self.tr("Path not found")
|
||||
self.logger.info("Could not find save path")
|
||||
|
|
|
@ -5,17 +5,20 @@ import time
|
|||
from logging import getLogger
|
||||
from multiprocessing import Queue as MPQueue
|
||||
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, Qt, QVariant
|
||||
from PyQt5.QtWidgets import QWidget, QMessageBox, QVBoxLayout, QLabel, QGridLayout, QProgressBar, QPushButton, QDialog, QListWidget
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, Qt
|
||||
from PyQt5.QtWidgets import QWidget, QMessageBox, QVBoxLayout, QLabel, QGridLayout, QProgressBar, QPushButton, QDialog, \
|
||||
QListWidget, QHBoxLayout
|
||||
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import Game
|
||||
from legendary.models.downloading import UIUpdate
|
||||
from legendary.utils.selective_dl import games
|
||||
|
||||
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.downloader.manager import DLManager
|
||||
from custom_legendary.models.downloading import UIUpdate
|
||||
from custom_legendary.models.game import Game
|
||||
from custom_legendary.utils.selective_dl import games
|
||||
|
||||
from Rare.Components.Dialogs.InstallDialog import InstallInfoDialog
|
||||
from Rare.utils.LegendaryApi import VerifyThread
|
||||
from Rare.utils.Models import InstallOptions
|
||||
from Rare.utils.Models import InstallOptions, KillDownloadException
|
||||
|
||||
logger = getLogger("Download")
|
||||
|
||||
|
@ -23,8 +26,10 @@ logger = getLogger("Download")
|
|||
class DownloadThread(QThread):
|
||||
status = pyqtSignal(str)
|
||||
statistics = pyqtSignal(UIUpdate)
|
||||
kill = False
|
||||
|
||||
def __init__(self, dlm, core: LegendaryCore, status_queue: MPQueue, igame, repair=False, repair_file=None):
|
||||
def __init__(self, dlm: DLManager, core: LegendaryCore, status_queue: MPQueue, igame, repair=False,
|
||||
repair_file=None):
|
||||
super(DownloadThread, self).__init__()
|
||||
self.dlm = dlm
|
||||
self.core = core
|
||||
|
@ -40,11 +45,23 @@ class DownloadThread(QThread):
|
|||
self.dlm.start()
|
||||
time.sleep(1)
|
||||
while self.dlm.is_alive():
|
||||
if self.kill:
|
||||
#raise KillDownloadException()
|
||||
# TODO kill download queue, workers
|
||||
pass
|
||||
try:
|
||||
self.statistics.emit(self.status_queue.get(timeout=0.1))
|
||||
self.statistics.emit(self.status_queue.get(timeout=1))
|
||||
except queue.Empty:
|
||||
pass
|
||||
|
||||
self.dlm.join()
|
||||
|
||||
except KillDownloadException:
|
||||
self.status.emit("stop")
|
||||
logger.info("Downlaod can be continued later")
|
||||
self.dlm.kill()
|
||||
return
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Installation failed after {time.time() - start_time:.02f} seconds: {e}")
|
||||
self.status.emit("error")
|
||||
|
@ -128,9 +145,18 @@ class DownloadTab(QWidget):
|
|||
self.info_layout.addWidget(self.downloaded, 1, 1)
|
||||
self.layout.addLayout(self.info_layout)
|
||||
|
||||
self.mini_layout = QHBoxLayout()
|
||||
|
||||
self.prog_bar = QProgressBar()
|
||||
self.prog_bar.setMaximum(100)
|
||||
self.layout.addWidget(self.prog_bar)
|
||||
self.mini_layout.addWidget(self.prog_bar)
|
||||
|
||||
self.kill_button = QPushButton(self.tr("Stop Download"))
|
||||
# self.mini_layout.addWidget(self.kill_button)
|
||||
self.kill_button.setDisabled(True)
|
||||
self.kill_button.clicked.connect(self.stop_download)
|
||||
|
||||
self.layout.addLayout(self.mini_layout)
|
||||
|
||||
self.installing_game_widget = QLabel(self.tr("No active Download"))
|
||||
self.layout.addWidget(self.installing_game_widget)
|
||||
|
@ -155,6 +181,9 @@ class DownloadTab(QWidget):
|
|||
|
||||
self.setLayout(self.layout)
|
||||
|
||||
def stop_download(self):
|
||||
self.thread.kill = True
|
||||
|
||||
def install_game(self, options: InstallOptions):
|
||||
game = self.core.get_game(options.app_name, update_meta=True)
|
||||
status_queue = MPQueue()
|
||||
|
@ -162,28 +191,28 @@ class DownloadTab(QWidget):
|
|||
dlm, analysis, game, igame, repair, repair_file = self.core.prepare_download(
|
||||
app_name=options.app_name,
|
||||
base_path=options.path,
|
||||
force=False, # TODO allow overwrite
|
||||
force=False, # TODO allow overwrite
|
||||
no_install=options.download_only,
|
||||
status_q=status_queue,
|
||||
#max_shm=,
|
||||
# max_shm=,
|
||||
max_workers=options.max_workers,
|
||||
#game_folder=,
|
||||
#disable_patching=,
|
||||
#override_manifest=,
|
||||
#override_old_manifest=,
|
||||
#override_base_url=,
|
||||
#platform_override=,
|
||||
#file_prefix_filter=,
|
||||
#file_exclude_filter=,
|
||||
#file_install_tag=,
|
||||
#dl_optimizations=,
|
||||
#dl_timeout=,
|
||||
# game_folder=,
|
||||
# disable_patching=,
|
||||
# override_manifest=,
|
||||
# override_old_manifest=,
|
||||
# override_base_url=,
|
||||
# platform_override=,
|
||||
# file_prefix_filter=,
|
||||
# file_exclude_filter=,
|
||||
# file_install_tag=,
|
||||
# dl_optimizations=,
|
||||
# dl_timeout=,
|
||||
repair=options.repair,
|
||||
#repair_use_latest=,
|
||||
#ignore_space_req=,
|
||||
#disable_delta=,
|
||||
#override_delta_manifest=,
|
||||
#reset_sdl=,
|
||||
# repair_use_latest=,
|
||||
# ignore_space_req=,
|
||||
# disable_delta=,
|
||||
# override_delta_manifest=,
|
||||
# reset_sdl=,
|
||||
sdl_prompt=self.sdl_prompt)
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self, self.tr("Error preparing download"),
|
||||
|
@ -202,6 +231,7 @@ class DownloadTab(QWidget):
|
|||
self.thread.status.connect(self.status)
|
||||
self.thread.statistics.connect(self.statistics)
|
||||
self.thread.start()
|
||||
self.kill_button.setDisabled(False)
|
||||
self.installing_game.setText("Installing Game: " + self.active_game.app_title)
|
||||
|
||||
def sdl_prompt(self, app_name: str = '', title: str = '') -> list:
|
||||
|
@ -223,7 +253,7 @@ class DownloadTab(QWidget):
|
|||
tags.extend(games[app_name]['__required']['tags'])
|
||||
|
||||
# add available additional downloads to list
|
||||
pack_list.addItems([ tag + ': ' + info['name'] for tag, info in games[app_name].items() if tag != '__required' ])
|
||||
pack_list.addItems([tag + ': ' + info['name'] for tag, info in games[app_name].items() if tag != '__required'])
|
||||
|
||||
# enable checkboxes
|
||||
for i in range(len(pack_list)):
|
||||
|
@ -265,11 +295,19 @@ class DownloadTab(QWidget):
|
|||
elif text == "error":
|
||||
QMessageBox.warning(self, "warn", "Download error")
|
||||
|
||||
elif text == "stop":
|
||||
self.kill_button.setDisabled(True)
|
||||
self.installing_game.setText(self.tr("Installing Game: No active download"))
|
||||
self.prog_bar.setValue(0)
|
||||
self.dl_speed.setText("")
|
||||
self.cache_used.setText("")
|
||||
self.downloaded.setText("")
|
||||
|
||||
def statistics(self, ui_update: UIUpdate):
|
||||
self.prog_bar.setValue(ui_update.progress)
|
||||
self.dl_speed.setText(self.tr("Download speed") + f": {ui_update.download_speed/1024/1024:.02f}MB/s")
|
||||
self.cache_used.setText(self.tr("Cache used") + f": {ui_update.cache_usage/1024/1024:.02f}MB")
|
||||
self.downloaded.setText(self.tr("Downloaded") + f": {ui_update.total_downloaded/1024/1024:.02f}MB")
|
||||
self.dl_speed.setText(self.tr("Download speed") + f": {ui_update.download_speed / 1024 / 1024:.02f}MB/s")
|
||||
self.cache_used.setText(self.tr("Cache used") + f": {ui_update.cache_usage / 1024 / 1024:.02f}MB")
|
||||
self.downloaded.setText(self.tr("Downloaded") + f": {ui_update.total_downloaded / 1024 / 1024:.02f}MB")
|
||||
|
||||
def update_game(self, app_name: str):
|
||||
print("Update ", app_name)
|
||||
|
|
|
@ -4,8 +4,8 @@ from PyQt5.QtCore import Qt, pyqtSignal
|
|||
from PyQt5.QtGui import QPixmap, QKeyEvent
|
||||
from PyQt5.QtWidgets import QWidget, QPushButton, QVBoxLayout, QLabel, QHBoxLayout, QTabWidget, QMessageBox, \
|
||||
QProgressBar, QStackedWidget
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import InstalledGame, Game
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame, Game
|
||||
from qtawesome import icon
|
||||
|
||||
from Rare.Components.Tabs.Games.GameInfo.GameSettings import GameSettings
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import os
|
||||
|
||||
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout, QComboBox, QFileDialog, QPushButton, QMessageBox
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import InstalledGame, Game
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame, Game
|
||||
|
||||
from Rare.Components.Tabs.Settings.Linux import LinuxSettings
|
||||
from Rare.Components.Tabs.Settings.SettingsWidget import SettingsWidget
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from PyQt5.QtCore import Qt, pyqtSignal, QSettings
|
||||
from PyQt5.QtWidgets import *
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
from Rare.Components.Tabs.Games.GameWidgetInstalled import GameWidgetInstalled
|
||||
from Rare.Components.Tabs.Games.GameWidgetListUninstalled import UninstalledGameWidget
|
||||
|
@ -46,7 +46,7 @@ class GameList(QScrollArea):
|
|||
widget = GameWidget(game, self.core)
|
||||
if widget.update_available:
|
||||
self.updates.append(widget.game.app_name)
|
||||
widget.update_game.connect(self.update_game.emit)
|
||||
widget.update_game.connect(lambda: self.update_game.emit())
|
||||
self.layout.addWidget(widget)
|
||||
widget.update_list.connect(self.update_list)
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ from logging import getLogger
|
|||
from PyQt5.QtCore import QEvent, pyqtSignal, QSettings, QSize, Qt
|
||||
from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import *
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import InstalledGame
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame
|
||||
from qtawesome import icon
|
||||
|
||||
from Rare.utils import LegendaryApi
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import os
|
||||
import subprocess
|
||||
from logging import getLogger
|
||||
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, QProcess, QSettings
|
||||
from PyQt5.QtCore import pyqtSignal, QSettings
|
||||
from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QPushButton, QMessageBox
|
||||
from legendary.core import LegendaryCore
|
||||
from PyQt5.QtWidgets import QWidget, QLabel, QHBoxLayout, QVBoxLayout, QPushButton
|
||||
|
||||
from Rare.Components.Dialogs.InstallDialog import InstallDialog
|
||||
from Rare.utils.Models import InstallOptions
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
logger = getLogger("Game")
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ from logging import getLogger
|
|||
from PyQt5.QtCore import pyqtSignal, QSettings
|
||||
from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import Game
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import Game
|
||||
|
||||
from Rare.Components.Dialogs.InstallDialog import InstallDialog
|
||||
from Rare.utils.Models import InstallOptions
|
||||
|
|
|
@ -4,8 +4,8 @@ from logging import getLogger
|
|||
from PyQt5.QtCore import QProcess, pyqtSignal, QSettings
|
||||
from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QPushButton, QStyle, QVBoxLayout
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import InstalledGame
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import InstalledGame
|
||||
|
||||
from Rare.utils import LegendaryApi
|
||||
|
||||
|
@ -16,6 +16,7 @@ class GameWidget(QWidget):
|
|||
proc: QProcess
|
||||
signal = pyqtSignal(str)
|
||||
update_list = pyqtSignal()
|
||||
update_game = pyqtSignal()
|
||||
|
||||
# TODO Repair
|
||||
def __init__(self, game: InstalledGame, core: LegendaryCore):
|
||||
|
|
|
@ -2,7 +2,7 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from PyQt5.QtWidgets import QWidget, QCheckBox, QVBoxLayout, QWidgetAction, QMenu, QToolButton, QHBoxLayout, QLabel
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
logger = getLogger("DXVK Settings")
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ from logging import getLogger
|
|||
|
||||
from PyQt5.QtGui import QIntValidator
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QFileDialog, QPushButton, QLineEdit
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
from Rare.Components.Tabs.Settings.SettingsWidget import SettingsWidget
|
||||
from Rare.utils.QtExtensions import PathEdit
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from logging import getLogger
|
||||
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton, QFileDialog, QLineEdit
|
||||
from legendary.core import LegendaryCore
|
||||
from custom_legendary.core import LegendaryCore
|
||||
|
||||
from Rare.Components.Tabs.Settings.DXVK.Dxvk import DxvkWidget
|
||||
from Rare.Components.Tabs.Settings.SettingsWidget import SettingsWidget
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
|
||||
from PyQt5.QtCore import QRect, QPoint, QSize
|
||||
from PyQt5.QtWidgets import QTabWidget, QStylePainter, QStyleOptionTab, QTabBar, QStyle
|
||||
from PyQt5.QtWidgets import QTabWidget
|
||||
|
||||
from Rare.Components.Tabs.Settings.About import About
|
||||
from Rare.Components.Tabs.Settings.Legendary import LegendarySettings
|
||||
|
@ -21,4 +20,3 @@ class SettingsTab(QTabWidget):
|
|||
if os.name != "nt":
|
||||
self.addTab(LinuxSettings(core), "Linux")
|
||||
self.addTab(About(), "About")
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ from sys import stdout
|
|||
|
||||
from PyQt5.QtCore import QProcess, QProcessEnvironment, QThread, pyqtSignal
|
||||
from PyQt5.QtWidgets import QMessageBox, QWidget
|
||||
from legendary.core import LegendaryCore
|
||||
from legendary.models.game import VerifyResult
|
||||
from legendary.utils.lfs import validate_files
|
||||
from custom_legendary.core import LegendaryCore
|
||||
from custom_legendary.models.game import VerifyResult
|
||||
from custom_legendary.utils.lfs import validate_files
|
||||
|
||||
logger = getLogger("Legendary Utils")
|
||||
|
||||
|
|
|
@ -10,3 +10,7 @@ class InstallOptions:
|
|||
self.max_workers = max_workers
|
||||
self.repair = repair
|
||||
self.download_only = download_only
|
||||
|
||||
|
||||
class KillDownloadException(Exception):
|
||||
pass
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
import os
|
||||
|
||||
from legendary.lfs.lgndry import LGDLFS
|
||||
|
||||
lgd = LGDLFS()
|
||||
|
||||
|
||||
def get_config() -> {}:
|
||||
return lgd.config
|
||||
|
||||
|
||||
def set_config(new_config: {}):
|
||||
lgd.config = new_config
|
||||
with open(os.path.join(lgd.path, 'config.ini'), "w") as cf:
|
||||
lgd.config.write(cf)
|
|
@ -9,7 +9,6 @@ from PyQt5.QtCore import pyqtSignal, QLocale, QSettings
|
|||
from legendary.core import LegendaryCore
|
||||
|
||||
from Rare import lang_path
|
||||
from Rare.utils import legendaryConfig
|
||||
|
||||
logger = getLogger("Utils")
|
||||
s = QSettings("Rare","Rare")
|
||||
|
@ -95,9 +94,10 @@ def download_image(game, force=False):
|
|||
|
||||
|
||||
def get_lang():
|
||||
if "Legendary" in legendaryConfig.get_config() and "locale" in legendaryConfig.get_config()["Legendary"]:
|
||||
logger.info("Found locale in Legendary config: " + legendaryConfig.get_config()["Legendary"]["locale"])
|
||||
return legendaryConfig.get_config()["Legendary"]["locale"].split("-")[0]
|
||||
core = LegendaryCore()
|
||||
if "Legendary" in core.lgd.config.sections() and "locale" in core.lgd.config["Legendary"]:
|
||||
logger.info("Found locale in Legendary config: " + core.lgd.config.get("Legendary", "locale"))
|
||||
return core.lgd.config.get("Legendary", "locale").split("-")[0]
|
||||
else:
|
||||
logger.info("Found locale in system config: " + QLocale.system().name().split("_")[0])
|
||||
return QLocale.system().name().split("_")[0]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""Legendary!"""
|
||||
|
||||
__version__ = '0.20.6'
|
||||
__codename__ = 'A Red Letter Day'
|
||||
__codename__ = 'Custom'
|
Loading…
Reference in a new issue