This commit is contained in:
ChrisTerBeke 2017-11-24 10:31:30 +01:00
commit 46a575b84f
4 changed files with 47 additions and 36 deletions

View file

@ -45,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
@ -86,6 +94,10 @@ Item {
if (saveToButton.enabled) {
saveToButton.clicked();
}
// prepare button
if (prepareButton.enabled) {
sliceOrStopSlicing();
}
}
}
@ -145,7 +157,7 @@ Item {
Button {
id: prepareButton
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
tooltip: catalog.i18nc("@info:tooltip","Slice");
// 1 = not started, 2 = Processing
enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true
visible: {
@ -162,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 {

View file

@ -343,7 +343,6 @@ Rectangle
onEntered:
{
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
// All the time information for the different features is achieved
@ -356,20 +355,10 @@ Rectangle
{
if(!print_time[feature].isTotalDurationZero)
{
var feature_name = "";
if (feature.length <= 11)
{
feature_name = feature
}
else{
feature_name = feature.substring(0, 8) + "..."
}
content += "<tr><td>" + feature_name + ":" +
"&nbsp;&nbsp;</td><td>" + print_time[feature].getDisplayString(UM.DurationFormat.Short) +
"&nbsp;&nbsp;</td><td>" + Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds) + "%" +
content += "<tr><td colspan='2'>" + feature + "</td></tr>" +
"<tr>" +
"<td width='60%'>" + print_time[feature].getDisplayString(UM.DurationFormat.Short) + "</td>" +
"<td width='40%'>&nbsp;&nbsp;" + Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds) + "%" +
"</td></tr>";
}
}