Merge branch 'master' into CURA-8640_PyQt6

# Conflicts:
#	cura/CuraApplication.py
#	resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
#	resources/qml/Preferences/Materials/MaterialsView.qml
This commit is contained in:
Jelle Spijker 2022-03-24 11:53:44 +01:00
commit 3f8907d02a
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
582 changed files with 8061 additions and 9724 deletions

View file

@ -1,4 +1,4 @@
//Copyright (c) 2021 Ultimaker B.V.
//Copyright (c) 2022 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
@ -7,7 +7,7 @@ import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.15
import QtQuick.Window 2.1
import Cura 1.1 as Cura
import UM 1.4 as UM
import UM 1.5 as UM
Window
{
@ -20,6 +20,7 @@ Window
width: minimumWidth
height: minimumHeight
modality: Qt.ApplicationModal
color: UM.Theme.getColor("main_background")
property variant syncModel
property alias pageIndex: swipeView.currentIndex
@ -32,82 +33,78 @@ Window
anchors.fill: parent
interactive: false
Rectangle
Item
{
id: introPage
color: UM.Theme.getColor("main_background")
Column
ColumnLayout
{
spacing: UM.Theme.getSize("default_margin").height
anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width
Label
UM.Label
{
text: catalog.i18nc("@title:header", "Sync materials with printers")
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.fillWidth: true
}
Label
UM.Label
{
text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap
width: parent.width
Layout.fillWidth: true
}
Image
{
Layout.fillWidth: true
Layout.fillHeight: true
source: UM.Theme.getImage("material_ecosystem")
width: parent.width
fillMode: Image.PreserveAspectFit
sourceSize.width: width
}
}
Cura.PrimaryButton
{
id: startButton
anchors
Item
{
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height
}
text: catalog.i18nc("@button", "Start")
onClicked:
{
if(Cura.API.account.isLoggedIn)
Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Cura.TertiaryButton
{
swipeView.currentIndex += 2; //Skip sign in page.
text: catalog.i18nc("@button", "Why do I need to sync material profiles?")
iconSource: UM.Theme.getIcon("LinkExternal")
isIconOnRightSide: true
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why")
}
else
Cura.PrimaryButton
{
swipeView.currentIndex += 1;
anchors.right: parent.right
text: catalog.i18nc("@button", "Start")
onClicked:
{
if(Cura.API.account.isLoggedIn)
{
swipeView.currentIndex += 2; //Skip sign in page.
}
else
{
swipeView.currentIndex += 1;
}
}
}
}
}
Cura.TertiaryButton
{
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
verticalCenter: startButton.verticalCenter
}
text: catalog.i18nc("@button", "Why do I need to sync material profiles?")
iconSource: UM.Theme.getIcon("LinkExternal")
isIconOnRightSide: true
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-why")
}
}
Rectangle
Item
{
id: signinPage
color: UM.Theme.getColor("main_background")
Connections //While this page is active, continue to the next page if the user logs in.
// While this page is active, continue to the next page if the user logs in.
Connections
{
target: Cura.API.account
function onLoginStateChanged(is_logged_in)
@ -125,40 +122,35 @@ Window
anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width
Label
UM.Label
{
text: catalog.i18nc("@title:header", "Sign in")
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredHeight: height
Layout.fillWidth: true
}
Label
UM.Label
{
text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap
width: parent.width
Layout.maximumWidth: width
Layout.preferredHeight: height
Layout.fillWidth: true
}
Item
Image
{
Layout.preferredWidth: parent.width
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: parent.width / 2
source: UM.Theme.getImage("first_run_ultimaker_cloud")
Layout.fillHeight: true
Image
{
source: UM.Theme.getImage("first_run_ultimaker_cloud")
width: parent.width / 2
sourceSize.width: width
anchors.centerIn: parent
}
sourceSize.width: width
fillMode: Image.PreserveAspectFit
}
Item
{
width: parent.width
height: childrenRect.height
Layout.preferredHeight: height
Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Cura.SecondaryButton
{
anchors.left: parent.left
@ -175,10 +167,9 @@ Window
}
}
Rectangle
Item
{
id: printerListPage
color: UM.Theme.getColor("main_background")
ColumnLayout
{
@ -189,7 +180,6 @@ Window
Row
{
Layout.preferredHeight: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
states: [
@ -220,244 +210,225 @@ Window
{
id: printerListHeaderIcon
width: UM.Theme.getSize("section_icon").width
height: width
height: UM.Theme.getSize("section_icon").height
anchors.verticalCenter: parent.verticalCenter
}
Label
UM.Label
{
id: printerListHeader
anchors.verticalCenter: parent.verticalCenter
//Text is always defined by the states above.
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
}
}
Row
{
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
Label
UM.Label
{
id: syncStatusLabel
width: parent.width - UM.Theme.getSize("default_margin").width - troubleshootingLink.width
anchors.left: parent.left
wrapMode: Text.Wrap
elide: Text.ElideRight
visible: text !== ""
text: ""
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium")
}
Cura.TertiaryButton
{
id: troubleshootingLink
anchors.right: parent.right
text: catalog.i18nc("@button", "Troubleshooting")
visible: typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "error"
iconSource: UM.Theme.getIcon("LinkExternal")
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer")
}
}
ScrollView
ListView
{
id: printerListScrollView
width: parent.width
Layout.preferredWidth: width
id: printerList
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ListView
ScrollBar.vertical: UM.ScrollBar
{
id: printerList
width: parent.width
spacing: UM.Theme.getSize("default_margin").height
id: printerListScrollBar
}
spacing: UM.Theme.getSize("default_margin").height
model: cloudPrinterList
delegate: Rectangle
model: cloudPrinterList
delegate: Rectangle
{
id: delegateContainer
color: "transparent"
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
width: printerList.width - printerListScrollBar.width
height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height
property string syncStatus:
{
id: delegateContainer
color: "transparent"
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
width: printerListScrollView.width
height: UM.Theme.getSize("card").height
property string syncStatus:
var printer_id = model.metadata["host_guid"]
if(syncModel.printerStatus[printer_id] === undefined) //No status information available. Could be added after we started syncing.
{
var printer_id = model.metadata["host_guid"]
if(syncModel.printerStatus[printer_id] === undefined) //No status information available. Could be added after we started syncing.
{
return "idle";
}
return syncModel.printerStatus[printer_id];
return "idle";
}
return syncModel.printerStatus[printer_id];
}
Cura.IconWithText
{
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: Math.round(parent.height - height) / 2 //Equal margin on the left as above and below.
right: parent.right
rightMargin: Math.round(parent.height - height) / 2
}
Cura.IconWithText
{
anchors
{
verticalCenter: parent.verticalCenter
left: parent.left
leftMargin: Math.round(parent.height - height) / 2 //Equal margin on the left as above and below.
right: parent.right
rightMargin: Math.round(parent.height - height) / 2
}
text: model.name
font: UM.Theme.getFont("medium")
text: model.name
font: UM.Theme.getFont("medium")
source: UM.Theme.getIcon("Printer", "medium")
iconColor: UM.Theme.getColor("machine_selector_printer_icon")
iconSize: UM.Theme.getSize("machine_selector_icon").width
//Printer status badge (always cloud, but whether it's online or offline).
UM.RecolorImage
{
width: UM.Theme.getSize("printer_status_icon").width
height: UM.Theme.getSize("printer_status_icon").height
anchors
{
bottom: parent.bottom
bottomMargin: -Math.round(height / 6)
left: parent.left
leftMargin: parent.iconSize - Math.round(width * 5 / 6)
}
source: UM.Theme.getIcon("CloudBadge", "low")
color: UM.Theme.getColor("primary")
//Make a themeable circle in the background so we can change it in other themes.
Rectangle
{
anchors.centerIn: parent
width: parent.width - 1.5 //1.5 pixels smaller (at least sqrt(2), regardless of pixel scale) so that the circle doesn't show up behind the icon due to anti-aliasing.
height: parent.height - 1.5
radius: width / 2
color: UM.Theme.getColor("connection_badge_background")
z: parent.z - 1
}
}
}
source: UM.Theme.getIcon("Printer", "medium")
iconColor: UM.Theme.getColor("machine_selector_printer_icon")
iconSize: UM.Theme.getSize("machine_selector_icon").width
//Printer status badge (always cloud, but whether it's online or offline).
UM.RecolorImage
{
id: printerSpinner
width: UM.Theme.getSize("section_icon").width
height: width
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
width: UM.Theme.getSize("printer_status_icon").width
height: UM.Theme.getSize("printer_status_icon").height
anchors
{
bottom: parent.bottom
bottomMargin: -Math.round(height / 6)
left: parent.left
leftMargin: parent.iconSize - Math.round(width * 5 / 6)
}
visible: delegateContainer.syncStatus === "uploading"
source: UM.Theme.getIcon("ArrowDoubleCircleRight")
source: UM.Theme.getIcon("CloudBadge", "low")
color: UM.Theme.getColor("primary")
RotationAnimator
//Make a themeable circle in the background so we can change it in other themes.
Rectangle
{
target: printerSpinner
from: 0
to: 360
duration: 1000
loops: Animation.Infinite
running: true
anchors.centerIn: parent
width: parent.width - 1.5 //1.5 pixels smaller (at least sqrt(2), regardless of pixel scale) so that the circle doesn't show up behind the icon due to anti-aliasing.
height: parent.height - 1.5
radius: width / 2
color: UM.Theme.getColor("connection_badge_background")
z: parent.z - 1
}
}
UM.StatusIcon
{
width: UM.Theme.getSize("section_icon").width
height: width
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
visible: delegateContainer.syncStatus === "failed" || delegateContainer.syncStatus === "success"
status: delegateContainer.syncStatus === "success" ? UM.StatusIcon.Status.POSITIVE : UM.StatusIcon.Status.ERROR
}
}
footer: Item
UM.RecolorImage
{
width: printerListScrollView.width
height: {
if(!visible)
{
return 0;
}
let h = UM.Theme.getSize("card").height + printerListTroubleshooting.height + UM.Theme.getSize("default_margin").height * 2; //1 margin between content and footer, 1 for troubleshooting link.
return h;
}
visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle"
Rectangle
id: printerSpinner
width: UM.Theme.getSize("section_icon").width
height: width
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
visible: delegateContainer.syncStatus === "uploading"
source: UM.Theme.getIcon("ArrowDoubleCircleRight")
color: UM.Theme.getColor("primary")
RotationAnimator
{
anchors.fill: parent
anchors.topMargin: UM.Theme.getSize("default_margin").height
target: printerSpinner
from: 0
to: 360
duration: 1000
loops: Animation.Infinite
running: true
}
}
UM.StatusIcon
{
width: UM.Theme.getSize("section_icon").width
height: width
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Math.round((parent.height - height) / 2) //Same margin on the right as above and below.
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
color: "transparent"
visible: delegateContainer.syncStatus === "failed" || delegateContainer.syncStatus === "success"
status: delegateContainer.syncStatus === "success" ? UM.StatusIcon.Status.POSITIVE : UM.StatusIcon.Status.ERROR
}
}
Row
footer: Item
{
width: printerList.width - printerListScrollBar.width
height: childrenRect.height + UM.Theme.getSize("default_margin").height
visible: includeOfflinePrinterList.count - cloudPrinterList.count > 0 && typeof syncModel !== "undefined" && syncModel.exportUploadStatus === "idle"
Rectangle
{
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
anchors.topMargin: UM.Theme.getSize("default_margin").height
height: childrenRect.height + 2 * UM.Theme.getSize("thick_margin").height
color: "transparent"
GridLayout
{
columns: 3
rows: 2
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: UM.Theme.getSize("thick_margin").width
anchors.rightMargin: UM.Theme.getSize("thick_margin").width
anchors.topMargin: UM.Theme.getSize("thick_margin").height
anchors.bottomMargin: UM.Theme.getSize("thick_margin").height
columnSpacing: UM.Theme.getSize("default_margin").width
rowSpacing: UM.Theme.getSize("default_margin").height
UM.StatusIcon
{
anchors
{
fill: parent
margins: Math.round(UM.Theme.getSize("card").height - UM.Theme.getSize("machine_selector_icon").width) / 2 //Same margin as in other cards.
}
spacing: UM.Theme.getSize("default_margin").width
Layout.preferredWidth: UM.Theme.getSize("section_icon").width
Layout.preferredHeight: UM.Theme.getSize("section_icon").height
status: UM.StatusIcon.Status.WARNING
}
UM.StatusIcon
{
id: infoIcon
width: UM.Theme.getSize("section_icon").width
height: width
//Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings.
anchors.top: parent.top
anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2)
UM.Label
{
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?")
+ "\n"
+ catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.")
font: UM.Theme.getFont("medium")
elide: Text.ElideRight
}
status: UM.StatusIcon.Status.WARNING
}
Cura.SecondaryButton
{
id: refreshListButton
Layout.alignment: Qt.AlignVCenter
text: catalog.i18nc("@button", "Refresh List")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
onClicked: Cura.API.account.sync(true)
}
Column
{
//Fill the total width. Can't use layouts because we need the anchors for vertical alignment.
width: parent.width - infoIcon.width - refreshListButton.width - parent.spacing * 2
spacing: UM.Theme.getSize("default_margin").height
Label
{
id: printersMissingText
text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?")
+ "\n"
+ catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
elide: Text.ElideRight
}
Cura.TertiaryButton
{
id: printerListTroubleshooting
leftPadding: 0 //Want to visually align this to the text.
text: catalog.i18nc("@button", "Troubleshooting")
iconSource: UM.Theme.getIcon("LinkExternal")
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer")
}
}
Cura.SecondaryButton
{
id: refreshListButton
//Fake anchor.verticalCenter: printersMissingText.verticalCenter, since we can't anchor to things that aren't siblings.
anchors.top: parent.top
anchors.topMargin: Math.round(printersMissingText.height / 2 - height / 2)
text: catalog.i18nc("@button", "Refresh List")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
onClicked: Cura.API.account.sync(true)
}
Cura.TertiaryButton
{
id: printerListTroubleshooting
Layout.column: 1
Layout.row: 1
Layout.fillWidth: true
leftPadding: 0
text: catalog.i18nc("@button", "Troubleshooting")
iconSource: UM.Theme.getIcon("LinkExternal")
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-troubleshoot-cloud-printer")
}
}
}
@ -465,10 +436,9 @@ Window
}
Item
{
width: parent.width
height: childrenRect.height
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignBottom
Cura.SecondaryButton
{
@ -540,7 +510,7 @@ Window
running: true
}
}
Label
UM.Label
{
id: syncingLabel
anchors.left: syncingIcon.right
@ -554,56 +524,62 @@ Window
}
}
ColumnLayout //Placeholder for when the user has no cloud printers.
// Placeholder for when the user has no cloud printers.
ColumnLayout
{
spacing: UM.Theme.getSize("default_margin").height
anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width
visible: cloudPrinterList.count == 0
Label
UM.Label
{
text: catalog.i18nc("@title:header", "No printers found")
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredWidth: width
Layout.preferredHeight: height
}
Image
{
source: UM.Theme.getImage("3d_printer_faded")
sourceSize.width: width
fillMode: Image.PreserveAspectFit
Layout.alignment: Qt.AlignmentFlag.AlignHCenter
Layout.preferredWidth: parent.width / 3
}
Label
{
text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.")
width: parent.width
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.fillWidth: true
}
Item
{
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
Image
{
anchors.fill: parent
source: UM.Theme.getImage("3d_printer_faded")
sourceSize.width: width
fillMode: Image.PreserveAspectFit
}
}
UM.Label
{
text: catalog.i18nc("@text", "It seems like you don't have any compatible printers connected to Digital Factory. Make sure your printer is connected and it's running the latest firmware.")
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
}
Item
{
Layout.fillWidth: true
Layout.preferredHeight: parent.height / 4
Cura.TertiaryButton
{
text: catalog.i18nc("@button", "Learn how to connect your printer to Digital Factory")
iconSource: UM.Theme.getIcon("LinkExternal")
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/360012019239?utm_source=cura&utm_medium=software&utm_campaign=sync-material-wizard-add-cloud-printer")
anchors.horizontalCenter: parent.horizontalCenter
maximumWidth: parent.width
}
}
Item
{
width: parent.width
height: childrenRect.height
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Cura.SecondaryButton
{
@ -611,30 +587,34 @@ Window
text: catalog.i18nc("@button", "Sync materials with USB")
onClicked: swipeView.currentIndex = removableDriveSyncPage.SwipeView.index
}
Cura.PrimaryButton
RowLayout
{
id: disabledSyncButton
anchors.right: parent.right
text: catalog.i18nc("@button", "Sync")
enabled: false //If there are no printers, always disable this button.
}
Cura.SecondaryButton
{
anchors.right: disabledSyncButton.left
anchors.rightMargin: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Refresh")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
outlineColor: "transparent"
onClicked: Cura.API.account.sync(true)
spacing: UM.Theme.getSize("default_margin").width
Cura.SecondaryButton
{
text: catalog.i18nc("@button", "Refresh")
iconSource: UM.Theme.getIcon("ArrowDoubleCircleRight")
outlineColor: "transparent"
onClicked: Cura.API.account.sync(true)
}
Cura.PrimaryButton
{
id: disabledSyncButton
text: catalog.i18nc("@button", "Sync")
enabled: false // If there are no printers, always disable this button.
}
}
}
}
}
Rectangle
Item
{
id: removableDriveSyncPage
color: UM.Theme.getColor("main_background")
ColumnLayout
{
@ -642,53 +622,56 @@ Window
anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width
Label
UM.Label
{
text: catalog.i18nc("@title:header", "Sync material profiles via USB")
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredHeight: height
Layout.fillWidth: true
}
Label
UM.Label
{
text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap
width: parent.width
Layout.maximumWidth: width
Layout.preferredHeight: height
Layout.fillWidth: true
}
Row
RowLayout
{
width: parent.width
Layout.preferredWidth: width
Layout.fillWidth: true
Layout.fillHeight: true
spacing: UM.Theme.getSize("default_margin").width
Image
Item
{
source: UM.Theme.getImage("insert_usb")
width: parent.width / 3
height: width
anchors.verticalCenter: parent.verticalCenter
sourceSize.width: width
Layout.preferredWidth: parent.width / 3
Layout.fillHeight: true
Image
{
anchors.fill: parent
source: UM.Theme.getImage("insert_usb")
verticalAlignment: Image.AlignVCenter
horizontalAlignment: Image.AlignHCenter
fillMode: Image.PreserveAspectFit
sourceSize.width: width
}
}
Label
UM.Label
{
Layout.alignment: Qt.AlignCenter
Layout.fillWidth: true
text: "1. " + catalog.i18nc("@text", "Click the export material archive button.")
+ "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.")
+ "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.")
font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap
width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
}
}
Cura.TertiaryButton
{
Layout.fillWidth: true
text: catalog.i18nc("@button", "How to load new material profiles to my printer")
iconSource: UM.Theme.getIcon("LinkExternal")
onClicked: Qt.openUrlExternally("https://support.ultimaker.com/hc/en-us/articles/4403319801106/?utm_source=cura&utm_medium=software&utm_campaign=add-material-profiles-via-usb")
@ -696,10 +679,9 @@ Window
Item
{
width: parent.width
height: childrenRect.height
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
Cura.SecondaryButton
{
@ -732,24 +714,22 @@ Window
}
}
Cura.GlobalStacksModel
property variant cloudPrinterList: Cura.GlobalStacksModel
{
id: cloudPrinterList
filterConnectionType: 3 //Only show cloud connections.
filterOnlineOnly: true //Only show printers that are online.
filterCapabilities: ["import_material"] //Only show printers that can receive the material profiles.
}
Cura.GlobalStacksModel
property variant includeOfflinePrinterList: Cura.GlobalStacksModel
{
//In order to show a refresh button only when there are offline cloud printers, we need to know if there are any offline printers.
//A global stacks model without the filter for online-only printers allows this.
id: includeOfflinePrinterList
filterConnectionType: 3 //Still only show cloud connections.
}
FileDialog
property variant exportUsbDialog: FileDialog
{
id: exportUsbDialog
title: catalog.i18nc("@title:window", "Export All Materials")
selectExisting: false
nameFilters: ["Material archives (*.umm)", "All files (*)"]
@ -760,4 +740,4 @@ Window
materialsSyncDialog.hasExportedUsb = true;
}
}
}
}