mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-22 10:21:39 -07:00
CURA-4870 Start showing the list of printers separating between local
and networked priters.
This commit is contained in:
parent
197508028a
commit
0d8302d864
4 changed files with 70 additions and 18 deletions
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.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
@ -11,24 +11,24 @@ Menu
|
||||||
{
|
{
|
||||||
id: menu;
|
id: menu;
|
||||||
|
|
||||||
Instantiator
|
MenuItem
|
||||||
{
|
{
|
||||||
model: UM.ContainerStacksModel
|
text: "Network printers"
|
||||||
{
|
checkable: false
|
||||||
filter: {"type": "machine"}
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetworkPrinterMenu { }
|
||||||
|
|
||||||
|
MenuSeparator { }
|
||||||
|
|
||||||
|
MenuItem
|
||||||
|
{
|
||||||
|
text: "Local printers"
|
||||||
|
checkable: false
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalPrinterMenu { }
|
||||||
|
|
||||||
ExclusiveGroup { id: group; }
|
ExclusiveGroup { id: group; }
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ Rectangle
|
||||||
visible: base.width - allItemsWidth - 1 * this.width > 0
|
visible: base.width - allItemsWidth - 1 * this.width > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// #5 Left view
|
// #5 Right view
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_right")
|
iconSource: UM.Theme.getIcon("view_right")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue