Merge pull request #1708 from demmm/calamares
[localeq], working Offline.qml
This commit is contained in:
commit
78af510535
@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
*
|
*
|
||||||
* SPDX-FileCopyrightText: 2020 Anke Boersma <demm@kaosx.us>
|
* SPDX-FileCopyrightText: 2020-2021 Anke Boersma <demm@kaosx.us>
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
@ -21,6 +21,10 @@ Page {
|
|||||||
width: 800 //parent.width
|
width: 800 //parent.width
|
||||||
height: 500
|
height: 500
|
||||||
|
|
||||||
|
id: control
|
||||||
|
property string currentRegion
|
||||||
|
property string currentZone
|
||||||
|
|
||||||
StackView {
|
StackView {
|
||||||
id: stack
|
id: stack
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@ -34,7 +38,7 @@ Page {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
color: Kirigami.Theme.textColor
|
color: Kirigami.Theme.textColor
|
||||||
horizontalAlignment: Text.AlignCenter
|
horizontalAlignment: Text.AlignCenter
|
||||||
text: qsTr("Select your preferred Region, or use the default one based on your current location.")
|
text: qsTr("Select your preferred Region, or use the default settings.")
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
@ -45,7 +49,7 @@ Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
width: parent.width / 2
|
width: parent.width / 2
|
||||||
height: 250
|
height: parent.height / 1.5
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.verticalCenterOffset: -30
|
anchors.verticalCenterOffset: -30
|
||||||
focus: true
|
focus: true
|
||||||
@ -62,9 +66,8 @@ Page {
|
|||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
}
|
}
|
||||||
|
|
||||||
// model loads, dozens of variations tried for currentIndex all fail
|
|
||||||
model: config.regionModel
|
model: config.regionModel
|
||||||
currentIndex: config.currentIndex
|
currentIndex: -1
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -73,9 +76,9 @@ Page {
|
|||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
||||||
text: name
|
text: model.name
|
||||||
Layout.fillHeight: true
|
horizontalAlignment: Text.AlignHCenter
|
||||||
Layout.fillWidth: true
|
verticalAlignment: Text.AlignVCenter
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 30
|
height: 30
|
||||||
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
||||||
@ -89,8 +92,9 @@ Page {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
list.model.currentIndex = index
|
list.currentIndex = index
|
||||||
// correct to use config.currentTimezoneName when index is updated?
|
control.currentRegion = model.name
|
||||||
|
config.regionalZonesModel.region = control.currentRegion
|
||||||
tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName)
|
tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName)
|
||||||
stack.push(zoneView)
|
stack.push(zoneView)
|
||||||
}
|
}
|
||||||
@ -119,7 +123,7 @@ Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
width: parent.width / 2
|
width: parent.width / 2
|
||||||
height: 250
|
height: parent.height / 1.5
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.verticalCenterOffset: -30
|
anchors.verticalCenterOffset: -30
|
||||||
focus: true
|
focus: true
|
||||||
@ -136,9 +140,8 @@ Page {
|
|||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
}
|
}
|
||||||
|
|
||||||
// model loads, dozens of variations tried for currentIndex all fail
|
|
||||||
model: config.regionalZonesModel
|
model: config.regionalZonesModel
|
||||||
currentIndex: config.currentIndex
|
currentIndex : -1
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
@ -147,9 +150,9 @@ Page {
|
|||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
||||||
text: name
|
text: model.name
|
||||||
Layout.fillHeight: true
|
horizontalAlignment: Text.AlignHCenter
|
||||||
Layout.fillWidth: true
|
verticalAlignment: Text.AlignVCenter
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 30
|
height: 30
|
||||||
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
||||||
@ -163,9 +166,10 @@ Page {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
list2.model.currentIndex = index
|
list2.currentIndex = index
|
||||||
list2.positionViewAtIndex(index, ListView.Center)
|
list2.positionViewAtIndex(index, ListView.Center)
|
||||||
// correct to use config.currentTimezoneName when index is updated?
|
control.currentZone = model.name
|
||||||
|
config.setCurrentLocation(control.currentRegion, control.currentZone)
|
||||||
tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName)
|
tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user