mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Update cluster view components
CL-541
This commit is contained in:
parent
52a137a68c
commit
5d3779da26
9 changed files with 59 additions and 50 deletions
|
@ -31,7 +31,7 @@ Rectangle
|
|||
|
||||
function printerStatusText(printer)
|
||||
{
|
||||
switch (printer.status)
|
||||
switch (printer.state)
|
||||
{
|
||||
case "pre_print":
|
||||
return catalog.i18nc("@label", "Preparing to print")
|
||||
|
@ -49,22 +49,14 @@ Rectangle
|
|||
}
|
||||
|
||||
id: printerDelegate
|
||||
property var printer
|
||||
|
||||
property var printer: null
|
||||
property var printJob: printer != null ? printer.activePrintJob: null
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: mouse.containsMouse ? emphasisColor : lineColor
|
||||
z: mouse.containsMouse ? 1 : 0 // Push this item up a bit on mouse over to ensure that the highlighted bottom border is visible.
|
||||
|
||||
property var printJob:
|
||||
{
|
||||
if (printer.reserved_by != null)
|
||||
{
|
||||
// Look in another list.
|
||||
return OutputDevice.printJobsByUUID[printer.reserved_by]
|
||||
}
|
||||
return OutputDevice.printJobsByPrinterUUID[printer.uuid]
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouse
|
||||
|
@ -73,7 +65,7 @@ Rectangle
|
|||
hoverEnabled: true;
|
||||
|
||||
// Only clickable if no printer is selected
|
||||
enabled: OutputDevice.selectedPrinterName == "" && printer.status !== "unreachable"
|
||||
enabled: OutputDevice.selectedPrinterName == "" && printer.state !== "unreachable"
|
||||
}
|
||||
|
||||
Row
|
||||
|
@ -166,7 +158,7 @@ Rectangle
|
|||
anchors.right: printProgressArea.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
color: emphasisColor
|
||||
opacity: printer != null && printer.status === "unreachable" ? 0.3 : 1
|
||||
opacity: printer != null && printer.state === "unreachable" ? 0.3 : 1
|
||||
|
||||
Image
|
||||
{
|
||||
|
@ -192,7 +184,7 @@ Rectangle
|
|||
{
|
||||
id: leftExtruderInfo
|
||||
width: Math.floor((parent.width - extruderSeperator.width) / 2)
|
||||
printCoreConfiguration: printer.configuration[0]
|
||||
printCoreConfiguration: printer.extruders[0]
|
||||
}
|
||||
|
||||
Rectangle
|
||||
|
@ -207,7 +199,7 @@ Rectangle
|
|||
{
|
||||
id: rightExtruderInfo
|
||||
width: Math.floor((parent.width - extruderSeperator.width) / 2)
|
||||
printCoreConfiguration: printer.configuration[1]
|
||||
printCoreConfiguration: printer.extruders[1]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,9 +217,9 @@ Rectangle
|
|||
if(printJob != null)
|
||||
{
|
||||
var extendStates = ["sent_to_printer", "wait_for_configuration", "printing", "pre_print", "post_print", "wait_cleanup", "queued"];
|
||||
return extendStates.indexOf(printJob.status) !== -1;
|
||||
return extendStates.indexOf(printJob.state) !== -1;
|
||||
}
|
||||
return !printer.enabled;
|
||||
return printer.state == "disabled"
|
||||
}
|
||||
|
||||
Item // Status and Percent
|
||||
|
@ -235,7 +227,7 @@ Rectangle
|
|||
id: printProgressTitleBar
|
||||
|
||||
property var showPercent: {
|
||||
return printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.status) !== -1);
|
||||
return printJob != null && (["printing", "post_print", "pre_print", "sent_to_printer"].indexOf(printJob.state) !== -1);
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
|
@ -252,19 +244,19 @@ Rectangle
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: {
|
||||
if (!printer.enabled)
|
||||
if (printer.state == "disabled")
|
||||
{
|
||||
return catalog.i18nc("@label:status", "Disabled");
|
||||
}
|
||||
|
||||
if (printer.status === "unreachable")
|
||||
if (printer.state === "unreachable")
|
||||
{
|
||||
return printerStatusText(printer);
|
||||
}
|
||||
|
||||
if (printJob != null)
|
||||
{
|
||||
switch (printJob.status)
|
||||
switch (printJob.state)
|
||||
{
|
||||
case "printing":
|
||||
case "post_print":
|
||||
|
@ -328,26 +320,26 @@ Rectangle
|
|||
visible: !printProgressTitleBar.showPercent
|
||||
|
||||
source: {
|
||||
if (!printer.enabled)
|
||||
if (printer.state == "disabled")
|
||||
{
|
||||
return "blocked-icon.svg";
|
||||
}
|
||||
|
||||
if (printer.status === "unreachable")
|
||||
if (printer.state === "unreachable")
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (printJob != null)
|
||||
{
|
||||
if(printJob.status === "queued")
|
||||
if(printJob.state === "queued")
|
||||
{
|
||||
if (printJob.configuration_changes_required != null && printJob.configuration_changes_required.length !== 0)
|
||||
{
|
||||
return "action-required-icon.svg";
|
||||
}
|
||||
}
|
||||
else if (printJob.status === "wait_cleanup")
|
||||
else if (printJob.state === "wait_cleanup")
|
||||
{
|
||||
return "checkmark-icon.svg";
|
||||
}
|
||||
|
@ -384,19 +376,19 @@ Rectangle
|
|||
{
|
||||
text:
|
||||
{
|
||||
if (!printer.enabled)
|
||||
if (printer.state == "disabled")
|
||||
{
|
||||
return catalog.i18nc("@label", "Not accepting print jobs");
|
||||
}
|
||||
|
||||
if (printer.status === "unreachable")
|
||||
if (printer.state === "unreachable")
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if(printJob != null)
|
||||
{
|
||||
switch (printJob.status)
|
||||
switch (printJob.state)
|
||||
{
|
||||
case "printing":
|
||||
case "post_print":
|
||||
|
@ -432,7 +424,7 @@ Rectangle
|
|||
text: {
|
||||
if(printJob != null)
|
||||
{
|
||||
if(printJob.status == "printing" || printJob.status == "post_print")
|
||||
if(printJob.state == "printing" || printJob.state == "post_print")
|
||||
{
|
||||
return OutputDevice.getDateCompleted(printJob.time_total - printJob.time_elapsed)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue