Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2022-04-21 15:04:27 +0300
committerGhostkeeper <rubend@tutanota.com>2022-04-21 15:04:27 +0300
commit9389a6f4e87aa47e21ff14d5aee6fa1a3b9ce8a7 (patch)
tree2038ccb78b21884f41f9fedb4723a180d65e4393 /plugins/Marketplace/resources
parent38d62b73c5ab043f4413360cdb627f26a096fbf6 (diff)
parent1e7cf21f463e0ff7a40a33e1215dd6a0c75e9859 (diff)
Merge branch 'CURA-9146_account_sync' into 5.05.0-beta
Diffstat (limited to 'plugins/Marketplace/resources')
-rw-r--r--plugins/Marketplace/resources/qml/CompatibilityDialog.qml146
-rw-r--r--plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml98
-rw-r--r--plugins/Marketplace/resources/qml/OnboardBanner.qml12
3 files changed, 247 insertions, 9 deletions
diff --git a/plugins/Marketplace/resources/qml/CompatibilityDialog.qml b/plugins/Marketplace/resources/qml/CompatibilityDialog.qml
new file mode 100644
index 0000000000..837c4defa5
--- /dev/null
+++ b/plugins/Marketplace/resources/qml/CompatibilityDialog.qml
@@ -0,0 +1,146 @@
+// Copyright (c) 2022 Ultimaker B.V.
+// Marketplace is released under the terms of the LGPLv3 or higher.
+
+import QtQuick 2.10
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.3
+
+import UM 1.5 as UM
+import Cura 1.6 as Cura
+
+
+UM.Dialog
+{
+ visible: true
+ title: catalog.i18nc("@title", "Changes from your account")
+ width: UM.Theme.getSize("popup_dialog").width
+ height: UM.Theme.getSize("popup_dialog").height
+ minimumWidth: width
+ maximumWidth: minimumWidth
+ minimumHeight: height
+ maximumHeight: minimumHeight
+ margin: 0
+
+ property string actionButtonText: subscribedPackagesModel.hasIncompatiblePackages && !subscribedPackagesModel.hasCompatiblePackages ? catalog.i18nc("@button", "Dismiss") : catalog.i18nc("@button", "Next")
+
+ Rectangle
+ {
+ id: root
+ anchors.fill: parent
+ color: UM.Theme.getColor("main_background")
+
+ UM.I18nCatalog
+ {
+ id: catalog
+ name: "cura"
+ }
+
+ ScrollView
+ {
+ width: parent.width
+ height: parent.height - nextButton.height - nextButton.anchors.margins * 2 // We want some leftover space for the button at the bottom
+ clip: true
+
+ Column
+ {
+ anchors.fill: parent
+ anchors.margins: UM.Theme.getSize("default_margin").width
+
+ // Compatible packages
+ UM.Label
+ {
+ text: catalog.i18nc("@label", "The following packages will be added:")
+ visible: subscribedPackagesModel.hasCompatiblePackages
+ height: contentHeight + UM.Theme.getSize("default_margin").height
+ }
+ Repeater
+ {
+ model: subscribedPackagesModel
+ Component
+ {
+ Item
+ {
+ width: parent.width
+ property int lineHeight: 60
+ visible: model.is_compatible
+ height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the compatible packages here
+ Image
+ {
+ id: packageIcon
+ source: model.icon_url || Qt.resolvedUrl("../../images/placeholder.svg")
+ height: lineHeight
+ width: height
+ sourceSize.height: height
+ sourceSize.width: width
+ mipmap: true
+ fillMode: Image.PreserveAspectFit
+ }
+ UM.Label
+ {
+ text: model.display_name
+ font: UM.Theme.getFont("medium_bold")
+ anchors.left: packageIcon.right
+ anchors.leftMargin: UM.Theme.getSize("default_margin").width
+ anchors.verticalCenter: packageIcon.verticalCenter
+ elide: Text.ElideRight
+ }
+ }
+ }
+ }
+
+ // Incompatible packages
+ UM.Label
+ {
+ text: catalog.i18nc("@label", "The following packages can not be installed because of an incompatible Cura version:")
+ visible: subscribedPackagesModel.hasIncompatiblePackages
+ height: contentHeight + UM.Theme.getSize("default_margin").height
+ }
+ Repeater
+ {
+ model: subscribedPackagesModel
+ Component
+ {
+ Item
+ {
+ width: parent.width
+ property int lineHeight: 60
+ visible: !model.is_compatible && !model.is_dismissed
+ height: visible ? (lineHeight + UM.Theme.getSize("default_margin").height) : 0 // We only show the incompatible packages here
+ Image
+ {
+ id: packageIcon
+ source: model.icon_url || Qt.resolvedUrl("../../images/placeholder.svg")
+ height: lineHeight
+ width: height
+ sourceSize.height: height
+ sourceSize.width: width
+ mipmap: true
+ fillMode: Image.PreserveAspectFit
+ }
+ UM.Label
+ {
+ text: model.display_name
+ font: UM.Theme.getFont("medium_bold")
+ anchors.left: packageIcon.right
+ anchors.leftMargin: UM.Theme.getSize("default_margin").width
+ anchors.verticalCenter: packageIcon.verticalCenter
+ elide: Text.ElideRight
+ }
+ }
+ }
+ }
+ }
+
+ } // End of ScrollView
+
+ Cura.PrimaryButton
+ {
+ id: nextButton
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.margins: UM.Theme.getSize("default_margin").height
+ text: actionButtonText
+ onClicked: accept()
+ }
+ }
+}
diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml
new file mode 100644
index 0000000000..aa11d3a7e9
--- /dev/null
+++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml
@@ -0,0 +1,98 @@
+// Copyright (c) 2021 Ultimaker B.V.
+// Marketplace is released under the terms of the LGPLv3 or higher.
+
+import QtQuick 2.10
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.3
+import QtQuick.Layouts 1.3
+
+import UM 1.5 as UM
+import Cura 1.6 as Cura
+
+UM.Dialog
+{
+ id: licenseDialog
+ title: licenseModel.dialogTitle
+
+ minimumWidth: UM.Theme.getSize("modal_window_minimum").width
+ minimumHeight: UM.Theme.getSize("modal_window_minimum").height
+ width: minimumWidth
+ height: minimumHeight
+ backgroundColor: UM.Theme.getColor("main_background")
+ margin: UM.Theme.getSize("default_margin").width
+
+ ColumnLayout
+ {
+ anchors.fill: parent
+ spacing: UM.Theme.getSize("thick_margin").height
+
+ UM.I18nCatalog { id: catalog; name: "cura" }
+
+ UM.Label
+ {
+ id: licenseHeader
+ Layout.fillWidth: true
+ text: catalog.i18nc("@label", "You need to accept the license to install the package")
+ }
+
+ Row {
+ id: packageRow
+
+ Layout.fillWidth: true
+ height: childrenRect.height
+ spacing: UM.Theme.getSize("default_margin").width
+ leftPadding: UM.Theme.getSize("narrow_margin").width
+
+ Image
+ {
+ id: icon
+ width: UM.Theme.getSize("card_icon").width
+ height: width
+ sourceSize.width: width
+ sourceSize.height: height
+ fillMode: Image.PreserveAspectFit
+ source: licenseModel.iconUrl || Qt.resolvedUrl("../../images/placeholder.svg")
+ mipmap: true
+ }
+
+ UM.Label
+ {
+ id: packageName
+ text: licenseModel.packageName
+
+ font.bold: true
+ anchors.verticalCenter: icon.verticalCenter
+ height: contentHeight
+ }
+ }
+
+ Cura.ScrollableTextArea
+ {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ anchors.topMargin: UM.Theme.getSize("default_margin").height
+
+ textArea.text: licenseModel.licenseText
+ textArea.readOnly: true
+ }
+ }
+
+ rightButtons:
+ [
+ Cura.PrimaryButton
+ {
+ text: licenseModel.acceptButtonText
+ onClicked: handler.onLicenseAccepted()
+ }
+ ]
+
+ leftButtons:
+ [
+ Cura.SecondaryButton
+ {
+ id: declineButton
+ text: licenseModel.declineButtonText
+ onClicked: handler.onLicenseDeclined()
+ }
+ ]
+}
diff --git a/plugins/Marketplace/resources/qml/OnboardBanner.qml b/plugins/Marketplace/resources/qml/OnboardBanner.qml
index 278c50ab57..8217a7d03f 100644
--- a/plugins/Marketplace/resources/qml/OnboardBanner.qml
+++ b/plugins/Marketplace/resources/qml/OnboardBanner.qml
@@ -19,7 +19,6 @@ Rectangle
implicitHeight: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
color: UM.Theme.getColor("action_panel_secondary")
- // Icon
UM.ColorImage
{
id: onboardingIcon
@@ -33,7 +32,6 @@ Rectangle
height: UM.Theme.getSize("banner_icon_size").height
}
- // Close button
UM.SimpleButton
{
id: onboardingClose
@@ -52,8 +50,8 @@ Rectangle
onClicked: onRemove()
}
- // Body
- Label {
+ UM.Label
+ {
id: infoText
anchors
{
@@ -63,11 +61,7 @@ Rectangle
margins: UM.Theme.getSize("default_margin").width
}
- font: UM.Theme.getFont("default")
-
- renderType: Text.NativeRendering
color: UM.Theme.getColor("primary_text")
- wrapMode: Text.Wrap
elide: Text.ElideRight
onLineLaidOut: (line) =>
@@ -102,7 +96,7 @@ Rectangle
id: readMoreButton
anchors.left: infoText.left
anchors.bottom: infoText.bottom
- text: "Learn More"
+ text: catalog.i18nc("@button:label", "Learn More")
textFont: UM.Theme.getFont("default")
textColor: infoText.color
leftPadding: 0