diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 339dac3382..bc77196b90 100755 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -260,6 +260,32 @@ 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) + { + if(PluginRegistry.isPluginFile(drop.urls[0])) + { + // Try to install plugin & close. + var result = PluginRegistry.installPlugin(drop.urls[0]); + pluginInstallDialog.text = result.message + if(result.status == "ok") + { + pluginInstallDialog.icon = StandardIcon.Information + } + else if(result.status == "duplicate") + { + pluginInstallDialog.icon = StandardIcon.Warning + } + else + { + pluginInstallDialog.icon = StandardIcon.Critical + } + pluginInstallDialog.open(); + return; + } + + } + openDialog.handleOpenFileUrls(drop.urls); } } @@ -687,6 +713,14 @@ UM.MainWindow } } + MessageDialog + { + id: pluginInstallDialog + title: catalog.i18nc("@window:title", "Install Plugin"); + standardButtons: StandardButton.Ok + modality: Qt.ApplicationModal + } + MessageDialog { id: infoMultipleFilesWithGcodeDialog title: catalog.i18nc("@title:window", "Open File(s)")