[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.
This commit is contained in:
Adriaan de Groot 2020-04-03 13:43:48 +02:00
parent 54b8ad5475
commit 6c418402e3
2 changed files with 28 additions and 103 deletions

View File

@ -199,5 +199,4 @@ void LocaleQmlViewStep::setConfigurationMap(const QVariantMap& configurationMap)
checkRequirements(); checkRequirements();
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
setContextProperty( "Localeq", m_config );
} }

View File

@ -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 io.calamares.ui 1.0
import QtQuick 2.10 import QtQuick 2.10
@ -7,107 +7,33 @@ import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami import org.kde.kirigami 2.7 as Kirigami
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
ResponsiveBase RowLayout
{ {
id: control Rectangle {
width: parent.width / 3
Modules.Locale //locale handler Layout.fillWidth: true
{ ColumnLayout {
id: _locale id: regions
} Repeater {
model: config.regionModel
title: stackView.currentItem.title Text {
subtitle: stackView.currentItem.subtitle text: label
message: stackView.currentItem.message }
}
stackView.initialItem: Item }
{ }
id: _regionsListComponent Rectangle {
width: parent.width / 3
property string title: qsTr("Region") Layout.fillWidth: true
property string subtitle: qsTr("Pick your preferred region or use the default one based on your current location") ColumnLayout {
property string message: qsTr("Select your preferred zone within your location to continue with the installation") id: zones
Repeater {
ListViewTemplate model: config.zonesModel
{ Text {
id: _regionListView text: label
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()
}
}
}
}
}
} }