Updated qml files to reflect C++ changes
[quandoparte] / application / resources / harmattan / qml / StationPage.qml
1 import QtQuick 1.1
2 import QtWebKit 1.0
3 import com.nokia.meego 1.0
4 import net.cirulla.quandoparte 1.0
5 import "uiconstants.js" as UiConstants
6
7 Page {
8     property alias name: schedule.name
9     property alias html: webView.html
10     property alias url: webView.url
11     anchors.fill: parent
12
13     tools: ToolBarLayout {
14         id: toolBar
15         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
16         ToolIcon { iconId: "icon-m-toolbar-view-menu"; }
17     }
18     PageHeader {
19         id: header
20         anchors.top: parent.top
21         selectedIndex: settings.showArrivalsPreferred ? 1 : 0
22         options: ListModel {
23             id: dialogOptions
24             ListElement {
25                 name: QT_TR_NOOP("Departures")
26             }
27             ListElement {
28                 name: QT_TR_NOOP("Arrivals")
29             }
30         }
31     }
32     InfoBar {
33         id: info
34         anchors.top: header.bottom
35         text: parent.name
36     }
37     Rectangle {
38         id: shadow
39         width: parent.width
40         anchors.top: view.top
41         height: 5
42         gradient: Gradient {
43             GradientStop {color: "#aa000000"; position: 0.0}
44             GradientStop {color: "#00000000"; position: 1.0}
45         }
46     }
47     Binding {
48         target: settings
49         property: "showArrivalsPreferred"
50         value: header.selectedIndex === 1 ? true : false
51     }
52     LabelStyle {
53         id: labelStyle
54     }
55     Item {
56         id: view
57         anchors {
58             top: info.bottom;
59             bottom: parent.bottom;
60         }
61         width: parent.width
62
63         WebView {
64             id: webView
65             visible: false
66             anchors.fill: parent
67
68             settings.defaultFontSize: labelStyle.fontPixelSize
69             settings.defaultFixedFontSize: labelStyle.fontPixelSize
70             settings.standardFontFamily: labelStyle.fontFamily
71         }
72     }
73
74     StationScheduleModel {
75         id: schedule
76     }
77
78     Component.onCompleted: {
79         schedule.fetch(name)
80     }
81  }