| 1 |
/* |
| 2 |
* Copyright (C) 2021 UBports Foundation |
| 3 |
* |
| 4 |
* This file is part of Lomiri Weather App |
| 5 |
* |
| 6 |
* Lomiri Weather App is free software: you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License version 3 as |
| 8 |
* published by the Free Software Foundation. |
| 9 |
* |
| 10 |
* Lomiri Weather App is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
import QtQuick 2.12 |
| 20 |
import Lomiri.Components 1.3 |
| 21 |
|
| 22 |
Page { |
| 23 |
id: generalPage |
| 24 |
header: PageHeader { |
| 25 |
id: header |
| 26 |
title: i18n.tr("About") |
| 27 |
} |
| 28 |
|
| 29 |
Flickable { |
| 30 |
id: generalFlickable |
| 31 |
clip: true |
| 32 |
flickableDirection: Flickable.AutoFlickIfNeeded |
| 33 |
boundsBehavior: Flickable.StopAtBounds |
| 34 |
|
| 35 |
anchors { |
| 36 |
topMargin: units.gu(2) + header.height |
| 37 |
fill: parent |
| 38 |
} |
| 39 |
|
| 40 |
contentHeight: generalColumn.childrenRect.height + units.gu(2) |
| 41 |
|
| 42 |
Column { |
| 43 |
id: generalColumn |
| 44 |
|
| 45 |
anchors { |
| 46 |
top: parent.top |
| 47 |
left: parent.left |
| 48 |
right: parent.right |
| 49 |
} |
| 50 |
|
| 51 |
Item { |
| 52 |
id: appIcon |
| 53 |
width: parent.width |
| 54 |
height: app_icon.height + units.gu(4) |
| 55 |
|
| 56 |
LomiriShape { |
| 57 |
id: app_icon |
| 58 |
|
| 59 |
width: Math.min(generalPage.width/4, 256) |
| 60 |
height: width |
| 61 |
anchors.centerIn: parent |
| 62 |
|
| 63 |
source: Image { |
| 64 |
id: icon_image |
| 65 |
source: Qt.resolvedUrl("/weather-app.svg") |
| 66 |
} |
| 67 |
radius: "medium" |
| 68 |
aspect: LomiriShape.DropShadow |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
ListItem { |
| 73 |
id: appLabel |
| 74 |
height: appLayout.height |
| 75 |
divider.visible: false |
| 76 |
ListItemLayout { |
| 77 |
id: appLayout |
| 78 |
title.text: i18n.tr("Weather app") |
| 79 |
title.font.pixelSize: units.gu(2.5) |
| 80 |
title.horizontalAlignment: Text.AlignHCenter |
| 81 |
subtitle.text: i18n.tr("Version %1").arg(Qt.application.version) |
| 82 |
subtitle.font.pixelSize: units.gu(1.75) |
| 83 |
subtitle.horizontalAlignment: Text.AlignHCenter |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
Rectangle { |
| 88 |
id: spacer1 |
| 89 |
width: parent.width |
| 90 |
height: units.gu(2) |
| 91 |
color: "transparent" |
| 92 |
} |
| 93 |
|
| 94 |
Label { |
| 95 |
id: headlineLinksLabel |
| 96 |
text: i18n.tr("Links") |
| 97 |
font.bold: true |
| 98 |
anchors { |
| 99 |
left: parent.left |
| 100 |
leftMargin: units.gu(2) |
| 101 |
} |
| 102 |
} |
| 103 |
|
| 104 |
Rectangle { |
| 105 |
id: spacer2 |
| 106 |
width: parent.width |
| 107 |
height: units.gu(1) |
| 108 |
color: "transparent" |
| 109 |
} |
| 110 |
|
| 111 |
Repeater { |
| 112 |
id: listViewGeneral |
| 113 |
|
| 114 |
model: [ |
| 115 |
{ name: i18n.tr("Get the sourcecode"), url: "https://gitlab.com/ubports/development/apps/lomiri-weather-app/" }, |
| 116 |
{ name: i18n.tr("Report issues"), url: "https://gitlab.com/ubports/development/apps/lomiri-weather-app/-/issues" }, |
| 117 |
{ name: i18n.tr("Help translate"), url: "https://hosted.weblate.org/projects/lomiri/weather-app/" }, |
| 118 |
] |
| 119 |
|
| 120 |
delegate: ListItem { |
| 121 |
divider.visible: false |
| 122 |
height: layoutAbout.height |
| 123 |
ListItemLayout { |
| 124 |
id: layoutAbout |
| 125 |
title.text : modelData.name |
| 126 |
ProgressionSlot {color: theme.palette.normal.baseText; } |
| 127 |
} |
| 128 |
onClicked: Qt.openUrlExternally(modelData.url) |
| 129 |
} |
| 130 |
} |
| 131 |
|
| 132 |
Rectangle { |
| 133 |
id: spacer3 |
| 134 |
width: parent.width |
| 135 |
height: units.gu(4) |
| 136 |
color: "transparent" |
| 137 |
} |
| 138 |
|
| 139 |
Label { |
| 140 |
id: headlineCreditsLabel |
| 141 |
text: i18n.tr("Credits") |
| 142 |
font.bold: true |
| 143 |
anchors { |
| 144 |
left: parent.left |
| 145 |
leftMargin: units.gu(2) |
| 146 |
} |
| 147 |
} |
| 148 |
|
| 149 |
Rectangle { |
| 150 |
id: spacer4 |
| 151 |
width: parent.width |
| 152 |
height: units.gu(1) |
| 153 |
color: "transparent" |
| 154 |
} |
| 155 |
|
| 156 |
Repeater { |
| 157 |
id: listViewCredits |
| 158 |
|
| 159 |
model: [ |
| 160 |
{ |
| 161 |
name: i18n.tr("Weather data by") + " open-meteo.com", |
| 162 |
// licence: i18n.tr("Licence: commercial data"), |
| 163 |
// summary: i18n.tr("Provides weather data via API"), |
| 164 |
url: "https://open-meteo.com/" |
| 165 |
}, |
| 166 |
{ |
| 167 |
name: i18n.tr("Rainradar by") + " Rainviewer.com", |
| 168 |
// licence: i18n.tr("Licence: free, depending on data source"), |
| 169 |
// summary: i18n.tr("Provides a collection of weather data from free sources"), |
| 170 |
url: "https://www.rainviewer.com/" |
| 171 |
}, |
| 172 |
{ |
| 173 |
name: i18n.tr("Coordinate lookup by") + " geoip.ubuntu.com", |
| 174 |
// licence: i18n.tr("Licence: Canonical terms and conditions"), |
| 175 |
// summary: i18n.tr("Allows to retreive coordinates for a given location name"), |
| 176 |
url: "https://wiki.ubuntu.com/mapuntu/API" |
| 177 |
}, |
| 178 |
{ |
| 179 |
name: i18n.tr("Location data lookup by") + " geonames.org", |
| 180 |
// licence: i18n.tr("Licence: CC BY 4.0"), |
| 181 |
// summary: i18n.tr("Allows to retreive administrative data e.g. country name for a given location"), |
| 182 |
url: "http://www.geonames.org/" |
| 183 |
}, |
| 184 |
{ |
| 185 |
name: i18n.tr("Sun and moon calculations by") + " suncalc.js", |
| 186 |
// licence: i18n.tr("Licence: BSD"), |
| 187 |
// summary: i18n.tr("Javascript library for calculating sun and moon related data"), |
| 188 |
url: "https://github.com/mourner/suncalc" |
| 189 |
}, |
| 190 |
{ |
| 191 |
name: i18n.tr("Timezone converting by") + " moment.js", |
| 192 |
// licence: i18n.tr("Licence: MIT"), |
| 193 |
// summary: i18n.tr("Moment with MomentTimezone is using build-in IANA timezone data"), |
| 194 |
url: "https://momentjs.com/" |
| 195 |
} |
| 196 |
] |
| 197 |
|
| 198 |
delegate: ListItem { |
| 199 |
divider.visible: false |
| 200 |
height: layoutCredits.height |
| 201 |
ListItemLayout { |
| 202 |
id: layoutCredits |
| 203 |
title.text : modelData.name |
| 204 |
ProgressionSlot {color: theme.palette.normal.baseText; } |
| 205 |
} |
| 206 |
onClicked: Qt.openUrlExternally(modelData.url) |
| 207 |
} |
| 208 |
} |
| 209 |
} |
| 210 |
} |
| 211 |
} |