15.10 restyling Sava-button

solves problem with the buttonsize and adds a filename to the textfield

Contributes to: issue CURA-60
This commit is contained in:
Tamara Hogenhout 2015-09-02 14:30:43 +02:00
parent 3088579aad
commit 02206c5540
2 changed files with 66 additions and 18 deletions

View file

@ -16,6 +16,8 @@ UM.MainWindow
//: Cura application window title
title: catalog.i18nc("@title:window","Cura");
Item
{
id: backgroundItem;
@ -32,7 +34,9 @@ UM.MainWindow
//: File menu
title: catalog.i18nc("@title:menu","&File");
MenuItem { action: actions.open; }
MenuItem {
action: actions.open;
}
Menu
{
@ -52,7 +56,10 @@ UM.MainWindow
var path = modelData.toString()
return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1);
}
onTriggered: UM.MeshFileHandler.readLocalFile(modelData);
onTriggered: {
UM.MeshFileHandler.readLocalFile(modelData);
openDialog.sendMeshName(modelData.toString())
}
}
onObjectAdded: recentFilesMenu.insertItem(index, object)
onObjectRemoved: recentFilesMenu.removeItem(object)
@ -541,11 +548,19 @@ UM.MainWindow
//TODO: Support multiple file selection, workaround bug in KDE file dialog
//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;
onAccepted:
{
UM.MeshFileHandler.readLocalFile(fileUrl)
openDialog.sendMeshName(fileUrl.toString())
}
}