From fed89badd4da3e9ac56e4f0f083e17fe8d37d3af Mon Sep 17 00:00:00 2001 From: demmm Date: Thu, 14 May 2020 19:00:02 +0200 Subject: [PATCH 1/2] [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 --- src/modules/welcomeq/Recommended.qml | 69 ++++++++++++++++++-------- src/modules/welcomeq/Requirements.qml | 70 +++++++++++++++++++-------- src/modules/welcomeq/welcomeq.conf | 37 ++++++++++++++ src/modules/welcomeq/welcomeq.qml | 6 --- 4 files changed, 138 insertions(+), 44 deletions(-) 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 } From a85ff30ad44dbbdc75f04758545a9677a1fdc4bc Mon Sep 17 00:00:00 2001 From: demmm Date: Thu, 14 May 2020 20:01:50 +0200 Subject: [PATCH 2/2] [welcomeq] smaller font size correct color order Requirements.qml --- src/modules/welcomeq/Recommended.qml | 2 +- src/modules/welcomeq/Requirements.qml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/welcomeq/Recommended.qml b/src/modules/welcomeq/Recommended.qml index 9bc0ef619..3fedb3282 100644 --- a/src/modules/welcomeq/Recommended.qml +++ b/src/modules/welcomeq/Recommended.qml @@ -81,7 +81,7 @@ Rectangle { Text { text: ( satisfied ? 'Met: ' : 'Missing: ' ) + name + " " + details anchors.centerIn: parent - font.pointSize: 12 + font.pointSize: 11 } } } diff --git a/src/modules/welcomeq/Requirements.qml b/src/modules/welcomeq/Requirements.qml index b12caf6f6..a1f318532 100644 --- a/src/modules/welcomeq/Requirements.qml +++ b/src/modules/welcomeq/Requirements.qml @@ -68,8 +68,8 @@ Rectangle { Rectangle { implicitWidth: 640 implicitHeight: 40 - border.color: mandatory ? "#ff0000" : "#228b22" - color: mandatory ? "#ffc0cb" : "#f0fff0" + border.color: mandatory ? "#228b22" : "#ff0000" + color: mandatory ? "#f0fff0" : "#ffc0cb" Image { anchors.verticalCenter: parent.verticalCenter @@ -81,7 +81,7 @@ Rectangle { Text { text: ( mandatory ? 'Met: ' : 'Failed: ' ) + name + " " + details anchors.centerIn: parent - font.pointSize: 12 + font.pointSize: 11 } } }