mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Merge pull request #5470 from Ultimaker/WIP_onboarding_machine_action
New onboarding flow - machine action
This commit is contained in:
commit
84de34341d
66 changed files with 2104 additions and 3498 deletions
|
@ -129,7 +129,7 @@ ScrollView
|
|||
{
|
||||
id: machineButton
|
||||
|
||||
RadioButton
|
||||
Cura.RadioButton
|
||||
{
|
||||
id: radioButton
|
||||
anchors.left: parent.left
|
||||
|
@ -140,47 +140,7 @@ ScrollView
|
|||
|
||||
checked: ListView.view.currentIndex == index
|
||||
text: name
|
||||
font: UM.Theme.getFont("default")
|
||||
visible: base.currentSection == section
|
||||
|
||||
background: Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
indicator: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("radio_button").width
|
||||
implicitHeight: UM.Theme.getSize("radio_button").height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
radius: (width / 2) | 0
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: radioButton.hovered ? UM.Theme.getColor("small_button_text") : UM.Theme.getColor("small_button_text_hover")
|
||||
|
||||
Rectangle
|
||||
{
|
||||
width: (parent.width / 2) | 0
|
||||
height: width
|
||||
anchors.centerIn: parent
|
||||
radius: (width / 2) | 0
|
||||
color: radioButton.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("primary_button")
|
||||
visible: radioButton.checked
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Label
|
||||
{
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: radioButton.indicator.width + radioButton.spacing
|
||||
text: radioButton.text
|
||||
font: radioButton.font
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
ListView.view.currentIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ Item
|
|||
}
|
||||
|
||||
text: catalog.i18nc("@button", "Next")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked:
|
||||
{
|
||||
|
@ -135,18 +135,18 @@ Item
|
|||
// Create a network printer
|
||||
const networkPrinterItem = addNetworkPrinterDropDown.contentItem.currentItem
|
||||
CuraApplication.getDiscoveredPrintersModel().createMachineFromDiscoveredPrinter(networkPrinterItem)
|
||||
|
||||
// If we have created a machine, go to the last page, which is the "cloud" page.
|
||||
base.goToPage("cloud")
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a local printer
|
||||
const localPrinterItem = addLocalPrinterDropDown.contentItem.currentItem
|
||||
Cura.MachineManager.addMachine(localPrinterItem.id)
|
||||
|
||||
base.showNextPage()
|
||||
}
|
||||
|
||||
// TODO: implement machine actions
|
||||
|
||||
// If we have created a machine, go to the last page, which is the "cloud" page.
|
||||
base.goToPage("cloud")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Finish")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage()
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ Item
|
|||
anchors.verticalCenter: finishButton.verticalCenter
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Create an account")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Next")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
//
|
||||
// This component contains the content for the "What's new in Ultimaker Cura" page of the welcome on-boarding process.
|
||||
//
|
||||
Item
|
||||
{
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
|
||||
property var machineActionsModel: CuraApplication.getFirstStartMachineActionsModel()
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
// Reset the action to start from the beginning when it is shown.
|
||||
machineActionsModel.reset()
|
||||
}
|
||||
|
||||
// Go to the next page when all machine actions have been finished
|
||||
Connections
|
||||
{
|
||||
target: machineActionsModel
|
||||
onAllFinished:
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
base.showNextPage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: titleLabel
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title
|
||||
color: UM.Theme.getColor("primary_button")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.top: titleLabel.bottom
|
||||
anchors.bottom: nextButton.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
data: machineActionsModel.currentItem.content == undefined ? emptyItem : machineActionsModel.currentItem.content
|
||||
}
|
||||
|
||||
// An empty item in case there's no currentItem.content to show
|
||||
Item
|
||||
{
|
||||
id: emptyItem
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: nextButton
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Next")
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: machineActionsModel.goToNextAction()
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Agree")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked:
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Decline and close")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ Item
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Get started")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage()
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@ import UM 1.3 as UM
|
|||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
//
|
||||
// This is a no-frame dialog that shows the welcome process.
|
||||
//
|
||||
Window
|
||||
{
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
|
|
|
@ -67,7 +67,7 @@ Item
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||
text: catalog.i18nc("@button", "Next")
|
||||
width: 140
|
||||
width: UM.Theme.getSize("welcome_pages_button").width
|
||||
fixedWidthMode: true
|
||||
onClicked: base.showNextPage()
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@ import QtQuick.Controls 2.3
|
|||
import UM 1.3 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "../Widgets"
|
||||
|
||||
|
||||
//
|
||||
// This item is a wizard panel that contains a progress bar at the top and a content area that's beneath the progress
|
||||
|
@ -42,7 +40,7 @@ Item
|
|||
anchors.fill: parent
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
|
||||
CuraProgressBar
|
||||
Cura.ProgressBar
|
||||
{
|
||||
id: progressBar
|
||||
anchors.top: parent.top
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue