mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Merge branch 'CURA-6057_fix_onboarding' of github.com:Ultimaker/Cura
This commit is contained in:
commit
c2b901ae47
14 changed files with 216 additions and 136 deletions
|
@ -25,13 +25,17 @@ Button
|
|||
property var outputDevice: null
|
||||
property var printerTypesList: []
|
||||
|
||||
// Indicates if only to update the printer types list when this button is checked
|
||||
property bool updatePrinterTypesOnlyWhenChecked: true
|
||||
|
||||
property var updatePrinterTypesFunction: updatePrinterTypesList
|
||||
// This function converts the printer type string to another string.
|
||||
property var printerTypeLabelConversionFunction: Cura.MachineManager.getAbbreviatedMachineName
|
||||
|
||||
function updatePrinterTypesList()
|
||||
{
|
||||
printerTypesList = (outputDevice != null) ? outputDevice.uniquePrinterTypes : []
|
||||
var to_update = (updatePrinterTypesOnlyWhenChecked && checked) || !updatePrinterTypesOnlyWhenChecked
|
||||
printerTypesList = (to_update && outputDevice != null) ? outputDevice.uniquePrinterTypes : []
|
||||
}
|
||||
|
||||
contentItem: Item
|
||||
|
|
|
@ -97,6 +97,8 @@ Item
|
|||
|
||||
printerTypeLabelAutoFit: true
|
||||
|
||||
// update printer types for all items in the list
|
||||
updatePrinterTypesOnlyWhenChecked: false
|
||||
updatePrinterTypesFunction: updateMachineTypes
|
||||
// show printer type as it is
|
||||
printerTypeLabelConversionFunction: function(value) { return value }
|
||||
|
|
|
@ -69,16 +69,14 @@ Item
|
|||
width: parent.width
|
||||
anchors.top: explainLabel.bottom
|
||||
|
||||
TextField
|
||||
Cura.TextField
|
||||
{
|
||||
id: hostnameField
|
||||
width: (parent.width / 2) | 0
|
||||
height: addPrinterButton.height
|
||||
anchors.verticalCenter: addPrinterButton.verticalCenter
|
||||
anchors.left: parent.left
|
||||
height: addPrinterButton.height
|
||||
anchors.right: addPrinterButton.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
font: UM.Theme.getFont("default")
|
||||
selectByMouse: true
|
||||
|
||||
validator: RegExpValidator
|
||||
{
|
||||
|
@ -89,11 +87,11 @@ Item
|
|||
onAccepted: addPrinterButton.clicked()
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: addPrinterButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.left: hostnameField.right
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: catalog.i18nc("@button", "Add")
|
||||
|
@ -198,7 +196,10 @@ Item
|
|||
{
|
||||
if (UM.OutputDeviceManager.hasManualDevice)
|
||||
{
|
||||
typeText.text = UM.OutputDeviceManager.manualDeviceProperty("printer_type")
|
||||
const type_id = UM.OutputDeviceManager.manualDeviceProperty("printer_type")
|
||||
var readable_type = Cura.MachineManager.getMachineTypeNameFromId(type_id)
|
||||
readable_type = (readable_type != "") ? readable_type : catalog.i18nc("@label", "Unknown")
|
||||
typeText.text = readable_type
|
||||
firmwareText.text = UM.OutputDeviceManager.manualDeviceProperty("firmware_version")
|
||||
addressText.text = UM.OutputDeviceManager.manualDeviceProperty("address")
|
||||
}
|
||||
|
@ -240,7 +241,7 @@ Item
|
|||
id: backButton
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
text: catalog.i18nc("@button", "Cancel")
|
||||
text: catalog.i18nc("@button", "Back")
|
||||
onClicked: base.showPreviousPage()
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ Item
|
|||
onClicked:
|
||||
{
|
||||
CuraApplication.writeToLog("i", "User declined the User Agreement.")
|
||||
base.endWizard()
|
||||
CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved!
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,10 @@ Item
|
|||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Rectangle
|
||||
Cura.ScrollableTextArea
|
||||
{
|
||||
id: whatsNewTextArea
|
||||
|
||||
anchors.top: titleLabel.bottom
|
||||
anchors.bottom: getStartedButton.top
|
||||
anchors.topMargin: UM.Theme.getSize("wide_margin").height
|
||||
|
@ -36,27 +38,12 @@ Item
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
border.color: "#dfdfdf"
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
|
||||
ScrollView
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("default_lining").width
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
|
||||
TextArea
|
||||
{
|
||||
id: whatsNewTextArea
|
||||
text: CuraApplication.getTextManager().getChangeLogText()
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.WordWrap
|
||||
readOnly: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
textArea.text: CuraApplication.getTextManager().getChangeLogText()
|
||||
textArea.textFormat: Text.RichText
|
||||
textArea.wrapMode: Text.WordWrap
|
||||
textArea.readOnly: true
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
|
|
32
resources/qml/Widgets/ScrollableTextArea.qml
Normal file
32
resources/qml/Widgets/ScrollableTextArea.qml
Normal file
|
@ -0,0 +1,32 @@
|
|||
// 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
|
||||
|
||||
|
||||
//
|
||||
// Cura-style TextArea with scrolls
|
||||
//
|
||||
ScrollView
|
||||
{
|
||||
property alias textArea: _textArea
|
||||
|
||||
TextArea
|
||||
{
|
||||
id: _textArea
|
||||
font: UM.Theme.getFont("default")
|
||||
textFormat: TextEdit.PlainText
|
||||
renderType: Text.NativeRendering
|
||||
selectByMouse: true
|
||||
|
||||
background: Rectangle // Border
|
||||
{
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
}
|
||||
}
|
||||
}
|
47
resources/qml/Widgets/TextField.qml
Normal file
47
resources/qml/Widgets/TextField.qml
Normal file
|
@ -0,0 +1,47 @@
|
|||
// 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
|
||||
|
||||
|
||||
//
|
||||
// Cura-style TextField
|
||||
//
|
||||
TextField
|
||||
{
|
||||
id: textField
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
|
||||
property int controlWidth: UM.Theme.getSize("setting_control").width
|
||||
property int controlHeight: UM.Theme.getSize("setting_control").height
|
||||
|
||||
hoverEnabled: true
|
||||
selectByMouse: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
|
||||
border.color:
|
||||
{
|
||||
if (!textField.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
if (textField.hovered || textField.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,7 +25,9 @@ CheckBox 1.0 CheckBox.qml
|
|||
ComboBox 1.0 ComboBox.qml
|
||||
NotificationIcon 1.0 NotificationIcon.qml
|
||||
RadioButton 1.0 RadioButton.qml
|
||||
Scrollable 1.0 Scrollable.qml
|
||||
TabButton 1.0 TabButton.qml
|
||||
TextField 1.0 TextField.qml
|
||||
|
||||
|
||||
# Cura/MachineSettings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue