Debian Codegraph @

About.qml.in

raw
1 /*
2 * About template
3 * By Joan CiberSheep using base file from uNav
4 *
5 * uNav is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * uNav 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
16 import QtQuick 2.9
17 import Lomiri.Components 1.3
18
19 import "Components"
20
21 Page {
22 id: aboutPage
23 objectName: 'aboutPage'
24
25 //Margins
26 property int marginColumn: units.gu(1)
27
28 //Properties
29 property string iconAppRute: "../assets/logo.svg"
30 property string version: "@APP_VERSION@"
31 property string license: "<a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPLv3</a>"
32 property string source: "<a href='https://gitlab.com/cibersheep/tfamanager'>Gitlab</a>"
33 property string appName: "@APP_NAME@"
34
35 header: HeaderBase {
36 id: pageHeader
37 title: i18n.tr("About")
38 flickable: aboutView
39 }
40
41 ScrollView {
42 width: parent.width
43 height: parent.height
44 contentItem: aboutView
45 }
46
47 ListView {
48 id: aboutView
49 section.property: "category"
50 section.criteria: ViewSection.FullString
51
52 section.delegate: ListItemHeader {
53 title: section
54 }
55
56 anchors {
57 fill: parent
58 topMargin: units.gu(5)
59 }
60
61 header: Column {
62 width: parent.width - units.gu(6)
63 anchors.horizontalCenter: parent.horizontalCenter
64 spacing: units.gu(3)
65
66 LomiriShape {
67 width: units.gu(20)
68 height: width
69 aspect: LomiriShape.Flat
70 anchors.horizontalCenter: parent.horizontalCenter
71
72 source: Image {
73 sourceSize.width: parent.width
74 sourceSize.height: parent.height
75 source: iconAppRute
76 }
77 }
78
79 Label {
80 width: parent.width
81 wrapMode: Text.WordWrap
82 horizontalAlignment: Text.AlignHCenter
83 text: i18n.tr(appName)
84 font.bold: true
85 }
86
87 Label {
88 width: parent.width
89 wrapMode: Text.WordWrap
90 horizontalAlignment: Text.AlignHCenter
91 text: i18n.tr("Version %1. Source %2").arg(version).arg(source)
92 onLinkActivated: Qt.openUrlExternally(link)
93 linkColor: mainColor
94 }
95
96 Label {
97 width: parent.width
98 wrapMode: Text.WordWrap
99 horizontalAlignment: Text.AlignHCenter
100 text: i18n.tr("Under License %1").arg(license)
101 onLinkActivated: Qt.openUrlExternally(link)
102 linkColor: mainColor
103 }
104
105 Label {
106 width: parent.width
107 wrapMode: Text.WordWrap
108 horizontalAlignment: Text.AlignHCenter
109 text: i18n.tr("App used %1 times. Consider donating: %2").arg(appsettins.runs).arg("<a href='https://liberapay.com/cibersheep/donate'>liberapay.com/cibersheep</a>")
110 onLinkActivated: Qt.openUrlExternally(link)
111 linkColor: mainColor
112 }
113
114 Item {
115 width: parent.width
116 height: units.gu(2)
117 }
118 }
119
120 model: aboutModel
121
122 delegate: ListItem {
123 height: storiesDelegateLayout.height
124 divider.visible: false
125 highlightColor: highlightColor
126
127 ListItemLayout {
128 id: storiesDelegateLayout
129 title.text: mainText
130 subtitle.text: secondaryText
131
132 ProgressionSlot {
133 name: link !== "" ? "next" : ""
134 }
135 }
136
137 onClicked: model.link !== "" ? Qt.openUrlExternally(model.link) : null
138 }
139
140 ListModel {
141 id: aboutModel
142
143 Component.onCompleted: initialize()
144
145 function initialize() {
146 aboutModel.append([
147 { category: i18n.tr("App Development"),
148 mainText: "Joan CiberSheep",
149 secondaryText: "",
150 link: "https://cibersheep.com/"
151 },
152
153
154 { category: i18n.tr("Translate the app"),
155 mainText: "gitlab.com",
156 secondaryText: "",
157 link: "https://gitlab.com/cibersheep/tfamanager/-/blob/master/po/tfamanager.cibersheep.pot"
158 },
159
160 { category: i18n.tr("Code Used from"),
161 mainText: "Héctor Molinero Fernández",
162 secondaryText: "OTPAuth (MIT)",
163 link: "https://gitlab.com/hectorm/otpauth"
164 },
165
166 { category: i18n.tr("Icons"),
167 mainText: i18n.tr("App Icon"),
168 secondaryText: "CC-By Evgeny Filatov",
169 link: "https://thenounproject.com/efilatov/"
170 },
171
172 { category: i18n.tr("Icons"),
173 mainText: i18n.tr("Scan Icon"),
174 secondaryText: "CC-By Tienan",
175 link: "https://thenounproject.com/zhoutienan/"
176 }
177 ])
178 }
179 }
180 }
181 }
182