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

PrinterTypeMenu.qml « Menus « qml « resources - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 17986ac1b84ea10ae2efa418c8d7da398cd1091a (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
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.

import QtQuick 2.7
import QtQuick.Controls 2.4

import UM 1.5 as UM
import Cura 1.0 as Cura

Cura.Menu
{
    id: menu
    title: "Printer type"
    property var outputDevice: Cura.MachineManager.printerOutputDevices[0]

    Instantiator
    {
        id: printerTypeInstantiator
        model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []

        Cura.MenuItem
        {
            text: modelData.machine_type
            checkable: true
            checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type
            onTriggered:
            {
                Cura.MachineManager.switchPrinterType(modelData.machine_type)
            }
        }
        onObjectAdded: menu.insertItem(index, object)
        onObjectRemoved: menu.removeItem(object)
    }
}