diff --git a/src/modules/welcomeq/Recommended.qml b/src/modules/welcomeq/Recommended.qml index 373509104..9bc0ef619 100644 --- a/src/modules/welcomeq/Recommended.qml +++ b/src/modules/welcomeq/Recommended.qml @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Anke Boersma + * Copyright 2020, Adriaan de Groot * * 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 . */ +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("

This computer does not satisfy some of the recommended requirements for setting up %1.

-

Setup can continue, but some features might be disabled.

").arg(Branding.string(Branding.VersionedName)) + text: qsTr("

This computer does not satisfy some of the recommended requirements for setting up %1.
+ Setup can continue, but some features might be disabled.

").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" - } - font.pointSize: 12 - textFormat: Text.RichText - antialiasing: true - activeFocusOnPress: false - wrapMode: Text.WordWrap + anchors.topMargin: 5 - text: qsTr("

The system is not connected to the internet.

")//.arg(requirementsModel) + 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 + } + } + } + } + } + + ListView { + anchors.fill: parent + spacing: 5 + model: config.requirementsModel + delegate: requirementsDelegate + } } } diff --git a/src/modules/welcomeq/Requirements.qml b/src/modules/welcomeq/Requirements.qml index 4f5520270..b12caf6f6 100644 --- a/src/modules/welcomeq/Requirements.qml +++ b/src/modules/welcomeq/Requirements.qml @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Anke Boersma + * Copyright 2020, Adriaan de Groot * * 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 . */ +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("

This computer does not satisfy the minimum requirements for setting up %1.

-

Setup cannot continue.

").arg(Branding.string(Branding.VersionedName)) + text: qsTr("

This computer does not satisfy the minimum requirements for installing %1.
+ Installation cannot continue.

").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" - } - font.pointSize: 12 - textFormat: Text.RichText - antialiasing: true - activeFocusOnPress: false - wrapMode: Text.WordWrap + anchors.topMargin: 5 - text: qsTr("

The installer is not running with administrator rights.

")//.arg(requirementsModel) + 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 + } + } + } + } + } + + ListView { + anchors.fill: parent + spacing: 5 + model: config.requirementsModel + delegate: requirementsDelegate + } } } + diff --git a/src/modules/welcomeq/welcomeq.conf b/src/modules/welcomeq/welcomeq.conf index a5ab97f50..2553e157a 100644 --- a/src/modules/welcomeq/welcomeq.conf +++ b/src/modules/welcomeq/welcomeq.conf @@ -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 diff --git a/src/modules/welcomeq/welcomeq.qml b/src/modules/welcomeq/welcomeq.qml index 2a29c5d9a..b92ff9628 100644 --- a/src/modules/welcomeq/welcomeq.qml +++ b/src/modules/welcomeq/welcomeq.qml @@ -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 }