Updated qml files to reflect C++ changes
authorLuciano Montanaro <mikelima@cirulla.net>
Tue, 25 Oct 2011 23:04:10 +0000 (01:04 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:19:10 +0000 (23:19 +0100)
application/resources/harmattan/qml/StationListPage.js
application/resources/harmattan/qml/StationListPage.qml
application/resources/harmattan/qml/StationPage.qml

index 09cbafb..300d9e0 100644 (file)
@@ -19,7 +19,7 @@ function loadStation(name)
         stationListPage.stationView = view
         pageStack.push(view)
         view.html = "<h1>Loading station " + name + "</h1><p>Lorem ipsum</p>"
-        provider.stationSchedule(name)
+        view.name = name
     }
     else
         console.log('Cannot load component: ' + component.errorString());
index 3039311..479b4c9 100644 (file)
@@ -23,16 +23,6 @@ Page {
         ToolIcon { iconId: "icon-m-toolbar-settings"; onClicked: settingsSheet.open(); }
         ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
     }
-
-    DataProvider {
-        id: provider
-        onStationScheduleReady: {
-            if (Private.view !== undefined) {
-                Private.view.html = result
-                //Private.view.url = url
-            }
-        }
-    }
     PageHeader {
         id: header
         anchors.top: parent.top
index 5870548..ebc9b5f 100644 (file)
@@ -2,10 +2,12 @@ import QtQuick 1.1
 import QtWebKit 1.0
 import com.nokia.meego 1.0
 import net.cirulla.quandoparte 1.0
+import "uiconstants.js" as UiConstants
 
 Page {
-    property alias html: view.html
-    property alias url: view.url
+    property alias name: schedule.name
+    property alias html: webView.html
+    property alias url: webView.url
     anchors.fill: parent
 
     tools: ToolBarLayout {
@@ -27,6 +29,21 @@ Page {
             }
         }
     }
+    InfoBar {
+        id: info
+        anchors.top: header.bottom
+        text: parent.name
+    }
+    Rectangle {
+        id: shadow
+        width: parent.width
+        anchors.top: view.top
+        height: 5
+        gradient: Gradient {
+            GradientStop {color: "#aa000000"; position: 0.0}
+            GradientStop {color: "#00000000"; position: 1.0}
+        }
+    }
     Binding {
         target: settings
         property: "showArrivalsPreferred"
@@ -35,16 +52,30 @@ Page {
     LabelStyle {
         id: labelStyle
     }
-    WebView {
+    Item {
         id: view
         anchors {
-            top: header.bottom;
+            top: info.bottom;
             bottom: parent.bottom;
         }
         width: parent.width
 
-        settings.defaultFontSize: labelStyle.fontPixelSize
-        settings.defaultFixedFontSize: labelStyle.fontPixelSize
-        settings.standardFontFamily: labelStyle.fontFamily
+        WebView {
+            id: webView
+            visible: false
+            anchors.fill: parent
+
+            settings.defaultFontSize: labelStyle.fontPixelSize
+            settings.defaultFixedFontSize: labelStyle.fontPixelSize
+            settings.standardFontFamily: labelStyle.fontFamily
+        }
+    }
+
+    StationScheduleModel {
+        id: schedule
+    }
+
+    Component.onCompleted: {
+        schedule.fetch(name)
     }
  }