Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AddMachineWizard.qml « qml « resources - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2cd54b5b02282573e91d73d654d7db107bc3efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// 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

UM.Dialog {
    id: base

    //: Add Printer dialog title
    title: qsTr("Add Printer");

    ColumnLayout {
        anchors.fill: parent;

        Label {
            //: Add Printer wizard page title
            text: qsTr("Add Printer");
            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; }
    }

    rightButtons: [
        Button {
            //: Add Printer wizarad button
            text: qsTr("Next");
            onClicked: {
                if(machineList.currentIndex != -1) {
                    UM.Models.availableMachinesModel.createMachine(machineList.currentIndex, machineName.text)
                    base.visible = false
                }
            }
        },
        Button {
            //: Add Printer wizarad button
            text: qsTr("Cancel");
            onClicked: base.visible = false;
        }
    ]
}