CURA-4870 Start showing the list of printers separating between local

and networked priters.
This commit is contained in:
Diego Prado Gesto 2018-02-27 11:23:04 +01:00
parent 197508028a
commit 0d8302d864
4 changed files with 70 additions and 18 deletions

View 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)
}

View 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)
}

View File

@ -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
{
model: UM.ContainerStacksModel
{
filter: {"type": "machine"}
}
MenuItem MenuItem
{ {
text: model.name; text: "Network printers"
checkable: true; checkable: false
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 { }

View File

@ -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")