Merge branch 'master' into feature_setting_visibility_profiles

This commit is contained in:
fieldOfView 2018-01-04 11:06:51 +01:00
commit 3f11b8a756
699 changed files with 62717 additions and 19296 deletions

View file

@ -132,6 +132,7 @@ UM.Dialog
projectsModel.append({ name:"PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
projectsModel.append({ name:"python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
projectsModel.append({ name:"Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
projectsModel.append({ name:"Requests", description: catalog.i18nc("@Label", "Python HTTP library"), license: "GPL", url: "http://docs.python-requests.org" });
projectsModel.append({ name:"Open Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://fonts.google.com/specimen/Open+Sans" });
projectsModel.append({ name:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });

View file

@ -17,7 +17,13 @@ Item
property alias undo: undoAction;
property alias redo: redoAction;
property alias homeCamera: homeCameraAction;
property alias view3DCamera: view3DCameraAction;
property alias viewFrontCamera: viewFrontCameraAction;
property alias viewTopCamera: viewTopCameraAction;
property alias viewLeftSideCamera: viewLeftSideCameraAction;
property alias viewRightSideCamera: viewRightSideCameraAction;
property alias expandSidebar: expandSidebarAction;
property alias deleteSelection: deleteSelectionAction;
property alias centerSelection: centerSelectionAction;
@ -35,6 +41,7 @@ Item
property alias selectAll: selectAllAction;
property alias deleteAll: deleteAllAction;
property alias reloadAll: reloadAllAction;
property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction;
property alias arrangeAll: arrangeAllAction;
property alias arrangeSelection: arrangeSelectionAction;
property alias resetAllTranslation: resetAllTranslationAction;
@ -103,9 +110,37 @@ Item
Action
{
id: homeCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&Reset camera position");
onTriggered: CuraActions.homeCamera();
id: view3DCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&3D View");
onTriggered: UM.Controller.rotateView("3d", 0);
}
Action
{
id: viewFrontCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&Front View");
onTriggered: UM.Controller.rotateView("home", 0);
}
Action
{
id: viewTopCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&Top View");
onTriggered: UM.Controller.rotateView("y", 90);
}
Action
{
id: viewLeftSideCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&Left Side View");
onTriggered: UM.Controller.rotateView("x", 90);
}
Action
{
id: viewRightSideCameraAction;
text: catalog.i18nc("@action:inmenu menubar:view","&Right Side View");
onTriggered: UM.Controller.rotateView("x", -90);
}
Action
@ -244,6 +279,16 @@ Item
onTriggered: CuraApplication.groupSelected();
}
Action
{
id: reloadQmlAction
onTriggered:
{
CuraApplication.reloadQML()
}
shortcut: "Shift+F5"
}
Action
{
id: unGroupObjectsAction
@ -300,6 +345,13 @@ Item
onTriggered: CuraApplication.reloadAll();
}
Action
{
id: arrangeAllBuildPlatesAction;
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates");
onTriggered: Printer.arrangeObjectsToAllBuildPlates();
}
Action
{
id: arrangeAllAction;
@ -379,4 +431,11 @@ Item
text: catalog.i18nc("@action:menu", "Installed plugins...");
iconName: "plugins_configure"
}
Action
{
id: expandSidebarAction;
text: catalog.i18nc("@action:inmenu menubar:view","Expand/Collapse Sidebar");
shortcut: "Ctrl+E";
}
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V.
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
@ -25,6 +25,15 @@ UM.Dialog
width: minimumWidth
height: minimumHeight
flags: {
var window_flags = Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint;
if (Cura.MachineManager.activeDefinitionId !== "") //Disallow closing the window if we have no active printer yet. You MUST add a printer.
{
window_flags |= Qt.WindowCloseButtonHint;
}
return window_flags;
}
onVisibilityChanged:
{
// Reset selection and machine name

View file

@ -63,11 +63,12 @@ UM.Dialog
anchors.fill: parent
anchors.leftMargin: 20 * screenScaleFactor
anchors.rightMargin: 20 * screenScaleFactor
anchors.bottomMargin: 20 * screenScaleFactor
anchors.bottomMargin: 10 * screenScaleFactor
spacing: 10 * screenScaleFactor
Label
{
id: questionText
text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?")
anchors.left: parent.left
anchors.right: parent.right
@ -80,11 +81,18 @@ UM.Dialog
id: rememberChoiceCheckBox
text: catalog.i18nc("@text:window", "Remember my choice")
checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
style: CheckBoxStyle {
label: Label {
text: control.text
font: UM.Theme.getFont("default")
}
}
}
// Buttons
Item
{
id: buttonBar
anchors.right: parent.right
anchors.left: parent.left
height: childrenRect.height

View file

@ -20,14 +20,34 @@ UM.MainWindow
viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
property bool showPrintMonitor: false
// This connection is here to support legacy printer output devices that use the showPrintMonitor signal on Application to switch to the monitor stage
// It should be phased out in newer plugin versions.
Connections
{
target: Printer
target: CuraApplication
onShowPrintMonitor: {
if (show) {
topbar.startMonitoringPrint()
UM.Controller.setActiveStage("MonitorStage")
} else {
topbar.stopMonitoringPrint()
UM.Controller.setActiveStage("PrepareStage")
}
}
}
onWidthChanged:
{
// If slidebar is collapsed then it should be invisible
// otherwise after the main_window resize the sidebar will be fully re-drawn
if (sidebar.collapsed){
if (sidebar.visible == true){
sidebar.visible = false
sidebar.initialWidth = 0
}
}
else{
if (sidebar.visible == false){
sidebar.visible = true
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
}
}
}
@ -46,6 +66,7 @@ UM.MainWindow
//
// This has been fixed for QtQuick Controls 2 since the Shortcut item has a context property.
Cura.Actions.parent = backgroundItem
CuraApplication.purgeWindows()
}
Item
@ -115,7 +136,7 @@ UM.MainWindow
MenuItem
{
id: saveWorkspaceMenu
text: catalog.i18nc("@title:menu menubar:file","Save project")
text: catalog.i18nc("@title:menu menubar:file","Save &Project...")
onTriggered:
{
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
@ -177,7 +198,7 @@ UM.MainWindow
MenuSeparator { }
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: ExtruderManager.setActiveExtruderIndex(model.index) }
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) }
}
onObjectAdded: settingsMenu.insertItem(index, object)
onObjectRemoved: settingsMenu.removeItem(object)
@ -330,7 +351,7 @@ UM.MainWindow
text: catalog.i18nc("@action:button","Open File");
iconSource: UM.Theme.getIcon("load")
style: UM.Theme.styles.tool_button
tooltip: '';
tooltip: ""
anchors
{
top: topbar.bottom;
@ -354,65 +375,107 @@ UM.MainWindow
}
}
ObjectsList
{
id: objectsList;
visible: UM.Preferences.getValue("cura/use_multi_build_plate");
anchors
{
bottom: parent.bottom;
left: parent.left;
}
}
Topbar
{
id: topbar
anchors.left:parent.left
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
monitoringPrint: base.showPrintMonitor
onStartMonitoringPrint: base.showPrintMonitor = true
onStopMonitoringPrint: base.showPrintMonitor = false
}
Sidebar
Loader
{
id: sidebar;
id: sidebar
anchors
{
top: topbar.bottom;
bottom: parent.bottom;
right: parent.right;
property bool collapsed: false;
property var initialWidth: UM.Theme.getSize("sidebar").width;
function callExpandOrCollapse() {
if (collapsed) {
sidebar.visible = true;
sidebar.initialWidth = UM.Theme.getSize("sidebar").width;
viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0);
expandSidebarAnimation.start();
} else {
viewportRect = Qt.rect(0, 0, 1, 1.0);
collapseSidebarAnimation.start();
}
collapsed = !collapsed;
UM.Preferences.setValue("cura/sidebar_collapsed", collapsed);
}
z: 1
width: UM.Theme.getSize("sidebar").width;
monitoringPrint: base.showPrintMonitor
}
Rectangle
{
id: viewportOverlay
color: UM.Theme.getColor("viewport_overlay")
anchors
{
top: topbar.bottom
top: topbar.top
bottom: parent.bottom
left:parent.left
right: sidebar.left
}
visible: opacity > 0
opacity: base.showPrintMonitor ? 1 : 0
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.AllButtons
width: initialWidth
x: base.width - sidebar.width
source: UM.Controller.activeStage.sidebarComponent
onWheel: wheel.accepted = true
NumberAnimation {
id: collapseSidebarAnimation
target: sidebar
properties: "x"
to: base.width
duration: 100
}
NumberAnimation {
id: expandSidebarAnimation
target: sidebar
properties: "x"
to: base.width - sidebar.width
duration: 100
}
Component.onCompleted:
{
var sidebar_collapsed = UM.Preferences.getValue("cura/sidebar_collapsed");
if (sidebar_collapsed)
{
sidebar.collapsed = true;
viewportRect = Qt.rect(0, 0, 1, 1.0)
collapseSidebarAnimation.start();
}
}
}
Loader
{
sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem: null
visible: base.showPrintMonitor
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenterOffset: - UM.Theme.getSize("sidebar").width / 2
anchors.verticalCenterOffset: UM.Theme.getSize("sidebar_header").height / 2
property real maximumWidth: viewportOverlay.width
property real maximumHeight: viewportOverlay.height
id: main
anchors
{
top: topbar.bottom
bottom: parent.bottom
left: parent.left
right: sidebar.left
}
MouseArea
{
visible: UM.Controller.activeStage.mainComponent != ""
anchors.fill: parent
acceptedButtons: Qt.AllButtons
onWheel: wheel.accepted = true
}
source: UM.Controller.activeStage.mainComponent
}
UM.MessageStack
@ -428,6 +491,13 @@ UM.MainWindow
}
}
// Expand or collapse sidebar
Connections
{
target: Cura.Actions.expandSidebar
onTriggered: sidebar.callExpandOrCollapse()
}
UM.PreferencesDialog
{
id: preferences
@ -471,6 +541,12 @@ UM.MainWindow
onTriggered: preferences.visible = true
}
Connections
{
target: CuraApplication
onShowPreferencesWindow: preferences.visible = true
}
MessageDialog
{
id: newProjectDialog
@ -829,7 +905,7 @@ UM.MainWindow
Connections
{
target: Printer
target: CuraApplication
onShowMessageBox:
{
messageDialog.title = title
@ -875,7 +951,7 @@ UM.MainWindow
Connections
{
target: Printer
target: CuraApplication
onRequestAddPrinter:
{
addMachineDialog.visible = true
@ -894,6 +970,11 @@ UM.MainWindow
if(!base.visible)
{
base.visible = true;
}
// check later if the user agreement dialog has been closed
if (CuraApplication.needToShowUserAgreement)
{
restart();
}
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "")

View file

@ -18,7 +18,7 @@ Button
style: UM.Theme.styles.tool_button;
iconSource: UM.Theme.getIcon("extruder_button")
checked: ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
enabled: UM.Selection.hasSelection
property color customColor: base.hovered ? UM.Theme.getColor("button_hover") : UM.Theme.getColor("button");

View file

@ -18,7 +18,6 @@ Item {
UM.I18nCatalog { id: catalog; name:"cura"}
height: childrenRect.height
width: childrenRect.width
Connections
{
@ -95,7 +94,7 @@ Item {
{
id: printJobTextfield
anchors.right: printJobPencilIcon.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width/2
anchors.rightMargin: Math.floor(UM.Theme.getSize("default_margin").width/2)
height: UM.Theme.getSize("jobspecs_line").height
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
maximumLength: 120

View file

@ -0,0 +1,71 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM
import Cura 1.0 as Cura
import "Menus"
ToolButton
{
text: Cura.MachineManager.activeMachineName
tooltip: Cura.MachineManager.activeMachineName
style: ButtonStyle
{
background: Rectangle
{
color:
{
if(control.pressed)
{
return UM.Theme.getColor("sidebar_header_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("sidebar_header_hover");
}
else
{
return UM.Theme.getColor("sidebar_header_bar");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
UM.RecolorImage
{
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.getColor("text_emphasis")
source: UM.Theme.getIcon("arrow_bottom")
}
Label
{
id: sidebarComboBoxLabel
color: UM.Theme.getColor("sidebar_header_text_active")
text: control.text;
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
anchors.right: downArrow.left;
anchors.rightMargin: control.rightMargin;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large")
}
}
label: Label {}
}
menu: PrinterMenu { }
}

View file

@ -7,7 +7,7 @@ import QtQuick.Dialogs 1.2
import QtQuick.Window 2.1
import UM 1.2 as UM
import Cura 1.0 as Cura
import Cura 1.2 as Cura
Menu
{
@ -31,7 +31,7 @@ Menu
visible: base.shouldShowExtruders
enabled: UM.Selection.hasSelection
checkable: true
checked: ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(model.id) != -1
onTriggered: CuraActions.setExtruderForSelection(model.id)
shortcut: "Ctrl+" + (model.index + 1)
}
@ -39,6 +39,35 @@ Menu
onObjectRemoved: base.removeItem(object)
}
MenuSeparator {
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
Instantiator
{
model: Cura.BuildPlateModel
MenuItem {
text: Cura.BuildPlateModel.getItem(index).name;
onTriggered: CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.getItem(index).buildPlateNumber);
checkable: true
checked: Cura.BuildPlateModel.selectionBuildPlates.indexOf(Cura.BuildPlateModel.getItem(index).buildPlateNumber) != -1;
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
onObjectAdded: base.insertItem(index, object);
onObjectRemoved: base.removeItem(object);
}
MenuItem {
text: "New build plate";
onTriggered: {
CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.maxBuildPlate + 1);
checked = false;
}
checkable: true
checked: false
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
// Global actions
MenuSeparator {}
MenuItem { action: Cura.Actions.selectAll; }

View file

@ -1,4 +1,4 @@
// Copyright (c) 2016 Ultimaker B.V.
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
@ -16,20 +16,27 @@ Menu
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool isClusterPrinter:
{
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
// This is a non cluster printer or the cluster it is just one printer
if (clusterSize == undefined || clusterSize == 1)
return false
return true
if(Cura.MachineManager.printerOutputDevices.length == 0)
{
return false;
}
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
// This is not a cluster printer or the cluster it is just one printer
if(clusterSize == undefined || clusterSize == 1)
{
return false;
}
return true;
}
UM.SettingPropertyProvider
{
id: materialDiameterProvider
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.ExtruderManager.activeExtruderStackId
key: "material_diameter"
watchedProperties: [ "value" ]
storeIndex: 5
}
MenuItem
@ -72,16 +79,16 @@ Menu
{
text: model.name
checkable: true
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
exclusiveGroup: group
onTriggered:
{
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
Cura.MachineManager.setActiveMaterial(model.id);
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
onObjectAdded: menu.insertItem(index, object)
@ -115,16 +122,16 @@ Menu
{
text: model.name
checkable: true
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
checked: model.id == Cura.MachineManager.allActiveMaterialIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
exclusiveGroup: group
onTriggered:
{
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
Cura.MachineManager.setActiveMaterial(model.id);
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
@ -151,7 +158,7 @@ Menu
}
//: Model used to populate the brandModel
UM.InstanceContainersModel
Cura.MaterialsModel
{
id: materialsModel
filter: materialFilter()
@ -201,8 +208,8 @@ Menu
// Add to top section
var materialId = items[i].id;
genericMaterialsModel.append({
id:materialId,
name:items[i].name
id: materialId,
name: items[i].name
});
}
else

View file

@ -16,11 +16,17 @@ Menu
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool isClusterPrinter:
{
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
// This is a non cluster printer or the cluster it is just one printer
if (clusterSize == undefined || clusterSize == 1)
return false
return true
if(Cura.MachineManager.printerOutputDevices.length == 0)
{
return false;
}
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
// This is not a cluster printer or the cluster it is just one printer
if(clusterSize == undefined || clusterSize == 1)
{
return false;
}
return true;
}
MenuItem
@ -38,15 +44,15 @@ Menu
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex && !isClusterPrinter
onTriggered:
{
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
var hotendId = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
var itemIndex = nozzleInstantiator.model.find("name", hotendId);
if(itemIndex > -1)
{
Cura.MachineManager.setActiveVariant(nozzleInstantiator.model.getItem(itemIndex).id);
}
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
@ -69,14 +75,14 @@ Menu
MenuItem {
text: model.name
checkable: true
checked: model.id == Cura.MachineManager.allActiveVariantIds[ExtruderManager.extruderIds[extruderIndex]]
checked: model.id == Cura.MachineManager.allActiveVariantIds[Cura.ExtruderManager.extruderIds[extruderIndex]]
exclusiveGroup: group
onTriggered:
{
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
var activeExtruderIndex = Cura.ExtruderManager.activeExtruderIndex;
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex);
Cura.MachineManager.setActiveVariant(model.id);
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
Cura.ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
onObjectAdded: menu.insertItem(index, object)

View file

@ -17,9 +17,9 @@ Menu
MenuItem
{
text: model.name + " - " + model.layer_height
text: (model.layer_height != "") ? model.name + " - " + model.layer_height : model.name
checkable: true
checked: Cura.MachineManager.activeQualityChangesId == "" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
checked: Cura.MachineManager.activeQualityId == model.id
exclusiveGroup: group
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
visible: model.available
@ -41,7 +41,7 @@ Menu
MenuItem
{
text: model.name + " - " + model.layer_height
text: model.name
checkable: true
checked: Cura.MachineManager.activeQualityChangesId == model.id
exclusiveGroup: group

View file

@ -5,29 +5,69 @@ import QtQuick 2.2
import QtQuick.Controls 1.1
import UM 1.2 as UM
import Cura 1.0 as Cura
import Cura 1.2 as Cura
Menu
{
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
id: menu
id: base
enabled: !PrintInformation.preSliced
// main views
Instantiator
{
model: UM.ViewModel { }
model: UM.ViewModel{}
MenuItem
{
text: model.name;
checkable: true;
checked: model.active;
exclusiveGroup: group;
onTriggered: UM.Controller.setActiveView(model.id);
text: model.name
checkable: true
checked: model.active
exclusiveGroup: group
onTriggered: UM.Controller.setActiveView(model.id)
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
onObjectAdded: base.insertItem(index, object)
onObjectRemoved: base.removeItem(object)
}
ExclusiveGroup { id: group; }
ExclusiveGroup { id: group }
MenuSeparator {}
MenuItem { action: Cura.Actions.homeCamera; }
Menu
{
title: catalog.i18nc("@action:inmenu menubar:view","&Camera position");
MenuItem { action: Cura.Actions.view3DCamera; }
MenuItem { action: Cura.Actions.viewFrontCamera; }
MenuItem { action: Cura.Actions.viewTopCamera; }
MenuItem { action: Cura.Actions.viewLeftSideCamera; }
MenuItem { action: Cura.Actions.viewRightSideCamera; }
}
MenuSeparator {
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
Menu
{
id: buildPlateMenu;
title: catalog.i18nc("@action:inmenu menubar:view","&Build plate");
Instantiator
{
model: Cura.BuildPlateModel
MenuItem {
text: Cura.BuildPlateModel.getItem(index).name;
onTriggered: Cura.SceneController.setActiveBuildPlate(Cura.BuildPlateModel.getItem(index).buildPlateNumber);
checkable: true;
checked: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate;
exclusiveGroup: buildPlateGroup;
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
onObjectAdded: buildPlateMenu.insertItem(index, object);
onObjectRemoved: buildPlateMenu.removeItem(object)
}
ExclusiveGroup { id: buildPlateGroup; }
}
MenuSeparator {}
MenuItem { action: Cura.Actions.expandSidebar; }
}

View file

@ -18,7 +18,6 @@ Item
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
property int backendState: UM.Backend.state
property bool showProgress: {
// determine if we need to show the progress bar + percentage
@ -199,14 +198,19 @@ Item
spacing: UM.Theme.getSize("default_margin").width
}
Component.onCompleted: {
buttonsRow.updateAdditionalComponents("monitorButtons")
}
Connections {
target: Printer
onAdditionalComponentsChanged:
{
if(areaId == "monitorButtons") {
for (var component in CuraApplication.additionalComponents["monitorButtons"]) {
CuraApplication.additionalComponents["monitorButtons"][component].parent = additionalComponentsRow
}
target: CuraApplication
onAdditionalComponentsChanged: buttonsRow.updateAdditionalComponents("monitorButtons")
}
function updateAdditionalComponents (areaId) {
if(areaId == "monitorButtons") {
for (var component in CuraApplication.additionalComponents["monitorButtons"]) {
CuraApplication.additionalComponents["monitorButtons"][component].parent = additionalComponentsRow
}
}
}

View file

@ -0,0 +1,267 @@
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import UM 1.3 as UM
import Cura 1.2 as Cura
import "Menus"
Rectangle
{
id: base;
color: UM.Theme.getColor("tool_panel_background")
width: UM.Theme.getSize("objects_menu_size").width
height: {
if (collapsed) {
return UM.Theme.getSize("objects_menu_size_collapsed").height;
} else {
return UM.Theme.getSize("objects_menu_size").height;
}
}
Behavior on height { NumberAnimation { duration: 100 } }
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
property bool collapsed: false;
SystemPalette { id: palette }
Button {
id: collapseButton
anchors.top: parent.top
anchors.topMargin: Math.floor(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2)
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
onClicked: collapsed = !collapsed
style: ButtonStyle
{
background: UM.RecolorImage
{
width: control.width
height: control.height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.getColor("setting_control_text")
source: collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom")
}
label: Label{ }
}
}
Component {
id: buildPlateDelegate
Rectangle
{
height: childrenRect.height
color: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
width: parent.width
Label
{
id: buildPlateNameLabel
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30
text: Cura.BuildPlateModel.getItem(index) ? Cura.BuildPlateModel.getItem(index).name : "";
color: Cura.BuildPlateModel.activeBuildPlate == index ? palette.highlightedText : palette.text
elide: Text.ElideRight
}
MouseArea
{
anchors.fill: parent;
onClicked:
{
Cura.SceneController.setActiveBuildPlate(index);
}
}
}
}
ScrollView
{
id: buildPlateSelection
frameVisible: true
height: UM.Theme.getSize("build_plate_selection_size").height
width: parent.width - 2 * UM.Theme.getSize("default_margin").height
style: UM.Theme.styles.scrollview
anchors
{
top: collapseButton.bottom;
topMargin: UM.Theme.getSize("default_margin").height;
left: parent.left;
leftMargin: UM.Theme.getSize("default_margin").height;
//bottom: objectsList.top;
bottomMargin: UM.Theme.getSize("default_margin").height;
}
Rectangle
{
parent: viewport
anchors.fill: parent
color: palette.light
}
ListView
{
id: buildPlateListView
model: Cura.BuildPlateModel
width: parent.width
delegate: buildPlateDelegate
}
}
Component {
id: objectDelegate
Rectangle
{
height: childrenRect.height
color: Cura.ObjectsModel.getItem(index).isSelected ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
width: parent.width
Label
{
id: nodeNameLabel
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30
text: Cura.ObjectsModel.getItem(index) ? Cura.ObjectsModel.getItem(index).name : "";
color: Cura.ObjectsModel.getItem(index).isSelected ? palette.highlightedText : (Cura.ObjectsModel.getItem(index).isOutsideBuildArea ? palette.mid : palette.text)
elide: Text.ElideRight
}
Label
{
id: buildPlateNumberLabel
width: 20
anchors.left: nodeNameLabel.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
anchors.right: parent.right
text: Cura.ObjectsModel.getItem(index).buildPlateNumber != -1 ? Cura.ObjectsModel.getItem(index).buildPlateNumber + 1 : "";
color: Cura.ObjectsModel.getItem(index).isSelected ? palette.highlightedText : palette.text
elide: Text.ElideRight
}
MouseArea
{
anchors.fill: parent;
onClicked:
{
Cura.SceneController.changeSelection(index);
}
}
}
}
// list all the scene nodes
ScrollView
{
id: objectsList
frameVisible: true
visible: !collapsed
width: parent.width - 2 * UM.Theme.getSize("default_margin").height
anchors
{
top: buildPlateSelection.bottom;
topMargin: UM.Theme.getSize("default_margin").height;
left: parent.left;
leftMargin: UM.Theme.getSize("default_margin").height;
bottom: filterBuildPlateCheckbox.top;
bottomMargin: UM.Theme.getSize("default_margin").height;
}
Rectangle
{
parent: viewport
anchors.fill: parent
color: palette.light
}
ListView
{
id: listview
model: Cura.ObjectsModel
width: parent.width
delegate: objectDelegate
}
}
CheckBox
{
id: filterBuildPlateCheckbox
visible: !collapsed
checked: UM.Preferences.getValue("view/filter_current_build_plate")
onClicked: UM.Preferences.setValue("view/filter_current_build_plate", checked)
text: catalog.i18nc("@option:check","See only current build plate");
style: UM.Theme.styles.checkbox;
anchors
{
left: parent.left;
topMargin: UM.Theme.getSize("default_margin").height;
bottomMargin: UM.Theme.getSize("default_margin").height;
leftMargin: UM.Theme.getSize("default_margin").height;
bottom: arrangeAllBuildPlatesButton.top;
}
}
Button
{
id: arrangeAllBuildPlatesButton;
text: catalog.i18nc("@action:button","Arrange to all build plates");
style: UM.Theme.styles.sidebar_action_button
height: UM.Theme.getSize("objects_menu_button").height;
tooltip: '';
anchors
{
//top: buildPlateSelection.bottom;
topMargin: UM.Theme.getSize("default_margin").height;
left: parent.left;
leftMargin: UM.Theme.getSize("default_margin").height;
right: parent.right;
rightMargin: UM.Theme.getSize("default_margin").height;
bottom: arrangeBuildPlateButton.top;
bottomMargin: UM.Theme.getSize("default_margin").height;
}
action: Cura.Actions.arrangeAllBuildPlates;
}
Button
{
id: arrangeBuildPlateButton;
text: catalog.i18nc("@action:button","Arrange current build plate");
style: UM.Theme.styles.sidebar_action_button
height: UM.Theme.getSize("objects_menu_button").height;
tooltip: '';
anchors
{
topMargin: UM.Theme.getSize("default_margin").height;
left: parent.left;
leftMargin: UM.Theme.getSize("default_margin").height;
right: parent.right;
rightMargin: UM.Theme.getSize("default_margin").height;
bottom: parent.bottom;
bottomMargin: UM.Theme.getSize("default_margin").height;
}
action: Cura.Actions.arrangeAll;
}
}

View file

@ -151,7 +151,7 @@ UM.PreferencesPage
append({ text: "English", code: "en_US" })
append({ text: "Deutsch", code: "de_DE" })
append({ text: "Español", code: "es_ES" })
append({ text: "Suomi", code: "fi_FI" })
//Finnish is disabled for being incomplete: append({ text: "Suomi", code: "fi_FI" })
append({ text: "Français", code: "fr_FR" })
append({ text: "Italiano", code: "it_IT" })
append({ text: "日本語", code: "ja_JP" })
@ -159,9 +159,11 @@ UM.PreferencesPage
append({ text: "Nederlands", code: "nl_NL" })
append({ text: "Polski", code: "pl_PL" })
append({ text: "Português do Brasil", code: "pt_BR" })
append({ text: "Português", code: "pt_PT" })
append({ text: "Русский", code: "ru_RU" })
append({ text: "Türkçe", code: "tr_TR" })
append({ text: "简体中文", code: "zh_CN" })
append({ text: "正體字", code: "zh_TW" })
var date_object = new Date();
if (date_object.getUTCMonth() == 8 && date_object.getUTCDate() == 19) //Only add Pirate on the 19th of September.
@ -304,7 +306,7 @@ UM.PreferencesPage
text: catalog.i18nc("@option:check","Slice automatically");
}
}
Item
{
//: Spacer
@ -451,6 +453,34 @@ UM.PreferencesPage
text: catalog.i18nc("@label","Opening and saving files")
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Use multi build plate functionality (EXPERIMENTAL)")
CheckBox
{
id: useMultiBuildPlateCheckbox
text: catalog.i18nc("@option:check","Use multi build plate functionality (EXPERIMENTAL, restart)")
checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should newly loaded models be arranged on the build plate? Used in conjunction with multi build plate (EXPERIMENTAL)")
CheckBox
{
id: arrangeOnLoadCheckbox
text: catalog.i18nc("@option:check","Arrange objects on load (EXPERIMENTAL)")
checked: boolCheck(UM.Preferences.getValue("cura/arrange_objects_on_load"))
onCheckedChanged: UM.Preferences.setValue("cura/arrange_objects_on_load", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height

View file

@ -222,14 +222,19 @@ UM.ManagementPage
}
}
Component.onCompleted: {
addAdditionalComponents("machinesDetailPane")
}
Connections {
target: Printer
onAdditionalComponentsChanged:
{
if(areaId == "machinesDetailPane") {
for (var component in CuraApplication.additionalComponents["machinesDetailPane"]) {
CuraApplication.additionalComponents["machinesDetailPane"][component].parent = additionalComponentsColumn
}
target: CuraApplication
onAdditionalComponentsChanged: addAdditionalComponents
}
function addAdditionalComponents (areaId) {
if(areaId == "machinesDetailPane") {
for (var component in CuraApplication.additionalComponents["machinesDetailPane"]) {
CuraApplication.additionalComponents["machinesDetailPane"][component].parent = additionalComponentsColumn
}
}
}

View file

@ -41,7 +41,7 @@ TabView
Tab
{
title: catalog.i18nc("@title","Information")
title: catalog.i18nc("@title", "Information")
anchors.margins: UM.Theme.getSize("default_margin").width

View file

@ -182,6 +182,7 @@ UM.ManagementPage
{
Cura.MachineManager.setActiveMaterial(material_id)
}
// TODO: this doesn't work because the source is a bit delayed
base.objectList.currentIndex = base.getIndexById(material_id);
}
},
@ -292,10 +293,16 @@ UM.ManagementPage
base_file = base.currentItem.id
}
var guid = Cura.ContainerManager.getContainerMetaDataEntry(base.currentItem.id, "GUID")
// remove base container first, it otherwise triggers loading the base file while removing other containers
var base_containers = Cura.ContainerManager.findInstanceContainers({"GUID": guid, "id": base_file, "base_file": base_file, "type": "material"})
for(var i in base_containers)
{
Cura.ContainerManager.removeContainer(base_containers[i]);
}
var containers = Cura.ContainerManager.findInstanceContainers({"GUID": guid, "base_file": base_file, "type": "material"})
for(var i in containers)
{
Cura.ContainerManager.removeContainer(containers[i])
Cura.ContainerManager.removeContainer(containers[i]);
}
if(base.objectList.currentIndex > 0)
{
@ -322,7 +329,6 @@ UM.ManagementPage
{
messageDialog.icon = StandardIcon.Information
messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Successfully imported material <filename>%1</filename>").arg(fileUrl)
currentItem = base.model.getItem(base.objectList.currentIndex)
}
else if(result.status == "duplicate")
{
@ -381,9 +387,10 @@ UM.ManagementPage
{
id: materialDiameterProvider
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.ExtruderManager.activeExtruderStackId
key: "material_diameter"
watchedProperties: [ "value" ]
storeIndex: 5
}
UM.I18nCatalog { id: catalog; name: "cura"; }

View file

@ -208,7 +208,7 @@ UM.ManagementPage
anchors.right: parent.right
anchors.bottom: parent.bottom
currentIndex: ExtruderManager.extruderCount > 0 ? ExtruderManager.activeExtruderIndex + 1 : 0
currentIndex: Cura.ExtruderManager.extruderCount > 0 ? Cura.ExtruderManager.activeExtruderIndex + 1 : 0
ProfileTab
{

View file

@ -87,7 +87,7 @@ Column
Label //Extruder name.
{
text: ExtruderManager.getExtruderName(index) != "" ? ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Extruder")
text: Cura.ExtruderManager.getExtruderName(index) != "" ? Cura.ExtruderManager.getExtruderName(index) : catalog.i18nc("@label", "Extruder")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
anchors.left: parent.left
@ -677,6 +677,341 @@ Column
watchedProperties: ["value"]
}
Column
{
visible: connectedPrinter != null ? connectedPrinter.canControlManually : false
enabled:
{
if (connectedPrinter == null)
{
return false; //Can't control the printer if not connected.
}
if (!connectedPrinter.acceptsCommands)
{
return false; //Not allowed to do anything.
}
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "pausing" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
{
return false; //Printer is in a state where it can't react to manual control
}
return true;
}
Loader
{
sourceComponent: monitorSection
property string label: catalog.i18nc("@label", "Printer control")
}
Row
{
width: base.width - 2 * UM.Theme.getSize("default_margin").width
height: childrenRect.height + UM.Theme.getSize("default_margin").width
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
Label
{
text: catalog.i18nc("@label", "Jog Position")
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
verticalAlignment: Text.AlignVCenter
}
GridLayout
{
columns: 3
rows: 4
rowSpacing: UM.Theme.getSize("default_lining").width
columnSpacing: UM.Theme.getSize("default_lining").height
Label
{
text: catalog.i18nc("@label", "X/Y")
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
width: height
height: UM.Theme.getSize("setting_control").height
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
Layout.row: 1
Layout.column: 2
Layout.preferredWidth: width
Layout.preferredHeight: height
}
Button
{
Layout.row: 2
Layout.column: 2
Layout.preferredWidth: width
Layout.preferredHeight: height
iconSource: UM.Theme.getIcon("arrow_top");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(0, distancesRow.currentDistance, 0)
}
}
Button
{
Layout.row: 3
Layout.column: 1
Layout.preferredWidth: width
Layout.preferredHeight: height
iconSource: UM.Theme.getIcon("arrow_left");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(-distancesRow.currentDistance, 0, 0)
}
}
Button
{
Layout.row: 3
Layout.column: 3
Layout.preferredWidth: width
Layout.preferredHeight: height
iconSource: UM.Theme.getIcon("arrow_right");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(distancesRow.currentDistance, 0, 0)
}
}
Button
{
Layout.row: 4
Layout.column: 2
Layout.preferredWidth: width
Layout.preferredHeight: height
iconSource: UM.Theme.getIcon("arrow_bottom");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(0, -distancesRow.currentDistance, 0)
}
}
Button
{
Layout.row: 3
Layout.column: 2
Layout.preferredWidth: width
Layout.preferredHeight: height
iconSource: UM.Theme.getIcon("home");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.homeHead()
}
}
}
Column
{
spacing: UM.Theme.getSize("default_lining").height
Label
{
text: catalog.i18nc("@label", "Z")
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
width: UM.Theme.getSize("section").height
height: UM.Theme.getSize("setting_control").height
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
Button
{
iconSource: UM.Theme.getIcon("arrow_top");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(0, 0, distancesRow.currentDistance)
}
}
Button
{
iconSource: UM.Theme.getIcon("home");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.homeBed()
}
}
Button
{
iconSource: UM.Theme.getIcon("arrow_bottom");
style: monitorButtonStyle
width: height
height: UM.Theme.getSize("setting_control").height
onClicked:
{
connectedPrinter.moveHead(0, 0, -distancesRow.currentDistance)
}
}
}
}
Row
{
id: distancesRow
width: base.width - 2 * UM.Theme.getSize("default_margin").width
height: childrenRect.height + UM.Theme.getSize("default_margin").width
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
property real currentDistance: 10
Label
{
text: catalog.i18nc("@label", "Jog Distance")
color: UM.Theme.getColor("setting_control_text")
font: UM.Theme.getFont("default")
width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
verticalAlignment: Text.AlignVCenter
}
Row
{
Repeater
{
model: distancesModel
delegate: Button
{
height: UM.Theme.getSize("setting_control").height
width: height + UM.Theme.getSize("default_margin").width
text: model.label
exclusiveGroup: distanceGroup
checkable: true
checked: distancesRow.currentDistance == model.value
onClicked: distancesRow.currentDistance = model.value
style: ButtonStyle {
background: Rectangle {
border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width
border.color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled_border");
}
else if (control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active_border");
}
else if(control.hovered)
{
return UM.Theme.getColor("action_button_hovered_border");
}
return UM.Theme.getColor("action_button_border");
}
color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled");
}
else if (control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active");
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered");
}
return UM.Theme.getColor("action_button");
}
Behavior on color { ColorAnimation { duration: 50; } }
Label {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: UM.Theme.getSize("default_lining").width * 2
anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2
color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled_text");
}
else if (control.checked || control.pressed)
{
return UM.Theme.getColor("action_button_active_text");
}
else if (control.hovered)
{
return UM.Theme.getColor("action_button_hovered_text");
}
return UM.Theme.getColor("action_button_text");
}
font: UM.Theme.getFont("default")
text: control.text
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideMiddle
}
}
label: Item { }
}
}
}
}
}
ListModel
{
id: distancesModel
ListElement { label: "0.1"; value: 0.1 }
ListElement { label: "1"; value: 1 }
ListElement { label: "10"; value: 10 }
ListElement { label: "100"; value: 100 }
}
ExclusiveGroup { id: distanceGroup }
}
Loader
{
sourceComponent: monitorSection
@ -754,4 +1089,86 @@ Column
}
}
}
}
Component
{
id: monitorButtonStyle
ButtonStyle
{
background: Rectangle
{
border.width: UM.Theme.getSize("default_lining").width
border.color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled_border");
}
else if(control.pressed)
{
return UM.Theme.getColor("action_button_active_border");
}
else if(control.hovered)
{
return UM.Theme.getColor("action_button_hovered_border");
}
return UM.Theme.getColor("action_button_border");
}
color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled");
}
else if(control.pressed)
{
return UM.Theme.getColor("action_button_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("action_button_hovered");
}
return UM.Theme.getColor("action_button");
}
Behavior on color
{
ColorAnimation
{
duration: 50
}
}
}
label: Item
{
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: Math.floor(control.width / 2)
height: Math.floor(control.height / 2)
sourceSize.width: width
sourceSize.height: width
color:
{
if(!control.enabled)
{
return UM.Theme.getColor("action_button_disabled_text");
}
else if(control.pressed)
{
return UM.Theme.getColor("action_button_active_text");
}
else if(control.hovered)
{
return UM.Theme.getColor("action_button_hovered_text");
}
return UM.Theme.getColor("action_button_text");
}
source: control.iconSource
}
}
}
}
}

View file

@ -12,11 +12,11 @@ Item {
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property real progress: UM.Backend.progress;
property int backendState: UM.Backend.state;
property real progress: UM.Backend.progress
property int backendState: UM.Backend.state
property bool activity: CuraApplication.platformActivity
property var backend: CuraApplication.getBackend();
property bool activity: CuraApplication.platformActivity;
property alias buttonRowWidth: saveRow.width
property string fileBaseName
property string statusText:
@ -26,6 +26,10 @@ Item {
return catalog.i18nc("@label:PrintjobStatus", "Please load a 3D model");
}
if (base.backendState == "undefined") {
return ""
}
switch(base.backendState)
{
case 1:
@ -43,6 +47,18 @@ Item {
}
}
function sliceOrStopSlicing() {
try {
if ([1, 5].indexOf(base.backendState) != -1) {
CuraApplication.backend.forceSlice();
} else {
CuraApplication.backend.stopSlicing();
}
} catch (e) {
console.log('Could not start or stop slicing', e)
}
}
Label {
id: statusLabel
width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width
@ -71,7 +87,7 @@ Item {
height: parent.height
color: UM.Theme.getColor("progressbar_control")
radius: UM.Theme.getSize("progressbar_radius").width
visible: base.backendState == 2 ? true : false
visible: (base.backendState != "undefined" && base.backendState == 2) ? true : false
}
}
@ -84,34 +100,56 @@ Item {
if (saveToButton.enabled) {
saveToButton.clicked();
}
// prepare button
if (prepareButton.enabled) {
sliceOrStopSlicing();
}
}
}
Item {
id: saveRow
width: base.width
width: {
// using childrenRect.width directly causes a binding loop, because setting the width affects the childrenRect
var children_width = UM.Theme.getSize("default_margin").width;
for (var index in children)
{
var child = children[index];
if(child.visible)
{
children_width += child.width + child.anchors.rightMargin;
}
}
return Math.min(children_width, base.width - UM.Theme.getSize("sidebar_margin").width);
}
height: saveToButton.height
anchors.top: progressBar.bottom
anchors.topMargin: UM.Theme.getSize("sidebar_margin").height
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
anchors.right: parent.right
clip: true
Row {
id: additionalComponentsRow
anchors.top: parent.top
anchors.right: saveToButton.visible ? saveToButton.left : parent.right
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
anchors.rightMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
}
Component.onCompleted: {
saveRow.addAdditionalComponents("saveButton")
}
Connections {
target: Printer
onAdditionalComponentsChanged:
{
if(areaId == "saveButton") {
for (var component in CuraApplication.additionalComponents["saveButton"]) {
CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow
}
target: CuraApplication
onAdditionalComponentsChanged: saveRow.addAdditionalComponents("saveButton")
}
function addAdditionalComponents (areaId) {
if(areaId == "saveButton") {
for (var component in CuraApplication.additionalComponents["saveButton"]) {
CuraApplication.additionalComponents["saveButton"][component].parent = additionalComponentsRow
}
}
}
@ -130,12 +168,10 @@ Item {
Button {
id: prepareButton
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
// 1 = not started, 2 = Processing
enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true
visible: {
return !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true;
}
enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true
visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true
property bool autoSlice
height: UM.Theme.getSize("save_button_save_to_button").height
@ -144,14 +180,10 @@ Item {
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
// 1 = not started, 5 = disabled
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
text: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
onClicked:
{
if ([1, 5].indexOf(UM.Backend.state) != -1) {
backend.forceSlice();
} else {
backend.stopSlicing();
}
sliceOrStopSlicing();
}
style: ButtonStyle {
@ -212,10 +244,8 @@ Item {
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
// 3 = done, 5 = disabled
enabled: (base.backendState == 3 || base.backendState == 5) && base.activity == true
visible: {
return autoSlice || ((base.backendState == 3 || base.backendState == 5) && base.activity == true);
}
enabled: base.backendState != "undefined" && (base.backendState == 3 || base.backendState == 5) && base.activity == true
visible: base.backendState != "undefined" && autoSlice || ((base.backendState == 3 || base.backendState == 5) && base.activity == true)
property bool autoSlice
height: UM.Theme.getSize("save_button_save_to_button").height
@ -292,8 +322,8 @@ Item {
width: UM.Theme.getSize("save_button_save_to_button").height
height: UM.Theme.getSize("save_button_save_to_button").height
// 3 = Done, 5 = Disabled
enabled: (base.backendState == 3 || base.backendState == 5) && base.activity == true
visible: (devicesModel.deviceCount > 1) && (base.backendState == 3 || base.backendState == 5) && base.activity == true
enabled: base.backendState != "undefined" && (base.backendState == 3 || base.backendState == 5) && base.activity == true
visible: base.backendState != "undefined" && (devicesModel.deviceCount > 1) && (base.backendState == 3 || base.backendState == 5) && base.activity == true
style: ButtonStyle {

View file

@ -1,5 +1,5 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
@ -31,13 +31,17 @@ Button {
onClicked:
{
forceActiveFocus();
if(definition.expanded)
{
settingDefinitionsModel.collapse(definition.key);
} else {
}
else
{
settingDefinitionsModel.expandAll(definition.key);
}
//Set focus so that tab navigation continues from this point on.
//NB: This must be set AFTER collapsing/expanding the category so that the scroll position is correct.
forceActiveFocus();
}
onActiveFocusChanged:
{

View file

@ -1,5 +1,5 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Layouts 1.1
@ -14,9 +14,9 @@ import "."
Item {
id: base;
height: UM.Theme.getSize("section").height;
height: UM.Theme.getSize("section").height
property alias contents: controlContainer.children;
property alias contents: controlContainer.children
property alias hovered: mouse.containsMouse
property var showRevertButton: true
@ -154,10 +154,10 @@ Item {
onEntered: {
hoverTimer.stop();
var tooltipText = catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders") + ".";
var tooltipText = catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders.");
if ((resolve != "None") && (stackLevel != 0)) {
// We come here if a setting has a resolve and the setting is not manually edited.
tooltipText += " " + catalog.i18nc("@label", "The value is resolved from per-extruder values ") + "[" + ExtruderManager.getInstanceExtruderValues(definition.key) + "].";
tooltipText += " " + catalog.i18nc("@label", "The value is resolved from per-extruder values ") + "[" + Cura.ExtruderManager.getInstanceExtruderValues(definition.key) + "].";
}
base.showTooltip(tooltipText);
}
@ -179,8 +179,13 @@ Item {
iconSource: UM.Theme.getIcon("reset")
onClicked: {
revertButton.focus = true;
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key);
revertButton.focus = true
if (externalResetHandler) {
externalResetHandler(propertyProvider.key)
} else {
Cura.MachineManager.clearUserSettingAllCurrentStacks(propertyProvider.key)
}
}
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile.")) }

View file

@ -1,5 +1,5 @@
// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
// Copyright (c) 2017 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.2
@ -11,6 +11,14 @@ SettingItem
id: base
property var focusItem: input
property string textBeforeEdit
property bool textHasChanged
onFocusReceived:
{
textHasChanged = false;
textBeforeEdit = focusItem.text;
}
contents: Rectangle
{
id: control
@ -100,6 +108,7 @@ SettingItem
left: parent.left
leftMargin: UM.Theme.getSize("setting_unit_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("setting_unit_margin").width
verticalCenter: parent.verticalCenter
}
renderType: Text.NativeRendering
@ -115,12 +124,22 @@ SettingItem
Keys.onReleased:
{
propertyProvider.setPropertyValue("value", text)
if (text != textBeforeEdit)
{
textHasChanged = true;
}
if (textHasChanged)
{
propertyProvider.setPropertyValue("value", text)
}
}
onEditingFinished:
{
propertyProvider.setPropertyValue("value", text)
if (textHasChanged)
{
propertyProvider.setPropertyValue("value", text)
}
}
onActiveFocusChanged:
@ -136,7 +155,8 @@ SettingItem
selectByMouse: true;
maximumLength: (definition.type == "[int]") ? 20 : (definition.type == "str") ? -1 : 10;
maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10;
clip: true; //Hide any text that exceeds the width of the text box.
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry

View file

@ -52,27 +52,34 @@ Item
{
id: globalProfileSelection
text: {
var result = Cura.MachineManager.activeQualityName;
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">";
result += " - ";
result += Cura.MachineManager.activeQualityLayerHeight + "mm";
result += "</font>";
}
return result;
}
text: generateActiveQualityText()
enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1
width: Math.floor(parent.width * 0.55)
height: UM.Theme.getSize("setting_control").height
anchors.left: globalProfileLabel.right
anchors.right: parent.right
tooltip: Cura.MachineManager.activeQualityName
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
activeFocusOnPress: true
menu: ProfileMenu { }
function generateActiveQualityText () {
var result = catalog.i18nc("@", "No Profile Available") // default text
if (Cura.MachineManager.isActiveQualitySupported ) {
result = Cura.MachineManager.activeQualityName
if (Cura.MachineManager.activeQualityLayerHeight > 0) {
result += " <font color=\"" + UM.Theme.getColor("text_detail") + "\">"
result += " - "
result += Cura.MachineManager.activeQualityLayerHeight + "mm"
result += "</font>"
}
}
return result
}
UM.SimpleButton
{
id: customisedSettings
@ -329,7 +336,7 @@ Item
Behavior on opacity { NumberAnimation { duration: 100 } }
enabled:
{
if(!ExtruderManager.activeExtruderStackId && machineExtruderCount.properties.value > 1)
if (!Cura.ExtruderManager.activeExtruderStackId && machineExtruderCount.properties.value > 1)
{
// disable all controls on the global tab, except categories
return model.type == "category"
@ -341,6 +348,7 @@ Item
property var settingDefinitionsModel: definitionsModel
property var propertyProvider: provider
property var globalPropertyProvider: inheritStackProvider
property var externalResetHandler: false
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
@ -391,7 +399,7 @@ Item
// machine gets changed.
var activeMachineId = Cura.MachineManager.activeMachineId;
if(!model.settable_per_extruder || machineExtruderCount.properties.value == 1)
if(!model.settable_per_extruder)
{
//Not settable per extruder or there only is global, so we must pick global.
return activeMachineId;
@ -399,12 +407,12 @@ Item
if(inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0)
{
//We have limit_to_extruder, so pick that stack.
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
return Cura.ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
}
if(ExtruderManager.activeExtruderStackId)
if(Cura.ExtruderManager.activeExtruderStackId)
{
//We're on an extruder tab. Pick the current extruder.
return ExtruderManager.activeExtruderStackId;
return Cura.ExtruderManager.activeExtruderStackId;
}
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
return activeMachineId;

View file

@ -22,14 +22,14 @@ Rectangle
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
property int backendState: UM.Backend.state
property bool monitoringPrint: false
property bool monitoringPrint: UM.Controller.activeStage.stageId == "MonitorStage"
property variant printDuration: PrintInformation.currentPrintTime
property variant printMaterialLengths: PrintInformation.materialLengths
property variant printMaterialWeights: PrintInformation.materialWeights
property variant printMaterialCosts: PrintInformation.materialCosts
property variant printMaterialNames: PrintInformation.materialNames
color: UM.Theme.getColor("sidebar")
UM.I18nCatalog { id: catalog; name:"cura"}
@ -86,10 +86,19 @@ Rectangle
}
}
MachineSelection {
id: machineSelection
width: base.width
height: UM.Theme.getSize("sidebar_header").height
anchors.top: base.top
anchors.right: parent.right
}
SidebarHeader {
id: header
width: parent.width
visible: machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants
visible: (machineExtruderCount.properties.value > 1 || Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants) && !monitoringPrint
anchors.top: machineSelection.bottom
onShowTooltip: base.showTooltip(item, location, text)
onHideTooltip: base.hideTooltip()
@ -262,7 +271,7 @@ Rectangle
{
id: controlItem
anchors.bottom: footerSeparator.top
anchors.top: headerSeparator.bottom
anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
anchors.left: base.left
anchors.right: base.right
sourceComponent:
@ -281,7 +290,7 @@ Rectangle
Loader
{
anchors.bottom: footerSeparator.top
anchors.top: headerSeparator.bottom
anchors.top: monitoringPrint ? machineSelection.bottom : headerSeparator.bottom
anchors.left: base.left
anchors.right: base.right
source:
@ -313,51 +322,56 @@ Rectangle
anchors.bottomMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize)
}
Rectangle
Item
{
id: printSpecs
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
height: timeDetails.height + timeSpecDescription.height + lengthSpec.height
height: timeDetails.height + costSpec.height
width: base.width - (saveButton.buttonRowWidth + UM.Theme.getSize("sidebar_margin").width)
visible: !monitoringPrint
clip: true
Label
{
id: timeDetails
anchors.left: parent.left
anchors.bottom: timeSpecDescription.top
anchors.bottom: costSpec.top
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text_subtext")
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
MouseArea
{
id: infillMouseArea
id: timeDetailsMouseArea
anchors.fill: parent
hoverEnabled: true
//enabled: base.settingsEnabled
onEntered:
{
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
// All the time information for the different features is achieved
var print_time = PrintInformation.getFeaturePrintTimes()
var print_time = PrintInformation.getFeaturePrintTimes();
var total_seconds = parseInt(base.printDuration.getDisplayString(UM.DurationFormat.Seconds))
// A message is created and displayed when the user hover the time label
var content = catalog.i18nc("@tooltip", "<b>Time information</b>")
var tooltip_html = "<b>%1</b><br/><table width=\"100%\">".arg(catalog.i18nc("@tooltip", "Time specification"));
for(var feature in print_time)
{
if(!print_time[feature].isTotalDurationZero)
{
content += "<br /><i>" + feature + "</i>: " + print_time[feature].getDisplayString(UM.DurationFormat.Short)
tooltip_html += "<tr><td>" + feature + ":</td>" +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(print_time[feature].getDisplayString(UM.DurationFormat.ISO8601).slice(0,-3)) +
"<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1%</td>".arg(Math.round(100 * parseInt(print_time[feature].getDisplayString(UM.DurationFormat.Seconds)) / total_seconds)) +
"</td></tr>";
}
}
tooltip_html += "</table>";
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content)
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), tooltip_html);
}
}
onExited:
@ -369,20 +383,96 @@ Rectangle
Label
{
id: timeSpecDescription
anchors.left: parent.left
anchors.bottom: lengthSpec.top
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_subtext")
text: catalog.i18nc("@description", "Print time")
}
Label
{
id: lengthSpec
function formatRow(items)
{
var row_html = "<tr>";
for(var item = 0; item < items.length; item++)
{
if (item == 0)
{
row_html += "<td valign=\"bottom\">%1</td>".arg(items[item]);
}
else
{
row_html += "<td align=\"right\" valign=\"bottom\">&nbsp;&nbsp;%1</td>".arg(items[item]);
}
}
row_html += "</tr>";
return row_html;
}
function getSpecsData()
{
var lengths = [];
var total_length = 0;
var weights = [];
var total_weight = 0;
var costs = [];
var total_cost = 0;
var some_costs_known = false;
var names = [];
if(base.printMaterialLengths)
{
for(var index = 0; index < base.printMaterialLengths.length; index++)
{
if(base.printMaterialLengths[index] > 0)
{
names.push(base.printMaterialNames[index]);
lengths.push(base.printMaterialLengths[index].toFixed(2));
weights.push(String(Math.floor(base.printMaterialWeights[index])));
var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2);
costs.push(cost);
if(cost > 0)
{
some_costs_known = true;
}
total_length += base.printMaterialLengths[index];
total_weight += base.printMaterialWeights[index];
total_cost += base.printMaterialCosts[index];
}
}
}
if(lengths.length == 0)
{
lengths = ["0.00"];
weights = ["0"];
costs = ["0.00"];
}
var tooltip_html = "<b>%1</b><br/><table width=\"100%\">".arg(catalog.i18nc("@label", "Cost specification"));
for(var index = 0; index < lengths.length; index++)
{
tooltip_html += formatRow([
"%1:".arg(names[index]),
catalog.i18nc("@label m for meter", "%1m").arg(lengths[index]),
catalog.i18nc("@label g for grams", "%1g").arg(weights[index]),
"%1&nbsp;%2".arg(UM.Preferences.getValue("cura/currency")).arg(costs[index]),
]);
}
if(lengths.length > 1)
{
tooltip_html += formatRow([
catalog.i18nc("@label", "Total:"),
catalog.i18nc("@label m for meter", "%1m").arg(total_length.toFixed(2)),
catalog.i18nc("@label g for grams", "%1g").arg(Math.round(total_weight)),
"%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(total_cost.toFixed(2)),
]);
}
tooltip_html += "</table>";
tooltipText = tooltip_html;
return tooltipText
}
id: costSpec
anchors.left: parent.left
anchors.bottom: parent.bottom
font: UM.Theme.getFont("very_small")
color: UM.Theme.getColor("text_subtext")
elide: Text.ElideMiddle
width: parent.width
property string tooltipText
text:
{
var lengths = [];
@ -421,6 +511,27 @@ Rectangle
return catalog.i18nc("@label Print estimates: m for meters, g for grams", "%1m / ~ %2g").arg(lengths.join(" + ")).arg(weights.join(" + "));
}
}
MouseArea
{
id: costSpecMouseArea
anchors.fill: parent
hoverEnabled: true
onEntered:
{
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
var show_data = costSpec.getSpecsData()
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), show_data);
}
}
onExited:
{
base.hideTooltip();
}
}
}
}
@ -446,7 +557,6 @@ Rectangle
visible: monitoringPrint
}
SidebarTooltip
{
id: tooltip;

View file

@ -14,7 +14,7 @@ Column
{
id: base;
property int currentExtruderIndex: ExtruderManager.activeExtruderIndex;
property int currentExtruderIndex: Cura.ExtruderManager.activeExtruderIndex;
property bool currentExtruderVisible: extrudersList.visible;
spacing: Math.floor(UM.Theme.getSize("sidebar_margin").width * 0.9)
@ -34,6 +34,7 @@ Column
width: height
}
// Extruder Row
Item
{
id: extruderSelectionRow
@ -72,7 +73,7 @@ Column
orientation: ListView.Horizontal
model: Cura.ExtrudersModel { id: extrudersModel; addGlobal: false }
model: Cura.ExtrudersModel { id: extrudersModel; }
Connections
{
@ -93,7 +94,7 @@ Column
onClicked:
{
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
ExtruderManager.setActiveExtruderIndex(index);
Cura.ExtruderManager.setActiveExtruderIndex(index);
}
style: ButtonStyle
@ -185,6 +186,8 @@ Column
// Only draw the filling colour of the material inside the SVG border.
Rectangle
{
id: materialColorCircle
anchors
{
right: parent.right
@ -245,35 +248,29 @@ Column
color: UM.Theme.getColor("text");
}
ToolButton {
ToolButton
{
id: materialSelection
text: Cura.MachineManager.activeMaterialName
tooltip: Cura.MachineManager.activeMaterialName
visible: Cura.MachineManager.hasMaterials
property var valueError:
{
var data = Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible")
if(data == "False")
{
return true
}
else
{
return false
}
}
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
enabled: !extrudersList.visible || base.currentExtruderIndex > -1
height: UM.Theme.getSize("setting_control").height
width: parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width
anchors.right: parent.right
style: UM.Theme.styles.sidebar_header_button
activeFocusOnPress: true;
menu: MaterialMenu {
extruderIndex: base.currentExtruderIndex
}
menu: MaterialMenu { extruderIndex: base.currentExtruderIndex }
property var valueError: !isMaterialSupported()
property var valueWarning: ! Cura.MachineManager.isActiveQualitySupported
function isMaterialSupported () {
return Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeMaterialId, "compatible") == "True"
}
}
}
@ -352,7 +349,7 @@ Column
Label {
id: materialInfoLabel
wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "<a href='%1'>Check material compatibility</a>")
text: catalog.i18nc("@label", "<a href='%1'>Check compatibility</a>")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")

View file

@ -19,7 +19,7 @@ Item
property Action configureSettings;
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
Component.onCompleted: PrintInformation.enabled = true
Component.onDestruction: PrintInformation.enabled = false
@ -303,13 +303,31 @@ Item
// only change if an active machine is set and the slider is visible at all.
if (Cura.MachineManager.activeMachine != null && visible) {
// prevent updating during view initializing. Trigger only if the value changed by user
if (qualitySlider.value != qualityModel.qualitySliderActiveIndex) {
if (qualitySlider.value != qualityModel.qualitySliderActiveIndex && qualityModel.qualitySliderActiveIndex != -1) {
// start updating with short delay
qualitySliderChangeTimer.start()
}
}
}
}
MouseArea
{
id: speedSliderMouseArea
anchors.fill: parent
hoverEnabled: true
enabled: Cura.SimpleModeSettingsManager.isProfileUserCreated
onEntered:
{
var content = catalog.i18nc("@tooltip","A custom profile is currently active. To enable the quality slider, choose a default quality profile in Custom tab")
base.showTooltip(qualityRow, Qt.point(-UM.Theme.getSize("sidebar_margin").width, customisedSettings.height), content)
}
onExited:
{
base.hideTooltip();
}
}
}
Label
@ -322,6 +340,8 @@ Item
text: catalog.i18nc("@label", "Print Speed")
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
width: parseInt(UM.Theme.getSize("sidebar").width * 0.35)
elide: Text.ElideRight
}
Label
@ -350,7 +370,7 @@ Item
{
id: customisedSettings
visible: Cura.SimpleModeSettingsManager.isProfileCustomized
visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.SimpleModeSettingsManager.isProfileUserCreated
height: speedSlider.height * 0.8
width: speedSlider.height * 0.8
@ -363,7 +383,18 @@ Item
onClicked:
{
discardOrKeepProfileChangesDialog.show()
// if the current profile is user-created, switch to a built-in quality
if (Cura.SimpleModeSettingsManager.isProfileUserCreated)
{
if (Cura.ProfilesModel.rowCount() > 0)
{
Cura.MachineManager.setActiveQuality(Cura.ProfilesModel.getItem(0).id)
}
}
if (Cura.SimpleModeSettingsManager.isProfileCustomized)
{
discardOrKeepProfileChangesDialog.show()
}
}
onEntered:
{
@ -374,8 +405,6 @@ Item
}
}
//
// Infill
//
@ -539,18 +568,20 @@ Item
model: infillModel
anchors.fill: parent
property int activeIndex: {
function activeIndex () {
for (var i = 0; i < infillModel.count; i++) {
var density = parseInt(infillDensity.properties.value)
var steps = parseInt(infillSteps.properties.value)
var infillModelItem = infillModel.get(i)
if (density >= infillModelItem.percentageMin
if (infillModelItem != "undefined"
&& density >= infillModelItem.percentageMin
&& density <= infillModelItem.percentageMax
&& steps >= infillModelItem.stepsMin
&& steps <= infillModelItem.stepsMax){
return i
}
&& steps <= infillModelItem.stepsMax
){
return i
}
}
return -1
}
@ -558,7 +589,7 @@ Item
Rectangle
{
anchors.fill: parent
visible: infillIconList.activeIndex == index
visible: infillIconList.activeIndex() == index
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("quality_slider_unavailable")

View file

@ -54,6 +54,7 @@ UM.PointingRectangle {
rightMargin: UM.Theme.getSize("tooltip_margins").width;
}
wrapMode: Text.Wrap;
textFormat: Text.RichText
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("tooltip_text");
}

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM
import UM 1.4 as UM
import Cura 1.0 as Cura
import "Menus"
@ -16,24 +16,28 @@ Rectangle
anchors.left: parent.left
anchors.right: parent.right
height: UM.Theme.getSize("sidebar_header").height
color: base.monitoringPrint ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color")
color: UM.Controller.activeStage.stageId == "MonitorStage" ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color")
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property bool monitoringPrint: false
// outgoing signal
signal startMonitoringPrint()
signal stopMonitoringPrint()
property int rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
property int allItemsWidth: 0;
// update monitoring status when event was triggered outside topbar
Component.onCompleted: {
startMonitoringPrint.connect(function () {
base.monitoringPrint = true
})
stopMonitoringPrint.connect(function () {
base.monitoringPrint = false
})
function updateMarginsAndSizes() {
if (UM.Preferences.getValue("cura/sidebar_collapsed"))
{
rightMargin = UM.Theme.getSize("default_margin").width;
}
else
{
rightMargin = UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width;
}
allItemsWidth = (
logo.width + UM.Theme.getSize("topbar_logo_right_margin").width +
UM.Theme.getSize("topbar_logo_right_margin").width + stagesMenuContainer.width +
UM.Theme.getSize("default_margin").width + viewModeButton.width +
rightMargin);
}
UM.I18nCatalog
@ -59,163 +63,101 @@ Rectangle
Row
{
id: stagesMenuContainer
anchors.left: logo.right
anchors.leftMargin: UM.Theme.getSize("topbar_logo_right_margin").width
anchors.right: machineSelection.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width
spacing: UM.Theme.getSize("default_margin").width
Button
// The topbar is dynamically filled with all available stages
Repeater
{
id: showSettings
height: UM.Theme.getSize("sidebar_header").height
text: catalog.i18nc("@title:tab", "Prepare")
checkable: true
checked: isChecked()
exclusiveGroup: sidebarHeaderBarGroup
style: UM.Theme.styles.topbar_header_tab
id: stagesMenu
// We use a Qt.binding to re-bind the checkbox state after manually setting it
// https://stackoverflow.com/questions/38798450/qt-5-7-qml-why-are-my-checkbox-property-bindings-disappearing
onClicked: {
base.stopMonitoringPrint()
checked = Qt.binding(isChecked)
}
model: UM.StageModel{}
function isChecked () {
return !base.monitoringPrint
}
property color overlayColor: "transparent"
property string overlayIconSource: ""
}
Button
{
id: showMonitor
width: UM.Theme.getSize("topbar_button").width
height: UM.Theme.getSize("sidebar_header").height
text: catalog.i18nc("@title:tab", "Monitor")
checkable: true
checked: isChecked()
exclusiveGroup: sidebarHeaderBarGroup
style: UM.Theme.styles.topbar_header_tab_no_overlay
// We use a Qt.binding to re-bind the checkbox state after manually setting it
// https://stackoverflow.com/questions/38798450/qt-5-7-qml-why-are-my-checkbox-property-bindings-disappearing
onClicked: {
base.startMonitoringPrint()
checked = Qt.binding(isChecked)
}
function isChecked () {
return base.monitoringPrint
}
property string iconSource:
delegate: Button
{
if (!printerConnected)
{
return UM.Theme.getIcon("tab_status_unknown");
}
else if (!printerAcceptsCommands)
{
return UM.Theme.getIcon("tab_status_unknown");
}
text: model.name
checkable: true
checked: model.active
exclusiveGroup: topbarMenuGroup
style: (model.stage.iconSource != "") ? UM.Theme.styles.topbar_header_tab_no_overlay : UM.Theme.styles.topbar_header_tab
height: UM.Theme.getSize("sidebar_header").height
onClicked: UM.Controller.setActiveStage(model.id)
iconSource: model.stage.iconSource
if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
{
return UM.Theme.getIcon("tab_status_busy");
}
switch (Cura.MachineManager.printerOutputDevices[0].jobState)
{
case "printing":
case "pre_print":
case "pausing":
case "resuming":
return UM.Theme.getIcon("tab_status_busy");
case "wait_cleanup":
return UM.Theme.getIcon("tab_status_finished");
case "ready":
case "":
return UM.Theme.getIcon("tab_status_connected")
case "paused":
return UM.Theme.getIcon("tab_status_paused")
case "error":
return UM.Theme.getIcon("tab_status_stopped")
default:
return UM.Theme.getIcon("tab_status_unknown")
}
property color overlayColor: "transparent"
property string overlayIconSource: ""
}
}
ExclusiveGroup { id: sidebarHeaderBarGroup }
ExclusiveGroup { id: topbarMenuGroup }
}
ToolButton
// View orientation Item
Row
{
id: machineSelection
text: Cura.MachineManager.activeMachineName
id: viewOrientationControl
height: 30
spacing: 2
visible: UM.Controller.activeStage.stageId != "MonitorStage"
width: UM.Theme.getSize("sidebar").width
height: UM.Theme.getSize("sidebar_header").height
tooltip: Cura.MachineManager.activeMachineName
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
style: ButtonStyle
anchors
{
background: Rectangle
{
color:
{
if(control.pressed)
{
return UM.Theme.getColor("sidebar_header_active");
}
else if(control.hovered)
{
return UM.Theme.getColor("sidebar_header_hover");
}
else
{
return UM.Theme.getColor("sidebar_header_bar");
}
}
Behavior on color { ColorAnimation { duration: 50; } }
UM.RecolorImage
{
id: downArrow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
sourceSize.width: width
sourceSize.height: width
color: UM.Theme.getColor("text_emphasis")
source: UM.Theme.getIcon("arrow_bottom")
}
Label
{
id: sidebarComboBoxLabel
color: UM.Theme.getColor("sidebar_header_text_active")
text: control.text;
elide: Text.ElideRight;
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
anchors.right: downArrow.left;
anchors.rightMargin: control.rightMargin;
anchors.verticalCenter: parent.verticalCenter;
font: UM.Theme.getFont("large")
}
}
label: Label {}
verticalCenter: base.verticalCenter
right: viewModeButton.left
rightMargin: UM.Theme.getSize("default_margin").width
}
menu: PrinterMenu { }
// #1 3d view
Button
{
iconSource: UM.Theme.getIcon("view_3d")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked:UM.Controller.rotateView("3d", 0)
visible: base.width - allItemsWidth - 4 * this.width > 0
}
// #2 Front view
Button
{
iconSource: UM.Theme.getIcon("view_front")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked: UM.Controller.rotateView("home", 0);
visible: base.width - allItemsWidth - 3 * this.width > 0
}
// #3 Top view
Button
{
iconSource: UM.Theme.getIcon("view_top")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked: UM.Controller.rotateView("y", 90)
visible: base.width - allItemsWidth - 2 * this.width > 0
}
// #4 Left view
Button
{
iconSource: UM.Theme.getIcon("view_left")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked: UM.Controller.rotateView("x", 90)
visible: base.width - allItemsWidth - 1 * this.width > 0
}
// #5 Left view
Button
{
iconSource: UM.Theme.getIcon("view_right")
style: UM.Theme.styles.small_tool_button
anchors.verticalCenter: viewOrientationControl.verticalCenter
onClicked: UM.Controller.rotateView("x", -90)
visible: base.width - allItemsWidth > 0
}
}
ComboBox
@ -225,11 +167,11 @@ Rectangle
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width
rightMargin: rightMargin
}
style: UM.Theme.styles.combobox
visible: !base.monitoringPrint
visible: UM.Controller.activeStage.stageId != "MonitorStage"
model: UM.ViewModel { }
textRole: "name"
@ -285,4 +227,16 @@ Rectangle
source: UM.ActiveView.valid ? UM.ActiveView.activeViewPanel : "";
}
// Expand or collapse sidebar
Connections
{
target: Cura.Actions.expandSidebar
onTriggered: updateMarginsAndSizes()
}
Component.onCompleted:
{
updateMarginsAndSizes();
}
}