1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

InstallOptionsModel: Rename fields to use the same names as Legendary's arguments

This commit is contained in:
loathingKernel 2022-07-10 02:34:53 +03:00
parent 883bd268ff
commit 197f915fb3
6 changed files with 22 additions and 16 deletions

View file

@ -169,10 +169,10 @@ class InstallDialog(QDialog, Ui_InstallDialog):
self.dl_item.options.base_path = self.install_dir_edit.text() if not self.update else None
self.dl_item.options.max_workers = self.max_workers_spin.value()
self.dl_item.options.max_shm = self.max_memory_spin.value()
self.dl_item.options.dl_optimizations = self.dl_optimizations_check.isChecked()
self.dl_item.options.shared_memory = self.max_memory_spin.value()
self.dl_item.options.order_opt = self.dl_optimizations_check.isChecked()
self.dl_item.options.force = self.force_download_check.isChecked()
self.dl_item.options.ignore_space_req = self.ignore_space_check.isChecked()
self.dl_item.options.ignore_space = self.ignore_space_check.isChecked()
self.dl_item.options.no_install = self.download_only_check.isChecked()
self.dl_item.options.platform = self.platform_combo_box.currentText()
self.dl_item.options.sdl_list = [""]
@ -317,7 +317,7 @@ class InstallInfoWorker(QRunnable):
force=self.dl_item.options.force,
no_install=self.dl_item.options.no_install,
status_q=self.dl_item.status_q,
shared_memory=self.dl_item.options.max_shm,
shared_memory=self.dl_item.options.shared_memory,
max_workers=self.dl_item.options.max_workers,
# game_folder=,
# disable_patching=,
@ -328,11 +328,11 @@ class InstallInfoWorker(QRunnable):
# file_prefix_filter=,
# file_exclude_filter=,
# file_install_tag=,
order_opt=self.dl_item.options.dl_optimizations,
order_opt=self.dl_item.options.order_opt,
# dl_timeout=,
repair_mode=self.dl_item.options.repair,
repair_mode=self.dl_item.options.repair_mode,
# repair_and_update=True,
ignore_space=self.dl_item.options.ignore_space_req,
ignore_space=self.dl_item.options.ignore_space,
# disable_delta=,
# override_delta_manifest=,
# reset_sdl=,

View file

@ -188,7 +188,7 @@ class DownloadThread(QThread):
os.remove(self.repair_file)
if old_igame and old_igame.install_tags != self.igame.install_tags:
old_igame.install_tags = self.igame.install_tags
self.logger.info("Deleting now untagged files.")
logger.info("Deleting now untagged files.")
self.core.uninstall_tag(old_igame)
self.core.install_game(old_igame)

View file

@ -129,7 +129,7 @@ class GameInfo(QWidget, Ui_GameInfo):
)
return
self.signals.install_game.emit(
InstallOptionsModel(app_name=self.game.app_name, repair=True, update=True)
InstallOptionsModel(app_name=self.game.app_name, repair_mode=True, update=True)
)
def verify(self):
@ -182,7 +182,7 @@ class GameInfo(QWidget, Ui_GameInfo):
)
if ans == QMessageBox.Yes:
self.signals.install_game.emit(
InstallOptionsModel(app_name=app_name, repair=True, update=True)
InstallOptionsModel(app_name=app_name, repair_mode=True, update=True)
)
self.verify_widget.setCurrentIndex(0)
self.verify_threads.pop(app_name)

View file

@ -261,6 +261,12 @@ class LegendaryCLI(legendary.cli.LegendaryCLI):
self.core.uninstall_tag(old_igame)
self.core.install_game(old_igame)
def _handle_postinstall(self, postinstall, igame, yes=False):
super(LegendaryCLI, self)._handle_postinstall(postinstall, igame, yes)
def uninstall_game(self, args):
super(LegendaryCLI, self).uninstall_game(args)
def verify_game(self, args, print_command=True, repair_mode=False, repair_online=False):
if not hasattr(args, 'callback') or args.callback is None:
args.callback = print

View file

@ -19,5 +19,5 @@ class LgndrLogHandler(logging.Handler):
# lk: FATAL is the same as CRITICAL
if record.levelno == logging.ERROR or record.levelno == logging.CRITICAL:
raise LgndrException(record.getMessage())
if record.levelno == logging.INFO or record.levelno == logging.WARNING:
warnings.warn(record.getMessage())
# if record.levelno == logging.INFO or record.levelno == logging.WARNING:
# warnings.warn(record.getMessage())

View file

@ -14,17 +14,17 @@ from legendary.models.game import Game, InstalledGame
class InstallOptionsModel:
app_name: str
base_path: str = ""
max_shm: int = 1024
shared_memory: int = 1024
max_workers: int = os.cpu_count() * 2
repair: bool = False
repair_mode: bool = False
no_install: bool = False
ignore_space_req: bool = False
ignore_space: bool = False
force: bool = False
sdl_list: list = field(default_factory=lambda: [""])
update: bool = False
silent: bool = False
platform: str = ""
dl_optimizations: bool = False
order_opt: bool = False
overlay: bool = False
create_shortcut: bool = True
install_preqs: bool = pf.system() == "Windows"