Moved header title update to PageHeader Component
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 30 Jul 2011 22:49:04 +0000 (00:49 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:16:48 +0000 (23:16 +0100)
application/resources/harmattan/qml/PageHeader.qml
application/resources/harmattan/qml/StationListPage.qml

index 763e7c7..4aba89f 100644 (file)
@@ -59,4 +59,13 @@ Rectangle {
         id: dialog
         titleText: qsTr("Show")
     }
+    onSelectedIndexChanged: {
+        console.log("Selection changed to: " + selectedIndex)
+        if (options === undefined || options.count === 0) {
+            header.text = " "
+        } else {
+            header.text = options.get(selectedIndex).name
+            console.log("Selection text is: " + header.text)
+        }
+    }
 }
index e45f3f1..a7a3ed4 100644 (file)
@@ -46,7 +46,6 @@ Page {
     PageHeader {
         id: header
         anchors.top: parent.top
-        text: qsTr("Stations")
         selectedIndex: stationListProxyModel.sortingMode
         options: ListModel {
             id: dialogOptions
@@ -60,11 +59,6 @@ Page {
                 name: QT_TR_NOOP("Stations Recently Seen")
             }
         }
-        onSelectedIndexChanged: {
-            header.text = dialogOptions.get(selectedIndex).name
-            console.log("Selection changed to: " + selectedIndex)
-            console.log("Selection text is: " + header.text)
-        }
     }
     SearchBar {
         id: searchField