summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveSummary.qml
blob: e827d4f4255b389e3f44a8032b2971ff690a58b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.3
import org.subsurfacedivelog.mobile 1.0
import org.kde.kirigami 2.4 as Kirigami

Kirigami.ScrollablePage {
	id: summary
	property string firstDive: ""
	property string lastDive: ""

	background: Rectangle { color: subsurfaceTheme.backgroundColor }
	title: qsTr("Dive summary")

	onVisibleChanged: {
		if (visible)
			Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
	}
	Connections {
		target: Backend
		onLengthChanged: {
			Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
		}
		onVolumeChanged: {
			Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
		}
	}


	GridLayout {
		columns: 3
		width: parent.width
		columnSpacing: Kirigami.Units.smallSpacing
		rowSpacing: Kirigami.Units.smallSpacing

		ListModel {
			id: monthModel
			ListElement {text: qsTr("Total")}
			ListElement {text: qsTr(" 1 month [ 30 days]")}
			ListElement {text: qsTr(" 2 month [ 60 days]")}
			ListElement {text: qsTr(" 3 month [ 90 days]")}
			ListElement {text: qsTr(" 4 month [120 days]")}
			ListElement {text: qsTr(" 5 month [150 days]")}
			ListElement {text: qsTr(" 6 month [180 days]")}
			ListElement {text: qsTr(" 7 month [210 days]")}
			ListElement {text: qsTr(" 8 month [240 days]")}
			ListElement {text: qsTr(" 9 month [270 days]")}
			ListElement {text: qsTr("10 month [300 days]")}
			ListElement {text: qsTr("11 month [330 days]")}
			ListElement {text: qsTr("12 month [360 days]")}
		}

		TemplateLabel {
			text: qsTr("oldest/newest dive")
			font.bold: true
		}
		TemplateLabel {
			text: summary.firstDive
		}
		TemplateLabel {
			text: summary.lastDive
		}

		TemplateLabel {
			Layout.columnSpan: 3
		}

		TemplateLabel {
			text: ""
		}
		TemplateComboBox {
			id: selectionPrimary
			editable: false
			currentIndex: 0
			model: monthModel
			onActivated:  {
				Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
			}
		}
		TemplateComboBox {
			id: selectionSecondary
			editable: false
			currentIndex: 3
			model: monthModel
			onActivated:  {
				Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
			}
		}
		TemplateLabel {
			text: qsTr("dives")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[2]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[3]
		}
		TemplateLabel {
			text: qsTr("- EANx")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[4]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[5]
		}
		TemplateLabel {
			text: qsTr("- depth > 39m")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[6]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[7]
		}

		TemplateLabel {
			Layout.columnSpan: 3
		}

		TemplateLabel {
			text: qsTr("dive time")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[8]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[9]
		}
		TemplateLabel {
			text: qsTr("max dive time")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[10]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[11]
		}
		TemplateLabel {
			text: qsTr("avg. dive time")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[12]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[13]
		}

		TemplateLabel {
			Layout.columnSpan: 3
		}

		TemplateLabel {
			text: qsTr("max depth")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[14]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[15]
		}
		TemplateLabel {
			text: qsTr("avg. max depth")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[16]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[17]
		}

		TemplateLabel {
			Layout.columnSpan: 3
		}

		TemplateLabel {
			text: qsTr("min. SAC")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[18]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[19]
		}
		TemplateLabel {
			text: qsTr("max. SAC")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[20]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[21]
		}
		TemplateLabel {
			text: qsTr("avg. SAC")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[22]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[23]
		}

		TemplateLabel {
			Layout.columnSpan: 3
		}

		TemplateLabel {
			text: qsTr("dive plan(s)")
			font.bold: true
		}
		TemplateLabel {
			text: Backend.diveSummaryText[24]
		}
		TemplateLabel {
			text: Backend.diveSummaryText[25]
		}

	}
}