Qml/Main: clean up mod install logic
This commit is contained in:
parent
fa8421ff42
commit
8be97c1f5b
1 changed files with 27 additions and 22 deletions
|
|
@ -32,14 +32,12 @@ Kirigami.ApplicationWindow {
|
|||
isMenu: true
|
||||
}
|
||||
|
||||
Dialogs.FileDialog {
|
||||
id: modFileDialog
|
||||
Component.onCompleted: {
|
||||
QModInstaller.statusChanged.connect(installerStatusChanged);
|
||||
QModInstaller.finishedInstall.connect(installDialog.close);
|
||||
}
|
||||
|
||||
nameFilters: ["Project DIVA Mods (*.zip *.7z *.rar)"]
|
||||
selectedNameFilter.index: 0
|
||||
|
||||
onAccepted: {
|
||||
QModInstaller.statusChanged.connect(() => {
|
||||
function installerStatusChanged() {
|
||||
switch (QModInstaller.status) {
|
||||
case "initialized":
|
||||
if (QModInstaller.installed) {
|
||||
|
|
@ -47,7 +45,6 @@ Kirigami.ApplicationWindow {
|
|||
installInfoDialog.open();
|
||||
} else {
|
||||
installDialog.open();
|
||||
QModInstaller.finishedInstall.connect(() => installDialog.close())
|
||||
QModInstaller.install();
|
||||
}
|
||||
break;
|
||||
|
|
@ -60,7 +57,15 @@ Kirigami.ApplicationWindow {
|
|||
installInfoDialog.open();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Dialogs.FileDialog {
|
||||
id: modFileDialog
|
||||
|
||||
nameFilters: ["Project DIVA Mods (*.zip *.7z *.rar)"]
|
||||
selectedNameFilter.index: 0
|
||||
|
||||
onAccepted: {
|
||||
QModInstaller.modPath = selectedFile;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue