2021-03-25 23:49:05 +13:00
|
|
|
from logging import getLogger
|
|
|
|
|
|
|
|
from PyQt5.QtCore import pyqtSignal
|
2021-03-27 01:29:26 +13:00
|
|
|
from PyQt5.QtWidgets import QWidget, QGroupBox
|
2021-03-25 23:49:05 +13:00
|
|
|
|
2021-04-08 08:39:23 +12:00
|
|
|
from rare.components.dialogs.install_dialog import InstallDialog
|
|
|
|
from rare.utils.models import InstallOptions
|
2021-03-25 23:49:05 +13:00
|
|
|
|
|
|
|
logger = getLogger("Uninstalled")
|
|
|
|
|
|
|
|
|
2021-03-27 01:29:26 +13:00
|
|
|
class BaseUninstalledWidget(QGroupBox):
|
2021-03-25 23:49:05 +13:00
|
|
|
install_game = pyqtSignal(InstallOptions)
|
|
|
|
|
|
|
|
def __init__(self, game, core, pixmap):
|
|
|
|
super(BaseUninstalledWidget, self).__init__()
|
|
|
|
self.game = game
|
|
|
|
self.core = core
|
|
|
|
self.pixmap = pixmap
|
2021-04-08 04:17:56 +12:00
|
|
|
self.installing = False
|
2021-03-25 23:49:05 +13:00
|
|
|
|
2021-03-27 01:29:26 +13:00
|
|
|
self.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
2021-03-25 23:49:05 +13:00
|
|
|
def install(self):
|
2021-04-05 21:53:33 +12:00
|
|
|
infos = InstallDialog(self.game.app_name, self.core).get_information()
|
2021-03-25 23:49:05 +13:00
|
|
|
if infos != 0:
|
2021-04-05 21:53:33 +12:00
|
|
|
path, max_workers, force, ignore_free_space = infos
|
|
|
|
self.install_game.emit(InstallOptions(app_name=self.game.app_name, max_workers=max_workers, path=path, force=force, ignore_free_space=ignore_free_space))
|