Cura/resources/qml/Preferences/MachinesPage.qml
Arjen Hiemstra 7008e047f6 Merge branch 'master' of github.com:ultimaker/Cura into feature_material_editing
* 'master' of github.com:ultimaker/Cura: (76 commits)
  Added UMO upgrade selection
  Added stubs for UMO upgrade selection
  Machine action labels are now translatable
  Code style CURA-1676
  Using the correct placeholder
  SplashScreen: Using system-default fontfamily
  USBPrinting: Let's "Print via USB"
  BQ Hephestos2 - Preheating temperature fix When starting a print with the "custom" GCode by BQ, the printer resets the nozzle temperature to 210°C when printing via SD card (no matter what you set on Cura) and only preheats the nozzle to 180°C when printing via USB. So currently the printer begins to print via USB at 180°C and reaches the correct temperature eg.g while printing the brim.
  Fix warning about missing color in theme
  Automatically show the Print Monitor when starting a print
  Fix USBPrinterOutputDevice to work with the Print Monitor
  Properly prevent warning when no printer is connected.
  ZOffset decorator is now correctly copied
  Force focus instead of requesting it.
  Fix two "critical errors" on startup
  Minor check machine action GUI improvements
  Prevent warning when no printer is connected.
  Fix empty material/quality profiles when switching variants
  Disable monitor buttons when there is no job running
  Move message stack "above" the viewport overlay
  ...
2016-07-04 11:45:59 +02:00

146 lines
4.3 KiB
QML

// Copyright (c) 2016 Ultimaker B.V.
// Uranium is released under the terms of the AGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.1
import UM 1.2 as UM
import Cura 1.0 as Cura
UM.ManagementPage
{
id: base;
title: catalog.i18nc("@title:tab", "Printers");
model: UM.ContainerStacksModel
{
filter: {"type": "machine"}
}
activeId: Cura.MachineManager.activeMachineId
activeIndex: {
for(var i = 0; i < model.rowCount(); i++) {
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) {
return i;
}
}
return -1;
}
buttons: [
Button
{
text: catalog.i18nc("@action:button", "Activate");
iconName: "list-activate";
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId
onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id)
},
Button
{
text: catalog.i18nc("@action:button", "Add");
iconName: "list-add";
onClicked: Printer.requestAddPrinter()
},
Button
{
text: catalog.i18nc("@action:button", "Remove");
iconName: "list-remove";
enabled: base.currentItem != null && model.rowCount() > 1
onClicked: confirmDialog.open();
},
Button
{
text: catalog.i18nc("@action:button", "Rename");
iconName: "edit-rename";
enabled: base.currentItem != null
onClicked: renameDialog.open();
}
]
Item
{
visible: base.currentItem != null
anchors.fill: parent
Label
{
id: machineName
text: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
font: UM.Theme.getFont("large")
width: parent.width
elide: Text.ElideRight
}
Row
{
id: machineActions
anchors.left: parent.left
anchors.top: machineName.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
Repeater
{
id: machineActionRepeater
model: Cura.MachineActionManager.getSupportedActions(Cura.MachineManager.getDefinitionByMachineId(base.currentItem.id))
Button
{
text: machineActionRepeater.model[index].label;
onClicked:
{
actionDialog.content = machineActionRepeater.model[index].displayItem
machineActionRepeater.model[index].displayItem.reset()
actionDialog.show()
}
}
}
}
UM.Dialog
{
id: actionDialog
property var content
onContentChanged:
{
contents = content;
content.onCompleted.connect(hide)
}
}
Row
{
anchors.top: machineActions.visible ? machineActions.bottom : machineActions.anchors.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
anchors.right: parent.right
spacing: UM.Theme.getSize("default_margin").height
Label { text: catalog.i18nc("@label", "Type") }
Label { text: base.currentItem ? base.currentItem.metadata.definition_name : "" }
}
UM.I18nCatalog { id: catalog; name: "uranium"; }
UM.ConfirmRemoveDialog
{
id: confirmDialog;
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
onYes: Cura.MachineManager.removeMachine(base.currentItem.id);
}
UM.RenameDialog
{
id: renameDialog;
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
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
}
}
}
}