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
|
isMenu: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialogs.FileDialog {
|
Component.onCompleted: {
|
||||||
id: modFileDialog
|
QModInstaller.statusChanged.connect(installerStatusChanged);
|
||||||
|
QModInstaller.finishedInstall.connect(installDialog.close);
|
||||||
|
}
|
||||||
|
|
||||||
nameFilters: ["Project DIVA Mods (*.zip *.7z *.rar)"]
|
function installerStatusChanged() {
|
||||||
selectedNameFilter.index: 0
|
|
||||||
|
|
||||||
onAccepted: {
|
|
||||||
QModInstaller.statusChanged.connect(() => {
|
|
||||||
switch (QModInstaller.status) {
|
switch (QModInstaller.status) {
|
||||||
case "initialized":
|
case "initialized":
|
||||||
if (QModInstaller.installed) {
|
if (QModInstaller.installed) {
|
||||||
|
|
@ -47,7 +45,6 @@ Kirigami.ApplicationWindow {
|
||||||
installInfoDialog.open();
|
installInfoDialog.open();
|
||||||
} else {
|
} else {
|
||||||
installDialog.open();
|
installDialog.open();
|
||||||
QModInstaller.finishedInstall.connect(() => installDialog.close())
|
|
||||||
QModInstaller.install();
|
QModInstaller.install();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -60,7 +57,15 @@ Kirigami.ApplicationWindow {
|
||||||
installInfoDialog.open();
|
installInfoDialog.open();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
Dialogs.FileDialog {
|
||||||
|
id: modFileDialog
|
||||||
|
|
||||||
|
nameFilters: ["Project DIVA Mods (*.zip *.7z *.rar)"]
|
||||||
|
selectedNameFilter.index: 0
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
QModInstaller.modPath = selectedFile;
|
QModInstaller.modPath = selectedFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue