Merge branch '4.0' into STAR-322_cloud-connection

This commit is contained in:
ChrisTerBeke 2018-12-14 16:10:20 +01:00
commit 2772b3bcbd
25 changed files with 76 additions and 74 deletions

View file

@ -41,7 +41,7 @@ Column
{
left: parent.left
right: printInformationPanel.left
rightMargin: UM.Theme.getSize("thin_margin").height
rightMargin: printInformationPanel.visible ? UM.Theme.getSize("thin_margin").width : 0
}
Cura.IconWithText

View file

@ -12,7 +12,7 @@ UM.RecolorImage
id: widget
source: UM.Theme.getIcon("info")
width: UM.Theme.getSize("section_icon").width
width: visible ? UM.Theme.getSize("section_icon").width : 0
height: UM.Theme.getSize("section_icon").height
color: UM.Theme.getColor("icon")

View file

@ -49,7 +49,7 @@ Item
anchors.centerIn: parent
text: index + 1
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text")
color: UM.Theme.getColor("text")
width: contentWidth
height: contentHeight
visible: extruderEnabled

View file

@ -54,7 +54,7 @@ Item
{
text: model.name.toUpperCase()
checkable: true
checked: UM.Controller.activeStage != null ? model.id == UM.Controller.activeStage.stageId : false
checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId
anchors.verticalCenter: parent.verticalCenter
exclusiveGroup: mainWindowHeaderMenuGroup

View file

@ -17,10 +17,7 @@ Cura.ExpandablePopup
{
id: base
Cura.ExtrudersModel
{
id: extrudersModel
}
property var extrudersModel: CuraApplication.getExtrudersModel()
UM.I18nCatalog
{

View file

@ -27,7 +27,7 @@ Menu
MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders }
Instantiator
{
model: Cura.ExtrudersModel { id: extrudersModel }
model: CuraApplication.getExtrudersModel()
MenuItem {
text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant)
visible: base.shouldShowExtruders

View file

@ -16,7 +16,7 @@ Item
property QtObject qualityManager: CuraApplication.getQualityManager()
property var resetEnabled: false // Keep PreferencesDialog happy
property var extrudersModel: Cura.ExtrudersModel {}
property var extrudersModel: CuraApplication.getExtrudersModel()
UM.I18nCatalog { id: catalog; name: "cura"; }

View file

@ -60,11 +60,7 @@ Rectangle
anchors.fill: parent
Cura.ExtrudersModel
{
id: extrudersModel
simpleNames: true
}
property var extrudersModel: CuraApplication.getExtrudersModel()
OutputDeviceHeader
{

View file

@ -16,10 +16,7 @@ Item
property real padding: UM.Theme.getSize("default_margin").width
property bool multipleExtruders: extrudersModel.count > 1
Cura.ExtrudersModel
{
id: extrudersModel
}
property var extrudersModel: CuraApplication.getExtrudersModel()
// Profile selector row
GlobalProfileSelector
@ -113,9 +110,11 @@ Item
}
z: tabBar.z - 1
// Don't show the border when only one extruder
border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent"
border.width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("main_background")
Cura.SettingView
{
anchors

View file

@ -26,10 +26,7 @@ Cura.ExpandableComponent
headerItem: PrintSetupSelectorHeader {}
Cura.ExtrudersModel
{
id: extrudersModel
}
property var extrudersModel: CuraApplication.getExtrudersModel()
contentItem: PrintSetupSelectorContents {}
}

View file

@ -156,9 +156,10 @@ Item
}
//: Model used to populate the extrudelModel
Cura.ExtrudersModel
property var extruders: CuraApplication.getExtrudersModel()
Connections
{
id: extruders
target: extruders
onModelChanged: populateExtruderModel()
}

View file

@ -17,11 +17,16 @@ SettingItem
id: control
anchors.fill: parent
model: Cura.ExtrudersModel
property var extrudersModel: CuraApplication.getExtrudersModel()
model: extrudersModel
Connections
{
target: extrudersModel
onModelChanged:
{
control.color = getItem(control.currentIndex).color
control.color = extrudersModel.getItem(control.currentIndex).color
}
}

View file

@ -12,15 +12,24 @@ SettingItem
id: base
property var focusItem: control
// Somehow if we directory set control.model to CuraApplication.getExtrudersModelWithOptional()
// and in the Connections.onModelChanged use control.model as a reference, it will complain about
// non-existing properties such as "onModelChanged" and "getItem". I guess if we access the model
// via "control.model", it gives back a generic/abstract model instance. To avoid this, we add
// this extra property to keep the ExtrudersModel and use this in the rest of the code.
property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional()
contents: ComboBox
{
id: control
anchors.fill: parent
model: Cura.ExtrudersModel
model: base.extrudersWithOptionalModel
Connections
{
onModelChanged: control.color = getItem(control.currentIndex).color
addOptionalExtruder: true
target: base.extrudersWithOptionalModel
onModelChanged: control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color
}
textRole: "name"

View file

@ -144,10 +144,7 @@ Item
}
}
Cura.ExtrudersModel
{
id: extrudersModel
}
property var extrudersModel: CuraApplication.getExtrudersModel()
UM.PointingRectangle
{

View file

@ -78,8 +78,6 @@ Cura.ExpandablePopup
{
id: viewSelectorPopup
width: viewSelector.width - 2 * viewSelector.contentPadding
leftPadding: UM.Theme.getSize("default_lining").width
rightPadding: UM.Theme.getSize("default_lining").width
// For some reason the height/width of the column gets set to 0 if this is not set...
Component.onCompleted: