mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
parent
e84322ed82
commit
8596c08a80
9 changed files with 328 additions and 3 deletions
|
@ -8,12 +8,20 @@ import QtQuick.Window 2.1
|
|||
|
||||
import UM 1.0 as UM
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
UM.Dialog
|
||||
{
|
||||
=======
|
||||
UM.Wizard{
|
||||
>>>>>>> Stashed changes
|
||||
id: base
|
||||
property bool printer: true
|
||||
file: "ultimaker2.json"
|
||||
firstRun: printer ? false : true
|
||||
|
||||
//: Add Printer dialog title
|
||||
title: qsTr("Add Printer");
|
||||
<<<<<<< Updated upstream
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
|
@ -124,4 +132,6 @@ UM.Dialog
|
|||
onClicked: base.visible = false;
|
||||
}
|
||||
]
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
|
|
|
@ -368,7 +368,7 @@ UM.MainWindow {
|
|||
resetAll.onTriggered: Printer.resetAll()
|
||||
reloadAll.onTriggered: Printer.reloadAll()
|
||||
|
||||
addMachine.onTriggered: addMachine.visible = true;
|
||||
addMachine.onTriggered: addMachineWizard.visible = true;
|
||||
|
||||
preferences.onTriggered: preferences.visible = true;
|
||||
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(2); }
|
||||
|
@ -460,16 +460,20 @@ UM.MainWindow {
|
|||
}
|
||||
|
||||
AddMachineWizard {
|
||||
id: addMachine;
|
||||
id: addMachineWizard
|
||||
}
|
||||
|
||||
|
||||
AboutDialog {
|
||||
id: aboutDialog
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Printer
|
||||
onRequestAddPrinter: addMachine.visible = true;
|
||||
onRequestAddPrinter: {
|
||||
addMachineWizard.visible = true
|
||||
addMachineWizard.printer = false
|
||||
}
|
||||
onWriteToLocalFileRequested: saveDialog.open();
|
||||
}
|
||||
|
||||
|
|
89
resources/qml/WizardPages/AddMachine.qml
Normal file
89
resources/qml/WizardPages/AddMachine.qml
Normal file
|
@ -0,0 +1,89 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import ".."
|
||||
|
||||
ColumnLayout {
|
||||
id: wizardPage
|
||||
property string title
|
||||
anchors.fill: parent
|
||||
signal openFile(string fileName)
|
||||
signal closeWizard()
|
||||
|
||||
Connections {
|
||||
target: rootElement
|
||||
onFinalClicked: {//You can add functions here that get triggered when the final button is clicked in the wizard-element
|
||||
saveMachine()
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard page description
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton {
|
||||
exclusiveGroup: printerGroup;
|
||||
checked: ListView.view.currentIndex == index ? true : false
|
||||
text: model.name;
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard field 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; }
|
||||
|
||||
function getSpecialMachineType(machineId){
|
||||
for (var i = 0; i < UM.Models.addMachinesModel.rowCount(); i++) {
|
||||
if (UM.Models.addMachinesModel.getItem(i).id == machineId){
|
||||
return UM.Models.addMachinesModel.getItem(i).file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveMachine(){
|
||||
if(machineList.currentIndex != -1) {
|
||||
UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
|
||||
|
||||
var chosenMachineType = UM.Models.availableMachinesModel.getItem(machineList.currentIndex).type
|
||||
var originalMachineType = getSpecialMachineType("ultimaker_original")
|
||||
var orginalPlusMachineType = getSpecialMachineType("ultimaker_original_plus")
|
||||
|
||||
if (chosenMachineType == originalMachineType)
|
||||
wizardPage.openFile(originalMachineType)
|
||||
if (chosenMachineType == orginalPlusMachineType)
|
||||
wizardPage.openFile(orginalPlusMachineType)
|
||||
else
|
||||
wizardPage.closeWizard()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
52
resources/qml/WizardPages/Bedleveling.qml
Normal file
52
resources/qml/WizardPages/Bedleveling.qml
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
ColumnLayout {
|
||||
property string title
|
||||
anchors.fill: parent;
|
||||
|
||||
Label {
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard page description
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton {
|
||||
exclusiveGroup: printerGroup;
|
||||
text: model.name;
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard field 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; }
|
||||
}
|
52
resources/qml/WizardPages/SelectUpgradedParts.qml
Normal file
52
resources/qml/WizardPages/SelectUpgradedParts.qml
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
ColumnLayout {
|
||||
property string title
|
||||
anchors.fill: parent;
|
||||
|
||||
Label {
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard page description
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton {
|
||||
exclusiveGroup: printerGroup;
|
||||
text: model.name;
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard field 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; }
|
||||
}
|
52
resources/qml/WizardPages/UltimakerCheckup.qml
Normal file
52
resources/qml/WizardPages/UltimakerCheckup.qml
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
ColumnLayout {
|
||||
property string title
|
||||
anchors.fill: parent;
|
||||
|
||||
Label {
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard page description
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton {
|
||||
exclusiveGroup: printerGroup;
|
||||
text: model.name;
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard field 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; }
|
||||
}
|
52
resources/qml/WizardPages/UpgradeFirmware.qml
Normal file
52
resources/qml/WizardPages/UpgradeFirmware.qml
Normal file
|
@ -0,0 +1,52 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
|
||||
ColumnLayout {
|
||||
property string title
|
||||
anchors.fill: parent;
|
||||
signal openFile(string fileName)
|
||||
|
||||
Label {
|
||||
text: parent.title
|
||||
font.pointSize: 18;
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard page description
|
||||
text: qsTr("Please select the type of printer:");
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true;
|
||||
|
||||
ListView {
|
||||
id: machineList;
|
||||
model: UM.Models.availableMachinesModel
|
||||
delegate: RadioButton {
|
||||
exclusiveGroup: printerGroup;
|
||||
text: model.name;
|
||||
onClicked: {
|
||||
ListView.view.currentIndex = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
//: Add Printer wizard field 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; }
|
||||
}
|
|
@ -1,6 +1,13 @@
|
|||
{
|
||||
"visible": false,
|
||||
<<<<<<< Updated upstream
|
||||
"manufacturer": "other",
|
||||
=======
|
||||
"add_pages": [
|
||||
{"page": "AddMachine", "title": "Add new printer"}
|
||||
],
|
||||
|
||||
>>>>>>> Stashed changes
|
||||
"machine_settings": {
|
||||
"machine_start_gcode": {
|
||||
"default": "G28 ; Home\nG1 Z15.0 F6000 ;move the platform down 15mm\n;Prime the extruder\nG92 E0\nG1 F200 E3\nG92 E0"
|
||||
|
|
|
@ -7,6 +7,13 @@
|
|||
|
||||
"inherits": "fdmprinter.json",
|
||||
|
||||
"add_pages": [
|
||||
{"page": "SelectUpgradedParts", "title": "Select Upgraded Parts"},
|
||||
{"page": "UpgradeFirmware", "title": "Upgrade Ultimaker Firmware"},
|
||||
{"page": "UltimakerCheckup", "title": "Ultimaker Checkup"},
|
||||
{"page": "Bedleveling", "title": "Bedleveling Wizard"}
|
||||
],
|
||||
|
||||
"machine_settings": {
|
||||
"machine_width": { "default": 205 },
|
||||
"machine_height": { "default": 200 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue