[localeq] Hook up to Config object
- get network status from the global Network object; document that - get the strings describing the language and LC settings from the config-object instead of roll-our-own - use the model of supported locales from Config to populate listboxes - connect selection of language or LC to the Config object
This commit is contained in:
parent
75da1bece4
commit
00e9454344
@ -32,10 +32,6 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
//Needs to come from Locale config
|
|
||||||
property var confLang: "en_US.UTF8"
|
|
||||||
property var confLocale: "nl_NL.UTF8"
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: textArea
|
id: textArea
|
||||||
x: 28
|
x: 28
|
||||||
@ -57,7 +53,7 @@ Item {
|
|||||||
width: 240
|
width: 240
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: qsTr("<h1>Languages</h1> </br>
|
text: qsTr("<h1>Languages</h1> </br>
|
||||||
The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>.").arg(confLang)
|
The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>.").arg(config.currentLanguageCode)
|
||||||
font.pointSize: 10
|
font.pointSize: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,8 +72,7 @@ Item {
|
|||||||
id: list1
|
id: list1
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
// bogus entries, need to come from Locale config
|
model: config.supportedLocales
|
||||||
model: ["en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8"]
|
|
||||||
|
|
||||||
currentIndex: 1
|
currentIndex: 1
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
@ -95,17 +90,17 @@ Item {
|
|||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
list1.currentIndex = index
|
list1.currentIndex = index
|
||||||
confLang = list1.currentIndex
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onCurrentItemChanged: { config.currentLanguageCode = model[currentIndex] } /* This works because model is a stringlist */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: i18n
|
id: lc_numeric
|
||||||
x: 430
|
x: 430
|
||||||
y: 40
|
y: 40
|
||||||
|
|
||||||
@ -118,7 +113,7 @@ Item {
|
|||||||
width: 240
|
width: 240
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: qsTr("<h1>Locales</h1> </br>
|
text: qsTr("<h1>Locales</h1> </br>
|
||||||
The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>.").arg(confLocale)
|
The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>.").arg(config.currentLCCode)
|
||||||
font.pointSize: 10
|
font.pointSize: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,7 +134,7 @@ Item {
|
|||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
// bogus entries, need to come from Locale config
|
// bogus entries, need to come from Locale config
|
||||||
model: ["en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8", "en_GB.UTF-8 UTF-8", "en_US.UTF-8 UTF-8 ", "nl_NL.UTF-8 UTF-8"]
|
model: config.supportedLocales
|
||||||
|
|
||||||
currentIndex: 2
|
currentIndex: 2
|
||||||
highlight: Rectangle {
|
highlight: Rectangle {
|
||||||
@ -154,11 +149,10 @@ Item {
|
|||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
list2.currentIndex = index
|
list2.currentIndex = index
|
||||||
confLocale = list1.currentIndex
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onCurrentItemChanged: console.debug(currentIndex)
|
onCurrentItemChanged: { config.currentLCCode = model[currentIndex]; } /* This works because model is a stringlist */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,8 @@ Page {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height / 1.28
|
height: parent.height / 1.28
|
||||||
source: (Network.hasInternet) ? "Map.qml" : "Offline.qml"
|
// Network is in io.calamares.core
|
||||||
|
source: Network.hasInternet ? "Map.qml" : "Offline.qml"
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
@ -67,7 +68,7 @@ Page {
|
|||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: qsTr("System language set to %1").arg(confLang)
|
text: config.currentLanguageStatus
|
||||||
}
|
}
|
||||||
Kirigami.Separator {
|
Kirigami.Separator {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@ -75,7 +76,7 @@ Page {
|
|||||||
Label {
|
Label {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: qsTr("Numbers and dates locale set to %1").arg(confLocale)
|
text: config.currentLCStatus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
Loading…
Reference in New Issue
Block a user