mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 23:05:01 -06:00
Merge master. CURA-2006
This commit is contained in:
commit
8c0837d75d
58 changed files with 11611 additions and 530 deletions
|
@ -183,7 +183,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: deleteObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","Delete Object");
|
||||
text: catalog.i18nc("@action:inmenu","Delete Model");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
}
|
||||
|
@ -191,13 +191,13 @@ Item
|
|||
Action
|
||||
{
|
||||
id: centerObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","Ce&nter Object on Platform");
|
||||
text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform");
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: groupObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Objects");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models");
|
||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "object-group"
|
||||
shortcut: "Ctrl+G";
|
||||
|
@ -207,7 +207,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: unGroupObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Objects");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models");
|
||||
enabled: UM.Scene.isGroupSelected
|
||||
iconName: "object-ungroup"
|
||||
shortcut: "Ctrl+Shift+G";
|
||||
|
@ -217,7 +217,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: mergeObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Objects");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models");
|
||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "merge";
|
||||
shortcut: "Ctrl+Alt+G";
|
||||
|
@ -227,14 +227,14 @@ Item
|
|||
Action
|
||||
{
|
||||
id: multiplyObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","&Duplicate Object");
|
||||
text: catalog.i18nc("@action:inmenu","&Duplicate Model");
|
||||
iconName: "edit-duplicate"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: selectAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Select All Objects");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Select All Models");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-select-all";
|
||||
shortcut: "Ctrl+A";
|
||||
|
@ -244,7 +244,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: deleteAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Clear Build Platform");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Clear Build Plate");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: "Ctrl+D";
|
||||
|
@ -254,7 +254,7 @@ Item
|
|||
Action
|
||||
{
|
||||
id: reloadAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Objects");
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Models");
|
||||
iconName: "document-revert";
|
||||
onTriggered: Printer.reloadAll();
|
||||
}
|
||||
|
@ -262,14 +262,14 @@ Item
|
|||
Action
|
||||
{
|
||||
id: resetAllTranslationAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object Positions");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions");
|
||||
onTriggered: Printer.resetAllTranslation();
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object &Transformations");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model &Transformations");
|
||||
onTriggered: Printer.resetAll();
|
||||
}
|
||||
|
||||
|
|
|
@ -183,13 +183,17 @@ UM.Dialog
|
|||
text: catalog.i18nc("@action:button", "Add Printer")
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
base.visible = false
|
||||
var item = machineList.model.getItem(machineList.currentIndex);
|
||||
Cura.MachineManager.addMachine(machineName.text, item.id)
|
||||
base.machineAdded(item.id) // Emit signal that the user added a machine.
|
||||
}
|
||||
onClicked: addMachine()
|
||||
}
|
||||
|
||||
onAccepted: addMachine()
|
||||
|
||||
function addMachine()
|
||||
{
|
||||
base.visible = false
|
||||
var item = machineList.model.getItem(machineList.currentIndex);
|
||||
Cura.MachineManager.addMachine(machineName.text, item.id)
|
||||
base.machineAdded(item.id) // Emit signal that the user added a machine.
|
||||
}
|
||||
|
||||
Item
|
||||
|
|
|
@ -209,7 +209,7 @@ Rectangle {
|
|||
lengths = ["0.00"];
|
||||
weights = ["0"];
|
||||
}
|
||||
return catalog.i18nc("@label", "%1 m / %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
return catalog.i18nc("@label", "%1 m / ~ %2 g").arg(lengths.join(" + ")).arg(weights.join(" + "));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,25 +15,57 @@ Rectangle
|
|||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0;
|
||||
property int backendState: UM.Backend.state;
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
|
||||
property int backendState: UM.Backend.state
|
||||
|
||||
|
||||
property bool showProgress: {
|
||||
// determine if we need to show the progress bar + percentage
|
||||
if(!printerConnected || !printerAcceptsCommands) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "paused":
|
||||
return true;
|
||||
case "pre_print": // heating, etc.
|
||||
case "wait_cleanup":
|
||||
case "offline":
|
||||
case "abort": // note sure if this jobState actually occurs in the wild
|
||||
case "error": // after clicking abort you apparently get "error"
|
||||
case "ready": // ready to print or getting ready
|
||||
case "": // ready to print or getting ready
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
property variant statusColor:
|
||||
{
|
||||
if(!printerConnected)
|
||||
return UM.Theme.getColor("status_offline")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
|
||||
return UM.Theme.getColor("status_busy")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
|
||||
return UM.Theme.getColor("status_ready")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
return UM.Theme.getColor("status_paused")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
|
||||
return UM.Theme.getColor("status_stopped")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
return UM.Theme.getColor("status_offline")
|
||||
else
|
||||
return UM.Theme.getColor("text")
|
||||
if(!printerConnected || !printerAcceptsCommands)
|
||||
return UM.Theme.getColor("text");
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "pre_print":
|
||||
case "wait_cleanup":
|
||||
return UM.Theme.getColor("status_busy");
|
||||
case "ready":
|
||||
case "":
|
||||
return UM.Theme.getColor("status_ready");
|
||||
case "paused":
|
||||
return UM.Theme.getColor("status_paused");
|
||||
case "error":
|
||||
return UM.Theme.getColor("status_stopped");
|
||||
case "offline":
|
||||
return UM.Theme.getColor("status_offline");
|
||||
default:
|
||||
return UM.Theme.getColor("text");
|
||||
}
|
||||
}
|
||||
|
||||
property bool activity: Printer.getPlatformActivity;
|
||||
|
@ -42,31 +74,28 @@ Rectangle
|
|||
property string statusText:
|
||||
{
|
||||
if(!printerConnected)
|
||||
{
|
||||
return catalog.i18nc("@label:", "Not connected to a printer")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Lost connection with the printer")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Printing...")
|
||||
} else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Paused")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Preparing...")
|
||||
}
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup")
|
||||
{
|
||||
return catalog.i18nc("@label:", "Waiting for cleanup...")
|
||||
}
|
||||
else
|
||||
{
|
||||
return " "
|
||||
}
|
||||
return catalog.i18nc("@label:MonitorStatus", "Not connected to a printer");
|
||||
if(!printerAcceptsCommands)
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printer does not accept commands");
|
||||
|
||||
var printerOutputDevice = Cura.MachineManager.printerOutputDevices[0]
|
||||
switch(printerOutputDevice.jobState)
|
||||
{
|
||||
case "offline":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Lost connection with the printer");
|
||||
case "printing":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Printing...");
|
||||
case "paused":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Paused");
|
||||
case "pre_print":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Preparing...");
|
||||
case "wait_cleanup":
|
||||
return catalog.i18nc("@label:MonitorStatus", "Please remove the print");
|
||||
case "error":
|
||||
return printerOutputDevice.errorText;
|
||||
default:
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -79,7 +108,7 @@ Rectangle
|
|||
|
||||
color: base.statusColor
|
||||
font: UM.Theme.getFont("large")
|
||||
text: statusText;
|
||||
text: statusText
|
||||
}
|
||||
|
||||
Label
|
||||
|
@ -90,8 +119,8 @@ Rectangle
|
|||
|
||||
color: base.statusColor
|
||||
font: UM.Theme.getFont("large")
|
||||
text: Math.round(progress) + "%";
|
||||
visible: printerConnected
|
||||
text: Math.round(progress) + "%"
|
||||
visible: showProgress
|
||||
}
|
||||
|
||||
Rectangle
|
||||
|
@ -105,6 +134,7 @@ Rectangle
|
|||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
radius: UM.Theme.getSize("progressbar_radius").width
|
||||
color: UM.Theme.getColor("progressbar_background")
|
||||
visible: showProgress
|
||||
|
||||
Rectangle
|
||||
{
|
||||
|
@ -120,7 +150,8 @@ Rectangle
|
|||
id: abortButton
|
||||
|
||||
visible: printerConnected
|
||||
enabled: printerConnected && (Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||
(["paused", "printing", "pre_print"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
||||
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
anchors.top: progressBar.bottom
|
||||
|
@ -129,20 +160,35 @@ Rectangle
|
|||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: catalog.i18nc("@label:", "Abort Print")
|
||||
onClicked: { Cura.MachineManager.printerOutputDevices[0].setJobState("abort") }
|
||||
|
||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
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");
|
||||
else
|
||||
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");
|
||||
else
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||
|
@ -151,9 +197,17 @@ Rectangle
|
|||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
|
||||
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");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
}
|
||||
|
@ -164,10 +218,7 @@ Rectangle
|
|||
|
||||
Button
|
||||
{
|
||||
id: pauseButton
|
||||
|
||||
visible: printerConnected
|
||||
enabled: printerConnected && (Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||
id: pauseResumeButton
|
||||
|
||||
height: UM.Theme.getSize("save_button_save_to_button").height
|
||||
anchors.top: progressBar.bottom
|
||||
|
@ -175,20 +226,77 @@ Rectangle
|
|||
anchors.right: abortButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? catalog.i18nc("@label:", "Resume") : catalog.i18nc("@label:", "Pause") : ""
|
||||
onClicked: { Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? Cura.MachineManager.printerOutputDevices[0].setJobState("print") : Cura.MachineManager.printerOutputDevices[0].setJobState("pause") }
|
||||
property bool userClicked: false
|
||||
property string lastJobState: ""
|
||||
|
||||
visible: printerConnected
|
||||
enabled: (!userClicked) && printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||
(["paused", "printing"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
||||
|
||||
text: {
|
||||
var result = "";
|
||||
var jobState = Cura.MachineManager.printerOutputDevices[0].jobState;
|
||||
if (!printerConnected) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (lastJobState !== jobState) {
|
||||
// the userClicked message must disappear when an "automated" jobState comes by
|
||||
userClicked = false;
|
||||
lastJobState = jobState;
|
||||
}
|
||||
|
||||
if (jobState == "paused")
|
||||
{
|
||||
if (userClicked) {
|
||||
// User feedback for pretending we're already in "printing" mode.
|
||||
result = catalog.i18nc("@label:", "Pause");
|
||||
} else {
|
||||
result = catalog.i18nc("@label:", "Resume");
|
||||
}
|
||||
} else {
|
||||
if (userClicked) {
|
||||
// User feedback for pretending we're already in "pause" mode.
|
||||
result = catalog.i18nc("@label:", "Resume");
|
||||
} else {
|
||||
result = catalog.i18nc("@label:", "Pause");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
onClicked: {
|
||||
var newJobState = Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause";
|
||||
Cura.MachineManager.printerOutputDevices[0].setJobState(newJobState);
|
||||
userClicked = true;
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
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");
|
||||
else
|
||||
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");
|
||||
else
|
||||
return UM.Theme.getColor("action_button");
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||
|
@ -197,11 +305,19 @@ Rectangle
|
|||
{
|
||||
id: actualLabel
|
||||
anchors.centerIn: parent
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
|
||||
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");
|
||||
else
|
||||
return UM.Theme.getColor("action_button_text");
|
||||
}
|
||||
font: UM.Theme.getFont("action_button")
|
||||
text: control.text;
|
||||
text: control.text
|
||||
}
|
||||
}
|
||||
label: Item { }
|
||||
|
|
|
@ -69,6 +69,7 @@ UM.PreferencesPage
|
|||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
Label
|
||||
{
|
||||
id: languageLabel
|
||||
|
@ -167,7 +168,7 @@ UM.PreferencesPage
|
|||
UM.TooltipArea {
|
||||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
text: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected")
|
||||
text: catalog.i18nc("@info:tooltip","Moves the camera so the model is in the center of the view when an model is selected")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
|
@ -181,12 +182,12 @@ UM.PreferencesPage
|
|||
UM.TooltipArea {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip", "Should objects on the platform be moved so that they no longer intersect?")
|
||||
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: pushFreeCheckbox
|
||||
text: catalog.i18nc("@option:check", "Ensure objects are kept apart")
|
||||
text: catalog.i18nc("@option:check", "Ensure models are kept apart")
|
||||
checked: boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
||||
onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
|
||||
}
|
||||
|
@ -246,12 +247,12 @@ UM.PreferencesPage
|
|||
UM.TooltipArea {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","Should objects be scaled to the build volume if they are too large?")
|
||||
text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: scaleToFitCheckbox
|
||||
text: catalog.i18nc("@option:check","Scale large objects")
|
||||
text: catalog.i18nc("@option:check","Scale large models")
|
||||
checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
|
||||
onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
|
||||
}
|
||||
|
@ -260,12 +261,12 @@ UM.PreferencesPage
|
|||
UM.TooltipArea {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","An object may appear extremely small if its unit is for example in meters rather than millimeters. Should these objects be scaled up?")
|
||||
text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: scaleTinyCheckbox
|
||||
text: catalog.i18nc("@option:check","Scale extremely small objects")
|
||||
text: catalog.i18nc("@option:check","Scale extremely small models")
|
||||
checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
|
||||
onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
|
||||
}
|
||||
|
|
|
@ -18,7 +18,10 @@ UM.ManagementPage
|
|||
}
|
||||
|
||||
activeId: Cura.MachineManager.activeMachineId
|
||||
activeIndex: {
|
||||
activeIndex: activeMachineIndex()
|
||||
|
||||
function activeMachineIndex()
|
||||
{
|
||||
for(var i = 0; i < model.rowCount(); i++) {
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) {
|
||||
return i;
|
||||
|
@ -129,10 +132,10 @@ UM.ManagementPage
|
|||
Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Type")
|
||||
visible: base.currentItem && base.currentItem.metadata
|
||||
visible: base.currentItem && "definition_name" in base.currentItem.metadata
|
||||
}
|
||||
Label {
|
||||
text: (base.currentItem && base.currentItem.metadata) ? base.currentItem.metadata.definition_name : ""
|
||||
text: (base.currentItem && "definition_name" in base.currentItem.metadata) ? base.currentItem.metadata.definition_name : ""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +145,16 @@ UM.ManagementPage
|
|||
{
|
||||
id: confirmDialog;
|
||||
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
|
||||
onYes: Cura.MachineManager.removeMachine(base.currentItem.id);
|
||||
onYes:
|
||||
{
|
||||
Cura.MachineManager.removeMachine(base.currentItem.id);
|
||||
if(!base.currentItem)
|
||||
{
|
||||
objectList.currentIndex = activeMachineIndex()
|
||||
}
|
||||
//Force updating currentItem and the details panel
|
||||
objectList.onCurrentIndexChanged()
|
||||
}
|
||||
}
|
||||
|
||||
UM.RenameDialog
|
||||
|
@ -152,11 +164,20 @@ UM.ManagementPage
|
|||
onAccepted:
|
||||
{
|
||||
Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim());
|
||||
//Reselect current item to update details panel
|
||||
var index = objectList.currentIndex
|
||||
objectList.currentIndex = -1
|
||||
objectList.currentIndex = index
|
||||
//Force updating currentItem and the details panel
|
||||
objectList.onCurrentIndexChanged()
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
objectList.currentIndex = activeMachineIndex()
|
||||
objectList.onCurrentIndexChanged()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,18 @@ import Cura 1.0 as Cura
|
|||
Column
|
||||
{
|
||||
id: printMonitor
|
||||
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
|
||||
Cura.ExtrudersModel { id: extrudersModel }
|
||||
|
||||
Label
|
||||
{
|
||||
text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@label", "The printer is not connected.")
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
width: base.width
|
||||
}
|
||||
|
||||
Loader
|
||||
{
|
||||
|
@ -24,8 +36,8 @@ Column
|
|||
delegate: Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: machineExtruderCount.properties.value > 1 ? catalog.i18nc("@label", "Hotend Temperature %1").arg(index + 1) : catalog.i18nc("@label", "Hotend Temperature")
|
||||
property string value: printerConnected ? Math.round(Cura.MachineManager.printerOutputDevices[0].hotendTemperatures[index]) + "°C" : ""
|
||||
property string label: machineExtruderCount.properties.value > 1 ? extrudersModel.getItem(index).name : catalog.i18nc("@label", "Hotend")
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||
}
|
||||
}
|
||||
Repeater
|
||||
|
@ -34,8 +46,8 @@ Column
|
|||
delegate: Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Bed Temperature")
|
||||
property string value: printerConnected ? Math.round(Cura.MachineManager.printerOutputDevices[0].bedTemperature) + "°C" : ""
|
||||
property string label: catalog.i18nc("@label", "Build plate")
|
||||
property string value: printerConnected ? Math.round(connectedPrinter.bedTemperature) + "°C" : ""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,19 +60,19 @@ Column
|
|||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Job Name")
|
||||
property string value: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobName : ""
|
||||
property string value: printerConnected ? connectedPrinter.jobName : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Printing Time")
|
||||
property string value: printerConnected ? getPrettyTime(Cura.MachineManager.printerOutputDevices[0].timeTotal) : ""
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal) : ""
|
||||
}
|
||||
Loader
|
||||
{
|
||||
sourceComponent: monitorItem
|
||||
property string label: catalog.i18nc("@label", "Estimated time left")
|
||||
property string value: printerConnected ? getPrettyTime(Cura.MachineManager.printerOutputDevices[0].timeTotal - Cura.MachineManager.printerOutputDevices[0].timeElapsed) : ""
|
||||
property string value: printerConnected ? getPrettyTime(connectedPrinter.timeTotal - connectedPrinter.timeElapsed) : ""
|
||||
}
|
||||
|
||||
Component
|
||||
|
@ -70,21 +82,24 @@ Column
|
|||
Row
|
||||
{
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
Label
|
||||
{
|
||||
text: label
|
||||
color: printerConnected ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
width: base.width * 0.4
|
||||
elide: Text.ElideRight
|
||||
width: parent.width * 0.4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: label
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: value
|
||||
color: printerConnected ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
width: parent.width * 0.6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: value
|
||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,10 @@ SettingItem
|
|||
model: Cura.ExtrudersModel
|
||||
{
|
||||
id: extruders_model
|
||||
onModelChanged: control.color = extruders_model.getItem(control.currentIndex).color
|
||||
}
|
||||
property string color: extruders_model.getItem(control.currentIndex).color
|
||||
|
||||
textRole: "name"
|
||||
|
||||
anchors.fill: parent
|
||||
|
@ -64,7 +67,7 @@ SettingItem
|
|||
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
color: extruders_model.getItem(control.currentIndex).colour
|
||||
color: control.color
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
|
@ -105,7 +108,8 @@ SettingItem
|
|||
onActivated:
|
||||
{
|
||||
forceActiveFocus();
|
||||
propertyProvider.setPropertyValue("value", extruders_model.getItem(index).index)
|
||||
propertyProvider.setPropertyValue("value", extruders_model.getItem(index).index);
|
||||
control.color = extruders_model.getItem(index).color;
|
||||
}
|
||||
onModelChanged: updateCurrentIndex();
|
||||
|
||||
|
@ -121,7 +125,8 @@ SettingItem
|
|||
{
|
||||
if(extruders_model.getItem(i).index == propertyProvider.properties.value)
|
||||
{
|
||||
currentIndex = i;
|
||||
control.currentIndex = i;
|
||||
control.color = extruders_model.getItem(i).color;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ SettingItem
|
|||
|
||||
maximumLength: 10;
|
||||
|
||||
validator: RegExpValidator { regExp: /[0-9.,-]{0,10}/ }
|
||||
validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}/ : /^-?[0-9.,]{0,10}/ } // definition.type property from parent loader used to disallow fractional number entry
|
||||
|
||||
Binding
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@ Rectangle
|
|||
|
||||
// Is there an output device for this printer?
|
||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||
|
||||
color: UM.Theme.getColor("sidebar");
|
||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||
|
@ -107,19 +108,28 @@ Rectangle
|
|||
onClicked: monitoringPrint = true
|
||||
iconSource: {
|
||||
if(!printerConnected)
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
|
||||
return UM.Theme.getIcon("tab_monitor_busy")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
|
||||
return UM.Theme.getIcon("tab_monitor_connected")
|
||||
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||
return UM.Theme.getIcon("tab_monitor_paused")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "error")
|
||||
return UM.Theme.getIcon("tab_monitor_stopped")
|
||||
else if (Cura.MachineManager.printerOutputDevices[0].jobState == "offline")
|
||||
return UM.Theme.getIcon("tab_monitor_offline")
|
||||
else
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
return UM.Theme.getIcon("tab_monitor");
|
||||
else if(!printerAcceptsCommands)
|
||||
return UM.Theme.getIcon("tab_monitor_unknown");
|
||||
|
||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||
{
|
||||
case "printing":
|
||||
case "pre_print":
|
||||
case "wait_cleanup":
|
||||
return UM.Theme.getIcon("tab_monitor_busy");
|
||||
case "ready":
|
||||
case "":
|
||||
return UM.Theme.getIcon("tab_monitor_connected")
|
||||
case "paused":
|
||||
return UM.Theme.getIcon("tab_monitor_paused")
|
||||
case "error":
|
||||
return UM.Theme.getIcon("tab_monitor_stopped")
|
||||
case "offline":
|
||||
return UM.Theme.getIcon("tab_monitor_offline")
|
||||
default:
|
||||
return UM.Theme.getIcon("tab_monitor")
|
||||
}
|
||||
}
|
||||
checkable: true
|
||||
checked: monitoringPrint
|
||||
|
|
|
@ -138,7 +138,7 @@ Column
|
|||
anchors.leftMargin: (parent.height - height) / 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
color: model.colour
|
||||
color: model.color
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("toggle_checked")
|
||||
}
|
||||
|
@ -183,8 +183,23 @@ Column
|
|||
Label
|
||||
{
|
||||
id: variantLabel
|
||||
text: (Cura.MachineManager.hasVariants && Cura.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
|
||||
Cura.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
|
||||
text:
|
||||
{
|
||||
var label;
|
||||
if(Cura.MachineManager.hasVariants && Cura.MachineManager.hasMaterials)
|
||||
{
|
||||
label = "%1 & %2".arg(Cura.MachineManager.activeDefinitionVariantsName).arg(catalog.i18nc("@label","Material"));
|
||||
}
|
||||
else if(Cura.MachineManager.hasVariants)
|
||||
{
|
||||
label = Cura.MachineManager.activeDefinitionVariantsName;
|
||||
}
|
||||
else
|
||||
{
|
||||
label = catalog.i18nc("@label","Material");
|
||||
}
|
||||
return "%1:".arg(label);
|
||||
}
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width * 0.45 - UM.Theme.getSize("default_margin").width
|
||||
|
|
|
@ -216,7 +216,7 @@ Item
|
|||
anchors.verticalCenter: brimCheckBox.verticalCenter
|
||||
width: parent.width / 100 * 35 - 3 * UM.Theme.getSize("default_margin").width
|
||||
//: Bed adhesion label
|
||||
text: catalog.i18nc("@label:listbox", "Bed Adhesion:");
|
||||
text: catalog.i18nc("@label", "Helper Parts:");
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ Item
|
|||
anchors.verticalCenter: supportCheckBox.verticalCenter
|
||||
width: parent.width / 100 * 35 - 3 * UM.Theme.getSize("default_margin").width
|
||||
//: Support label
|
||||
text: catalog.i18nc("@label:listbox", "Support:");
|
||||
text: "";
|
||||
font: UM.Theme.getFont("default");
|
||||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
@ -327,7 +327,8 @@ Item
|
|||
supportEnabled.setPropertyValue("value", false);
|
||||
} else {
|
||||
supportEnabled.setPropertyValue("value", true);
|
||||
supportExtruderNr.setPropertyValue("value", index - 1);
|
||||
// Send the extruder nr as a string.
|
||||
supportExtruderNr.setPropertyValue("value", String(index - 1));
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
|
@ -372,7 +373,7 @@ Item
|
|||
for(var extruderNumber = 0; extruderNumber < extruders.model.rowCount() ; extruderNumber++) {
|
||||
extruderModel.append({
|
||||
text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNumber).name),
|
||||
color: extruders.model.getItem(extruderNumber).colour
|
||||
color: extruders.model.getItem(extruderNumber).color
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue