mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 22:35:03 -06:00
Enabled drag-n-drop for curapackages
This commit is contained in:
parent
fea37b52be
commit
eecbe20830
2 changed files with 31 additions and 1 deletions
|
@ -323,6 +323,21 @@ UM.MainWindow
|
|||
{
|
||||
if (drop.urls.length > 0)
|
||||
{
|
||||
// As the drop area also supports plugins, first check if it's a plugin that was dropped.
|
||||
if (drop.urls.length == 1)
|
||||
{
|
||||
var filename = drop.urls[0];
|
||||
if (filename.endsWith(".curapackage"))
|
||||
{
|
||||
// Try to install plugin & close.
|
||||
CuraApplication.getCuraPackageManager().installPackageViaDragAndDrop(filename);
|
||||
packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting.");
|
||||
packageInstallDialog.icon = StandardIcon.Information;
|
||||
packageInstallDialog.open();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
openDialog.handleOpenFileUrls(drop.urls);
|
||||
}
|
||||
}
|
||||
|
@ -789,6 +804,14 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: packageInstallDialog
|
||||
title: catalog.i18nc("@window:title", "Install Package");
|
||||
standardButtons: StandardButton.Ok
|
||||
modality: Qt.ApplicationModal
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
id: infoMultipleFilesWithGcodeDialog
|
||||
title: catalog.i18nc("@title:window", "Open File(s)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue