Merge branch 'WIP_onboarding' of https://github.com/Ultimaker/Cura into WIP_onboarding

This commit is contained in:
Remco Burema 2019-03-22 13:20:43 +01:00
commit b25df557d3
15 changed files with 136 additions and 102 deletions

View file

@ -16,10 +16,13 @@ ScrollView
{
id: base
// The currently selected machine item in the local machine list.
property var currentItem: (machineList.currentIndex >= 0)
? machineList.model.getItem(machineList.currentIndex)
: null
// The currently active (expanded) section/category, where section/category is the grouping of local machine items.
property string currentSection: preferredCategory
// By default (when this list shows up) we always expand the "Ultimaker" section.
property string preferredCategory: "Ultimaker"
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff

View file

@ -19,7 +19,7 @@ Item
{
id: titleLabel
anchors.top: parent.top
anchors.topMargin: 40
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Add a printer")
@ -67,7 +67,7 @@ Item
onAddByIpButtonClicked:
{
base.gotoPage("add_printer_by_ip")
base.goToPage("add_printer_by_ip")
}
}
}
@ -101,8 +101,6 @@ Item
AddLocalPrinterScrollView
{
id: localPrinterView
maxItemCountAtOnce: 10 // show at max 10 items at once, otherwise you need to scroll.
}
}
}
@ -112,7 +110,7 @@ Item
id: nextButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
enabled:
{
// If the network printer dropdown is expanded, make sure that there is a selected item
@ -148,7 +146,7 @@ Item
// TODO: implement machine actions
// If we have created a machine, go to the last page, which is the "cloud" page.
base.gotoPage("cloud")
base.goToPage("cloud")
}
}
}

View file

@ -73,10 +73,9 @@ Item
Component.onCompleted:
{
// select the first one that's not "unknown" by default.
// Select the first one that's not "unknown" by default.
for (var i = 0; i < count; i++)
{
if (!model[i].is_unknown_machine_type)
{
currentIndex = i

View file

@ -18,15 +18,18 @@ Item
id: addPrinterByIpScreen
property bool hasSentRequest: false // True when a request has been sent to the device at the typed address.
property bool haveConnection: false // True when there is a connection with a machine, it can then be added.
property bool deviceUnresponsive: false // True when a request comes back, but the device hasn't responded.
// Whether an IP address is currently being resolved.
property bool hasSentRequest: false
// Whether the IP address user entered can be resolved as a recognizable printer.
property bool haveConnection: false
// True when a request comes back, but the device hasn't responded.
property bool deviceUnresponsive: false
Label
{
id: titleLabel
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Add printer by IP address")
@ -240,13 +243,11 @@ Item
id: backButton
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Cancel")
width: UM.Theme.getSize("action_button").width
fixedWidthMode: true
onClicked: base.gotoPage("add_printer_by_selection")
enabled: true
onClicked: base.goToPage("add_printer_by_selection")
}
Cura.PrimaryButton
@ -254,7 +255,7 @@ Item
id: connectButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Connect")
width: UM.Theme.getSize("action_button").width
fixedWidthMode: true

View file

@ -19,7 +19,7 @@ Item
{
id: titleLabel
anchors.top: parent.top
anchors.topMargin: 40
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Ultimaker Cloud")
@ -28,48 +28,65 @@ Item
renderType: Text.NativeRendering
}
Column
// Area where the cloud contents can be put. Pictures, texts and such.
Item
{
id: cloudContentsArea
anchors.top: titleLabel.bottom
anchors.topMargin: 80
anchors.horizontalCenter: parent.horizontalCenter
spacing: 60
Image
{
id: cloudImage
anchors.horizontalCenter: parent.horizontalCenter
source: UM.Theme.getImage("first_run_ultimaker_cloud")
}
anchors.bottom: finishButton.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: UM.Theme.getSize("default_margin").width
// Pictures and texts are arranged using Columns with spacing. The whole picture and text area is centered in
// the cloud contents area.
Column
{
anchors.horizontalCenter: parent.horizontalCenter
anchors.centerIn: parent
width: childrenRect.width
height: childrenRect.height
spacing: 30
spacing: 20 * screenScaleFactor
Label
Image // Cloud image
{
id: cloudImage
anchors.horizontalCenter: parent.horizontalCenter
source: UM.Theme.getImage("first_run_ultimaker_cloud")
}
Label // A title-ish text
{
id: highlightTextLabel
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@text", "The next generation 3D printing workflow")
textFormat: Text.RichText
color: UM.Theme.getColor("text_light_blue")
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
}
Label
Label // A number of text items
{
id: textLabel
anchors.horizontalCenter: parent.horizontalCenter
text: {
var t = "<p>- Send print jobs to Ultimaker printers outside your local network<p>"
t += "<p>- Store your Ultimaker Cura settings in the cloud for use anywhere</p>"
t += "<p>- Get exclusive access to material profiles from leading brands</p>"
catalog.i18nc("@text", t)
text:
{
// There are 3 text items, each of which is translated separately as a single piece of text.
var full_text = ""
var t = ""
t = catalog.i18nc("@text", "- Send print jobs to Ultimaker printers outside your local network")
full_text += "<p>" + t + "</p>"
t = catalog.i18nc("@text", "- Store your Ultimaker Cura settings in the cloud for use anywhere")
full_text += "<p>" + t + "</p>"
t = catalog.i18nc("@text", "- Get exclusive access to material profiles from leading brands")
full_text += "<p>" + t + "</p>"
return full_text
}
textFormat: Text.RichText
font: UM.Theme.getFont("medium")
@ -78,12 +95,13 @@ Item
}
}
// Bottom buttons go here
Cura.PrimaryButton
{
id: finishButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Finish")
width: 140
fixedWidthMode: true
@ -95,25 +113,31 @@ Item
id: createAccountButton
anchors.left: parent.left
anchors.verticalCenter: finishButton.verticalCenter
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Create an account")
width: 140
fixedWidthMode: true
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
}
Cura.SecondaryButton
Label
{
id: signInButton
anchors.left: createAccountButton.right
anchors.verticalCenter: finishButton.verticalCenter
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Sign in")
width: 80
shadowEnabled: false
color: "transparent"
hoverColor: "transparent"
textHoverColor: UM.Theme.getColor("text_light_blue")
fixedWidthMode: true
onClicked: Cura.API.account.login()
color: UM.Theme.getColor("secondary_button_text")
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
MouseArea
{
anchors.fill: parent
hoverEnabled: true
onClicked: Cura.API.account.login()
onEntered: parent.font.underline = true
onExited: parent.font.underline = false
}
}
}

View file

@ -19,7 +19,7 @@ Item
{
id: titleLabel
anchors.top: parent.top
anchors.topMargin: 40
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura")
@ -28,30 +28,39 @@ Item
renderType: Text.NativeRendering
}
Column
// Area where the cloud contents can be put. Pictures, texts and such.
Item
{
id: cloudContentsArea
anchors.top: titleLabel.bottom
anchors.topMargin: 80
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: getStartedButton.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: UM.Theme.getSize("default_margin").width
spacing: 60
Image
Column
{
id: curaImage
anchors.horizontalCenter: parent.horizontalCenter
source: UM.Theme.getImage("first_run_share_data")
}
anchors.centerIn: parent
Label
{
id: textLabel
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@text", "Ultimaker Cura collects anonymous data to improve print quality<br/>and user experience. <a href=\"TODO\">More information</a>")
textFormat: Text.RichText
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
spacing: UM.Theme.getSize("welcome_pages_default_margin").height
Image
{
id: curaImage
anchors.horizontalCenter: parent.horizontalCenter
source: UM.Theme.getImage("first_run_share_data")
}
Label
{
id: textLabel
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@text", "Ultimaker Cura collects anonymous data to improve print quality<br/>and user experience. <a href=\"TODO\">More information</a>")
textFormat: Text.RichText
font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering
}
}
}
@ -60,7 +69,7 @@ Item
id: getStartedButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Next")
width: 140
fixedWidthMode: true

View file

@ -21,14 +21,14 @@ Item
id: base
implicitWidth: 200
height: header.contentShown ? (header.height + contentRectangle.height + 30) : header.height
implicitWidth: 200 * screenScaleFactor
height: header.contentShown ? (header.height + contentRectangle.height) : header.height
property var contentComponent: null
property alias contentItem: contentLoader.item
property alias title: header.title
property bool contentShown: false
property bool contentShown: false // indicates if this dropdown widget is expanded to show its content
signal clicked()
@ -59,7 +59,7 @@ Item
anchors.top: header.bottom
anchors.left: header.left
anchors.right: header.right
height: contentLoader.height + 2
height: contentLoader.height
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
@ -74,7 +74,9 @@ Item
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: 1
// Keep a small margin with the Rectangle container so its content will not overlap with the Rectangle
// border.
anchors.margins: UM.Theme.getSize("default_lining").width
sourceComponent: base.contentComponent != null ? base.contentComponent : emptyComponent
}

View file

@ -33,7 +33,7 @@ Item
signal showNextPage()
signal showPreviousPage()
signal passLastPage() // Emitted when there is no more page to show
signal gotoPage(string page_id) // Go to a specific page by the given page_id.
signal goToPage(string page_id) // Go to a specific page by the given page_id.
onShowNextPage:
{
@ -41,7 +41,8 @@ Item
{
currentStep++
}
else {
else
{
passLastPage()
}
}
@ -54,7 +55,7 @@ Item
}
}
onGotoPage:
onGoToPage:
{
// find the page index
var page_index = -1
@ -71,10 +72,6 @@ Item
{
currentStep = page_index
}
else
{
console.log("Error: cannot find page with page_id = [", page_id, "]")
}
}
onVisibleChanged:
@ -110,7 +107,6 @@ Item
source: parent
horizontalOffset: base.shadowOffset
verticalOffset: base.shadowOffset
visible: true
color: UM.Theme.getColor("monitor_shadow")
transparentBorder: true
// Should always be drawn behind the background.

View file

@ -58,7 +58,7 @@ Item
id: agreeButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Agree")
width: 140
fixedWidthMode: true
@ -75,7 +75,7 @@ Item
id: declineButton
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Decline and close")
width: 140
fixedWidthMode: true

View file

@ -19,7 +19,7 @@ Item
{
id: titleLabel
anchors.top: parent.top
anchors.topMargin: 40
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: catalog.i18nc("@label", "What's new in Ultimaker Cura")
@ -32,8 +32,8 @@ Item
{
anchors.top: titleLabel.bottom
anchors.bottom: getStartedButton.top
anchors.topMargin: 40
anchors.bottomMargin: 40
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.bottomMargin: UM.Theme.getSize("welcome_pages_default_margin").height
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * 3 / 4
@ -76,7 +76,7 @@ Item
id: getStartedButton
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 40
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
text: catalog.i18nc("@button", "Next")
width: 140
fixedWidthMode: true