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

@ -6,13 +6,14 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.1 as UM
UM.Dialog { UM.Dialog
{
width: 500 * Screen.devicePixelRatio; width: 500 * Screen.devicePixelRatio;
height: 100 * Screen.devicePixelRatio; height: 100 * Screen.devicePixelRatio;
title: "Print with USB" title: catalog.i18nc("@title:window", "Print with USB")
Column Column
{ {
@ -23,18 +24,20 @@ UM.Dialog {
Text Text
{ {
//: USB Printing dialog label, %1 is head temperature //: USB Printing dialog label, %1 is head temperature
text: qsTr("Extruder Temperature %1").arg(manager.extruderTemperature) text: catalog.i18nc("@label","Extruder Temperature %1").arg(manager.extruderTemperature)
} }
Text Text
{ {
//: USB Printing dialog label, %1 is bed temperature //: USB Printing dialog label, %1 is bed temperature
text: qsTr("Bed Temperature %1").arg(manager.bedTemperature) text: catalog.i18nc("@label","Bed Temperature %1").arg(manager.bedTemperature)
} }
Text Text
{ {
text: "" + manager.error text: "" + manager.error
} }
UM.I18nCatalog{id: catalog; name:"cura"}
} }
ProgressBar ProgressBar
@ -50,16 +53,17 @@ UM.Dialog {
} }
rightButtons: [ rightButtons: [
Button { Button
{
//: USB Printing dialog start print button //: USB Printing dialog start print button
text: qsTr("Print"); text: catalog.i18nc("@action:button","Print");
onClicked: { manager.startPrint() } onClicked: { manager.startPrint() }
enabled: manager.progress == 0 ? true : false enabled: manager.progress == 0 ? true : false
}, },
Button Button
{ {
//: USB Printing dialog cancel print button //: USB Printing dialog cancel print button
text: qsTr("Cancel"); text: catalog.i18nc("@action:button","Cancel");
onClicked: { manager.cancelPrint() } onClicked: { manager.cancelPrint() }
enabled: manager.progress == 0 ? false: true enabled: manager.progress == 0 ? false: true
} }

View file

@ -17,7 +17,7 @@ UM.Dialog
visible: true; visible: true;
modality: Qt.ApplicationModal; modality: Qt.ApplicationModal;
title: "Firmware Update"; title: catalog.i18nc("@title:window","Firmware Update");
Column Column
{ {
@ -25,7 +25,8 @@ UM.Dialog
Text Text
{ {
anchors { anchors
{
left: parent.left; left: parent.left;
right: parent.right; right: parent.right;
} }
@ -34,17 +35,17 @@ UM.Dialog
if (manager.progress == 0) if (manager.progress == 0)
{ {
//: Firmware update status label //: Firmware update status label
return qsTr("Starting firmware update, this may take a while.") return catalog.i18nc("@label","Starting firmware update, this may take a while.")
} }
else if (manager.progress > 99) else if (manager.progress > 99)
{ {
//: Firmware update status label //: Firmware update status label
return qsTr("Firmware update completed.") return catalog.i18nc("@label","Firmware update completed.")
} }
else else
{ {
//: Firmware update status label //: Firmware update status label
return qsTr("Updating firmware.") return catalog.i18nc("@label","Updating firmware.")
} }
} }
@ -57,20 +58,23 @@ UM.Dialog
value: manager.progress value: manager.progress
minimumValue: 0; minimumValue: 0;
maximumValue: 100; maximumValue: 100;
anchors { anchors
{
left: parent.left; left: parent.left;
right: parent.right; right: parent.right;
} }
} }
SystemPalette { SystemPalette
{
id: palette; id: palette;
} }
} }
rightButtons: [ rightButtons: [
Button { Button
{
text: "Close"; text: "Close";
enabled: manager.progress >= 100; enabled: manager.progress >= 100;
onClicked: base.visible = false; onClicked: base.visible = false;

View file

@ -5,17 +5,21 @@ import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.1 as UM
UM.Dialog { UM.Dialog
{
id: base id: base
//: About dialog title //: About dialog title
title: qsTr("About Cura") title: catalog.i18nc("@title:window","About Cura")
minimumWidth: 400 minimumWidth: 400
minimumHeight: 300 minimumHeight: 300;
//UM.I18nCatalog { id: catalog; }
Image {
Image
{
id: logo id: logo
width: parent.width * 0.75 width: parent.width * 0.75
height: width * (1/4.25) height: width * (1/4.25)
@ -26,9 +30,11 @@ UM.Dialog {
sourceSize.height: height sourceSize.height: height
anchors.centerIn: parent anchors.centerIn: parent
anchors.verticalCenterOffset : -(height * 0.5) anchors.verticalCenterOffset : -(height * 0.5)
UM.I18nCatalog{id: catalog; name:"cura"}
} }
Label { Label
{
id: version id: version
text: "Cura %1".arg(UM.Application.version) text: "Cura %1".arg(UM.Application.version)
@ -39,30 +45,33 @@ UM.Dialog {
anchors.topMargin : 5 anchors.topMargin : 5
} }
Label { Label
{
id: description id: description
width: parent.width width: parent.width
//: About dialog application description //: About dialog application description
text: qsTr("End-to-end solution for fused filament 3D printing.") text: catalog.i18nc("@label","End-to-end solution for fused filament 3D printing.")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
anchors.top: version.bottom anchors.top: version.bottom
anchors.topMargin : 10 anchors.topMargin : 10
} }
Label { Label
{
id: author_note id: author_note
width: parent.width width: parent.width
//: About dialog application author note //: About dialog application author note
text: qsTr("Cura has been developed by Ultimaker B.V. in cooperation with the community.") text: catalog.i18nc("@label","Cura has been developed by Ultimaker B.V. in cooperation with the community.")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
anchors.top: description.bottom anchors.top: description.bottom
} }
rightButtons: Button { rightButtons: Button
{
//: Close about dialog button //: Close about dialog button
text: qsTr("Close"); text: catalog.i18nc("@action:button","Close");
onClicked: base.visible = false; onClicked: base.visible = false;
} }

View file

@ -3,9 +3,10 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import UM 1.0 as UM import UM 1.1 as UM
Item { Item
{
property alias open: openAction; property alias open: openAction;
property alias save: saveAction; property alias save: saveAction;
property alias quit: quitAction; property alias quit: quitAction;
@ -42,60 +43,69 @@ Item {
property alias toggleFullScreen: toggleFullScreenAction; property alias toggleFullScreen: toggleFullScreenAction;
UM.I18nCatalog{id: catalog; name:"cura"}
Action Action
{ {
id:toggleFullScreenAction id:toggleFullScreenAction
shortcut: StandardKey.FullScreen; shortcut: StandardKey.FullScreen;
} }
Action { Action
{
id: undoAction; id: undoAction;
//: Undo action //: Undo action
text: qsTr("Undo"); text: catalog.i18nc("@action","Undo");
iconName: "edit-undo"; iconName: "edit-undo";
shortcut: StandardKey.Undo; shortcut: StandardKey.Undo;
} }
Action { Action
{
id: redoAction; id: redoAction;
//: Redo action //: Redo action
text: qsTr("Redo"); text: catalog.i18nc("@action","Redo");
iconName: "edit-redo"; iconName: "edit-redo";
shortcut: StandardKey.Redo; shortcut: StandardKey.Redo;
} }
Action { Action
{
id: quitAction; id: quitAction;
//: Quit action //: Quit action
text: qsTr("Quit"); text: catalog.i18nc("@action","Quit");
iconName: "application-exit"; iconName: "application-exit";
shortcut: StandardKey.Quit; shortcut: StandardKey.Quit;
} }
Action { Action
{
id: preferencesAction; id: preferencesAction;
//: Preferences action //: Preferences action
text: qsTr("Preferences..."); text: catalog.i18nc("@action","Preferences...");
iconName: "configure"; iconName: "configure";
} }
Action { Action
{
id: addMachineAction; id: addMachineAction;
//: Add Printer action //: Add Printer action
text: qsTr("Add Printer..."); text: catalog.i18nc("@action","Add Printer...");
} }
Action { Action
{
id: settingsAction; id: settingsAction;
//: Configure Printers action //: Configure Printers action
text: qsTr("Configure Printers"); text: catalog.i18nc("@action","Configure Printers");
iconName: "configure"; iconName: "configure";
} }
Action { Action
{
id: documentationAction; id: documentationAction;
//: Show Online Documentation action //: Show Online Documentation action
text: qsTr("Show Online &Documentation"); text: catalog.i18nc("@action","Show Online &Documentation");
iconName: "help-contents"; iconName: "help-contents";
shortcut: StandardKey.Help; shortcut: StandardKey.Help;
} }
@ -103,118 +113,131 @@ Item {
Action { Action {
id: reportBugAction; id: reportBugAction;
//: Report a Bug Action //: Report a Bug Action
text: qsTr("Report a &Bug"); text: catalog.i18nc("@action","Report a &Bug");
iconName: "tools-report-bug"; iconName: "tools-report-bug";
} }
Action { Action
{
id: aboutAction; id: aboutAction;
//: About action //: About action
text: qsTr("About..."); text: catalog.i18nc("@action","About...");
iconName: "help-about"; iconName: "help-about";
} }
Action { Action
{
id: deleteSelectionAction; id: deleteSelectionAction;
//: Delete selection action //: Delete selection action
text: qsTr("Delete Selection"); text: catalog.i18nc("@action","Delete Selection");
iconName: "edit-delete"; iconName: "edit-delete";
shortcut: StandardKey.Delete; shortcut: StandardKey.Delete;
} }
Action { Action
{
id: deleteObjectAction; id: deleteObjectAction;
//: Delete object action //: Delete object action
text: qsTr("Delete Object"); text: catalog.i18nc("@action","Delete Object");
iconName: "edit-delete"; iconName: "edit-delete";
shortcut: StandardKey.Backspace; shortcut: StandardKey.Backspace;
} }
Action { Action
{
id: centerObjectAction; id: centerObjectAction;
//: Center object action //: Center object action
text: qsTr("Center Object on Platform"); text: catalog.i18nc("@action","Center Object on Platform");
} }
Action Action
{ {
id: groupObjectsAction id: groupObjectsAction
text: qsTr("Group objects"); text: catalog.i18nc("@action","Group objects");
enabled: UM.Scene.numObjectsSelected > 1 ? true: false enabled: UM.Scene.numObjectsSelected > 1 ? true: false
} }
Action Action
{ {
id: unGroupObjectsAction id: unGroupObjectsAction
text: qsTr("Ungroup objects"); text: catalog.i18nc("@action","Ungroup objects");
enabled: UM.Scene.isGroupSelected enabled: UM.Scene.isGroupSelected
} }
Action Action
{ {
id: mergeObjectsAction id: mergeObjectsAction
text: qsTr("Merge objects"); text: catalog.i18nc("@action","Merge objects");
enabled: UM.Scene.numObjectsSelected > 1 ? true: false enabled: UM.Scene.numObjectsSelected > 1 ? true: false
} }
Action { Action
{
id: multiplyObjectAction; id: multiplyObjectAction;
//: Duplicate object action //: Duplicate object action
text: qsTr("Duplicate Object"); text: catalog.i18nc("@action","Duplicate Object");
} }
Action { Action
{
id: splitObjectAction; id: splitObjectAction;
//: Split object action //: Split object action
text: qsTr("Split Object into Parts"); text: catalog.i18nc("@action","Split Object into Parts");
enabled: false; enabled: false;
} }
Action { Action
{
id: deleteAllAction; id: deleteAllAction;
//: Clear build platform action //: Clear build platform action
text: qsTr("Clear Build Platform"); text: catalog.i18nc("@action","Clear Build Platform");
iconName: "edit-clear"; iconName: "edit-clear";
} }
Action { Action
{
id: reloadAllAction; id: reloadAllAction;
//: Reload all objects action //: Reload all objects action
text: qsTr("Reload All Objects"); text: catalog.i18nc("@action","Reload All Objects");
} }
Action { Action
{
id: resetAllTranslationAction; id: resetAllTranslationAction;
//: Reset all positions action //: Reset all positions action
text: qsTr("Reset All Object Positions"); text: catalog.i18nc("@action","Reset All Object Positions");
} }
Action { Action
{
id: resetAllAction; id: resetAllAction;
//: Reset all positions action //: Reset all positions action
text: qsTr("Reset All Object Transformations"); text: catalog.i18nc("@action","Reset All Object Transformations");
} }
Action { Action
{
id: openAction; id: openAction;
//: Open file action //: Open file action
text: qsTr("Load file"); text: catalog.i18nc("@action","Load file");
iconName: "document-open"; iconName: "document-open";
shortcut: StandardKey.Open; shortcut: StandardKey.Open;
} }
Action { Action
{
id: saveAction; id: saveAction;
//: Save file action //: Save file action
text: qsTr("Save..."); text: catalog.i18nc("@action","Save...");
iconName: "document-save"; iconName: "document-save";
shortcut: StandardKey.Save; shortcut: StandardKey.Save;
} }
Action { Action
{
id: showEngineLogAction; id: showEngineLogAction;
//: Show engine log action //: Show engine log action
text: qsTr("Show engine &log..."); text: catalog.i18nc("@action","Show engine &log...");
iconName: "view-list-text"; iconName: "view-list-text";
} }
} }

View file

@ -6,18 +6,22 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.1 as UM
UM.Wizard UM.Wizard
{ {
//: Add Printer dialog title //: Add Printer dialog title
wizardTitle: qsTr("Add Printer") wizardTitle: catalog.i18nc("@title:wizard","Add Printer")
wizardPages: [ wizardPages: [
{ {
title: "Add Printer", title: "Add Printer",
page: "AddMachine.qml" page: "AddMachine.qml"
} }
] ]
Item
{
UM.I18nCatalog{id: catalog; name:"cura"}
}
// This part is optional // This part is optional
// This part checks whether there is a printer -> if not: some of the functions (delete for example) are disabled // This part checks whether there is a printer -> if not: some of the functions (delete for example) are disabled

View file

@ -9,38 +9,46 @@ import QtQuick.Dialogs 1.1
import UM 1.1 as UM import UM 1.1 as UM
UM.MainWindow { UM.MainWindow
{
id: base id: base
visible: true visible: true
//: Cura application window title //: Cura application window title
title: qsTr("Cura"); title: catalog.i18nc("@title:window","Cura");
Item { Item
{
id: backgroundItem; id: backgroundItem;
anchors.fill: parent; anchors.fill: parent;
UM.I18nCatalog{id: catalog; name:"cura"}
UM.ApplicationMenu { UM.ApplicationMenu
{
id: menu id: menu
window: base window: base
Menu { Menu
{
id: fileMenu id: fileMenu
//: File menu //: File menu
title: qsTr("&File"); title: catalog.i18nc("@title:menu","&File");
MenuItem { action: actions.open; } MenuItem { action: actions.open; }
Menu { Menu
{
id: recentFilesMenu; id: recentFilesMenu;
title: "Open Recent" title: catalog.i18nc("@title:menu","Open Recent")
iconName: "document-open-recent"; iconName: "document-open-recent";
enabled: Printer.recentFiles.length > 0; enabled: Printer.recentFiles.length > 0;
Instantiator { Instantiator
{
model: Printer.recentFiles model: Printer.recentFiles
MenuItem { MenuItem
text: { {
text:
{
var path = modelData.toString() var path = modelData.toString()
return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1); return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1);
} }
@ -53,22 +61,26 @@ UM.MainWindow {
MenuSeparator { } MenuSeparator { }
MenuItem { MenuItem
text: "Save Selection to File"; {
text: catalog.i18nc("@action:menu", "Save Selection to File");
enabled: UM.Selection.hasSelection; enabled: UM.Selection.hasSelection;
iconName: "document-save-as"; iconName: "document-save-as";
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file"); onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file");
} }
Menu { Menu
{
id: saveAllMenu id: saveAllMenu
title: "Save All" title: catalog.i18nc("@title:menu","Save All")
iconName: "document-save"; iconName: "document-save";
enabled: devicesModel.count > 0 && UM.Backend.progress > 0.99; enabled: devicesModel.count > 0 && UM.Backend.progress > 0.99;
Instantiator { Instantiator
{
model: UM.OutputDevicesModel { id: devicesModel; } model: UM.OutputDevicesModel { id: devicesModel; }
MenuItem { MenuItem
{
text: model.description; text: model.description;
onTriggered: UM.OutputDeviceManager.requestWriteToDevice(model.id); onTriggered: UM.OutputDeviceManager.requestWriteToDevice(model.id);
} }
@ -82,9 +94,10 @@ UM.MainWindow {
MenuItem { action: actions.quit; } MenuItem { action: actions.quit; }
} }
Menu { Menu
{
//: Edit menu //: Edit menu
title: qsTr("&Edit"); title: catalog.i18nc("@title:menu","&Edit");
MenuItem { action: actions.undo; } MenuItem { action: actions.undo; }
MenuItem { action: actions.redo; } MenuItem { action: actions.redo; }
@ -94,7 +107,7 @@ UM.MainWindow {
} }
Menu Menu
{ {
title: qsTr("&View"); title: catalog.i18nc("@title:menu","&View");
id: top_view_menu id: top_view_menu
Instantiator Instantiator
{ {
@ -112,14 +125,17 @@ UM.MainWindow {
} }
ExclusiveGroup { id: view_menu_top_group; } ExclusiveGroup { id: view_menu_top_group; }
} }
Menu { Menu
{
id: machineMenu; id: machineMenu;
//: Machine menu //: Machine menu
title: qsTr("&Machine"); title: catalog.i18nc("@title:menu","&Machine");
Instantiator { Instantiator
{
model: UM.Models.machinesModel model: UM.Models.machinesModel
MenuItem { MenuItem
{
text: model.name; text: model.name;
checkable: true; checkable: true;
checked: model.active; checked: model.active;
@ -138,10 +154,11 @@ UM.MainWindow {
MenuItem { action: actions.configureMachines; } MenuItem { action: actions.configureMachines; }
} }
Menu { Menu
{
id: extension_menu id: extension_menu
//: Extensions menu //: Extensions menu
title: qsTr("E&xtensions"); title: catalog.i18nc("@title:menu","E&xtensions");
Instantiator Instantiator
{ {
@ -170,16 +187,18 @@ UM.MainWindow {
} }
} }
Menu { Menu
{
//: Settings menu //: Settings menu
title: qsTr("&Settings"); title: catalog.i18nc("@title:menu","&Settings");
MenuItem { action: actions.preferences; } MenuItem { action: actions.preferences; }
} }
Menu { Menu
{
//: Help menu //: Help menu
title: qsTr("&Help"); title: catalog.i18nc("@title:menu","&Help");
MenuItem { action: actions.showEngineLog; } MenuItem { action: actions.showEngineLog; }
MenuItem { action: actions.documentation; } MenuItem { action: actions.documentation; }
@ -189,7 +208,8 @@ UM.MainWindow {
} }
} }
Item { Item
{
id: contentItem; id: contentItem;
y: menu.height y: menu.height
@ -198,19 +218,25 @@ UM.MainWindow {
Keys.forwardTo: menu Keys.forwardTo: menu
DropArea { DropArea
{
anchors.fill: parent; anchors.fill: parent;
onDropped: { onDropped:
if(drop.urls.length > 0) { {
for(var i in drop.urls) { if(drop.urls.length > 0)
{
for(var i in drop.urls)
{
UM.MeshFileHandler.readLocalFile(drop.urls[i]); UM.MeshFileHandler.readLocalFile(drop.urls[i]);
} }
} }
} }
} }
UM.MessageStack { UM.MessageStack
anchors { {
anchors
{
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -(UM.Theme.sizes.logo.width/ 2) horizontalCenterOffset: -(UM.Theme.sizes.logo.width/ 2)
top: parent.verticalCenter; top: parent.verticalCenter;
@ -237,12 +263,14 @@ UM.MainWindow {
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : ""; source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
} }
Button { Button
{
id: openFileButton; id: openFileButton;
//style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button; //style: UM.Backend.progress < 0 ? UM.Theme.styles.open_file_button : UM.Theme.styles.tool_button;
style: UM.Theme.styles.open_file_button style: UM.Theme.styles.open_file_button
tooltip: ''; tooltip: '';
anchors { anchors
{
top: parent.top; top: parent.top;
topMargin: UM.Theme.sizes.loadfile_margin.height topMargin: UM.Theme.sizes.loadfile_margin.height
left: parent.left; left: parent.left;
@ -251,9 +279,11 @@ UM.MainWindow {
action: actions.open; action: actions.open;
} }
Image { Image
{
id: logo id: logo
anchors { anchors
{
left: parent.left left: parent.left
leftMargin: UM.Theme.sizes.default_margin.width; leftMargin: UM.Theme.sizes.default_margin.width;
bottom: parent.bottom bottom: parent.bottom
@ -268,24 +298,29 @@ UM.MainWindow {
sourceSize.height: height; sourceSize.height: height;
} }
Button { Button
{
id: viewModeButton id: viewModeButton
anchors { anchors
{
top: parent.top; top: parent.top;
right: sidebar.left; right: sidebar.left;
rightMargin: UM.Theme.sizes.window_margin.width; rightMargin: UM.Theme.sizes.window_margin.width;
} }
//: View Mode toolbar button //: View Mode toolbar button
text: qsTr("View Mode"); text: catalog.i18nc("@action:button","View Mode");
iconSource: UM.Theme.icons.viewmode; iconSource: UM.Theme.icons.viewmode;
style: UM.Theme.styles.tool_button; style: UM.Theme.styles.tool_button;
tooltip: ''; tooltip: '';
menu: Menu { menu: Menu
{
id: viewMenu; id: viewMenu;
Instantiator { Instantiator
{
model: UM.Models.viewModel; model: UM.Models.viewModel;
MenuItem { MenuItem
{
text: model.name; text: model.name;
checkable: true; checkable: true;
checked: model.active; checked: model.active;
@ -300,20 +335,24 @@ UM.MainWindow {
} }
} }
Toolbar { Toolbar
{
id: toolbar; id: toolbar;
anchors { anchors
{
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -(UM.Theme.sizes.panel.width / 2) horizontalCenterOffset: -(UM.Theme.sizes.panel.width / 2)
top: parent.top; top: parent.top;
} }
} }
Sidebar { Sidebar
{
id: sidebar; id: sidebar;
anchors { anchors
{
top: parent.top; top: parent.top;
bottom: parent.bottom; bottom: parent.bottom;
right: parent.right; right: parent.right;
@ -325,13 +364,15 @@ UM.MainWindow {
configureMachinesAction: actions.configureMachines; configureMachinesAction: actions.configureMachines;
} }
Rectangle { Rectangle
{
x: base.mouseX + UM.Theme.sizes.default_margin.width; x: base.mouseX + UM.Theme.sizes.default_margin.width;
y: base.mouseY + UM.Theme.sizes.default_margin.height; y: base.mouseY + UM.Theme.sizes.default_margin.height;
width: childrenRect.width; width: childrenRect.width;
height: childrenRect.height; height: childrenRect.height;
Label { Label
{
text: UM.ActiveTool.properties.Rotation != undefined ? "%1°".arg(UM.ActiveTool.properties.Rotation) : ""; text: UM.ActiveTool.properties.Rotation != undefined ? "%1°".arg(UM.ActiveTool.properties.Rotation) : "";
} }
@ -340,23 +381,26 @@ UM.MainWindow {
} }
} }
UM.PreferencesDialog { UM.PreferencesDialog
{
id: preferences id: preferences
Component.onCompleted: { Component.onCompleted:
{
//; Remove & re-add the general page as we want to use our own instead of uranium standard. //; Remove & re-add the general page as we want to use our own instead of uranium standard.
removePage(0); removePage(0);
insertPage(0, qsTr("General") , "" , Qt.resolvedUrl("./GeneralPage.qml")); insertPage(0, catalog.i18nc("@title:tab","General") , "" , Qt.resolvedUrl("./GeneralPage.qml"));
//: View preferences page title //: View preferences page title
insertPage(1, qsTr("View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml")); insertPage(1, catalog.i18nc("@title:tab","View"), "view-preview", Qt.resolvedUrl("./ViewPage.qml"));
//Force refresh //Force refresh
setPage(0) setPage(0)
} }
} }
Actions { Actions
{
id: actions; id: actions;
open.onTriggered: openDialog.open(); open.onTriggered: openDialog.open();
@ -369,28 +413,36 @@ UM.MainWindow {
redo.onTriggered: UM.OperationStack.redo(); redo.onTriggered: UM.OperationStack.redo();
redo.enabled: UM.OperationStack.canRedo; redo.enabled: UM.OperationStack.canRedo;
deleteSelection.onTriggered: { deleteSelection.onTriggered:
if(objectContextMenu.objectId != 0) { {
if(objectContextMenu.objectId != 0)
{
Printer.deleteObject(objectContextMenu.objectId); Printer.deleteObject(objectContextMenu.objectId);
} }
} }
deleteObject.onTriggered: { deleteObject.onTriggered:
if(objectContextMenu.objectId != 0) { {
if(objectContextMenu.objectId != 0)
{
Printer.deleteObject(objectContextMenu.objectId); Printer.deleteObject(objectContextMenu.objectId);
objectContextMenu.objectId = 0; objectContextMenu.objectId = 0;
} }
} }
multiplyObject.onTriggered: { multiplyObject.onTriggered:
if(objectContextMenu.objectId != 0) { {
if(objectContextMenu.objectId != 0)
{
Printer.multiplyObject(objectContextMenu.objectId, 1); Printer.multiplyObject(objectContextMenu.objectId, 1);
objectContextMenu.objectId = 0; objectContextMenu.objectId = 0;
} }
} }
centerObject.onTriggered: { centerObject.onTriggered:
if(objectContextMenu.objectId != 0) { {
if(objectContextMenu.objectId != 0)
{
Printer.centerObject(objectContextMenu.objectId); Printer.centerObject(objectContextMenu.objectId);
objectContextMenu.objectId = 0; objectContextMenu.objectId = 0;
} }
@ -429,7 +481,8 @@ UM.MainWindow {
} }
Menu { Menu
{
id: objectContextMenu; id: objectContextMenu;
property variant objectId: -1; property variant objectId: -1;
@ -448,7 +501,8 @@ UM.MainWindow {
MenuItem { action: actions.mergeObjects;} MenuItem { action: actions.mergeObjects;}
} }
Menu { Menu
{
id: contextMenu; id: contextMenu;
MenuItem { action: actions.deleteAll; } MenuItem { action: actions.deleteAll; }
MenuItem { action: actions.reloadAll; } MenuItem { action: actions.reloadAll; }
@ -459,23 +513,28 @@ UM.MainWindow {
MenuItem { action: actions.mergeObjects;} MenuItem { action: actions.mergeObjects;}
} }
Connections { Connections
{
target: UM.Controller target: UM.Controller
onContextMenuRequested: { onContextMenuRequested:
if(objectId == 0) { {
if(objectId == 0)
{
contextMenu.popup(); contextMenu.popup();
} else { } else
{
objectContextMenu.objectId = objectId; objectContextMenu.objectId = objectId;
objectContextMenu.popup(); objectContextMenu.popup();
} }
} }
} }
FileDialog { FileDialog
{
id: openDialog; id: openDialog;
//: File open dialog title //: File open dialog title
title: qsTr("Open File") title: catalog.i18nc("@title:window","Open File")
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal; modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
//TODO: Support multiple file selection, workaround bug in KDE file dialog //TODO: Support multiple file selection, workaround bug in KDE file dialog
//selectMultiple: true //selectMultiple: true
@ -488,22 +547,27 @@ UM.MainWindow {
} }
} }
EngineLog { EngineLog
{
id: engineLog; id: engineLog;
} }
AddMachineWizard { AddMachineWizard
{
id: addMachineWizard id: addMachineWizard
} }
AboutDialog { AboutDialog
{
id: aboutDialog id: aboutDialog
} }
Connections { Connections
{
target: Printer target: Printer
onRequestAddPrinter: { onRequestAddPrinter:
{
addMachineWizard.visible = true addMachineWizard.visible = true
addMachineWizard.printer = false addMachineWizard.printer = false
} }

View file

@ -5,40 +5,48 @@ import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.0 as UM import UM 1.1 as UM
UM.Dialog { UM.Dialog
{
id: dialog; id: dialog;
//: Engine Log dialog title //: Engine Log dialog title
title: qsTr("Engine Log"); title: catalog.i18nc("@title:window","Engine Log");
modality: Qt.NonModal; modality: Qt.NonModal;
TextArea { TextArea
{
id: textArea id: textArea
anchors.fill: parent; anchors.fill: parent;
Timer { Timer
{
id: updateTimer; id: updateTimer;
interval: 1000; interval: 1000;
running: false; running: false;
repeat: true; repeat: true;
onTriggered: textArea.text = Printer.getEngineLog(); onTriggered: textArea.text = Printer.getEngineLog();
} }
UM.I18nCatalog{id: catalog; name:"cura"}
} }
rightButtons: Button { rightButtons: Button
{
//: Close engine log button //: Close engine log button
text: qsTr("Close"); text: catalog.i18nc("@action:button","Close");
onClicked: dialog.visible = false; onClicked: dialog.visible = false;
} }
onVisibleChanged: { onVisibleChanged:
if(visible) { {
if(visible)
{
textArea.text = Printer.getEngineLog(); textArea.text = Printer.getEngineLog();
updateTimer.start(); updateTimer.start();
} else { } else
{
updateTimer.stop(); updateTimer.stop();
} }
} }

View file

@ -6,12 +6,12 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.1 as UM
UM.PreferencesPage UM.PreferencesPage
{ {
//: General configuration page title //: General configuration page title
title: qsTr("General"); title: catalog.i18nc("@title:wizard","General");
function reset() function reset()
{ {
@ -26,10 +26,11 @@ UM.PreferencesPage
{ {
columns: 2; columns: 2;
//: Language selection label //: Language selection label
UM.I18nCatalog{id: catalog; name:"cura"}
Label Label
{ {
id: languageLabel id: languageLabel
text: qsTr("Language") text: catalog.i18nc("@label","Language")
} }
ComboBox ComboBox
@ -76,7 +77,7 @@ UM.PreferencesPage
// Because ListModel is stupid and does not allow using qsTr() for values. // Because ListModel is stupid and does not allow using qsTr() for values.
for(var i = 0; i < languageList.count; ++i) for(var i = 0; i < languageList.count; ++i)
{ {
languageList.setProperty(i, "text", qsTr(languageList.get(i).text)); languageList.setProperty(i, "text", catalog.i18nc("@action:menu",languageList.get(i).text));
} }
// Glorious hack time. ComboBox does not update the text properly after changing the // Glorious hack time. ComboBox does not update the text properly after changing the
@ -92,7 +93,7 @@ UM.PreferencesPage
Layout.columnSpan: 2 Layout.columnSpan: 2
//: Language change warning //: Language change warning
text: qsTr("You will need to restart the application for language changes to have effect.") text: catalog.i18nc("@label","You will need to restart the application for language changes to have effect.")
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.italic: true font.italic: true
} }
@ -108,11 +109,11 @@ UM.PreferencesPage
id: pushFreeText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox id: pushFreeText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
//: Display Overhang preference checkbox //: Display Overhang preference checkbox
text: qsTr("Automatic push free"); text: catalog.i18nc("@action:checkbox","Automatic push free");
onClicked: pushFreeCheckbox.checked = !pushFreeCheckbox.checked onClicked: pushFreeCheckbox.checked = !pushFreeCheckbox.checked
//: Display Overhang preference tooltip //: Display Overhang preference tooltip
tooltip: "Are objects on the platform automatically moved so they no longer intersect" tooltip: catalog.i18nc("@info:tooltip","Are objects on the platform automatically moved so they no longer intersect")
style: ButtonStyle style: ButtonStyle
{ {
@ -141,11 +142,11 @@ UM.PreferencesPage
id: sendDataText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox id: sendDataText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
//: Display Overhang preference checkbox //: Display Overhang preference checkbox
text: qsTr("Send (anonymous) slice info"); text: catalog.i18nc("@action:checkbox","Send (anonymous) slice info");
onClicked: sendDataCheckbox.checked = !sendDataCheckbox.checked onClicked: sendDataCheckbox.checked = !sendDataCheckbox.checked
//: Display Overhang preference tooltip //: Display Overhang preference tooltip
tooltip: "Should anonymous data about your slices be sent to Ultimaker. No models or IP's are sent / stored." tooltip: catalog.i18nc("@info:tooltip","Should anonymous data about your slices be sent to Ultimaker. No models or IP's are sent / stored.")
style: ButtonStyle style: ButtonStyle
{ {

View file

@ -8,7 +8,8 @@ import QtQuick.Layouts 1.1
import UM 1.1 as UM import UM 1.1 as UM
Rectangle { Rectangle
{
id: base; id: base;
property real progress: UM.Backend.progress; property real progress: UM.Backend.progress;
@ -17,8 +18,9 @@ Rectangle {
property variant printDuration: PrintInformation.currentPrintTime; property variant printDuration: PrintInformation.currentPrintTime;
property real printMaterialAmount: PrintInformation.materialAmount; property real printMaterialAmount: PrintInformation.materialAmount;
UM.I18nCatalog { id: catalog; name:"cura"}
Rectangle{ Rectangle
{
id: background id: background
implicitWidth: base.width; implicitWidth: base.width;
implicitHeight: parent.height; implicitHeight: parent.height;
@ -26,7 +28,8 @@ Rectangle {
border.width: UM.Theme.sizes.save_button_border.width border.width: UM.Theme.sizes.save_button_border.width
border.color: UM.Theme.colors.save_button_border border.color: UM.Theme.colors.save_button_border
Rectangle { Rectangle
{
id: infoBox id: infoBox
width: parent.width - UM.Theme.sizes.default_margin.width * 2; width: parent.width - UM.Theme.sizes.default_margin.width * 2;
height: UM.Theme.sizes.save_button_slicing_bar.height height: UM.Theme.sizes.save_button_slicing_bar.height
@ -39,7 +42,8 @@ Rectangle {
border.width: UM.Theme.sizes.save_button_border.width border.width: UM.Theme.sizes.save_button_border.width
border.color: UM.Theme.colors.save_button_border border.color: UM.Theme.colors.save_button_border
color: UM.Theme.colors.save_button_estimated_text_background; color: UM.Theme.colors.save_button_estimated_text_background;
Label { Label
{
id: label; id: label;
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
@ -47,24 +51,27 @@ Rectangle {
visible: base.progress >= 0 && base.progress < 0.99 ? false : true visible: base.progress >= 0 && base.progress < 0.99 ? false : true
color: UM.Theme.colors.save_button_estimated_text; color: UM.Theme.colors.save_button_estimated_text;
font: UM.Theme.fonts.small; font: UM.Theme.fonts.small;
text: { text:
if(base.activity == false) { {
//: Save button label if(base.activity == false)
return qsTr("Please load a 3D model"); {
} else if (base.progress < 0.99) { return catalog.i18nc("@label","Please load a 3D model");
//: Save button label } else if (base.progress < 0.99)
return qsTr("Calculating Print-time"); {
} else if (base.printDuration.days > 0 || base.progress == null){ return catalog.i18nc("@label","Calculating Print-time");
return qsTr(""); } else if (base.printDuration.days > 0 || base.progress == null)
{
return "";
} }
else if (base.progress > 0.99){ else if (base.progress > 0.99)
//: Save button label {
return qsTr("Estimated Print-time"); return catalog.i18nc("@label","Estimated Print-time");
} }
return ""; return "";
} }
} }
Label { Label
{
id: printDurationLabel id: printDurationLabel
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: label.right; anchors.left: label.right;
@ -74,7 +81,8 @@ Rectangle {
visible: base.activity == false || base.progress < 0.99 ? false : true visible: base.activity == false || base.progress < 0.99 ? false : true
text: (!base.printDuration || !base.printDuration.valid) ? "" : base.printDuration.getDisplayString(UM.DurationFormat.Long); text: (!base.printDuration || !base.printDuration.valid) ? "" : base.printDuration.getDisplayString(UM.DurationFormat.Long);
} }
Label { Label
{
id: printMaterialLabel id: printMaterialLabel
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: printDurationLabel.right; anchors.left: printDurationLabel.right;
@ -86,12 +94,14 @@ Rectangle {
elide: mediumLengthDuration ? Text.ElideRight : Text.ElideNone elide: mediumLengthDuration ? Text.ElideRight : Text.ElideNone
visible: base.activity == false || base.progress < 0.99 ? false : true visible: base.activity == false || base.progress < 0.99 ? false : true
//: Print material amount save button label //: Print material amount save button label
text: base.printMaterialAmount < 0 ? "" : qsTr("%1m of Material").arg(base.printMaterialAmount); text: base.printMaterialAmount < 0 ? "" : catalog.i18nc("@label","%1m of Material").arg(base.printMaterialAmount);
} }
} }
Rectangle { Rectangle
{
id: infoBoxOverlay id: infoBoxOverlay
anchors { anchors
{
left: infoBox.left; left: infoBox.left;
top: infoBox.top; top: infoBox.top;
bottom: infoBox.bottom; bottom: infoBox.bottom;
@ -101,7 +111,8 @@ Rectangle {
visible: progress > 0.99 ? false : true visible: progress > 0.99 ? false : true
} }
Button { Button
{
id: saveToButton id: saveToButton
anchors.top: infoBox.bottom anchors.top: infoBox.bottom
anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height; anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height;
@ -115,11 +126,14 @@ Rectangle {
text: UM.OutputDeviceManager.activeDeviceShortDescription; text: UM.OutputDeviceManager.activeDeviceShortDescription;
style: ButtonStyle { style: ButtonStyle
background: Rectangle { {
background: Rectangle
{
color: !control.enabled ? UM.Theme.colors.save_button_inactive : control.hovered ? UM.Theme.colors.save_button_active_hover : UM.Theme.colors.save_button_active; color: !control.enabled ? UM.Theme.colors.save_button_inactive : control.hovered ? UM.Theme.colors.save_button_active_hover : UM.Theme.colors.save_button_active;
Label { Label
{
anchors.centerIn: parent anchors.centerIn: parent
color: UM.Theme.colors.save_button_safe_to_text; color: UM.Theme.colors.save_button_safe_to_text;
font: UM.Theme.fonts.sidebar_save_to; font: UM.Theme.fonts.sidebar_save_to;
@ -131,14 +145,15 @@ Rectangle {
onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice) onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice)
} }
Button { Button
{
id: deviceSelectionMenu; id: deviceSelectionMenu;
anchors.top: infoBox.bottom anchors.top: infoBox.bottom
anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: UM.Theme.sizes.default_margin.width; anchors.rightMargin: UM.Theme.sizes.default_margin.width;
tooltip: qsTr("Select the active output device"); tooltip: catalog.i18nc("@info:tooltip","Select the active output device");
width: infoBox.width/6*1.3 - UM.Theme.sizes.save_button_text_margin.height; width: infoBox.width/6*1.3 - UM.Theme.sizes.save_button_text_margin.height;
height: UM.Theme.sizes.save_button_save_to_button.height height: UM.Theme.sizes.save_button_save_to_button.height
@ -146,12 +161,14 @@ Rectangle {
iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName]; iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName];
style: ButtonStyle { style: ButtonStyle {
background: Rectangle { background: Rectangle
{
color: UM.Theme.colors.save_button_background; color: UM.Theme.colors.save_button_background;
border.width: control.hovered ? UM.Theme.sizes.save_button_border.width : 0 border.width: control.hovered ? UM.Theme.sizes.save_button_border.width : 0
border.color: UM.Theme.colors.save_button_border border.color: UM.Theme.colors.save_button_border
Rectangle { Rectangle
{
id: deviceSelectionIcon id: deviceSelectionIcon
color: UM.Theme.colors.save_button_background; color: UM.Theme.colors.save_button_background;
anchors.left: parent.left anchors.left: parent.left
@ -160,7 +177,8 @@ Rectangle {
width: parent.height - UM.Theme.sizes.save_button_text_margin.width ; width: parent.height - UM.Theme.sizes.save_button_text_margin.width ;
height: parent.height - UM.Theme.sizes.save_button_text_margin.width; height: parent.height - UM.Theme.sizes.save_button_text_margin.width;
UM.RecolorImage { UM.RecolorImage
{
anchors.fill: parent; anchors.fill: parent;
sourceSize.width: width; sourceSize.width: width;
sourceSize.height: height; sourceSize.height: height;
@ -168,7 +186,8 @@ Rectangle {
source: control.iconSource; source: control.iconSource;
} }
} }
Label { Label
{
id: deviceSelectionArrow id: deviceSelectionArrow
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: UM.Theme.sizes.save_button_text_margin.height anchors.rightMargin: UM.Theme.sizes.save_button_text_margin.height
@ -181,18 +200,19 @@ Rectangle {
label: Item { } label: Item { }
} }
menu: Menu { menu: Menu
{
id: devicesMenu; id: devicesMenu;
Instantiator { Instantiator
{
model: devicesModel; model: devicesModel;
MenuItem { MenuItem
{
text: model.description text: model.description
checkable: true; checkable: true;
checked: model.id == UM.OutputDeviceManager.activeDevice; checked: model.id == UM.OutputDeviceManager.activeDevice;
exclusiveGroup: devicesMenuGroup; exclusiveGroup: devicesMenuGroup;
onTriggered: { onTriggered: UM.OutputDeviceManager.setActiveDevice(model.id);
UM.OutputDeviceManager.setActiveDevice(model.id);
}
} }
onObjectAdded: devicesMenu.insertItem(index, object) onObjectAdded: devicesMenu.insertItem(index, object)
onObjectRemoved: devicesMenu.removeItem(object) onObjectRemoved: devicesMenu.removeItem(object)
@ -202,7 +222,8 @@ Rectangle {
} }
} }
UM.OutputDevicesModel { UM.OutputDevicesModel
{
id: devicesModel; id: devicesModel;
} }
} }

View file

@ -6,42 +6,50 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.0 as UM import UM 1.1 as UM
Rectangle { Rectangle
{
id: base; id: base;
property Action addMachineAction; property Action addMachineAction;
property Action configureMachinesAction; property Action configureMachinesAction;
color: UM.Theme.colors.sidebar; color: UM.Theme.colors.sidebar;
UM.I18nCatalog { id: catalog; name:"cura"}
function showTooltip(item, position, text) { function showTooltip(item, position, text)
{
tooltip.text = text; tooltip.text = text;
position = item.mapToItem(base, position.x, position.y / 2); position = item.mapToItem(base, position.x, position.y / 2);
tooltip.show(position); tooltip.show(position);
} }
function hideTooltip() { function hideTooltip()
{
tooltip.hide(); tooltip.hide();
} }
MouseArea { MouseArea
{
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.AllButtons; acceptedButtons: Qt.AllButtons;
onWheel: { onWheel:
{
wheel.accepted = true; wheel.accepted = true;
} }
} }
ColumnLayout { ColumnLayout
{
anchors.fill: parent; anchors.fill: parent;
anchors.topMargin: UM.Theme.sizes.default_margin.height; anchors.topMargin: UM.Theme.sizes.default_margin.height;
spacing: UM.Theme.sizes.default_margin.height; spacing: UM.Theme.sizes.default_margin.height;
SidebarHeader { SidebarHeader
{
id: header; id: header;
Layout.fillWidth: true; Layout.fillWidth: true;
@ -50,9 +58,11 @@ Rectangle {
configureMachinesAction: base.configureMachinesAction; configureMachinesAction: base.configureMachinesAction;
modesModel: modesListModel; modesModel: modesListModel;
currentModeIndex: { currentModeIndex:
{
var index = parseInt(UM.Preferences.getValue("cura/active_mode")) var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index) { if(index)
{
return index; return index;
} }
return 0; return 0;
@ -60,7 +70,8 @@ Rectangle {
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex); onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
} }
Loader { Loader
{
id: sidebarContents; id: sidebarContents;
Layout.fillWidth: true; Layout.fillWidth: true;
@ -87,18 +98,21 @@ Rectangle {
} }
} }
SaveButton { SaveButton
{
id: saveButton; id: saveButton;
implicitWidth: base.width implicitWidth: base.width
implicitHeight: UM.Theme.sizes.save_button_text_margin.height * 2 + UM.Theme.sizes.save_button_slicing_bar.height + UM.Theme.sizes.save_button_save_to_button.height + UM.Theme.sizes.default_margin.height implicitHeight: UM.Theme.sizes.save_button_text_margin.height * 2 + UM.Theme.sizes.save_button_slicing_bar.height + UM.Theme.sizes.save_button_save_to_button.height + UM.Theme.sizes.default_margin.height
} }
} }
SidebarTooltip { SidebarTooltip
{
id: tooltip; id: tooltip;
} }
ListModel { ListModel
{
id: modesListModel; id: modesListModel;
//: Simple configuration mode option //: Simple configuration mode option
ListElement { text: QT_TR_NOOP("Simple"); file: "SidebarSimple.qml" } ListElement { text: QT_TR_NOOP("Simple"); file: "SidebarSimple.qml" }
@ -106,10 +120,11 @@ Rectangle {
ListElement { text: QT_TR_NOOP("Advanced"); file: "SidebarAdvanced.qml" } ListElement { text: QT_TR_NOOP("Advanced"); file: "SidebarAdvanced.qml" }
} }
Component.onCompleted: { Component.onCompleted:
{
for(var i = 0; i < modesListModel.count; ++i) for(var i = 0; i < modesListModel.count; ++i)
{ {
modesListModel.setProperty(i, "text", qsTr(modesListModel.get(i).text)); modesListModel.setProperty(i, "text", catalog.i18nc("@label", modesListModel.get(i).text));
} }
} }
} }

View file

@ -6,9 +6,10 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.0 as UM import UM 1.1 as UM
Column { Column
{
id: base; id: base;
property variant modesModel; property variant modesModel;
@ -17,37 +18,43 @@ Column {
property Action configureMachinesAction; property Action configureMachinesAction;
spacing: UM.Theme.sizes.default_margin.height; spacing: UM.Theme.sizes.default_margin.height;
UM.I18nCatalog { id: catalog; name:"cura"}
RowLayout { RowLayout
{
anchors.horizontalCenter: parent.horizontalCenter; anchors.horizontalCenter: parent.horizontalCenter;
width: parent.width - UM.Theme.sizes.default_margin.width * 2; width: parent.width - UM.Theme.sizes.default_margin.width * 2;
height: UM.Theme.sizes.line.height; height: UM.Theme.sizes.line.height;
Label { Label
{
//: Configuration mode label //: Configuration mode label
text: qsTr("Mode:"); text: catalog.i18nc("@label","Mode:");
font: UM.Theme.fonts.sidebar_header; font: UM.Theme.fonts.sidebar_header;
color: UM.Theme.colors.text_inactive; color: UM.Theme.colors.text_inactive;
} }
ToolButton { ToolButton
{
text: base.modesModel ? base.modesModel.get(modeMenu.currentIndex).text : ""; text: base.modesModel ? base.modesModel.get(modeMenu.currentIndex).text : "";
style: UM.Theme.styles.sidebar_header_button; style: UM.Theme.styles.sidebar_header_button;
Layout.preferredWidth: base.width * 0.25; Layout.preferredWidth: base.width * 0.25;
menu: Menu { menu: Menu
{
id: modeMenu; id: modeMenu;
property int currentIndex: 0; property int currentIndex: 0;
Instantiator { Instantiator
{
model: base.modesModel; model: base.modesModel;
MenuItem { MenuItem
{
text: model.text; text: model.text;
checkable: true; checkable: true;
checked: modeMenu.currentIndex == index; checked: modeMenu.currentIndex == index;
@ -62,21 +69,24 @@ Column {
} }
} }
Rectangle { Rectangle
{
width: 1; width: 1;
height: parent.height; height: parent.height;
color: UM.Theme.colors.border; color: UM.Theme.colors.border;
} }
Label { Label
{
//: Machine selection label //: Machine selection label
text: qsTr("Machine:"); text: catalog.i18nc("@label","Machine:");
font: UM.Theme.fonts.sidebar_header; font: UM.Theme.fonts.sidebar_header;
color: UM.Theme.colors.text_inactive; color: UM.Theme.colors.text_inactive;
} }
ToolButton { ToolButton
{
id: machineButton; id: machineButton;
text: UM.Application.machineName; text: UM.Application.machineName;
tooltip: UM.Application.machineName; tooltip: UM.Application.machineName;
@ -85,11 +95,14 @@ Column {
Layout.fillWidth: true; Layout.fillWidth: true;
menu: Menu { menu: Menu
{
id: machineMenu; id: machineMenu;
Instantiator { Instantiator
{
model: UM.Models.machinesModel model: UM.Models.machinesModel
MenuItem { MenuItem
{
text: model.name; text: model.name;
checkable: true; checkable: true;
checked: model.active; checked: model.active;
@ -110,14 +123,15 @@ Column {
} }
} }
UM.SidebarCategoryHeader { UM.SidebarCategoryHeader
{
width: parent.width; width: parent.width;
height: UM.Theme.sizes.section.height; height: UM.Theme.sizes.section.height;
iconSource: UM.Theme.icons.printsetup; iconSource: UM.Theme.icons.printsetup;
//: Sidebar header label //: Sidebar header label
text: qsTr("Print Setup"); text: catalog.i18nc("@label","Print Setup");
enabled: false; enabled: false;
color: UM.Theme.colors.primary; color: UM.Theme.colors.primary;

View file

@ -6,9 +6,10 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.0 as UM import UM 1.1 as UM
Item { Item
{
id: base; id: base;
anchors.fill: parent; anchors.fill: parent;
@ -22,44 +23,47 @@ Item {
Component.onCompleted: PrintInformation.enabled = true Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false Component.onDestruction: PrintInformation.enabled = false
UM.I18nCatalog { id: catalog; name:"cura"}
ColumnLayout { ColumnLayout
{
anchors.fill: parent; anchors.fill: parent;
Item { Item
{
Layout.fillWidth: true; Layout.fillWidth: true;
Layout.preferredHeight: UM.Theme.sizes.section.height; Layout.preferredHeight: UM.Theme.sizes.section.height;
Label { Label
{
anchors.left: parent.left; anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: base.minimumPrintTime.valid ? base.minimumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??"; text: base.minimumPrintTime.valid ? base.minimumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??";
font: UM.Theme.fonts.timeslider_time; font: UM.Theme.fonts.timeslider_time;
color: UM.Theme.colors.primary; color: UM.Theme.colors.primary;
} }
Label { Label
{
anchors.centerIn: parent; anchors.centerIn: parent;
text: { text: //: Sidebar configuration label
{
if (UM.Backend.progress < 0) if (UM.Backend.progress < 0)
{ {
//: Sidebar configuration label return catalog.i18nc("@label","No Model Loaded");
return qsTr("No Model Loaded");
} }
else if (!base.minimumPrintTime.valid || !base.maximumPrintTime.valid) else if (!base.minimumPrintTime.valid || !base.maximumPrintTime.valid)
{ {
//: Sidebar configuration label return catalog.i18nc("@label","Calculating...")
return qsTr("Calculating...")
} }
else else
{ {
//: Sidebar configuration label return catalog.i18nc("@label","Estimated Print Time");
return qsTr("Estimated Print Time");
} }
} }
color: UM.Theme.colors.text; color: UM.Theme.colors.text;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
} }
Label { Label
{
anchors.right: parent.right; anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: base.maximumPrintTime.valid ? base.maximumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??"; text: base.maximumPrintTime.valid ? base.maximumPrintTime.getDisplayString(UM.DurationFormat.Short) : "??:??";
@ -68,7 +72,8 @@ Item {
} }
} }
Slider { Slider
{
Layout.fillWidth: true; Layout.fillWidth: true;
Layout.preferredHeight: UM.Theme.sizes.section.height; Layout.preferredHeight: UM.Theme.sizes.section.height;
@ -81,38 +86,42 @@ Item {
style: UM.Theme.styles.slider; style: UM.Theme.styles.slider;
} }
Item { Item
{
Layout.fillWidth: true; Layout.fillWidth: true;
Layout.preferredHeight: UM.Theme.sizes.section.height; Layout.preferredHeight: UM.Theme.sizes.section.height;
Label { Label
{
anchors.left: parent.left; anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
//: Quality slider label //: Quality slider label
text: qsTr("Minimum\nDraft"); text: catalog.i18nc("@label","Minimum\nDraft");
color: UM.Theme.colors.text; color: UM.Theme.colors.text;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
} }
Label { Label
{
anchors.right: parent.right; anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
//: Quality slider label //: Quality slider label
text: qsTr("Maximum\nQuality"); text: catalog.i18nc("@label","Maximum\nQuality");
horizontalAlignment: Text.AlignRight; horizontalAlignment: Text.AlignRight;
color: UM.Theme.colors.text; color: UM.Theme.colors.text;
font: UM.Theme.fonts.default; font: UM.Theme.fonts.default;
} }
} }
CheckBox { CheckBox
{
Layout.fillWidth: true; Layout.fillWidth: true;
Layout.preferredHeight: UM.Theme.sizes.section.height; Layout.preferredHeight: UM.Theme.sizes.section.height;
//: Setting checkbox //: Setting checkbox
text: qsTr("Enable Support"); text: catalog.i18nc("@action:checkbox","Enable Support");
style: UM.Theme.styles.checkbox; style: UM.Theme.styles.checkbox;

View file

@ -6,14 +6,14 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM import UM 1.1 as UM
UM.PreferencesPage UM.PreferencesPage
{ {
id: preferencesPage id: preferencesPage
//: View configuration page title //: View configuration page title
title: qsTr("View"); title: catalog.i18nc("@title:window","View");
function reset() function reset()
{ {
@ -26,7 +26,7 @@ UM.PreferencesPage
GridLayout GridLayout
{ {
columns: 2; columns: 2;
UM.I18nCatalog { id: catalog; name:"cura"}
CheckBox CheckBox
{ {
id: overhangCheckbox id: overhangCheckbox
@ -38,18 +38,21 @@ UM.PreferencesPage
id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox id: viewText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
//: Display Overhang preference checkbox //: Display Overhang preference checkbox
text: qsTr("Display Overhang"); text: catalog.i18nc("@action:button","Display Overhang");
onClicked: overhangCheckbox.checked = !overhangCheckbox.checked onClicked: overhangCheckbox.checked = !overhangCheckbox.checked
//: Display Overhang preference tooltip //: Display Overhang preference tooltip
tooltip: "Highlight unsupported areas of the model in red. Without support these areas will nog print properly." tooltip: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will nog print properly."
style: ButtonStyle { style: ButtonStyle
background: Rectangle { {
background: Rectangle
{
border.width: 0 border.width: 0
color: "transparent" color: "transparent"
} }
label: Text { label: Text
{
renderType: Text.NativeRendering renderType: Text.NativeRendering
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
text: control.text text: control.text
@ -68,11 +71,11 @@ UM.PreferencesPage
id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox id: centerText //is a button so the user doesn't have te click inconvenientley precise to enable or disable the checkbox
//: Display Overhang preference checkbox //: Display Overhang preference checkbox
text: qsTr("Center camera when item is selected"); text: catalog.i18nc("@action:button","Center camera when item is selected");
onClicked: centerCheckbox.checked = !centerCheckbox.checked onClicked: centerCheckbox.checked = !centerCheckbox.checked
//: Display Overhang preference tooltip //: Display Overhang preference tooltip
tooltip: "Moves the camera so the object is in the center of the view when an object is selected" tooltip: catalog.i18nc("@info:tooltip","Moves the camera so the object is in the center of the view when an object is selected")
style: ButtonStyle style: ButtonStyle
{ {

View file

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

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.1 as UM
Item Item
{ {
@ -14,7 +14,7 @@ Item
property string title property string title
SystemPalette{id: palette} SystemPalette{id: palette}
UM.I18nCatalog { id: catalog; name:"cura"}
ScrollView ScrollView
{ {
height: parent.height height: parent.height
@ -36,7 +36,7 @@ Item
//: Add UM Original wizard page description //: Add UM Original wizard page description
width: parent.width width: parent.width
wrapMode: Text.WordWrap 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 Column
@ -46,19 +46,19 @@ Item
CheckBox CheckBox
{ {
text: qsTr("Extruder driver ugrades") text: catalog.i18nc("@action:checkbox","Extruder driver ugrades")
} }
CheckBox CheckBox
{ {
text: qsTr("Heated printer bed (kit)") text: catalog.i18nc("@action:checkbox","Heated printer bed (kit)")
} }
CheckBox CheckBox
{ {
text: qsTr("Heated printer bed (self built)") text: catalog.i18nc("@action:checkbox","Heated printer bed (self built)")
} }
CheckBox CheckBox
{ {
text: qsTr("Dual extrusion (experimental)") text: catalog.i18nc("@action:checkbox","Dual extrusion (experimental)")
checked: true checked: true
} }
} }
@ -67,14 +67,14 @@ Item
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap 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 Label
{ {
width: parent.width width: parent.width
wrapMode: Text.WordWrap 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.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.0 as UM import UM 1.1 as UM
Column Column
{ {
@ -23,7 +23,7 @@ Column
Component.onCompleted: printer_connection.startPollEndstop() Component.onCompleted: printer_connection.startPollEndstop()
Component.onDestruction: printer_connection.stopPollEndstop() Component.onDestruction: printer_connection.stopPollEndstop()
UM.I18nCatalog { id: catalog; name:"cura"}
Label Label
{ {
text: parent.title text: parent.title
@ -33,14 +33,14 @@ Column
Label Label
{ {
//: Add Printer wizard page description //: 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 Row
{ {
Label Label
{ {
text: qsTr("Connection: ") text: catalog.i18nc("@label","Connection: ")
} }
Label Label
{ {
@ -51,22 +51,22 @@ Column
{ {
Label Label
{ {
text: qsTr("Min endstop X: ") text: catalog.i18nc("@label","Min endstop X: ")
} }
Label Label
{ {
text: x_min_pressed ? qsTr("Works") : qsTr("Not checked") text: x_min_pressed ? catalog.i18nc("@label","Works") : catalog.i18nc("@label","Not checked")
} }
} }
Row Row
{ {
Label Label
{ {
text: qsTr("Min endstop Y: ") text: catalog.i18nc("@label","Min endstop Y: ")
} }
Label 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 Label
{ {
text: qsTr("Min endstop Z: ") text: catalog.i18nc("@label","Min endstop Z: ")
} }
Label 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 Label
{ {
text: qsTr("Nozzle temperature check: ") text: catalog.i18nc("@label","Nozzle temperature check: ")
} }
Label Label
{ {
@ -94,10 +94,10 @@ Column
} }
Button Button
{ {
text: "Start heating" text: catalog.i18nc("@action:button","Start heating")
onClicked: onClicked:
{ {
heater_status_label.text = qsTr("Checking") heater_status_label.text = catalog.i18nc("@label","Checking")
printer_connection.heatupNozzle(190) printer_connection.heatupNozzle(190)
wizardPage.extruder_target_temp = 190 wizardPage.extruder_target_temp = 190
} }
@ -105,7 +105,7 @@ Column
Label Label
{ {
id: heater_status_label id: heater_status_label
text: qsTr("Not checked") text: catalog.i18nc("@label","Not checked")
} }
} }
@ -113,7 +113,7 @@ Column
{ {
Label Label
{ {
text: qsTr("bed temperature check: ") text: catalog.i18nc("@label","bed temperature check: ")
} }
Label Label
{ {
@ -121,10 +121,10 @@ Column
} }
Button Button
{ {
text: "Start heating" text: catalog.i18nc("@action:button","Start heating")
onClicked: onClicked:
{ {
bed_status_label.text = qsTr("Checking") bed_status_label.text = catalog.i18nc("@label","Checking")
printer_connection.printer.heatupBed(60) printer_connection.printer.heatupBed(60)
wizardPage.bed_target_temp = 60 wizardPage.bed_target_temp = 60
} }
@ -132,7 +132,7 @@ Column
Label Label
{ {
id: bed_status_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) 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) 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) 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) printer_connection.heatupBed(0)
} }
} }