mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Merge branch 'WIP_onboarding' of https://github.com/Ultimaker/Cura into WIP_onboarding
This commit is contained in:
commit
b25df557d3
15 changed files with 136 additions and 102 deletions
|
@ -88,7 +88,7 @@ class DiscoveredPrintersModel(QObject):
|
||||||
discoveredPrintersChanged = pyqtSignal()
|
discoveredPrintersChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(list, notify = discoveredPrintersChanged)
|
@pyqtProperty(list, notify = discoveredPrintersChanged)
|
||||||
def discovered_printers(self) -> "List[DiscoveredPrinter]":
|
def discovered_printers(self) -> List["DiscoveredPrinter"]:
|
||||||
item_list = list(x for x in self._discovered_printer_by_ip_dict.values())
|
item_list = list(x for x in self._discovered_printer_by_ip_dict.values())
|
||||||
item_list.sort(key = lambda x: x.name)
|
item_list.sort(key = lambda x: x.name)
|
||||||
return item_list
|
return item_list
|
||||||
|
@ -125,6 +125,8 @@ class DiscoveredPrintersModel(QObject):
|
||||||
del self._discovered_printer_by_ip_dict[ip_address]
|
del self._discovered_printer_by_ip_dict[ip_address]
|
||||||
self.discoveredPrintersChanged.emit()
|
self.discoveredPrintersChanged.emit()
|
||||||
|
|
||||||
|
# A convenience function for QML to create a machine (GlobalStack) out of the given discovered printer.
|
||||||
|
# This function invokes the given discovered printer's "create_callback" to do this.
|
||||||
@pyqtSlot("QVariant")
|
@pyqtSlot("QVariant")
|
||||||
def createMachineFromDiscoveredPrinter(self, discovered_printer: "DiscoveredPrinter") -> None:
|
def createMachineFromDiscoveredPrinter(self, discovered_printer: "DiscoveredPrinter") -> None:
|
||||||
discovered_printer.create_callback(discovered_printer.getKey())
|
discovered_printer.create_callback(discovered_printer.getKey())
|
||||||
|
|
|
@ -49,8 +49,8 @@ class WelcomePagesModel(ListModel):
|
||||||
self._pages.append({"id": "data_collections",
|
self._pages.append({"id": "data_collections",
|
||||||
"page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"),
|
"page_url": self._getBuiltinWelcomePagePath("DataCollectionsContent.qml"),
|
||||||
})
|
})
|
||||||
self._pages.append({"id": "add_printer_by_selection",
|
self._pages.append({"id": "add_network_or_local_printer",
|
||||||
"page_url": self._getBuiltinWelcomePagePath("AddPrinterBySelectionContent.qml"),
|
"page_url": self._getBuiltinWelcomePagePath("AddNetworkOrLocalPrinterContent.qml"),
|
||||||
})
|
})
|
||||||
self._pages.append({"id": "add_printer_by_ip",
|
self._pages.append({"id": "add_printer_by_ip",
|
||||||
"page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"),
|
"page_url": self._getBuiltinWelcomePagePath("AddPrinterByIpContent.qml"),
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
from threading import Event, Thread
|
from threading import Event, Thread
|
||||||
from time import time
|
from time import time
|
||||||
import os
|
from typing import Optional, TYPE_CHECKING, Dict
|
||||||
|
|
||||||
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
|
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
|
||||||
|
|
||||||
from PyQt5.QtNetwork import QNetworkRequest, QNetworkAccessManager
|
from PyQt5.QtNetwork import QNetworkRequest, QNetworkAccessManager
|
||||||
from PyQt5.QtCore import QUrl
|
from PyQt5.QtCore import QUrl
|
||||||
from PyQt5.QtGui import QDesktopServices
|
from PyQt5.QtGui import QDesktopServices
|
||||||
|
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||||
from cura.Settings.GlobalStack import GlobalStack # typing
|
|
||||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
|
||||||
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
|
from UM.OutputDevice.OutputDeviceManager import ManualDeviceAdditionAttempt
|
||||||
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.Signal import Signal, signalemitter
|
from UM.Signal import Signal, signalemitter
|
||||||
|
@ -28,9 +28,9 @@ from UM.Version import Version
|
||||||
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
|
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
|
||||||
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
||||||
|
|
||||||
from typing import Optional, TYPE_CHECKING
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from PyQt5.QtNetwork import QNetworkReply
|
||||||
from cura.Settings.GlobalStack import GlobalStack
|
from cura.Settings.GlobalStack import GlobalStack
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
name_request = QNetworkRequest(url)
|
name_request = QNetworkRequest(url)
|
||||||
self._network_manager.get(name_request)
|
self._network_manager.get(name_request)
|
||||||
|
|
||||||
def _onNetworkRequestFinished(self, reply):
|
def _onNetworkRequestFinished(self, reply: "QNetworkReply") -> None:
|
||||||
reply_url = reply.url().toString()
|
reply_url = reply.url().toString()
|
||||||
|
|
||||||
address = reply.url().host()
|
address = reply.url().host()
|
||||||
|
@ -325,7 +325,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
self.getOutputDeviceManager().addOutputDevice(device)
|
self.getOutputDeviceManager().addOutputDevice(device)
|
||||||
self.addManualDeviceSignal.emit(self.getPluginId(), device.getId(), address, properties)
|
self.addManualDeviceSignal.emit(self.getPluginId(), device.getId(), address, properties)
|
||||||
|
|
||||||
def _onRemoveDevice(self, device_id):
|
def _onRemoveDevice(self, device_id: str) -> None:
|
||||||
device = self._discovered_devices.pop(device_id, None)
|
device = self._discovered_devices.pop(device_id, None)
|
||||||
if device:
|
if device:
|
||||||
if device.isConnected():
|
if device.isConnected():
|
||||||
|
|
|
@ -16,10 +16,13 @@ ScrollView
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
|
// The currently selected machine item in the local machine list.
|
||||||
property var currentItem: (machineList.currentIndex >= 0)
|
property var currentItem: (machineList.currentIndex >= 0)
|
||||||
? machineList.model.getItem(machineList.currentIndex)
|
? machineList.model.getItem(machineList.currentIndex)
|
||||||
: null
|
: null
|
||||||
|
// The currently active (expanded) section/category, where section/category is the grouping of local machine items.
|
||||||
property string currentSection: preferredCategory
|
property string currentSection: preferredCategory
|
||||||
|
// By default (when this list shows up) we always expand the "Ultimaker" section.
|
||||||
property string preferredCategory: "Ultimaker"
|
property string preferredCategory: "Ultimaker"
|
||||||
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
|
|
@ -19,7 +19,7 @@ Item
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@label", "Add a printer")
|
text: catalog.i18nc("@label", "Add a printer")
|
||||||
|
@ -67,7 +67,7 @@ Item
|
||||||
|
|
||||||
onAddByIpButtonClicked:
|
onAddByIpButtonClicked:
|
||||||
{
|
{
|
||||||
base.gotoPage("add_printer_by_ip")
|
base.goToPage("add_printer_by_ip")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,6 @@ Item
|
||||||
AddLocalPrinterScrollView
|
AddLocalPrinterScrollView
|
||||||
{
|
{
|
||||||
id: localPrinterView
|
id: localPrinterView
|
||||||
|
|
||||||
maxItemCountAtOnce: 10 // show at max 10 items at once, otherwise you need to scroll.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +110,7 @@ Item
|
||||||
id: nextButton
|
id: nextButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
enabled:
|
enabled:
|
||||||
{
|
{
|
||||||
// If the network printer dropdown is expanded, make sure that there is a selected item
|
// If the network printer dropdown is expanded, make sure that there is a selected item
|
||||||
|
@ -148,7 +146,7 @@ Item
|
||||||
// TODO: implement machine actions
|
// TODO: implement machine actions
|
||||||
|
|
||||||
// If we have created a machine, go to the last page, which is the "cloud" page.
|
// If we have created a machine, go to the last page, which is the "cloud" page.
|
||||||
base.gotoPage("cloud")
|
base.goToPage("cloud")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -73,10 +73,9 @@ Item
|
||||||
|
|
||||||
Component.onCompleted:
|
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++)
|
for (var i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!model[i].is_unknown_machine_type)
|
if (!model[i].is_unknown_machine_type)
|
||||||
{
|
{
|
||||||
currentIndex = i
|
currentIndex = i
|
||||||
|
|
|
@ -18,15 +18,18 @@ Item
|
||||||
|
|
||||||
id: addPrinterByIpScreen
|
id: addPrinterByIpScreen
|
||||||
|
|
||||||
property bool hasSentRequest: false // True when a request has been sent to the device at the typed address.
|
// Whether an IP address is currently being resolved.
|
||||||
property bool haveConnection: false // True when there is a connection with a machine, it can then be added.
|
property bool hasSentRequest: false
|
||||||
property bool deviceUnresponsive: false // True when a request comes back, but the device hasn't responded.
|
// 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
|
Label
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
anchors.top: parent.top
|
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
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@label", "Add printer by IP address")
|
text: catalog.i18nc("@label", "Add printer by IP address")
|
||||||
|
@ -240,13 +243,11 @@ Item
|
||||||
id: backButton
|
id: backButton
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.bottom: parent.bottom
|
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")
|
text: catalog.i18nc("@button", "Cancel")
|
||||||
width: UM.Theme.getSize("action_button").width
|
width: UM.Theme.getSize("action_button").width
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
onClicked: base.gotoPage("add_printer_by_selection")
|
onClicked: base.goToPage("add_printer_by_selection")
|
||||||
|
|
||||||
enabled: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Cura.PrimaryButton
|
Cura.PrimaryButton
|
||||||
|
@ -254,7 +255,7 @@ Item
|
||||||
id: connectButton
|
id: connectButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
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")
|
text: catalog.i18nc("@button", "Connect")
|
||||||
width: UM.Theme.getSize("action_button").width
|
width: UM.Theme.getSize("action_button").width
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
|
|
@ -19,7 +19,7 @@ Item
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@label", "Ultimaker Cloud")
|
text: catalog.i18nc("@label", "Ultimaker Cloud")
|
||||||
|
@ -28,48 +28,65 @@ Item
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Area where the cloud contents can be put. Pictures, texts and such.
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: cloudContentsArea
|
||||||
|
anchors.top: titleLabel.bottom
|
||||||
|
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
|
Column
|
||||||
{
|
{
|
||||||
anchors.top: titleLabel.bottom
|
anchors.centerIn: parent
|
||||||
anchors.topMargin: 80
|
width: childrenRect.width
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
height: childrenRect.height
|
||||||
|
|
||||||
spacing: 60
|
spacing: 20 * screenScaleFactor
|
||||||
|
|
||||||
Image
|
Image // Cloud image
|
||||||
{
|
{
|
||||||
id: cloudImage
|
id: cloudImage
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
source: UM.Theme.getImage("first_run_ultimaker_cloud")
|
source: UM.Theme.getImage("first_run_ultimaker_cloud")
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
Label // A title-ish text
|
||||||
{
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
spacing: 30
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
{
|
||||||
id: highlightTextLabel
|
id: highlightTextLabel
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@text", "The next generation 3D printing workflow")
|
text: catalog.i18nc("@text", "The next generation 3D printing workflow")
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
color: UM.Theme.getColor("text_light_blue")
|
color: UM.Theme.getColor("primary")
|
||||||
font: UM.Theme.getFont("medium")
|
font: UM.Theme.getFont("medium")
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label // A number of text items
|
||||||
{
|
{
|
||||||
id: textLabel
|
id: textLabel
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: {
|
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>"
|
// There are 3 text items, each of which is translated separately as a single piece of text.
|
||||||
t += "<p>- Get exclusive access to material profiles from leading brands</p>"
|
var full_text = ""
|
||||||
catalog.i18nc("@text", t)
|
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
|
textFormat: Text.RichText
|
||||||
font: UM.Theme.getFont("medium")
|
font: UM.Theme.getFont("medium")
|
||||||
|
@ -78,12 +95,13 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bottom buttons go here
|
||||||
Cura.PrimaryButton
|
Cura.PrimaryButton
|
||||||
{
|
{
|
||||||
id: finishButton
|
id: finishButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Finish")
|
text: catalog.i18nc("@button", "Finish")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
@ -95,25 +113,31 @@ Item
|
||||||
id: createAccountButton
|
id: createAccountButton
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: finishButton.verticalCenter
|
anchors.verticalCenter: finishButton.verticalCenter
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Create an account")
|
text: catalog.i18nc("@button", "Create an account")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
|
onClicked: Qt.openUrlExternally(CuraApplication.ultimakerCloudAccountRootUrl + "/app/create")
|
||||||
}
|
}
|
||||||
|
|
||||||
Cura.SecondaryButton
|
Label
|
||||||
{
|
{
|
||||||
id: signInButton
|
id: signInButton
|
||||||
anchors.left: createAccountButton.right
|
anchors.left: createAccountButton.right
|
||||||
anchors.verticalCenter: finishButton.verticalCenter
|
anchors.verticalCenter: finishButton.verticalCenter
|
||||||
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Sign in")
|
text: catalog.i18nc("@button", "Sign in")
|
||||||
width: 80
|
color: UM.Theme.getColor("secondary_button_text")
|
||||||
shadowEnabled: false
|
font: UM.Theme.getFont("medium")
|
||||||
color: "transparent"
|
renderType: Text.NativeRendering
|
||||||
hoverColor: "transparent"
|
|
||||||
textHoverColor: UM.Theme.getColor("text_light_blue")
|
MouseArea
|
||||||
fixedWidthMode: true
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
onClicked: Cura.API.account.login()
|
onClicked: Cura.API.account.login()
|
||||||
|
onEntered: parent.font.underline = true
|
||||||
|
onExited: parent.font.underline = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ Item
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura")
|
text: catalog.i18nc("@label", "Help us to improve Ultimaker Cura")
|
||||||
|
@ -28,13 +28,21 @@ Item
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Area where the cloud contents can be put. Pictures, texts and such.
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: cloudContentsArea
|
||||||
|
anchors.top: titleLabel.bottom
|
||||||
|
anchors.bottom: getStartedButton.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
anchors.top: titleLabel.bottom
|
anchors.centerIn: parent
|
||||||
anchors.topMargin: 80
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
spacing: 60
|
spacing: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
|
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
|
@ -54,13 +62,14 @@ Item
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Cura.PrimaryButton
|
Cura.PrimaryButton
|
||||||
{
|
{
|
||||||
id: getStartedButton
|
id: getStartedButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Next")
|
text: catalog.i18nc("@button", "Next")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
|
|
@ -21,14 +21,14 @@ Item
|
||||||
|
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
implicitWidth: 200
|
implicitWidth: 200 * screenScaleFactor
|
||||||
height: header.contentShown ? (header.height + contentRectangle.height + 30) : header.height
|
height: header.contentShown ? (header.height + contentRectangle.height) : header.height
|
||||||
|
|
||||||
property var contentComponent: null
|
property var contentComponent: null
|
||||||
property alias contentItem: contentLoader.item
|
property alias contentItem: contentLoader.item
|
||||||
|
|
||||||
property alias title: header.title
|
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()
|
signal clicked()
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ Item
|
||||||
anchors.top: header.bottom
|
anchors.top: header.bottom
|
||||||
anchors.left: header.left
|
anchors.left: header.left
|
||||||
anchors.right: header.right
|
anchors.right: header.right
|
||||||
height: contentLoader.height + 2
|
height: contentLoader.height
|
||||||
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: UM.Theme.getColor("lining")
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
@ -74,7 +74,9 @@ Item
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
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
|
sourceComponent: base.contentComponent != null ? base.contentComponent : emptyComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ Item
|
||||||
signal showNextPage()
|
signal showNextPage()
|
||||||
signal showPreviousPage()
|
signal showPreviousPage()
|
||||||
signal passLastPage() // Emitted when there is no more page to show
|
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:
|
onShowNextPage:
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,8 @@ Item
|
||||||
{
|
{
|
||||||
currentStep++
|
currentStep++
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
passLastPage()
|
passLastPage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +55,7 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onGotoPage:
|
onGoToPage:
|
||||||
{
|
{
|
||||||
// find the page index
|
// find the page index
|
||||||
var page_index = -1
|
var page_index = -1
|
||||||
|
@ -71,10 +72,6 @@ Item
|
||||||
{
|
{
|
||||||
currentStep = page_index
|
currentStep = page_index
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
console.log("Error: cannot find page with page_id = [", page_id, "]")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged:
|
onVisibleChanged:
|
||||||
|
@ -110,7 +107,6 @@ Item
|
||||||
source: parent
|
source: parent
|
||||||
horizontalOffset: base.shadowOffset
|
horizontalOffset: base.shadowOffset
|
||||||
verticalOffset: base.shadowOffset
|
verticalOffset: base.shadowOffset
|
||||||
visible: true
|
|
||||||
color: UM.Theme.getColor("monitor_shadow")
|
color: UM.Theme.getColor("monitor_shadow")
|
||||||
transparentBorder: true
|
transparentBorder: true
|
||||||
// Should always be drawn behind the background.
|
// Should always be drawn behind the background.
|
||||||
|
|
|
@ -58,7 +58,7 @@ Item
|
||||||
id: agreeButton
|
id: agreeButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Agree")
|
text: catalog.i18nc("@button", "Agree")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
@ -75,7 +75,7 @@ Item
|
||||||
id: declineButton
|
id: declineButton
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Decline and close")
|
text: catalog.i18nc("@button", "Decline and close")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
|
|
@ -19,7 +19,7 @@ Item
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: titleLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: catalog.i18nc("@label", "What's new in Ultimaker Cura")
|
text: catalog.i18nc("@label", "What's new in Ultimaker Cura")
|
||||||
|
@ -32,8 +32,8 @@ Item
|
||||||
{
|
{
|
||||||
anchors.top: titleLabel.bottom
|
anchors.top: titleLabel.bottom
|
||||||
anchors.bottom: getStartedButton.top
|
anchors.bottom: getStartedButton.top
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.bottomMargin: 40
|
anchors.bottomMargin: UM.Theme.getSize("welcome_pages_default_margin").height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
width: parent.width * 3 / 4
|
width: parent.width * 3 / 4
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ Item
|
||||||
id: getStartedButton
|
id: getStartedButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: 40
|
anchors.margins: UM.Theme.getSize("welcome_pages_default_margin").width
|
||||||
text: catalog.i18nc("@button", "Next")
|
text: catalog.i18nc("@button", "Next")
|
||||||
width: 140
|
width: 140
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
|
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
@ -193,8 +193,6 @@
|
||||||
|
|
||||||
"window_disabled_background": [0, 0, 0, 255],
|
"window_disabled_background": [0, 0, 0, 255],
|
||||||
|
|
||||||
"text_light_blue": [50, 130, 255, 255],
|
|
||||||
|
|
||||||
"text": [25, 25, 25, 255],
|
"text": [25, 25, 25, 255],
|
||||||
"text_detail": [174, 174, 174, 128],
|
"text_detail": [174, 174, 174, 128],
|
||||||
"text_link": [50, 130, 255, 255],
|
"text_link": [50, 130, 255, 255],
|
||||||
|
@ -509,6 +507,8 @@
|
||||||
"button_icon": [2.5, 2.5],
|
"button_icon": [2.5, 2.5],
|
||||||
"button_lining": [0, 0],
|
"button_lining": [0, 0],
|
||||||
|
|
||||||
|
"welcome_pages_default_margin": [2.5, 2.5],
|
||||||
|
|
||||||
"action_button": [15.0, 2.5],
|
"action_button": [15.0, 2.5],
|
||||||
"action_button_icon": [1.0, 1.0],
|
"action_button_icon": [1.0, 1.0],
|
||||||
"action_button_radius": [0.15, 0.15],
|
"action_button_radius": [0.15, 0.15],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue