mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Drag profile into Cura; added importProfile(s), exportProfile to ContainerManager. CURA-787
This commit is contained in:
parent
d4f7a0e16c
commit
a23a922eec
3 changed files with 75 additions and 8 deletions
|
|
@ -246,15 +246,35 @@ UM.MainWindow
|
|||
{
|
||||
if(drop.urls.length > 0)
|
||||
{
|
||||
// Import models
|
||||
for(var i in drop.urls)
|
||||
{
|
||||
UM.MeshFileHandler.readLocalFile(drop.urls[i]);
|
||||
if (i == drop.urls.length - 1)
|
||||
{
|
||||
var meshName = backgroundItem.getMeshName(drop.urls[i].toString())
|
||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
||||
// There is no endsWith in this version of JS...
|
||||
if ((drop.urls[i].length <= 12) || (drop.urls[i].substring(drop.urls[i].length-12) !== ".curaprofile")) {
|
||||
// Drop an object
|
||||
UM.MeshFileHandler.readLocalFile(drop.urls[i]);
|
||||
if (i == drop.urls.length - 1)
|
||||
{
|
||||
var meshName = backgroundItem.getMeshName(drop.urls[i].toString());
|
||||
backgroundItem.hasMesh(decodeURIComponent(meshName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Import profiles
|
||||
var import_result = Cura.ContainerManager.importProfiles(drop.urls);
|
||||
if (import_result.message !== "") {
|
||||
messageDialog.text = import_result.message
|
||||
if(import_result.status == "ok")
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Information
|
||||
}
|
||||
else
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Critical
|
||||
}
|
||||
messageDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue