QModInstaller: actually install mod
This commit is contained in:
parent
9ed941b37e
commit
fa8421ff42
2 changed files with 8 additions and 6 deletions
|
|
@ -47,6 +47,8 @@ Kirigami.ApplicationWindow {
|
||||||
installInfoDialog.open();
|
installInfoDialog.open();
|
||||||
} else {
|
} else {
|
||||||
installDialog.open();
|
installDialog.open();
|
||||||
|
QModInstaller.finishedInstall.connect(() => installDialog.close())
|
||||||
|
QModInstaller.install();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "NoModExceptionError":
|
case "NoModExceptionError":
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import time
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
|
@ -68,21 +67,22 @@ class QModInstaller(QObject):
|
||||||
|
|
||||||
@Slot()
|
@Slot()
|
||||||
def install(self) -> None:
|
def install(self) -> None:
|
||||||
worker = InstallWorker(InstallWorkerSignals())
|
worker = InstallWorker(InstallWorkerSignals(), self.__mod_installer)
|
||||||
# worker.signals.installed.connect(self.mod_finished_installing)
|
|
||||||
worker.signals.installed.connect(self.finished_install)
|
worker.signals.installed.connect(self.finished_install)
|
||||||
QThreadPool.globalInstance().start(worker)
|
QThreadPool.globalInstance().start(worker)
|
||||||
|
|
||||||
|
|
||||||
class InstallWorker(QRunnable):
|
class InstallWorker(QRunnable):
|
||||||
def __init__(self, signals) -> None:
|
__installer: ModInstaller
|
||||||
|
|
||||||
|
def __init__(self, signals, installer: ModInstaller) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.signals = signals
|
self.signals = signals
|
||||||
|
self.__installer = installer
|
||||||
|
|
||||||
# @Slot()
|
# @Slot()
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
# Fake installing for now
|
self.__installer.install()
|
||||||
time.sleep(4)
|
|
||||||
self.signals.installed.emit()
|
self.signals.installed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue