mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Changes to USB printer manager so its usable by other qml files
This commit is contained in:
parent
c20b3bc2d5
commit
c95cf5263b
4 changed files with 69 additions and 26 deletions
|
@ -13,13 +13,12 @@ Column
|
|||
id: wizardPage
|
||||
property string title
|
||||
anchors.fill: parent;
|
||||
|
||||
Label
|
||||
{
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Component.onCompleted: console.log(UM.USBPrinterManager.connectedPrinterList.count)
|
||||
Label
|
||||
{
|
||||
//: Add Printer wizard page description
|
||||
|
@ -33,14 +32,26 @@ Column
|
|||
ListView
|
||||
{
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton
|
||||
model: UM.USBPrinterManager.connectedPrinterList
|
||||
|
||||
delegate:Row
|
||||
{
|
||||
exclusiveGroup: printerGroup;
|
||||
text: model.name;
|
||||
onClicked:
|
||||
id: derp
|
||||
Text
|
||||
{
|
||||
ListView.view.currentIndex = index;
|
||||
id: text_area
|
||||
text: model.name
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: "Update";
|
||||
onClicked:
|
||||
{
|
||||
if(!UM.USBPrinterManager.updateFirmwareBySerial(text_area.text))
|
||||
{
|
||||
status_text.text = "ERROR"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,15 +59,10 @@ Column
|
|||
|
||||
Label
|
||||
{
|
||||
//: Add Printer wizard field label
|
||||
text: qsTr("Printer Name:");
|
||||
id: status_text
|
||||
text: ""
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name
|
||||
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
|
@ -64,8 +70,5 @@ Column
|
|||
Layout.fillHeight: true;
|
||||
}
|
||||
|
||||
ExclusiveGroup
|
||||
{
|
||||
id: printerGroup;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue