mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
Merge pull request #1402 from demmm/master
[localeq] move to QtLocation map based module
This commit is contained in:
commit
d17dac67e7
11 changed files with 678 additions and 67 deletions
|
@ -6,6 +6,17 @@ if( DEBUG_TIMEZONES )
|
|||
add_definitions( -DDEBUG_TIMEZONES )
|
||||
endif()
|
||||
|
||||
find_package(Qt5Location CONFIG)
|
||||
set_package_properties(Qt5Location PROPERTIES
|
||||
DESCRIPTION "Used for rendering the map"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
find_package(Qt5Positioning CONFIG)
|
||||
set_package_properties(Qt5Positioning PROPERTIES
|
||||
DESCRIPTION "Used for GeoLocation and GeoCoding"
|
||||
TYPE RUNTIME
|
||||
)
|
||||
|
||||
# Because we're sharing sources with the regular locale module
|
||||
set( _locale ${CMAKE_CURRENT_SOURCE_DIR}/../locale )
|
||||
|
||||
|
|
243
src/modules/localeq/Map.qml
Normal file
243
src/modules/localeq/Map.qml
Normal file
|
@ -0,0 +1,243 @@
|
|||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2020, Anke Boersma <demm@kaosx.us>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.10
|
||||
import QtQuick.Window 2.14
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import org.kde.kirigami 2.7 as Kirigami
|
||||
|
||||
import QtLocation 5.14
|
||||
import QtPositioning 5.14
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
|
||||
//Needs to come from .conf/geoip
|
||||
property var configCity: "New York"
|
||||
property var configCountry: "USA"
|
||||
property var configTimezone: "America/New York"
|
||||
property var geoipCity: "" //"Amsterdam"
|
||||
property var geoipCountry: "" //"Netherlands"
|
||||
property var geoipTimezone: "" //"Europe/Amsterdam"
|
||||
// vars that will stay once connected
|
||||
property var cityName: (geoipCity != "") ? geoipCity : configCity
|
||||
property var countryName: (geoipCountry != "") ? geoipCountry : configCountry
|
||||
property var timeZone: (geoipTimezone != "") ? geoipTimezone : configTimezone
|
||||
|
||||
function getIp() {
|
||||
var xhr = new XMLHttpRequest
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
var responseJSON = JSON.parse(xhr.responseText)
|
||||
var tz = responseJSON.timezone
|
||||
var ct = responseJSON.city
|
||||
var cy = responseJSON.country
|
||||
|
||||
tzText.text = "Timezone: " + tz
|
||||
cityName = ct
|
||||
countryName = cy
|
||||
}
|
||||
}
|
||||
|
||||
// Define the target of the request
|
||||
xhr.open("GET", "https://get.geojs.io/v1/ip/geo.json")
|
||||
// Execute the request
|
||||
xhr.send()
|
||||
}
|
||||
|
||||
function getTz() {
|
||||
var xhr = new XMLHttpRequest
|
||||
var latC = map.center.latitude
|
||||
var lonC = map.center.longitude
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
var responseJSON = JSON.parse(xhr.responseText)
|
||||
var tz2 = responseJSON.timezoneId
|
||||
|
||||
tzText.text = "Timezone: " + tz2
|
||||
}
|
||||
}
|
||||
|
||||
// Needs to move to localeq.conf, each distribution will need their own account
|
||||
xhr.open("GET", "http://api.geonames.org/timezoneJSON?lat=" + latC + "&lng=" + lonC + "&username=SOME_USERNAME")
|
||||
xhr.send()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height / 1.28
|
||||
|
||||
Plugin {
|
||||
id: mapPlugin
|
||||
name: "esri" // "esri", "here", "itemsoverlay", "mapbox", "mapboxgl", "osm"
|
||||
}
|
||||
|
||||
Map {
|
||||
id: map
|
||||
anchors.fill: parent
|
||||
plugin: mapPlugin
|
||||
activeMapType: supportedMapTypes[0]
|
||||
//might be desirable to set zoom level configurable?
|
||||
zoomLevel: 5
|
||||
bearing: 0
|
||||
tilt: 0
|
||||
copyrightsVisible : true
|
||||
fieldOfView : 0
|
||||
|
||||
GeocodeModel {
|
||||
id: geocodeModel
|
||||
plugin: mapPlugin
|
||||
autoUpdate: true
|
||||
query: Address {
|
||||
id: address
|
||||
city: cityName
|
||||
country: countryName
|
||||
}
|
||||
|
||||
onLocationsChanged: {
|
||||
if (count == 1) {
|
||||
map.center.latitude = get(0).coordinate.latitude
|
||||
map.center.longitude = get(0).coordinate.longitude
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MapQuickItem {
|
||||
id: marker
|
||||
anchorPoint.x: image.width/4
|
||||
anchorPoint.y: image.height
|
||||
coordinate: QtPositioning.coordinate(
|
||||
map.center.latitude,
|
||||
map.center.longitude)
|
||||
//coordinate: QtPositioning.coordinate(40.730610, -73.935242) // New York
|
||||
|
||||
sourceItem: Image {
|
||||
id: image
|
||||
width: 32
|
||||
height: 32
|
||||
source: "img/pin.svg"
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
anchors.fill: map
|
||||
hoverEnabled: true
|
||||
property var coordinate: map.toCoordinate(Qt.point(mouseX, mouseY))
|
||||
Label {
|
||||
x: parent.mouseX - width
|
||||
y: parent.mouseY - height - 5
|
||||
text: "%1, %2".arg(
|
||||
parent.coordinate.latitude).arg(parent.coordinate.longitude)
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
marker.coordinate = coordinate
|
||||
map.center.latitude = coordinate.latitude
|
||||
map.center.longitude = coordinate.longitude
|
||||
|
||||
getTz();
|
||||
|
||||
console.log(coordinate.latitude, coordinate.longitude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.bottomMargin: 5
|
||||
anchors.rightMargin: 10
|
||||
|
||||
MouseArea {
|
||||
width: 32
|
||||
height:32
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
Image {
|
||||
source: "img/plus.png"
|
||||
anchors.centerIn: parent
|
||||
width: 36
|
||||
height: 36
|
||||
}
|
||||
|
||||
onClicked: map.zoomLevel++
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
width: 32
|
||||
height:32
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
Image {
|
||||
source: "img/minus.png"
|
||||
anchors.centerIn: parent
|
||||
width: 32
|
||||
height: 32
|
||||
}
|
||||
|
||||
onClicked: map.zoomLevel--
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 100
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Item {
|
||||
id: location
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: 300
|
||||
height: 30
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
|
||||
Text {
|
||||
id: tzText
|
||||
text: tzText.text
|
||||
//text: qsTr("Timezone: %1").arg(timeZone)
|
||||
color: Kirigami.Theme.textColor
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
Component.onCompleted: getIp();
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.top: location.bottom
|
||||
anchors.topMargin: 20
|
||||
padding: 10
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor
|
||||
text: qsTr("Please select your preferred location on the map so the installer can suggest the locale
|
||||
and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging
|
||||
to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming.")
|
||||
}
|
||||
}
|
||||
}
|
80
src/modules/localeq/Offline.qml
Normal file
80
src/modules/localeq/Offline.qml
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2020, Anke Boersma <demm@kaosx.us>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.10
|
||||
import QtQuick.Window 2.14
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import org.kde.kirigami 2.7 as Kirigami
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
|
||||
//Needs to come from localeq.conf
|
||||
property var configTimezone: "America/New York"
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height / 1.28
|
||||
|
||||
Image {
|
||||
id: image
|
||||
anchors.fill: parent
|
||||
source: "img/worldmap.png"
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 100
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Item {
|
||||
id: location
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: 300
|
||||
height: 30
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
|
||||
Text {
|
||||
text: qsTr("Timezone: %1").arg(configTimezone)
|
||||
color: Kirigami.Theme.textColor
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.top: location.bottom
|
||||
anchors.topMargin: 20
|
||||
padding: 10
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor
|
||||
text: qsTr("To be able to select a timezone, make sure you are connected to the internet. Restart the installer after connecting. You can fine-tune Language and Locale settings below.")
|
||||
}
|
||||
}
|
||||
}
|
189
src/modules/localeq/i18n.qml
Normal file
189
src/modules/localeq/i18n.qml
Normal file
|
@ -0,0 +1,189 @@
|
|||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2020, Anke Boersma <demm@kaosx.us>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import io.calamares.ui 1.0
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import org.kde.kirigami 2.7 as Kirigami
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
focus: true
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
//Needs to come from Locale config
|
||||
property var confLang: "en_US.UTF8"
|
||||
property var confLocale: "nl_NL.UTF8"
|
||||
|
||||
Rectangle {
|
||||
id: textArea
|
||||
x: 28
|
||||
y: 14
|
||||
anchors.fill: parent
|
||||
Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor
|
||||
|
||||
Column {
|
||||
id: languages
|
||||
x: 130
|
||||
y: 40
|
||||
|
||||
Rectangle {
|
||||
width: 250
|
||||
height: 140
|
||||
color: "#d3d3d3"
|
||||
Text {
|
||||
anchors.top: parent.top
|
||||
width: 240
|
||||
wrapMode: Text.WordWrap
|
||||
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)
|
||||
font.pointSize: 10
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 250
|
||||
height: 300
|
||||
|
||||
ScrollView {
|
||||
id: scroll1
|
||||
anchors.fill: parent
|
||||
contentHeight: 800
|
||||
clip: true
|
||||
|
||||
ListView {
|
||||
id: list1
|
||||
focus: true
|
||||
|
||||
// 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"]
|
||||
|
||||
currentIndex: 1
|
||||
highlight: Rectangle {
|
||||
color: Kirigami.Theme.highlightColor
|
||||
}
|
||||
delegate: Text {
|
||||
text: modelData
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
color: "#0000ff"
|
||||
}
|
||||
onClicked: {
|
||||
list1.currentIndex = index
|
||||
confLang = list1.currentIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: i18n
|
||||
x: 430
|
||||
y: 40
|
||||
|
||||
Rectangle {
|
||||
width: 250
|
||||
height: 140
|
||||
color: "#d3d3d3"
|
||||
Text {
|
||||
anchors.top: parent.top
|
||||
width: 240
|
||||
wrapMode: Text.WordWrap
|
||||
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)
|
||||
font.pointSize: 10
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 250
|
||||
height: 300
|
||||
|
||||
ScrollView {
|
||||
id: scroll2
|
||||
anchors.fill: parent
|
||||
contentHeight: 800
|
||||
clip: true
|
||||
|
||||
ListView {
|
||||
id: list2
|
||||
width: 180; height: 200
|
||||
focus: true
|
||||
|
||||
// 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"]
|
||||
|
||||
currentIndex: 2
|
||||
highlight: Rectangle {
|
||||
color: Kirigami.Theme.highlightColor
|
||||
}
|
||||
delegate: Text {
|
||||
text: modelData
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
list2.currentIndex = index
|
||||
confLocale = list1.currentIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
onCurrentItemChanged: console.debug(currentIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: toolButton
|
||||
x: 19
|
||||
y: 29
|
||||
width: 105
|
||||
height: 48
|
||||
text: qsTr("Back")
|
||||
hoverEnabled: true
|
||||
onClicked: load.source = ""
|
||||
|
||||
Image {
|
||||
id: image1
|
||||
x: 0
|
||||
y: 13
|
||||
width: 22
|
||||
height: 22
|
||||
source: "img/chevron-left-solid.svg"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1
src/modules/localeq/img/chevron-left-solid.svg
Normal file
1
src/modules/localeq/img/chevron-left-solid.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-left" class="svg-inline--fa fa-chevron-left fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"></path></svg>
|
After Width: | Height: | Size: 482 B |
BIN
src/modules/localeq/img/minus.png
Normal file
BIN
src/modules/localeq/img/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 177 B |
60
src/modules/localeq/img/pin.svg
Normal file
60
src/modules/localeq/img/pin.svg
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 1000 1000"
|
||||
enable-background="new 0 0 1000 1000"
|
||||
xml:space="preserve"
|
||||
id="svg14"
|
||||
sodipodi:docname="pin.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
|
||||
id="metadata20"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs18" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1351"
|
||||
inkscape:window-height="721"
|
||||
id="namedview16"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.236"
|
||||
inkscape:cx="46.610169"
|
||||
inkscape:cy="500"
|
||||
inkscape:window-x="909"
|
||||
inkscape:window-y="241"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg14" />
|
||||
<g
|
||||
id="g12"
|
||||
style="fill:#ff0000"><g
|
||||
transform="translate(0.000000,511.000000) scale(0.100000,-0.100000)"
|
||||
id="g10"
|
||||
style="fill:#ff0000"><path
|
||||
d="M6663.2,4984.8c-127.4-55.5-334.8-320.4-451.9-575.2c-127.4-273.2-164.3-456-164.3-803.2c0-260.9,8.2-332.8,47.2-472.5c217.8-755.9,891.5-1505.7,1647.5-1828.2c451.9-193.1,875.1-215.7,1335.2-67.8c382.1,121.2,778.6,414.9,813.5,601.9c84.2,456-386.2,1290-1164.7,2058.3c-318.4,312.2-517.7,478.6-819.6,682C7382.1,4931.4,6899.4,5089.6,6663.2,4984.8z M7686.1,4235c213.6-108.9,482.7-324.6,797-636.8c435.5-435.5,690.2-803.2,712.8-1025c10.3-125.3-22.6-158.2-150-143.8c-221.8,26.7-585.4,281.4-1018.9,712.8c-312.2,314.3-525.9,581.3-636.8,797c-74,145.8-98.6,297.9-57.5,347.1C7373.9,4335.7,7532.1,4313.1,7686.1,4235z"
|
||||
id="path2"
|
||||
style="fill:#ff0000" /><path
|
||||
d="M5143,2616.3c-338.9-240.3-638.9-466.3-667.6-501.2c-74-94.5-84.2-328.7-20.5-536.1C4660.3,901,5397.8,77.3,6129.1-286.3c275.3-137.6,431.4-184.9,616.3-184.9c228,2.1,252.7,22.6,595.7,505.3c168.4,236.2,367.7,517.7,445.8,624.5c76,106.8,139.7,199.3,139.7,207.5c0,6.2-67.8,32.9-147.9,57.5c-439.6,141.7-998.3,525.9-1347.5,930.6c-262.9,304-501.2,704.6-618.3,1045.6l-53.4,154.1L5143,2616.3z"
|
||||
id="path4"
|
||||
style="fill:#ff0000" /><path
|
||||
d="M3212.1,2384.2c-353.3-55.5-688.2-197.2-971.6-410.8c-386.2-289.6-517.7-554.6-517.7-1043.5c0-408.8,100.7-782.6,341-1273.6c655.3-1331.1,2085-2526.7,3336-2789.6c213.7-43.2,601.9-49.3,760.1-10.3c211.6,51.4,390.3,152,540.3,304c297.9,302,484.8,667.6,558.7,1092.8c49.3,273.2,39,710.7-22.6,1010.7l-10.3,55.4l-123.3-63.7c-456-234.2-1271.6,84.2-2027.5,797c-332.8,314.3-675.8,778.5-838.1,1131.9c-199.2,435.5-223.9,836.1-67.8,1088.7l39,65.7l-127.4,24.7C3910.5,2394.4,3368.2,2406.8,3212.1,2384.2z"
|
||||
id="path6"
|
||||
style="fill:#ff0000" /><path
|
||||
d="M1948.8-2445.2C1603.7-2841.7,1047-3482.6,712.1-3868.8C151.4-4509.7,100-4575.4,100-4643.2c0-106.8,96.6-180.8,191-143.8c24.7,10.3,423.2,349.2,887.4,751.8c464.3,404.7,1082.6,942.9,1376.3,1197.6c293.7,254.7,550.5,476.6,571.1,495.1c32.9,32.9,18.5,51.4-256.8,326.6c-160.2,160.2-291.7,291.7-293.7,291.7C2575.3-1724.2,2293.9-2048.8,1948.8-2445.2z"
|
||||
id="path8"
|
||||
style="fill:#ff0000" /></g></g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/modules/localeq/img/plus.png
Normal file
BIN
src/modules/localeq/img/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 483 B |
BIN
src/modules/localeq/img/worldmap.png
Normal file
BIN
src/modules/localeq/img/worldmap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
|
@ -1,3 +1,22 @@
|
|||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2020, Adriaan de Groot <groot@kde.org>
|
||||
* Copyright 2020, Anke Boersma <demm@kaosx.us>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import io.calamares.core 1.0
|
||||
import io.calamares.ui 1.0
|
||||
|
||||
|
@ -5,35 +24,77 @@ import QtQuick 2.10
|
|||
import QtQuick.Controls 2.10
|
||||
import QtQuick.Layouts 1.3
|
||||
import org.kde.kirigami 2.7 as Kirigami
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
RowLayout
|
||||
{
|
||||
Rectangle {
|
||||
width: parent.width / 3
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: regions
|
||||
Repeater {
|
||||
model: config.regionModel
|
||||
Text {
|
||||
text: label
|
||||
}
|
||||
}
|
||||
}
|
||||
Page {
|
||||
width: 800
|
||||
height: 550
|
||||
|
||||
property var confLang: "American English"
|
||||
property var confLocale: "Nederland"
|
||||
//Needs to come from .conf/geoip
|
||||
property var hasInternet: true
|
||||
|
||||
Loader {
|
||||
id: image
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
height: parent.height / 1.28
|
||||
source: (hasInternet) ? "Map.qml" : "Offline.qml"
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width / 3
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
id: zones
|
||||
ListView {
|
||||
model: config.zonesModel
|
||||
delegate: Text {
|
||||
text: label
|
||||
|
||||
RowLayout {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin : 20
|
||||
width: parent.width
|
||||
|
||||
Kirigami.FormLayout {
|
||||
id: lang
|
||||
|
||||
GridLayout {
|
||||
anchors {
|
||||
left: parent.left
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
}
|
||||
rowSpacing: Kirigami.Units.largeSpacing
|
||||
columnSpacing: Kirigami.Units.largeSpacing
|
||||
|
||||
Kirigami.Icon {
|
||||
source: "application-x-gettext-translation"
|
||||
Layout.fillHeight: true
|
||||
Layout.maximumHeight: Kirigami.Units.iconSizes.medium
|
||||
Layout.preferredWidth: height
|
||||
}
|
||||
ColumnLayout {
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("System language set to %1").arg(confLang)
|
||||
}
|
||||
Kirigami.Separator {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
text: qsTr("Numbers and dates locale set to %1").arg(confLocale)
|
||||
}
|
||||
}
|
||||
Button {
|
||||
Layout.alignment: Qt.AlignRight|Qt.AlignVCenter
|
||||
Layout.columnSpan: 2
|
||||
text: qsTr("Change")
|
||||
//onClicked: console.log("Adjust Language clicked");
|
||||
onClicked: {
|
||||
onClicked: load.source = "i18n.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loader {
|
||||
id:load
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,47 +1,13 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file alias="images/bg.png">../locale/images/bg.png</file>
|
||||
<file alias="images/pin.png">../locale/images/pin.png</file>
|
||||
<file alias="images/timezone_0.0.png">../locale/images/timezone_0.0.png</file>
|
||||
<file alias="images/timezone_1.0.png">../locale/images/timezone_1.0.png</file>
|
||||
<file alias="images/timezone_2.0.png">../locale/images/timezone_2.0.png</file>
|
||||
<file alias="images/timezone_3.0.png">../locale/images/timezone_3.0.png</file>
|
||||
<file alias="images/timezone_3.5.png">../locale/images/timezone_3.5.png</file>
|
||||
<file alias="images/timezone_4.0.png">../locale/images/timezone_4.0.png</file>
|
||||
<file alias="images/timezone_4.5.png">../locale/images/timezone_4.5.png</file>
|
||||
<file alias="images/timezone_5.0.png">../locale/images/timezone_5.0.png</file>
|
||||
<file alias="images/timezone_5.5.png">../locale/images/timezone_5.5.png</file>
|
||||
<file alias="images/timezone_5.75.png">../locale/images/timezone_5.75.png</file>
|
||||
<file alias="images/timezone_6.0.png">../locale/images/timezone_6.0.png</file>
|
||||
<file alias="images/timezone_6.5.png">../locale/images/timezone_6.5.png</file>
|
||||
<file alias="images/timezone_7.0.png">../locale/images/timezone_7.0.png</file>
|
||||
<file alias="images/timezone_8.0.png">../locale/images/timezone_8.0.png</file>
|
||||
<file alias="images/timezone_9.0.png">../locale/images/timezone_9.0.png</file>
|
||||
<file alias="images/timezone_9.5.png">../locale/images/timezone_9.5.png</file>
|
||||
<file alias="images/timezone_10.0.png">../locale/images/timezone_10.0.png</file>
|
||||
<file alias="images/timezone_10.5.png">../locale/images/timezone_10.5.png</file>
|
||||
<file alias="images/timezone_11.0.png">../locale/images/timezone_11.0.png</file>
|
||||
<file alias="images/timezone_11.5.png">../locale/images/timezone_11.5.png</file>
|
||||
<file alias="images/timezone_12.0.png">../locale/images/timezone_12.0.png</file>
|
||||
<file alias="images/timezone_12.75.png">../locale/images/timezone_12.75.png</file>
|
||||
<file alias="images/timezone_13.0.png">../locale/images/timezone_13.0.png</file>
|
||||
<file alias="images/timezone_-1.0.png">../locale/images/timezone_-1.0.png</file>
|
||||
<file alias="images/timezone_-2.0.png">../locale/images/timezone_-2.0.png</file>
|
||||
<file alias="images/timezone_-3.0.png">../locale/images/timezone_-3.0.png</file>
|
||||
<file alias="images/timezone_-3.5.png">../locale/images/timezone_-3.5.png</file>
|
||||
<file alias="images/timezone_-4.0.png">../locale/images/timezone_-4.0.png</file>
|
||||
<file alias="images/timezone_-4.5.png">../locale/images/timezone_-4.5.png</file>
|
||||
<file alias="images/timezone_-5.0.png">../locale/images/timezone_-5.0.png</file>
|
||||
<file alias="images/timezone_-5.5.png">../locale/images/timezone_-5.5.png</file>
|
||||
<file alias="images/timezone_-6.0.png">../locale/images/timezone_-6.0.png</file>
|
||||
<file alias="images/timezone_-7.0.png">../locale/images/timezone_-7.0.png</file>
|
||||
<file alias="images/timezone_-8.0.png">../locale/images/timezone_-8.0.png</file>
|
||||
<file alias="images/timezone_-9.0.png">../locale/images/timezone_-9.0.png</file>
|
||||
<file alias="images/timezone_-9.5.png">../locale/images/timezone_-9.5.png</file>
|
||||
<file alias="images/timezone_-10.0.png">../locale/images/timezone_-10.0.png</file>
|
||||
<file alias="images/timezone_-11.0.png">../locale/images/timezone_-11.0.png</file>
|
||||
</qresource>
|
||||
<qresource>
|
||||
<file>i18n.qml</file>
|
||||
<file>localeq.qml</file>
|
||||
<file>Map.qml</file>
|
||||
<file>Offline.qml</file>
|
||||
<file>img/minus.png</file>
|
||||
<file>img/pin.svg</file>
|
||||
<file>img/plus.png</file>
|
||||
<file>img/chevron-left-solid.svg</file>
|
||||
<file>img/worldmap.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Add table
Reference in a new issue