diff --git a/src/modules/dummyqml/DummyQmlViewStep.cpp b/src/modules/dummyqml/DummyQmlViewStep.cpp index 32c1c60d0..6bf0b4a60 100644 --- a/src/modules/dummyqml/DummyQmlViewStep.cpp +++ b/src/modules/dummyqml/DummyQmlViewStep.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Adriaan de Groot + * Copyright 2020, Anke Boersma * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +19,8 @@ #include "DummyQmlViewStep.h" +#include + DummyQmlViewStep::DummyQmlViewStep( QObject* parent ) : Calamares::QmlViewStep( "dummyqml", parent ) { @@ -28,8 +31,23 @@ DummyQmlViewStep::~DummyQmlViewStep() {} QString DummyQmlViewStep::prettyName() const { - return tr( "Example QML page." ); + return m_notesName ? m_notesName->get() : tr( "Notes" ); } +void +DummyQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap ) +{ + Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation + + bool qmlLabel_ok = false; + auto qmlLabel = CalamaresUtils::getSubMap( configurationMap, "qmlLabel", qmlLabel_ok ); + if ( qmlLabel_ok ) + { + if ( qmlLabel.contains( "notes" ) ) + { + m_notesName = new CalamaresUtils::Locale::TranslatedString( qmlLabel, "notes" ); + } + } +} CALAMARES_PLUGIN_FACTORY_DEFINITION( DummyQmlViewStepFactory, registerPlugin< DummyQmlViewStep >(); ) diff --git a/src/modules/dummyqml/DummyQmlViewStep.h b/src/modules/dummyqml/DummyQmlViewStep.h index ffc358fe7..6eb0d768e 100644 --- a/src/modules/dummyqml/DummyQmlViewStep.h +++ b/src/modules/dummyqml/DummyQmlViewStep.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2020, Adriaan de Groot + * Copyright 2020, Anke Boersma * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,10 +20,14 @@ #ifndef DUMMYQMLVIEWSTEP_H #define DUMMYQMLVIEWSTEP_H +#include +#include "locale/TranslatableConfiguration.h" +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Variant.h" #include "utils/PluginFactory.h" #include "viewpages/QmlViewStep.h" -class DummyQmlViewStep : public Calamares::QmlViewStep +class PLUGINDLLEXPORT DummyQmlViewStep : public Calamares::QmlViewStep { Q_OBJECT @@ -30,9 +35,12 @@ public: DummyQmlViewStep( QObject* parent = nullptr ); virtual ~DummyQmlViewStep() override; - virtual QString prettyName() const override; + QString prettyName() const override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; private: + CalamaresUtils::Locale::TranslatedString* m_notesName; // As it appears in the sidebar }; CALAMARES_PLUGIN_FACTORY_DECLARATION( DummyQmlViewStepFactory ) diff --git a/src/modules/dummyqml/dummyqml.conf b/src/modules/dummyqml/dummyqml.conf index e62d35383..c3581911f 100644 --- a/src/modules/dummyqml/dummyqml.conf +++ b/src/modules/dummyqml/dummyqml.conf @@ -20,3 +20,10 @@ search: both # Name of the QML file. If not set, uses the name of the module. filename: dummyqml + +# Name of the QML file. If not set, uses the name of the module. +filename: notes + +qmlLabel: + notes: "Release Notes" + notes[nl]: "Opmerkingen" diff --git a/src/modules/dummyqml/dummyqml.qml b/src/modules/dummyqml/dummyqml.qml index 6cab24bec..3cbfa65fc 100644 --- a/src/modules/dummyqml/dummyqml.qml +++ b/src/modules/dummyqml/dummyqml.qml @@ -1,12 +1,73 @@ -import QtQuick 2.3 +/* === This file is part of Calamares - === + * + * Copyright 2020, Anke Boersma + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ -Rectangle { - width: 200 - height: 100 - color: "red" +import QtQuick 2.7 +import QtQuick.Controls 2.2 +import QtQuick.Window 2.2 +import QtQuick.Layouts 1.3 +import QtQuick.Controls.Material 2.1 - Text { - anchors.centerIn: parent - text: "Hello, World!" +Item { + width: 740 + height: 420 + + Flickable { + id: flick + anchors.fill: parent + contentHeight: 800 + + ScrollBar.vertical: ScrollBar { + width: 10 + policy: ScrollBar.AlwaysOn + } + + TextArea { + id: intro + x: 1 + y: 0 + width: 720 + font.pointSize: 14 + textFormat: Text.RichText + antialiasing: true + activeFocusOnPress: false + wrapMode: Text.WordWrap + + text: qsTr("

Generic GNU/Linux 2017.8 LTS Soapy Sousaphone

+

This an example QML file, showing options in RichText with Flickable content.

+ +

QML with RichText can use HTML tags, Flickable content is useful for touchscreens.

+ +

This is bold text

+

This is italic text

+

This is underlined text

+

This is strikethrough

+ +

Code example: + ls -l /home

+ +

Lists:

+
    +
  • Intel CPU systems
  • +
  • AMD CPU systems
  • +
+ +

The vertical scrollbar is adjustable, current width set to 10.

") + + } } }