/
DublinWheels.qml
48 lines (38 loc) · 968 Bytes
/
DublinWheels.qml
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
import QtQuick 2.0
import Ubuntu.Components 1.2
import U1db 1.0 as U1db
import "ui"
MainView {
id: mainView
applicationName: "org.thecosmicfrog.dublinwheels"
property string version: "0.16"
//automaticOrientation: true
width: units.gu(45)
height: units.gu(78)
function getLastStationIndex(lastStation, stationsModel) {
for (var i = 0; i < stationsModel.count; i++) {
if (lastStation === stationsModel.get(i).name)
return i;
}
return 0;
}
// U1DB backend to record the last-picked station. Makes it faster for users to get information for their usual station.
U1db.Database {
id: db;
path: "dublinwheels.u1db"
}
U1db.Document {
id: lastStation
database: db
docId: "lastStation"
create: true
defaults: {
stationName: ""
}
}
MainPage {
}
ApiKeys {
id: apiKeys
}
}