mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Remove unused hasMesh signal
This is logic that shouldn't be in QML anyway. It's not used by anything at this point. Let's remove it. Contributes to issue CURA-7868.
This commit is contained in:
parent
e5038ab46d
commit
4b375ce2fe
4 changed files with 12 additions and 33 deletions
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2020 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
|
@ -149,15 +149,6 @@ UM.MainWindow
|
||||||
id: backgroundItem
|
id: backgroundItem
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
signal hasMesh(string name) //this signal sends the filebase name so it can be used for the JobSpecs.qml
|
|
||||||
function getMeshName(path)
|
|
||||||
{
|
|
||||||
//takes the path the complete path of the meshname and returns only the filebase
|
|
||||||
var fileName = path.slice(path.lastIndexOf("/") + 1)
|
|
||||||
var fileBase = fileName.slice(0, fileName.indexOf("."))
|
|
||||||
return fileBase
|
|
||||||
}
|
|
||||||
|
|
||||||
//DeleteSelection on the keypress backspace event
|
//DeleteSelection on the keypress backspace event
|
||||||
Keys.onPressed:
|
Keys.onPressed:
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2015 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
@ -32,30 +32,24 @@ UM.Dialog
|
||||||
|
|
||||||
// load the entire project
|
// load the entire project
|
||||||
function loadProjectFile() {
|
function loadProjectFile() {
|
||||||
|
|
||||||
// update preference
|
// update preference
|
||||||
if (rememberChoiceCheckBox.checked) {
|
if (rememberChoiceCheckBox.checked) {
|
||||||
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_project")
|
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_project")
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.WorkspaceFileHandler.readLocalFile(base.fileUrl)
|
UM.WorkspaceFileHandler.readLocalFile(base.fileUrl)
|
||||||
var meshName = backgroundItem.getMeshName(base.fileUrl.toString())
|
|
||||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
|
||||||
|
|
||||||
base.hide()
|
base.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
// load the project file as separated models
|
// load the project file as separated models
|
||||||
function loadModelFiles() {
|
function loadModelFiles() {
|
||||||
|
|
||||||
// update preference
|
// update preference
|
||||||
if (rememberChoiceCheckBox.checked) {
|
if (rememberChoiceCheckBox.checked) {
|
||||||
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_model")
|
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_model")
|
||||||
}
|
}
|
||||||
|
|
||||||
CuraApplication.readLocalFile(base.fileUrl, "open_as_model")
|
CuraApplication.readLocalFile(base.fileUrl, "open_as_model")
|
||||||
var meshName = backgroundItem.getMeshName(base.fileUrl.toString())
|
|
||||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
|
||||||
|
|
||||||
base.hide()
|
base.hide()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2017 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
@ -33,9 +33,6 @@ UM.Dialog
|
||||||
function loadProjectFile(projectFile)
|
function loadProjectFile(projectFile)
|
||||||
{
|
{
|
||||||
UM.WorkspaceFileHandler.readLocalFile(projectFile);
|
UM.WorkspaceFileHandler.readLocalFile(projectFile);
|
||||||
|
|
||||||
var meshName = backgroundItem.getMeshName(projectFile.toString());
|
|
||||||
backgroundItem.hasMesh(decodeURIComponent(meshName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadModelFiles(fileUrls)
|
function loadModelFiles(fileUrls)
|
||||||
|
@ -44,9 +41,6 @@ UM.Dialog
|
||||||
{
|
{
|
||||||
CuraApplication.readLocalFile(fileUrls[i], "open_as_model");
|
CuraApplication.readLocalFile(fileUrls[i], "open_as_model");
|
||||||
}
|
}
|
||||||
|
|
||||||
var meshName = backgroundItem.getMeshName(fileUrls[0].toString());
|
|
||||||
backgroundItem.hasMesh(decodeURIComponent(meshName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
Column
|
||||||
|
@ -108,5 +102,11 @@ UM.Dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.I18nCatalog
|
||||||
|
{
|
||||||
|
id: catalog
|
||||||
|
name: "cura"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2016 Ultimaker B.V.
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
|
@ -27,13 +27,7 @@ Menu
|
||||||
var path = decodeURIComponent(modelData.toString())
|
var path = decodeURIComponent(modelData.toString())
|
||||||
return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1);
|
return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1);
|
||||||
}
|
}
|
||||||
onTriggered:
|
onTriggered: CuraApplication.readLocalFile(modelData)
|
||||||
{
|
|
||||||
CuraApplication.readLocalFile(modelData);
|
|
||||||
|
|
||||||
var meshName = backgroundItem.getMeshName(modelData.toString())
|
|
||||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
onObjectAdded: menu.insertItem(index, object)
|
onObjectAdded: menu.insertItem(index, object)
|
||||||
onObjectRemoved: menu.removeItem(object)
|
onObjectRemoved: menu.removeItem(object)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue