Merge pull request #5470 from Ultimaker/WIP_onboarding_machine_action

New onboarding flow - machine action
This commit is contained in:
Jaime van Kessel 2019-03-28 13:43:48 +01:00 committed by GitHub
commit 84de34341d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 2104 additions and 3498 deletions

View file

@ -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
}
}
}
}

View file

@ -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")
}
}
}

View file

@ -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")
}

View file

@ -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()
}

View file

@ -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()
}
}

View file

@ -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:
{

View file

@ -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()
}

View file

@ -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" }

View file

@ -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()
}

View file

@ -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