[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:
parent
54b8ad5475
commit
6c418402e3
@ -199,5 +199,4 @@ void LocaleQmlViewStep::setConfigurationMap(const QVariantMap& configurationMap)
|
||||
|
||||
checkRequirements();
|
||||
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
||||
setContextProperty( "Localeq", m_config );
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user