[welcomeq] connected to RequirementsModel

clean up obsolete lines in welcomeq.qml
add requirement section from welcome.conf to welcomeq.conf
data shows correctly in Recommended.qml, fails to show any in Requirements.qml if run without admin rights
main
demmm 5 years ago
parent dd0491e5ca
commit fed89badd4

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2020, Anke Boersma <demm@kaosx.us>
* Copyright 2020, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +17,7 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
import io.calamares.core 1.0
import io.calamares.ui 1.0
import QtQuick 2.7
@ -33,35 +35,64 @@ Rectangle {
id: recommended
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 20
anchors.topMargin: 10
horizontalAlignment: TextEdit.AlignHCenter
width: 640
font.pointSize: 12
font.pointSize: 11
textFormat: Text.RichText
antialiasing: true
activeFocusOnPress: false
wrapMode: Text.WordWrap
text: qsTr("<p>This computer does not satisfy some of the recommended requirements for setting up %1.</p>
<p>Setup can continue, but some features might be disabled.</p>").arg(Branding.string(Branding.VersionedName))
text: qsTr("<p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/>
Setup can continue, but some features might be disabled.</p>").arg(Branding.string(Branding.VersionedName))
}
TextArea {
Rectangle {
width: 640
height: 400
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: recommended.bottom
anchors.topMargin: 20
width: 640
background: Rectangle {
implicitWidth: 640
implicitHeight: 50
border.color: "#ff0000"
color: "#b0e0e6"
anchors.topMargin: 5
Component {
id: requirementsDelegate
Item {
width: 640
height: 40
Column {
anchors.centerIn: parent
Rectangle {
implicitWidth: 640
implicitHeight: 40
border.color: satisfied ? "#228b22" : "#ffa411"
color: satisfied ? "#f0fff0" : "#ffefd5"
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.margins: 20
source: satisfied ? "qrc:/data/images/yes.svgz" : "qrc:/data/images/information.svgz"
}
Text {
text: ( satisfied ? 'Met: ' : 'Missing: ' ) + name + " " + details
anchors.centerIn: parent
font.pointSize: 12
}
}
}
}
}
font.pointSize: 12
textFormat: Text.RichText
antialiasing: true
activeFocusOnPress: false
wrapMode: Text.WordWrap
text: qsTr("<p>The system is not connected to the internet.</p>")//.arg(requirementsModel)
ListView {
anchors.fill: parent
spacing: 5
model: config.requirementsModel
delegate: requirementsDelegate
}
}
}

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2020, Anke Boersma <demm@kaosx.us>
* Copyright 2020, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +17,7 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
import io.calamares.core 1.0
import io.calamares.ui 1.0
import QtQuick 2.7
@ -33,35 +35,65 @@ Rectangle {
id: required
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 20
anchors.topMargin: 10
horizontalAlignment: TextEdit.AlignHCenter
width: 640
font.pointSize: 12
font.pointSize: 11
textFormat: Text.RichText
antialiasing: true
activeFocusOnPress: false
wrapMode: Text.WordWrap
text: qsTr("<p>This computer does not satisfy the minimum requirements for setting up %1.</p>
<p>Setup cannot continue.</p>").arg(Branding.string(Branding.VersionedName))
text: qsTr("<p>This computer does not satisfy the minimum requirements for installing %1.<br/>
Installation cannot continue.</p>").arg(Branding.string(Branding.VersionedName))
}
TextArea {
Rectangle {
width: 640
height: 400
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: required.bottom
anchors.topMargin: 20
width: 640
background: Rectangle {
implicitWidth: 640
implicitHeight: 50
border.color: "#ff0000"
color: "#ffc0cb"
anchors.topMargin: 5
Component {
id: requirementsDelegate
Item {
width: 640
height: 40
Column {
anchors.centerIn: parent
Rectangle {
implicitWidth: 640
implicitHeight: 40
border.color: mandatory ? "#ff0000" : "#228b22"
color: mandatory ? "#ffc0cb" : "#f0fff0"
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.margins: 20
source: mandatory ? "qrc:/data/images/yes.svgz" : "qrc:/data/images/no.svgz"
}
Text {
text: ( mandatory ? 'Met: ' : 'Failed: ' ) + name + " " + details
anchors.centerIn: parent
font.pointSize: 12
}
}
}
}
}
font.pointSize: 12
textFormat: Text.RichText
antialiasing: true
activeFocusOnPress: false
wrapMode: Text.WordWrap
text: qsTr("<p>The installer is not running with administrator rights.</p>")//.arg(requirementsModel)
ListView {
anchors.fill: parent
spacing: 5
model: config.requirementsModel
delegate: requirementsDelegate
}
}
}

@ -25,3 +25,40 @@ showReleaseNotesUrl: true
# branding.desc string)
#
# showDonateUrl: https://kde.org/community/donations/
# Requirements checking. These are general, generic, things
# that are checked. They may not match with the actual requirements
# imposed by other modules in the system.
requirements:
# Amount of available disk, in GiB. Floating-point is allowed here.
# Note that this does not account for *usable* disk, so it is possible
# to pass this requirement, yet have no space to install to.
requiredStorage: 5.5
# Amount of available RAM, in GiB. Floating-point is allowed here.
requiredRam: 1.0
# To check for internet connectivity, Calamares does a HTTP GET
# on this URL; on success (e.g. HTTP code 200) internet is OK.
internetCheckUrl: http://google.com
# List conditions to check. Each listed condition will be
# probed in some way, and yields true or false according to
# the host system satisfying the condition.
#
# This sample file lists all the conditions that are known.
check:
- storage
- ram
- power
- internet
- root
- screen
# List conditions that **must** be satisfied (from the list
# of conditions, above) for installation to proceed.
# If any of these conditions are not met, the user cannot
# continue past the welcome page.
required:
# - storage
- ram
# - root

@ -57,16 +57,10 @@ Page
}
Recommended {
property var required: "yes" //requirementsModel
property var satisfied: "yes" //satisfiedRequirements
property var requiredMet: (required != satisfied) ? true : false
visible: !config.requirementsModel.satisfiedRequirements
}
Requirements {
property var required: "yes" //requirementsModel
property var mandatory: "yes" //satisfiedMandatory
property var mandatoryMet: (required != mandatory) ? true : false
visible: !config.requirementsModel.satisfiedMandatory
}

Loading…
Cancel
Save