mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:08:58 +08:00
Just a little cleanup
so it is more clear when JobSpecs uses the fileBaseName from cura_app.py and when it uses fhe fileBaseName from cura.qml Contributes to #CURA-707 Contributes to #CURA-620 #591
This commit is contained in:
parent
a1be5a080f
commit
8af00b4195
@ -14,7 +14,6 @@ UM.MainWindow
|
|||||||
id: base
|
id: base
|
||||||
//: Cura application window title
|
//: Cura application window title
|
||||||
title: catalog.i18nc("@title:window","Cura");
|
title: catalog.i18nc("@title:window","Cura");
|
||||||
|
|
||||||
viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
|
viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
|
||||||
|
|
||||||
Item
|
Item
|
||||||
@ -23,6 +22,14 @@ UM.MainWindow
|
|||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||||
|
|
||||||
|
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.lastIndexOf("."))
|
||||||
|
return fileBase
|
||||||
|
}
|
||||||
|
|
||||||
//DeleteSelection on the keypress backspace event
|
//DeleteSelection on the keypress backspace event
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if (event.key == Qt.Key_Backspace)
|
if (event.key == Qt.Key_Backspace)
|
||||||
@ -34,7 +41,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UM.ApplicationMenu
|
UM.ApplicationMenu
|
||||||
{
|
{
|
||||||
id: menu
|
id: menu
|
||||||
@ -70,7 +76,8 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
UM.MeshFileHandler.readLocalFile(modelData);
|
UM.MeshFileHandler.readLocalFile(modelData);
|
||||||
openDialog.sendMeshName(modelData.toString())
|
var meshName = backgroundItem.getMeshName(modelData.toString())
|
||||||
|
backgroundItem.hasMesh(meshName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onObjectAdded: recentFilesMenu.insertItem(index, object)
|
onObjectAdded: recentFilesMenu.insertItem(index, object)
|
||||||
@ -303,7 +310,8 @@ UM.MainWindow
|
|||||||
UM.MeshFileHandler.readLocalFile(drop.urls[i]);
|
UM.MeshFileHandler.readLocalFile(drop.urls[i]);
|
||||||
if (i == drop.urls.length - 1)
|
if (i == drop.urls.length - 1)
|
||||||
{
|
{
|
||||||
openDialog.sendMeshName(drop.urls[i].toString())
|
var meshName = backgroundItem.getMeshName(drop.urls[i].toString())
|
||||||
|
backgroundItem.hasMesh(meshName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,6 +320,7 @@ UM.MainWindow
|
|||||||
|
|
||||||
JobSpecs
|
JobSpecs
|
||||||
{
|
{
|
||||||
|
id: jobSpecs
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
bottom: parent.bottom;
|
bottom: parent.bottom;
|
||||||
@ -636,14 +645,6 @@ UM.MainWindow
|
|||||||
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
|
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
|
||||||
//TODO: Support multiple file selection, workaround bug in KDE file dialog
|
//TODO: Support multiple file selection, workaround bug in KDE file dialog
|
||||||
//selectMultiple: true
|
//selectMultiple: true
|
||||||
|
|
||||||
signal hasMesh(string name)
|
|
||||||
|
|
||||||
function sendMeshName(path){
|
|
||||||
var fileName = path.slice(path.lastIndexOf("/") + 1)
|
|
||||||
var fileBase = fileName.slice(0, fileName.lastIndexOf("."))
|
|
||||||
openDialog.hasMesh(fileBase)
|
|
||||||
}
|
|
||||||
nameFilters: UM.MeshFileHandler.supportedReadFileTypes;
|
nameFilters: UM.MeshFileHandler.supportedReadFileTypes;
|
||||||
|
|
||||||
onAccepted:
|
onAccepted:
|
||||||
@ -654,7 +655,8 @@ UM.MainWindow
|
|||||||
folder = f;
|
folder = f;
|
||||||
|
|
||||||
UM.MeshFileHandler.readLocalFile(fileUrl)
|
UM.MeshFileHandler.readLocalFile(fileUrl)
|
||||||
openDialog.sendMeshName(fileUrl.toString())
|
var meshName = backgroundItem.getMeshName(fileUrl.toString())
|
||||||
|
backgroundItem.hasMesh(meshName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user