mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 04:25:55 +08:00
Use UM Dialog for AddMachineWizard
This commit is contained in:
parent
2b2c624e4e
commit
06c5419054
@ -5,69 +5,59 @@ import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
Window {
|
||||
UM.Dialog {
|
||||
id: base
|
||||
|
||||
width: 640
|
||||
height: 480
|
||||
|
||||
//: Add Printer dialog title
|
||||
title: qsTr("Add Printer");
|
||||
|
||||
Rectangle {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent;
|
||||
color: palette.window;
|
||||
anchors.margins: UM.Styles.defaultMargin;
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent;
|
||||
anchors.margins: UM.Styles.defaultMargin;
|
||||
Label {
|
||||
text: qsTr("Add Printer");
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton { exclusiveGroup: printerGroup; text: model.name; onClicked: ListView.view.currentIndex = index; }
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Printer Name:");
|
||||
}
|
||||
|
||||
TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name }
|
||||
|
||||
Item { Layout.fillWidth: true; Layout.fillHeight: true; }
|
||||
|
||||
ExclusiveGroup { id: printerGroup; }
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Item { Layout.fillWidth: true; }
|
||||
|
||||
Button {
|
||||
text: qsTr("Next");
|
||||
onClicked: {
|
||||
if(machineList.currentIndex != -1) {
|
||||
UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
|
||||
base.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Cancel");
|
||||
onClicked: base.visible = false;
|
||||
}
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton { exclusiveGroup: printerGroup; text: model.name; onClicked: ListView.view.currentIndex = index; }
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Printer Name:");
|
||||
}
|
||||
|
||||
TextField { id: machineName; Layout.fillWidth: true; text: machineList.model.getItem(machineList.currentIndex).name }
|
||||
|
||||
Item { Layout.fillWidth: true; Layout.fillHeight: true; }
|
||||
|
||||
ExclusiveGroup { id: printerGroup; }
|
||||
}
|
||||
|
||||
SystemPalette { id: palette; colorGroup: SystemPalette.Active }
|
||||
rightButtons: [
|
||||
Button {
|
||||
text: qsTr("Next");
|
||||
onClicked: {
|
||||
if(machineList.currentIndex != -1) {
|
||||
UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
|
||||
base.visible = false
|
||||
}
|
||||
}
|
||||
},
|
||||
Button {
|
||||
text: qsTr("Cancel");
|
||||
onClicked: base.visible = false;
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user