Revert "Change spelling of "colour" to "color" for consistency"

This reverts commit 963a2092ef.

I still say we should use "colour" for consistency, but that change should not be part of this branch.

CURA-333
This commit is contained in:
fieldOfView 2016-06-22 10:19:44 +02:00
parent b17d621243
commit 6adc4ef284
6 changed files with 16 additions and 16 deletions

View file

@ -18,8 +18,8 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
## Human-readable name of the extruder. ## Human-readable name of the extruder.
NameRole = Qt.UserRole + 2 NameRole = Qt.UserRole + 2
## Color of the material loaded in the extruder. ## Colour of the material loaded in the extruder.
ColorRole = Qt.UserRole + 3 ColourRole = Qt.UserRole + 3
## Index of the extruder, which is also the value of the setting itself. ## Index of the extruder, which is also the value of the setting itself.
# #
@ -28,9 +28,9 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
# containers. # containers.
IndexRole = Qt.UserRole + 4 IndexRole = Qt.UserRole + 4
## List of colors to display if there is no material or the material has no known ## List of colours to display if there is no material or the material has no known
# color. # colour.
defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"] defaultColours = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"]
## Initialises the extruders model, defining the roles and listening for ## Initialises the extruders model, defining the roles and listening for
# changes in the data. # changes in the data.
@ -41,7 +41,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
self.addRoleName(self.IdRole, "id") self.addRoleName(self.IdRole, "id")
self.addRoleName(self.NameRole, "name") self.addRoleName(self.NameRole, "name")
self.addRoleName(self.ColorRole, "color") self.addRoleName(self.ColourRole, "colour")
self.addRoleName(self.IndexRole, "index") self.addRoleName(self.IndexRole, "index")
self._add_global = False self._add_global = False
@ -99,11 +99,11 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
if self._add_global: if self._add_global:
material = global_container_stack.findContainer({ "type": "material" }) material = global_container_stack.findContainer({ "type": "material" })
color = material.getMetaDataEntry("color_code", default = self.defaultColors[0]) if material else self.defaultColors[0] colour = material.getMetaDataEntry("color_code", default = self.defaultColours[0]) if material else self.defaultColours[0]
item = { item = {
"id": global_container_stack.getId(), "id": global_container_stack.getId(),
"name": "Global", "name": "Global",
"color": color, "colour": colour,
"index": -1 "index": -1
} }
self.appendItem(item) self.appendItem(item)
@ -118,12 +118,12 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
position = int(position) position = int(position)
except ValueError: #Not a proper int. except ValueError: #Not a proper int.
position = -1 position = -1
default_color = self.defaultColors[position] if position >= 0 and position < len(self.defaultColors) else defaultColors[0] default_colour = self.defaultColours[position] if position >= 0 and position < len(self.defaultColours) else defaultColours[0]
color = material.getMetaDataEntry("color_code", default = default_color) if material else default_color colour = material.getMetaDataEntry("color_code", default = default_colour) if material else default_colour
item = { #Construct an item with only the relevant information. item = { #Construct an item with only the relevant information.
"id": extruder.getId(), "id": extruder.getId(),
"name": extruder_name, "name": extruder_name,
"color": color, "colour": colour,
"index": position "index": position
} }
self.appendItem(item) self.appendItem(item)

View file

@ -78,7 +78,7 @@ Item {
anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.leftMargin: UM.Theme.getSize("default_lining").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: extruders_model.getItem(extruderSelector.currentIndex).color color: extruders_model.getItem(extruderSelector.currentIndex).colour
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
} }

View file

@ -63,7 +63,7 @@ class SolidView(View):
if extruder_id: if extruder_id:
extruder_index = max(0, self._extruders_model.find("id", extruder_id)) extruder_index = max(0, self._extruders_model.find("id", extruder_id))
extruder_color = self._extruders_model.getItem(extruder_index)["color"] extruder_color = self._extruders_model.getItem(extruder_index)["colour"]
try: try:
# Colors are passed as rgb hex strings (eg "#ffffff"), and the shader needs # Colors are passed as rgb hex strings (eg "#ffffff"), and the shader needs
# an rgba list of floats (eg [1.0, 1.0, 1.0, 1.0]) # an rgba list of floats (eg [1.0, 1.0, 1.0, 1.0])

View file

@ -64,7 +64,7 @@ SettingItem
anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.leftMargin: UM.Theme.getSize("default_lining").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: extruders_model.getItem(control.currentIndex).color color: extruders_model.getItem(control.currentIndex).colour
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border") border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : UM.Theme.getColor("setting_control_border")
} }

View file

@ -162,7 +162,7 @@ Column
anchors.leftMargin: (parent.height - height) / 2 anchors.leftMargin: (parent.height - height) / 2
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: model.color color: model.colour
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("toggle_checked") border.color: UM.Theme.getColor("toggle_checked")
} }

View file

@ -339,7 +339,7 @@ Item
for(var extruderNr = 0; extruderNr < extruders.model.rowCount() ; extruderNr++) { for(var extruderNr = 0; extruderNr < extruders.model.rowCount() ; extruderNr++) {
extruderModel.append({ extruderModel.append({
text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNr).name), text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNr).name),
color: extruders.model.getItem(extruderNr).color color: extruders.model.getItem(extruderNr).colour
}) })
} }
} }