From 6c418402e3070e0453dd028f0bcfb8cf28b58755 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 3 Apr 2020 13:43:48 +0200 Subject: [PATCH] [localeq] Hit QML file with a hammer - io.calamares.modules doesn't exist - ResponsiveBase doesn't exist The module is now non-functional, but at least it loads and renders a list of regions and zones. --- src/modules/localeq/LocaleQmlViewStep.cpp | 1 - src/modules/localeq/localeq.qml | 130 +++++----------------- 2 files changed, 28 insertions(+), 103 deletions(-) diff --git a/src/modules/localeq/LocaleQmlViewStep.cpp b/src/modules/localeq/LocaleQmlViewStep.cpp index 8376b4f1d..13fbeaacc 100644 --- a/src/modules/localeq/LocaleQmlViewStep.cpp +++ b/src/modules/localeq/LocaleQmlViewStep.cpp @@ -199,5 +199,4 @@ void LocaleQmlViewStep::setConfigurationMap(const QVariantMap& configurationMap) checkRequirements(); Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last - setContextProperty( "Localeq", m_config ); } diff --git a/src/modules/localeq/localeq.qml b/src/modules/localeq/localeq.qml index b186a0081..534c8952c 100644 --- a/src/modules/localeq/localeq.qml +++ b/src/modules/localeq/localeq.qml @@ -1,4 +1,4 @@ -import io.calamares.modules 1.0 as Modules +import io.calamares.core 1.0 import io.calamares.ui 1.0 import QtQuick 2.10 @@ -7,107 +7,33 @@ import QtQuick.Layouts 1.3 import org.kde.kirigami 2.7 as Kirigami import QtGraphicalEffects 1.0 -ResponsiveBase +RowLayout { - id: control - - Modules.Locale //locale handler - { - id: _locale - } - - title: stackView.currentItem.title - subtitle: stackView.currentItem.subtitle - message: stackView.currentItem.message - - stackView.initialItem: Item - { - id: _regionsListComponent - - property string title: qsTr("Region") - property string subtitle: qsTr("Pick your preferred region or use the default one based on your current location") - property string message: qsTr("Select your preferred zone within your location to continue with the installation") - - ListViewTemplate - { - id: _regionListView - anchors.centerIn: parent - implicitWidth: Math.min(parent.width, 500) - implicitHeight: Math.min(contentHeight, 500) - currentIndex: model.currentIndex - model: _locale.Config.regionModel - - delegate: ListItemDelegate - { - id: _delegate - label1.text: model.label - onClicked: - { - _regionListView.model.currentIndex = index - _stackView.push(_zonesListComponent) - } - } - - footer: RowLayout - { - width: parent.width - z: 99999 - Button - { - Layout.fillWidth: true - text: qsTr("Timezones") - icon.name: "go-previous" - onClicked: control.stackView.push(_zonesListComponent) - } - } - } - } - - - Component - { - id: _zonesListComponent - - Item - { - property string title: qsTr("Timezone") - property string subtitle: _locale.Config.prettyStatus - property string message: "" - ListViewTemplate - { - id: _zonesListView - anchors.centerIn: parent - implicitWidth: Math.min(parent.width, 500) - implicitHeight: Math.min(contentHeight, 500) - currentIndex: model.currentIndex - model: _locale.Config.zonesModel - - delegate: ListItemDelegate - { - id: _delegate - label1.text: model.label - onClicked: - { - _zonesListView.model.currentIndex = index - positionViewAtIndex(index, ListView.Center) - } - } - - footer: RowLayout - { - width: parent.width - z: 99999 - - Button - { - Layout.fillWidth: true - icon.name: "go-previous" - text: qsTr("Regions") - onClicked: control.stackView.pop() - } - } - } - } - } + Rectangle { + width: parent.width / 3 + Layout.fillWidth: true + ColumnLayout { + id: regions + Repeater { + model: config.regionModel + Text { + text: label + } + } + } + } + Rectangle { + width: parent.width / 3 + Layout.fillWidth: true + ColumnLayout { + id: zones + Repeater { + model: config.zonesModel + Text { + text: label + } + } + } + } }