Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2017-05-09 13:19:05 +02:00
commit bb2600cd17
2 changed files with 107 additions and 100 deletions

View File

@ -14,8 +14,8 @@ UM.Dialog
id: base id: base
title: catalog.i18nc("@title:window", "Discard or Keep changes") title: catalog.i18nc("@title:window", "Discard or Keep changes")
width: 800 * Screen.devicePixelRatio width: 800
height: 400 * Screen.devicePixelRatio height: 400
property var changesModel: Cura.UserChangesModel{ id: userChangesModel} property var changesModel: Cura.UserChangesModel{ id: userChangesModel}
onVisibilityChanged: onVisibilityChanged:
{ {
@ -36,9 +36,14 @@ UM.Dialog
} }
} }
Column Row
{ {
anchors.fill: parent id: infoTextRow
height: childrenRect.height
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
UM.I18nCatalog UM.I18nCatalog
@ -47,14 +52,6 @@ UM.Dialog
name: "cura" name: "cura"
} }
Row
{
height: childrenRect.height
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.left: parent.left
anchors.right: parent.right
spacing: UM.Theme.getSize("default_margin").width
Label Label
{ {
text: catalog.i18nc("@text:window", "You have customized some profile settings.\nWould you like to keep or discard those settings?") text: catalog.i18nc("@text:window", "You have customized some profile settings.\nWould you like to keep or discard those settings?")
@ -64,12 +61,17 @@ UM.Dialog
} }
} }
TableView Item
{ {
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
anchors.top: infoTextRow.bottom
anchors.bottom: optionRow.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: base.height - 150 * Screen.devicePixelRatio TableView
{
anchors.fill: parent
height: base.height - 150
id: tableView id: tableView
Component Component
{ {
@ -132,9 +134,12 @@ UM.Dialog
model: base.changesModel model: base.changesModel
} }
}
Item Item
{ {
id: optionRow
anchors.bottom: buttonsRow.top
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
@ -179,6 +184,8 @@ UM.Dialog
Item Item
{ {
id: buttonsRow
anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
@ -220,4 +227,3 @@ UM.Dialog
} }
} }
} }
}

7
tests/Settings/TestGlobalStack.py Normal file → Executable file
View File

@ -78,9 +78,10 @@ def test_addExtruder(global_stack):
global_stack.addExtruder(second_extruder) global_stack.addExtruder(second_extruder)
assert len(global_stack.extruders) == 2 assert len(global_stack.extruders) == 2
assert global_stack.extruders[1] == second_extruder assert global_stack.extruders[1] == second_extruder
with unittest.mock.patch("cura.Settings.CuraContainerStack.DefinitionContainer", unittest.mock.MagicMock): # Disabled for now for Custom FDM Printer
with pytest.raises(TooManyExtrudersError): #Should be limited to 2 extruders because of machine_extruder_count. # with unittest.mock.patch("cura.Settings.CuraContainerStack.DefinitionContainer", unittest.mock.MagicMock):
global_stack.addExtruder(unittest.mock.MagicMock()) # with pytest.raises(TooManyExtrudersError): #Should be limited to 2 extruders because of machine_extruder_count.
# global_stack.addExtruder(unittest.mock.MagicMock())
assert len(global_stack.extruders) == 2 #Didn't add the faulty extruder. assert len(global_stack.extruders) == 2 #Didn't add the faulty extruder.
#Tests setting user changes profiles to invalid containers. #Tests setting user changes profiles to invalid containers.