Code style & switch to translation catalog

This commit is contained in:
Jaime van Kessel 2015-08-27 16:04:02 +02:00
parent f17cc811c4
commit d195c859a2
16 changed files with 496 additions and 317 deletions

View file

@ -7,7 +7,7 @@ import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM
import UM 1.1 as UM
import ".."
ColumnLayout
@ -19,12 +19,12 @@ ColumnLayout
property var manufacturers: wizardPage.lineManufacturers()
property int manufacturerIndex: 0
SystemPalette{id: palette}
SystemPalette {id: palette}
signal reloadModel(var newModel)
width: wizardPage.pageWidth
height: wizardPage.pageHeight
UM.I18nCatalog { id: catalog; name: "cura"}
Connections
{
target: elementRoot
@ -62,7 +62,7 @@ ColumnLayout
anchors.left: parent.left
anchors.top: title.bottom
//: Add Printer wizard page description
text: qsTr("Please select the type of printer:");
text: catalog.i18nc("@label","Please select the type of printer:");
}
ScrollView
@ -179,7 +179,7 @@ ColumnLayout
visible: model.author != "Ultimaker" ? true : false
height: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? UM.Theme.sizes.standard_list_lineheight.height : 0
//: Printer profile caption meaning: this profile is supported by the community
text: qsTr("community supported profile");
text: catalog.i18nc("@label","community supported profile");
opacity: wizardPage.manufacturers[wizardPage.manufacturerIndex] == model.manufacturer ? 1 : 0
anchors.left: machineButton.right
anchors.leftMargin: UM.Theme.sizes.standard_list_lineheight.height/2
@ -231,7 +231,7 @@ ColumnLayout
{
id: insertNameLabel
//: Add Printer wizard field label
text: qsTr("Printer Name:");
text: catalog.i18nc("@label","Printer Name:");
}
TextField
{

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.0 as UM
import UM 1.1 as UM
Item
{
@ -14,7 +14,7 @@ Item
property string title
SystemPalette{id: palette}
UM.I18nCatalog { id: catalog; name:"cura"}
ScrollView
{
height: parent.height
@ -36,7 +36,7 @@ Item
//: Add UM Original wizard page description
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("To assist you in having better default settings for your Ultimaker. Cura would like to know which upgrades you have in your machine:")
text: catalog.i18nc("@label","To assist you in having better default settings for your Ultimaker. Cura would like to know which upgrades you have in your machine:")
}
Column
@ -46,19 +46,19 @@ Item
CheckBox
{
text: qsTr("Extruder driver ugrades")
text: catalog.i18nc("@action:checkbox","Extruder driver ugrades")
}
CheckBox
{
text: qsTr("Heated printer bed (kit)")
text: catalog.i18nc("@action:checkbox","Heated printer bed (kit)")
}
CheckBox
{
text: qsTr("Heated printer bed (self built)")
text: catalog.i18nc("@action:checkbox","Heated printer bed (self built)")
}
CheckBox
{
text: qsTr("Dual extrusion (experimental)")
text: catalog.i18nc("@action:checkbox","Dual extrusion (experimental)")
checked: true
}
}
@ -67,14 +67,14 @@ Item
{
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("If you have an Ultimaker bought after october 2012 you will have the Extruder drive upgrade. If you do not have this upgrade, it is highly recommended to improve reliability.");
text: catalog.i18nc("@label","If you have an Ultimaker bought after october 2012 you will have the Extruder drive upgrade. If you do not have this upgrade, it is highly recommended to improve reliability.");
}
Label
{
width: parent.width
wrapMode: Text.WordWrap
text: qsTr("This upgrade can be bought from the Ultimaker webshop or found on thingiverse as thing:26094");
text: catalog.i18nc("@label","This upgrade can be bought from the Ultimaker webshop or found on thingiverse as thing:26094");
}
}
}

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.0 as UM
import UM 1.1 as UM
Column
{
@ -23,7 +23,7 @@ Column
Component.onCompleted: printer_connection.startPollEndstop()
Component.onDestruction: printer_connection.stopPollEndstop()
UM.I18nCatalog { id: catalog; name:"cura"}
Label
{
text: parent.title
@ -33,14 +33,14 @@ Column
Label
{
//: Add Printer wizard page description
text: qsTr("It's a good idea to do a few sanity checks on your Ultimaker. \n You can skip these if you know your machine is functional");
text: catalog.i18nc("@label","It's a good idea to do a few sanity checks on your Ultimaker. \n You can skip these if you know your machine is functional");
}
Row
{
Label
{
text: qsTr("Connection: ")
text: catalog.i18nc("@label","Connection: ")
}
Label
{
@ -51,22 +51,22 @@ Column
{
Label
{
text: qsTr("Min endstop X: ")
text: catalog.i18nc("@label","Min endstop X: ")
}
Label
{
text: x_min_pressed ? qsTr("Works") : qsTr("Not checked")
text: x_min_pressed ? catalog.i18nc("@label","Works") : catalog.i18nc("@label","Not checked")
}
}
Row
{
Label
{
text: qsTr("Min endstop Y: ")
text: catalog.i18nc("@label","Min endstop Y: ")
}
Label
{
text: y_min_pressed ? qsTr("Works") : qsTr("Not checked")
text: y_min_pressed ? catalog.i18nc("@label","Works") : catalog.i18nc("@label","Not checked")
}
}
@ -74,11 +74,11 @@ Column
{
Label
{
text: qsTr("Min endstop Z: ")
text: catalog.i18nc("@label","Min endstop Z: ")
}
Label
{
text: z_min_pressed ? qsTr("Works") : qsTr("Not checked")
text: z_min_pressed ? catalog.i18nc("@label","Works") : catalog.i18nc("@label","Not checked")
}
}
@ -86,7 +86,7 @@ Column
{
Label
{
text: qsTr("Nozzle temperature check: ")
text: catalog.i18nc("@label","Nozzle temperature check: ")
}
Label
{
@ -94,10 +94,10 @@ Column
}
Button
{
text: "Start heating"
text: catalog.i18nc("@action:button","Start heating")
onClicked:
{
heater_status_label.text = qsTr("Checking")
heater_status_label.text = catalog.i18nc("@label","Checking")
printer_connection.heatupNozzle(190)
wizardPage.extruder_target_temp = 190
}
@ -105,7 +105,7 @@ Column
Label
{
id: heater_status_label
text: qsTr("Not checked")
text: catalog.i18nc("@label","Not checked")
}
}
@ -113,7 +113,7 @@ Column
{
Label
{
text: qsTr("bed temperature check: ")
text: catalog.i18nc("@label","bed temperature check: ")
}
Label
{
@ -121,10 +121,10 @@ Column
}
Button
{
text: "Start heating"
text: catalog.i18nc("@action:button","Start heating")
onClicked:
{
bed_status_label.text = qsTr("Checking")
bed_status_label.text = catalog.i18nc("@label","Checking")
printer_connection.printer.heatupBed(60)
wizardPage.bed_target_temp = 60
}
@ -132,7 +132,7 @@ Column
Label
{
id: bed_status_label
text: qsTr("Not checked")
text: catalog.i18nc("@label","Not checked")
}
}
@ -159,7 +159,7 @@ Column
{
if(printer_connection.extruderTemperature > wizardPage.extruder_target_temp - 10 && printer_connection.extruderTemperature < wizardPage.extruder_target_temp + 10)
{
heater_status_label.text = qsTr("Works")
heater_status_label.text = catalog.i18nc("@label","Works")
printer_connection.heatupNozzle(0)
}
}
@ -167,7 +167,7 @@ Column
{
if(printer_connection.bedTemperature > wizardPage.bed_target_temp - 5 && printer_connection.bedTemperature < wizardPage.bed_target_temp + 5)
{
bed_status_label.text = qsTr("Works")
bed_status_label.text = catalog.i18nc("@label","Works")
printer_connection.heatupBed(0)
}
}