Open separate license dialog with each plugin install

Previously the license dialog was instanciated once and re-used for each
install. As the dialog is only shown after the plugin is downloaded it
was possible to click install for multiple plugins. Plugins that finish
downloading later would override the dialog of earlier downloaded
plugins. Clicking "accept" would then only install the latest downloaded
plugin.

Now for each install a separate dialog is shown. Accepting the license
agreement would only install the recently accepted plugin.

Note: in the current form the license agreement does not show any
identification to what plugin triggered the dialog. As multiple dialogs
can be shown at once this might be unclear.

cura 8587
This commit is contained in:
casper 2021-12-06 19:34:02 +01:00
parent 20fb08145d
commit 71a43060a6
3 changed files with 35 additions and 61 deletions

View file

@ -63,7 +63,7 @@ UM.Dialog
Layout.fillHeight: true
anchors.topMargin: UM.Theme.getSize("default_margin").height
textArea.text: licenseModel.licenseText
textArea.text: licenseContent
textArea.readOnly: true
}
@ -73,7 +73,7 @@ UM.Dialog
Cura.PrimaryButton
{
text: catalog.i18nc("@button", "Accept")
onClicked: { handler.onLicenseAccepted() }
onClicked: { handler.onLicenseAccepted(packageId) }
}
]
@ -82,7 +82,7 @@ UM.Dialog
Cura.SecondaryButton
{
text: catalog.i18nc("@button", "Decline")
onClicked: { handler.onLicenseDeclined() }
onClicked: { handler.onLicenseDeclined(packageId) }
}
]
}