mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 17:45:56 +08:00
CURA-4870 Start showing the list of printers separating between local
and networked priters.
This commit is contained in:
parent
197508028a
commit
0d8302d864
26
resources/qml/Menus/LocalPrinterMenu.qml
Normal file
26
resources/qml/Menus/LocalPrinterMenu.qml
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine", "um_network_key": null}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: Cura.MachineManager.activeMachineId == model.id
|
||||
exclusiveGroup: group;
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id);
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
26
resources/qml/Menus/NetworkPrinterMenu.qml
Normal file
26
resources/qml/Menus/NetworkPrinterMenu.qml
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine", "um_network_key": "*"}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: Cura.MachineManager.activeMachineId == model.id
|
||||
exclusiveGroup: group;
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id);
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -11,24 +11,24 @@ Menu
|
||||
{
|
||||
id: menu;
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine"}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: Cura.MachineManager.activeMachineId == model.id
|
||||
exclusiveGroup: group;
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id);
|
||||
text: "Network printers"
|
||||
checkable: false
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
|
||||
NetworkPrinterMenu { }
|
||||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: "Local printers"
|
||||
checkable: false
|
||||
}
|
||||
|
||||
LocalPrinterMenu { }
|
||||
|
||||
ExclusiveGroup { id: group; }
|
||||
|
||||
MenuSeparator { }
|
||||
|
@ -150,7 +150,7 @@ Rectangle
|
||||
visible: base.width - allItemsWidth - 1 * this.width > 0
|
||||
}
|
||||
|
||||
// #5 Left view
|
||||
// #5 Right view
|
||||
Button
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_right")
|
||||
|
Loading…
x
Reference in New Issue
Block a user