mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-03 15:51:12 -07:00
Merge branch 'master' into feature_local_container_server
Contributes to issue CURA-4243.
This commit is contained in:
commit
dad99f5292
542 changed files with 35309 additions and 16367 deletions
|
|
@ -132,6 +132,7 @@ UM.Dialog
|
|||
projectsModel.append({ name:"PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||
projectsModel.append({ name:"python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||
projectsModel.append({ name:"Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||
projectsModel.append({ name:"Requests", description: catalog.i18nc("@Label", "Python HTTP library"), license: "GPL", url: "http://docs.python-requests.org" });
|
||||
|
||||
projectsModel.append({ name:"Open Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://fonts.google.com/specimen/Open+Sans" });
|
||||
projectsModel.append({ name:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||
|
|
|
|||
|
|
@ -63,11 +63,12 @@ UM.Dialog
|
|||
anchors.fill: parent
|
||||
anchors.leftMargin: 20 * screenScaleFactor
|
||||
anchors.rightMargin: 20 * screenScaleFactor
|
||||
anchors.bottomMargin: 20 * screenScaleFactor
|
||||
anchors.bottomMargin: 10 * screenScaleFactor
|
||||
spacing: 10 * screenScaleFactor
|
||||
|
||||
Label
|
||||
{
|
||||
id: questionText
|
||||
text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?")
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
|
@ -80,11 +81,18 @@ UM.Dialog
|
|||
id: rememberChoiceCheckBox
|
||||
text: catalog.i18nc("@text:window", "Remember my choice")
|
||||
checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
|
||||
style: CheckBoxStyle {
|
||||
label: Label {
|
||||
text: control.text
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons
|
||||
Item
|
||||
{
|
||||
id: buttonBar
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: childrenRect.height
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ UM.MainWindow
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: ExtruderManager.setActiveExtruderIndex(model.index) }
|
||||
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) }
|
||||
}
|
||||
onObjectAdded: settingsMenu.insertItem(index, object)
|
||||
onObjectRemoved: settingsMenu.removeItem(object)
|
||||
|
|
@ -894,6 +894,11 @@ UM.MainWindow
|
|||
if(!base.visible)
|
||||
{
|
||||
base.visible = true;
|
||||
}
|
||||
|
||||
// check later if the user agreement dialog has been closed
|
||||
if (CuraApplication.needToShowUserAgreement)
|
||||
{
|
||||
restart();
|
||||
}
|
||||
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Button
|
|||
style: UM.Theme.styles.tool_button;
|
||||
iconSource: UM.Theme.getIcon("extruder_button")
|
||||
|
||||
checked: ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
|
||||
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
|
||||
enabled: UM.Selection.hasSelection
|
||||
|
||||
property color customColor: base.hovered ? UM.Theme.getColor("button_hover") : UM.Theme.getColor("button");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ Item {
|
|||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
||||
height: childrenRect.height
|
||||
width: childrenRect.width
|
||||
|
||||
Connections
|
||||
{
|
||||
|
|
@ -95,7 +94,7 @@ Item {
|
|||
{
|
||||
id: printJobTextfield
|
||||
anchors.right: printJobPencilIcon.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
|
||||
anchors.rightMargin: Math.floor(UM.Theme.getSize("default_margin").width/2)
|
||||
height: UM.Theme.getSize("jobspecs_line").height
|
||||
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
|
||||
maximumLength: 120
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Menu
|
|||
visible: base.shouldShowExtruders
|
||||
enabled: UM.Selection.hasSelection
|
||||
checkable: true
|
||||
checked: ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1
|
||||
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1
|
||||
onTriggered: CuraActions.setExtruderForSelection(model.id)
|
||||
shortcut: "Ctrl+" + (model.index + 1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,20 @@ Menu
|
|||
|
||||
property int extruderIndex: 0
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool isClusterPrinter:
|
||||
{
|
||||
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||
// This is not a cluster printer or the cluster it is just one printer
|
||||
if(clusterSize == undefined || clusterSize == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
|
|
@ -29,14 +43,14 @@ Menu
|
|||
id: automaticMaterial
|
||||
text:
|
||||
{
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex)
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex && !isClusterPrinter)
|
||||
{
|
||||
var materialName = Cura.MachineManager.printerOutputDevices[0].materialNames[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the automatically selected material", "Automatic: %1").arg(materialName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex && !isClusterPrinter
|
||||
onTriggered:
|
||||
{
|
||||
var materialId = Cura.MachineManager.printerOutputDevices[0].materialIds[extruderIndex];
|
||||
|
|
@ -64,16 +78,16 @@ Menu
|
|||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
|
||||
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
Cura.MachineManager.setActiveMaterial(model.id);
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
|
|
@ -107,16 +121,16 @@ Menu
|
|||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
|
||||
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
Cura.MachineManager.setActiveMaterial(model.id);
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
}
|
||||
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
|
||||
|
|
|
|||
|
|
@ -14,31 +14,45 @@ Menu
|
|||
|
||||
property int extruderIndex: 0
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool isClusterPrinter:
|
||||
{
|
||||
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||
// This is not a cluster printer or the cluster it is just one printer
|
||||
if(clusterSize == undefined || clusterSize == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
id: automaticNozzle
|
||||
text:
|
||||
{
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex)
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex && !isClusterPrinter)
|
||||
{
|
||||
var nozzleName = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the nozzle currently loaded in the printer", "Automatic: %1").arg(nozzleName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex && !isClusterPrinter
|
||||
onTriggered:
|
||||
{
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var hotendId = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
|
||||
var itemIndex = nozzleInstantiator.model.find("name", hotendId);
|
||||
if(itemIndex > -1)
|
||||
{
|
||||
Cura.MachineManager.setActiveVariant(nozzleInstantiator.model.getItem(itemIndex).id);
|
||||
}
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,14 +75,14 @@ Menu
|
|||
MenuItem {
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveVariantIds[ExtruderManager.extruderIds[extruderIndex]]
|
||||
checked: model.id == Cura.MachineManager.allActiveVariantIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
Cura.MachineManager.setActiveVariant(model.id);
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ Menu
|
|||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name + " - " + model.layer_height
|
||||
text: (model.layer_height != "") ? model.name + " - " + model.layer_height : model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
checked: Cura.MachineManager.activeQualityId == model.id
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
visible: model.available
|
||||
|
|
@ -41,7 +41,7 @@ Menu
|
|||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name + " - " + model.layer_height
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityChangesId == model.id
|
||||
exclusiveGroup: group
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ UM.PreferencesPage
|
|||
append({ text: "Nederlands", code: "nl_NL" })
|
||||
append({ text: "Polski", code: "pl_PL" })
|
||||
append({ text: "Português do Brasil", code: "pt_BR" })
|
||||
append({ text: "Русский", code: "ru_RU" })
|
||||
//Russian is disabled for being incomplete: append({ text: "Русский", code: "ru_RU" })
|
||||
append({ text: "Türkçe", code: "tr_TR" })
|
||||
append({ text: "简体中文", code: "zh_CN" })
|
||||
|
||||
|
|
|
|||
|
|
@ -322,7 +322,6 @@ UM.ManagementPage
|
|||
{
|
||||
messageDialog.icon = StandardIcon.Information
|
||||
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(fileUrl)
|
||||
currentItem = base.model.getItem(base.objectList.currentIndex)
|
||||
}
|
||||
else if(result.status == "duplicate")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ UM.ManagementPage
|
|||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
currentIndex: ExtruderManager.extruderCount > 0 ? ExtruderManager.activeExtruderIndex + 1 : 0
|
||||
currentIndex: Cura.ExtruderManager.extruderCount > 0 ? Cura.ExtruderManager.activeExtruderIndex + 1 : 0
|
||||
|
||||
ProfileTab
|
||||
{
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ Column
|
|||
|
||||
Label //Extruder name.
|
||||
{
|
||||
text: ExtruderManager.getExtruderName(index) != "" ? ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Extruder")
|
||||
text: Cura.ExtruderManager.getExtruderName(index) != "" ? Cura.ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Extruder")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.left: parent.left
|
||||
|
|
@ -677,6 +677,341 @@ Column
|
|||
watchedProperties: ["value"]
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
visible: connectedPrinter != null ? connectedPrinter.canControlManually : false
|
||||
enabled:
|
||||
{
|
||||
if (connectedPrinter == null)
|
||||
{
|
||||
return false; //Can't control the printer if not connected.
|
||||
}
|
||||
if (!connectedPrinter.acceptsCommands)
|
||||
{
|
||||
return false; //Not allowed to do anything.
|
||||
}
|
||||
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "pausing" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
|
||||
{
|
||||
return false; //Printer is in a state where it can't react to manual control
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorSection
|
||||
property string label: catalog.i18nc("@label", "Printer control")
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Jog Position")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
GridLayout
|
||||
{
|
||||
columns: 3
|
||||
rows: 4
|
||||
rowSpacing: UM.Theme.getSize("default_lining").width
|
||||
columnSpacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "X/Y")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 2
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
Layout.row: 2
|
||||
Layout.column: 2
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
iconSource: UM.Theme.getIcon("arrow_top");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(0, distancesRow.currentDistance, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
Layout.row: 3
|
||||
Layout.column: 1
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
iconSource: UM.Theme.getIcon("arrow_left");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(-distancesRow.currentDistance, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
Layout.row: 3
|
||||
Layout.column: 3
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
iconSource: UM.Theme.getIcon("arrow_right");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(distancesRow.currentDistance, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
Layout.row: 4
|
||||
Layout.column: 2
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
iconSource: UM.Theme.getIcon("arrow_bottom");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(0, -distancesRow.currentDistance, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
Layout.row: 3
|
||||
Layout.column: 2
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
iconSource: UM.Theme.getIcon("home");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.homeHead()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Column
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Z")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
width: UM.Theme.getSize("section").height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("arrow_top");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(0, 0, distancesRow.currentDistance)
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("home");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.homeBed()
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("arrow_bottom");
|
||||
style: monitorButtonStyle
|
||||
width: height
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
|
||||
onClicked:
|
||||
{
|
||||
connectedPrinter.moveHead(0, 0, -distancesRow.currentDistance)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
id: distancesRow
|
||||
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
property real currentDistance: 10
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Jog Distance")
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
Repeater
|
||||
{
|
||||
model: distancesModel
|
||||
delegate: Button
|
||||
{
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: height + UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: model.label
|
||||
exclusiveGroup: distanceGroup
|
||||
checkable: true
|
||||
checked: distancesRow.currentDistance == model.value
|
||||
onClicked: distancesRow.currentDistance = model.value
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Rectangle {
|
||||
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
}
|
||||
else if (control.checked || control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
}
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else if (control.checked || control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
}
|
||||
else if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: UM.Theme.getSize("default_lining").width * 2
|
||||
anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
else if (control.checked || control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
}
|
||||
else if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
}
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
text: control.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
id: distancesModel
|
||||
ListElement { label: "0.1"; value: 0.1 }
|
||||
ListElement { label: "1"; value: 1 }
|
||||
ListElement { label: "10"; value: 10 }
|
||||
ListElement { label: "100"; value: 100 }
|
||||
}
|
||||
ExclusiveGroup { id: distanceGroup }
|
||||
}
|
||||
|
||||
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorSection
|
||||
|
|
@ -754,4 +1089,86 @@ Column
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: monitorButtonStyle
|
||||
|
||||
ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_border");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_border");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_border");
|
||||
}
|
||||
return UM.Theme.getColor("action_button_border");
|
||||
}
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered");
|
||||
}
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color
|
||||
{
|
||||
ColorAnimation
|
||||
{
|
||||
duration: 50
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(control.width / 2)
|
||||
height: Math.floor(control.height / 2)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
else if(control.pressed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_active_text");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_hovered_text");
|
||||
}
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
source: control.iconSource
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,8 @@ Item {
|
|||
property var backend: CuraApplication.getBackend();
|
||||
property bool activity: CuraApplication.platformActivity;
|
||||
|
||||
property alias buttonRowWidth: saveRow.width
|
||||
|
||||
property string fileBaseName
|
||||
property string statusText:
|
||||
{
|
||||
|
|
@ -43,6 +45,14 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
function sliceOrStopSlicing() {
|
||||
if ([1, 5].indexOf(UM.Backend.state) != -1) {
|
||||
backend.forceSlice();
|
||||
} else {
|
||||
backend.stopSlicing();
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: statusLabel
|
||||
width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width
|
||||
|
|
@ -84,22 +94,39 @@ Item {
|
|||
if (saveToButton.enabled) {
|
||||
saveToButton.clicked();
|
||||
}
|
||||
// prepare button
|
||||
if (prepareButton.enabled) {
|
||||
sliceOrStopSlicing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: saveRow
|
||||
width: base.width
|
||||
width: {
|
||||
// using childrenRect.width directly causes a binding loop, because setting the width affects the childrenRect
|
||||
var children_width = UM.Theme.getSize("default_margin").width;
|
||||
for (var index in children)
|
||||
{
|
||||
var child = children[index];
|
||||
if(child.visible)
|
||||
{
|
||||
children_width += child.width + child.anchors.rightMargin;
|
||||
}
|
||||
}
|
||||
return Math.min(children_width, base.width - UM.Theme.getSize("sidebar_margin").width);
|
||||
}
|
||||
height: saveToButton.height
|
||||
anchors.top: progressBar.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
|
||||
anchors.right: parent.right
|
||||
clip: true
|
||||
|
||||
Row {
|
||||
id: additionalComponentsRow
|
||||
anchors.top: parent.top
|
||||
anchors.right: saveToButton.visible ? saveToButton.left : parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
|
@ -130,7 +157,7 @@ Item {
|
|||
Button {
|
||||
id: prepareButton
|
||||
|
||||
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
|
||||
tooltip: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
|
||||
// 1 = not started, 2 = Processing
|
||||
enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||
visible: {
|
||||
|
|
@ -147,11 +174,7 @@ Item {
|
|||
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
||||
onClicked:
|
||||
{
|
||||
if ([1, 5].indexOf(UM.Backend.state) != -1) {
|
||||
backend.forceSlice();
|
||||
} else {
|
||||
backend.stopSlicing();
|
||||
}
|
||||
sliceOrStopSlicing();
|
||||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ Item {
|
|||
var tooltipText = catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders") + ".";
|
||||
if ((resolve != "None") && (stackLevel != 0)) {
|
||||
// We come here if a setting has a resolve and the setting is not manually edited.
|
||||
tooltipText += " " + catalog.i18nc("@label", "The value is resolved from per-extruder values ") + "[" + ExtruderManager.getInstanceExtruderValues(definition.key) + "].";
|
||||
tooltipText += " " + catalog.i18nc("@label", "The value is resolved from per-extruder values ") + "[" + Cura.ExtruderManager.getInstanceExtruderValues(definition.key) + "].";
|
||||
}
|
||||
base.showTooltip(tooltipText);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
|
|
@ -11,6 +11,14 @@ SettingItem
|
|||
id: base
|
||||
property var focusItem: input
|
||||
|
||||
property string textBeforeEdit
|
||||
property bool textHasChanged
|
||||
onFocusReceived:
|
||||
{
|
||||
textHasChanged = false;
|
||||
textBeforeEdit = focusItem.text;
|
||||
}
|
||||
|
||||
contents: Rectangle
|
||||
{
|
||||
id: control
|
||||
|
|
@ -100,6 +108,7 @@ SettingItem
|
|||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
right: parent.right
|
||||
rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
renderType: Text.NativeRendering
|
||||
|
|
@ -115,12 +124,22 @@ SettingItem
|
|||
|
||||
Keys.onReleased:
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
if (text != textBeforeEdit)
|
||||
{
|
||||
textHasChanged = true;
|
||||
}
|
||||
if (textHasChanged)
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
}
|
||||
|
||||
onEditingFinished:
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
if (textHasChanged)
|
||||
{
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
}
|
||||
|
||||
onActiveFocusChanged:
|
||||
|
|
@ -136,7 +155,8 @@ SettingItem
|
|||
|
||||
selectByMouse: true;
|
||||
|
||||
maximumLength: (definition.type == "[int]") ? 20 : (definition.type == "str") ? -1 : 10;
|
||||
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10;
|
||||
clip: true; //Hide any text that exceeds the width of the text box.
|
||||
|
||||
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry
|
||||
|
||||
|
|
|
|||
|
|
@ -51,27 +51,34 @@ Item
|
|||
{
|
||||
id: globalProfileSelection
|
||||
|
||||
text: {
|
||||
var result = Cura.MachineManager.activeQualityName;
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">";
|
||||
result += " - ";
|
||||
result += Cura.MachineManager.activeQualityLayerHeight + "mm";
|
||||
result += "</font>";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
text: generateActiveQualityText()
|
||||
enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1
|
||||
|
||||
width: Math.floor(parent.width * 0.55)
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
anchors.left: globalProfileLabel.right
|
||||
anchors.right: parent.right
|
||||
tooltip: Cura.MachineManager.activeQualityName
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
activeFocusOnPress: true;
|
||||
activeFocusOnPress: true
|
||||
menu: ProfileMenu { }
|
||||
|
||||
function generateActiveQualityText () {
|
||||
var result = catalog.i18nc("@", "No Profile Available") // default text
|
||||
|
||||
if (Cura.MachineManager.isActiveQualitySupported ) {
|
||||
result = Cura.MachineManager.activeQualityName
|
||||
|
||||
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
|
||||
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
|
||||
result += " - "
|
||||
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
|
||||
result += "</font>"
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: customisedSettings
|
||||
|
|
@ -268,7 +275,7 @@ Item
|
|||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled:
|
||||
{
|
||||
if(!ExtruderManager.activeExtruderStackId && machineExtruderCount.properties.value > 1)
|
||||
if (!Cura.ExtruderManager.activeExtruderStackId && machineExtruderCount.properties.value > 1)
|
||||
{
|
||||
// disable all controls on the global tab, except categories
|
||||
return model.type == "category"
|
||||
|
|
@ -330,7 +337,7 @@ Item
|
|||
// machine gets changed.
|
||||
var activeMachineId = Cura.MachineManager.activeMachineId;
|
||||
|
||||
if(!model.settable_per_extruder || machineExtruderCount.properties.value == 1)
|
||||
if(!model.settable_per_extruder)
|
||||
{
|
||||
//Not settable per extruder or there only is global, so we must pick global.
|
||||
return activeMachineId;
|
||||
|
|
@ -338,12 +345,12 @@ Item
|
|||
if(inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0)
|
||||
{
|
||||
//We have limit_to_extruder, so pick that stack.
|
||||
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
|
||||
return Cura.ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
|
||||
}
|
||||
if(ExtruderManager.activeExtruderStackId)
|
||||
if(Cura.ExtruderManager.activeExtruderStackId)
|
||||
{
|
||||
//We're on an extruder tab. Pick the current extruder.
|
||||
return ExtruderManager.activeExtruderStackId;
|
||||
return Cura.ExtruderManager.activeExtruderStackId;
|
||||
}
|
||||
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||
return activeMachineId;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ Rectangle
|
|||
property variant printMaterialLengths: PrintInformation.materialLengths
|
||||
property variant printMaterialWeights: PrintInformation.materialWeights
|
||||
property variant printMaterialCosts: PrintInformation.materialCosts
|
||||
property variant printMaterialNames: PrintInformation.materialNames
|
||||
|
||||
color: UM.Theme.getColor("sidebar")
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
|
@ -313,51 +314,57 @@ Rectangle
|
|||
anchors.bottomMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize)
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: printSpecs
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
|
||||
height: timeDetails.height + timeSpecDescription.height + lengthSpec.height
|
||||
height: timeDetails.height + costSpec.height
|
||||
width: base.width - (saveButton.buttonRowWidth + UM.Theme.getSize("sidebar_margin").width)
|
||||
visible: !monitoringPrint
|
||||
clip: true
|
||||
|
||||
Label
|
||||
{
|
||||
id: timeDetails
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: timeSpecDescription.top
|
||||
anchors.bottom: costSpec.top
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: infillMouseArea
|
||||
id: timeDetailsMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
//enabled: base.settingsEnabled
|
||||
|
||||
onEntered:
|
||||
{
|
||||
|
||||
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
|
||||
{
|
||||
// All the time information for the different features is achieved
|
||||
var print_time = PrintInformation.getFeaturePrintTimes()
|
||||
var print_time = PrintInformation.getFeaturePrintTimes();
|
||||
var total_seconds = parseInt(base.printDuration.getDisplayString(UM.DurationFormat.Seconds))
|
||||
|
||||
// A message is created and displayed when the user hover the time label
|
||||
var content = catalog.i18nc("@tooltip", "<b>Time information</b>")
|
||||
var content = catalog.i18nc("@tooltip", "<b>Time specification</b><br/><table>");
|
||||
for(var feature in print_time)
|
||||
{
|
||||
if(!print_time[feature].isTotalDurationZero)
|
||||
{
|
||||
content += "<br /><i>" + feature + "</i>: " + print_time[feature].getDisplayString(UM.DurationFormat.Short)
|
||||
content += "<tr><td colspan='2'>" + feature + "</td></tr>" +
|
||||
"<tr>" +
|
||||
"<td width='60%'>" + print_time[feature].getDisplayString(UM.DurationFormat.Short) + "</td>" +
|
||||
"<td width='40%'> " + Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds) + "%" +
|
||||
"</td></tr>";
|
||||
}
|
||||
}
|
||||
content += "</table>";
|
||||
|
||||
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content)
|
||||
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content);
|
||||
}
|
||||
}
|
||||
onExited:
|
||||
|
|
@ -369,20 +376,84 @@ Rectangle
|
|||
|
||||
Label
|
||||
{
|
||||
id: timeSpecDescription
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: lengthSpec.top
|
||||
font: UM.Theme.getFont("very_small")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
text: catalog.i18nc("@description", "Print time")
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: lengthSpec
|
||||
|
||||
function getSpecsData(){
|
||||
|
||||
var lengths = [];
|
||||
var total_length = 0;
|
||||
var weights = [];
|
||||
var total_weight = 0;
|
||||
var costs = [];
|
||||
var total_cost = 0;
|
||||
var some_costs_known = false;
|
||||
var names = [];
|
||||
if(base.printMaterialLengths) {
|
||||
for(var index = 0; index < base.printMaterialLengths.length; index++)
|
||||
{
|
||||
if(base.printMaterialLengths[index] > 0)
|
||||
{
|
||||
names.push(base.printMaterialNames[index]);
|
||||
lengths.push(base.printMaterialLengths[index].toFixed(2));
|
||||
weights.push(String(Math.floor(base.printMaterialWeights[index])));
|
||||
var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2);
|
||||
costs.push(cost);
|
||||
if(cost > 0)
|
||||
{
|
||||
some_costs_known = true;
|
||||
}
|
||||
|
||||
total_length += base.printMaterialLengths[index];
|
||||
total_weight += base.printMaterialWeights[index];
|
||||
total_cost += base.printMaterialCosts[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(lengths.length == 0)
|
||||
{
|
||||
lengths = ["0.00"];
|
||||
weights = ["0"];
|
||||
costs = ["0.00"];
|
||||
}
|
||||
|
||||
var tooltip_html = "<b>%1</b><br/><table>".arg(catalog.i18nc("@label", "Cost specification"));
|
||||
for(var index = 0; index < lengths.length; index++)
|
||||
{
|
||||
var item_strings = [
|
||||
"%1:".arg(names[index]),
|
||||
catalog.i18nc("@label m for meter", "%1m").arg(lengths[index]),
|
||||
catalog.i18nc("@label g for grams", "%1g").arg(weights[index]),
|
||||
"%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(costs[index]),
|
||||
];
|
||||
tooltip_html += "<tr>";
|
||||
for(var item = 0; item < item_strings.length; item++) {
|
||||
tooltip_html += "<td>%1 </td>".arg(item_strings[item]);
|
||||
}
|
||||
}
|
||||
var item_strings = [
|
||||
catalog.i18nc("@label", "Total:"),
|
||||
catalog.i18nc("@label m for meter", "%1m").arg(total_length.toFixed(2)),
|
||||
catalog.i18nc("@label g for grams", "%1g").arg(Math.round(total_weight)),
|
||||
"%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(total_cost.toFixed(2)),
|
||||
];
|
||||
tooltip_html += "<tr>";
|
||||
for(var item = 0; item < item_strings.length; item++) {
|
||||
tooltip_html += "<td>%1 </td>".arg(item_strings[item]);
|
||||
}
|
||||
tooltip_html += "</tr></table>";
|
||||
tooltipText = tooltip_html;
|
||||
|
||||
|
||||
return tooltipText
|
||||
}
|
||||
|
||||
id: costSpec
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
font: UM.Theme.getFont("very_small")
|
||||
color: UM.Theme.getColor("text_subtext")
|
||||
elide: Text.ElideMiddle
|
||||
width: parent.width
|
||||
property string tooltipText
|
||||
text:
|
||||
{
|
||||
var lengths = [];
|
||||
|
|
@ -421,6 +492,27 @@ Rectangle
|
|||
return catalog.i18nc("@label Print estimates: m for meters, g for grams", "%1m / ~ %2g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
}
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
id: costSpecMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered:
|
||||
{
|
||||
|
||||
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
|
||||
{
|
||||
var show_data = costSpec.getSpecsData()
|
||||
|
||||
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), show_data);
|
||||
}
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
base.hideTooltip();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Column
|
|||
{
|
||||
id: base;
|
||||
|
||||
property int currentExtruderIndex: ExtruderManager.activeExtruderIndex;
|
||||
property int currentExtruderIndex: Cura.ExtruderManager.activeExtruderIndex;
|
||||
property bool currentExtruderVisible: extrudersList.visible;
|
||||
|
||||
spacing: Math.floor(UM.Theme.getSize("sidebar_margin").width * 0.9)
|
||||
|
|
@ -93,7 +93,7 @@ Column
|
|||
onClicked:
|
||||
{
|
||||
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
|
||||
ExtruderManager.setActiveExtruderIndex(index);
|
||||
Cura.ExtruderManager.setActiveExtruderIndex(index);
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
|
|
@ -245,39 +245,29 @@ Column
|
|||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
ToolButton
|
||||
{
|
||||
id: materialSelection
|
||||
|
||||
text: Cura.MachineManager.activeMaterialName
|
||||
tooltip: Cura.MachineManager.activeMaterialName
|
||||
visible: Cura.MachineManager.hasMaterials
|
||||
property var valueError:
|
||||
{
|
||||
if(Cura.MachineManager.activeMaterialId === "")
|
||||
{
|
||||
return false
|
||||
}
|
||||
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
|
||||
if(data == "False")
|
||||
{
|
||||
return true
|
||||
}
|
||||
else
|
||||
{
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
|
||||
|
||||
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
activeFocusOnPress: true;
|
||||
menu: MaterialMenu {
|
||||
extruderIndex: base.currentExtruderIndex
|
||||
}
|
||||
|
||||
menu: MaterialMenu { extruderIndex: base.currentExtruderIndex }
|
||||
property var valueError: !isMaterialSupported()
|
||||
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
|
||||
|
||||
function isMaterialSupported () {
|
||||
return Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible") == "True"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -356,7 +346,7 @@ Column
|
|||
Label {
|
||||
id: materialInfoLabel
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "<a href='%1'>Check material compatibility</a>")
|
||||
text: catalog.i18nc("@label", "<a href='%1'>Check compatibility</a>")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Item
|
|||
property Action configureSettings;
|
||||
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
|
||||
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
|
||||
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
|
||||
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
|
||||
|
||||
Component.onCompleted: PrintInformation.enabled = true
|
||||
Component.onDestruction: PrintInformation.enabled = false
|
||||
|
|
@ -76,12 +76,13 @@ Item
|
|||
|
||||
property var totalTicks: 0
|
||||
property var availableTotalTicks: 0
|
||||
property var activeQualityIndex: 0
|
||||
property var existingQualityProfile: 0
|
||||
|
||||
property var qualitySliderActiveIndex: 0
|
||||
property var qualitySliderStepWidth: 0
|
||||
property var qualitySliderAvailableMin : 0
|
||||
property var qualitySliderAvailableMax : 0
|
||||
property var qualitySliderMarginRight : 0
|
||||
property var qualitySliderAvailableMin: 0
|
||||
property var qualitySliderAvailableMax: 0
|
||||
property var qualitySliderMarginRight: 0
|
||||
|
||||
function update () {
|
||||
reset()
|
||||
|
|
@ -89,15 +90,23 @@ Item
|
|||
var availableMin = -1
|
||||
var availableMax = -1
|
||||
|
||||
for (var i = 0; i <= Cura.ProfilesModel.rowCount(); i++) {
|
||||
for (var i = 0; i < Cura.ProfilesModel.rowCount(); i++) {
|
||||
var qualityItem = Cura.ProfilesModel.getItem(i)
|
||||
|
||||
// Add each quality item to the UI quality model
|
||||
qualityModel.append(qualityItem)
|
||||
|
||||
// Set selected value
|
||||
if (Cura.MachineManager.activeQualityId == qualityItem.id) {
|
||||
qualityModel.activeQualityIndex = i
|
||||
if (Cura.MachineManager.activeQualityType == qualityItem.metadata.quality_type) {
|
||||
|
||||
// set to -1 when switching to user created profile so all ticks are clickable
|
||||
if (Cura.SimpleModeSettingsManager.isProfileUserCreated) {
|
||||
qualityModel.qualitySliderActiveIndex = -1
|
||||
} else {
|
||||
qualityModel.qualitySliderActiveIndex = i
|
||||
}
|
||||
|
||||
qualityModel.existingQualityProfile = 1
|
||||
}
|
||||
|
||||
// Set min available
|
||||
|
|
@ -141,16 +150,10 @@ Item
|
|||
function reset () {
|
||||
qualityModel.clear()
|
||||
qualityModel.availableTotalTicks = -1
|
||||
qualityModel.existingQualityProfile = 0
|
||||
|
||||
// check, the ticks count cannot be less than zero
|
||||
if(Cura.ProfilesModel.rowCount() != 0)
|
||||
{
|
||||
qualityModel.totalTicks = Cura.ProfilesModel.rowCount() - 1 // minus one, because slider starts from 0
|
||||
}
|
||||
else
|
||||
{
|
||||
qualityModel.totalTicks = 0
|
||||
}
|
||||
qualityModel.totalTicks = Math.max(0, Cura.ProfilesModel.rowCount() - 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -268,7 +271,7 @@ Item
|
|||
maximumValue: qualityModel.qualitySliderAvailableMax >= 0 ? qualityModel.qualitySliderAvailableMax : 0
|
||||
stepSize: 1
|
||||
|
||||
value: qualityModel.activeQualityIndex
|
||||
value: qualityModel.qualitySliderActiveIndex
|
||||
|
||||
width: qualityModel.qualitySliderStepWidth * qualityModel.availableTotalTicks
|
||||
|
||||
|
|
@ -291,24 +294,40 @@ Item
|
|||
implicitWidth: 10 * screenScaleFactor
|
||||
implicitHeight: implicitWidth
|
||||
radius: implicitWidth / 2
|
||||
visible: !Cura.SimpleModeSettingsManager.isProfileCustomized;
|
||||
visible: !Cura.SimpleModeSettingsManager.isProfileCustomized && !Cura.SimpleModeSettingsManager.isProfileUserCreated && qualityModel.existingQualityProfile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onValueChanged: {
|
||||
// Only change if an active machine is set and the slider is visible at all.
|
||||
if(Cura.MachineManager.activeMachine != null && visible)
|
||||
{
|
||||
//Prevent updating during view initializing. Trigger only if the value changed by user
|
||||
if(qualitySlider.value != qualityModel.activeQualityIndex)
|
||||
{
|
||||
//start updating with short delay
|
||||
qualitySliderChangeTimer.start();
|
||||
// only change if an active machine is set and the slider is visible at all.
|
||||
if (Cura.MachineManager.activeMachine != null && visible) {
|
||||
// prevent updating during view initializing. Trigger only if the value changed by user
|
||||
if (qualitySlider.value != qualityModel.qualitySliderActiveIndex) {
|
||||
// start updating with short delay
|
||||
qualitySliderChangeTimer.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: speedSliderMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: Cura.SimpleModeSettingsManager.isProfileUserCreated
|
||||
|
||||
onEntered:
|
||||
{
|
||||
var content = catalog.i18nc("@tooltip","A custom profile is currently active. To enable the quality slider, choose a default quality profile in Custom tab")
|
||||
base.showTooltip(qualityRow, Qt.point(-UM.Theme.getSize("sidebar_margin").width, customisedSettings.height), content)
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
base.hideTooltip();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ UM.PointingRectangle {
|
|||
rightMargin: UM.Theme.getSize("tooltip_margins").width;
|
||||
}
|
||||
wrapMode: Text.Wrap;
|
||||
textFormat: Text.RichText
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("tooltip_text");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ Rectangle
|
|||
Component.onCompleted: {
|
||||
startMonitoringPrint.connect(function () {
|
||||
base.monitoringPrint = true
|
||||
UM.Controller.disableModelRendering()
|
||||
})
|
||||
stopMonitoringPrint.connect(function () {
|
||||
base.monitoringPrint = false
|
||||
UM.Controller.enableModelRendering()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -218,6 +220,83 @@ Rectangle
|
|||
menu: PrinterMenu { }
|
||||
}
|
||||
|
||||
//View orientation Item
|
||||
Row
|
||||
{
|
||||
id: viewOrientationControl
|
||||
height: 30
|
||||
|
||||
spacing: 2
|
||||
|
||||
visible: !base.monitoringPrint
|
||||
|
||||
anchors {
|
||||
verticalCenter: base.verticalCenter
|
||||
right: viewModeButton.right
|
||||
rightMargin: UM.Theme.getSize("default_margin").width + viewModeButton.width
|
||||
}
|
||||
|
||||
// #1 3d view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_3d")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
anchors.verticalCenter: viewOrientationControl.verticalCenter
|
||||
onClicked:{
|
||||
UM.Controller.rotateView("3d", 0);
|
||||
}
|
||||
visible: base.width > 1100
|
||||
}
|
||||
|
||||
// #2 Front view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_front")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
anchors.verticalCenter: viewOrientationControl.verticalCenter
|
||||
onClicked:{
|
||||
UM.Controller.rotateView("home", 0);
|
||||
}
|
||||
visible: base.width > 1130
|
||||
}
|
||||
|
||||
// #3 Top view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_top")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
anchors.verticalCenter: viewOrientationControl.verticalCenter
|
||||
onClicked:{
|
||||
UM.Controller.rotateView("y", 90);
|
||||
}
|
||||
visible: base.width > 1160
|
||||
}
|
||||
|
||||
// #4 Left view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_left")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
anchors.verticalCenter: viewOrientationControl.verticalCenter
|
||||
onClicked:{
|
||||
UM.Controller.rotateView("x", 90);
|
||||
}
|
||||
visible: base.width > 1190
|
||||
}
|
||||
|
||||
// #5 Left view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_right")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
anchors.verticalCenter: viewOrientationControl.verticalCenter
|
||||
onClicked:{
|
||||
UM.Controller.rotateView("x", -90);
|
||||
}
|
||||
visible: base.width > 1210
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
id: viewModeButton
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue