Added Menu item to open the about page
authorLuciano Montanaro <mikelima@cirulla.net>
Wed, 10 Aug 2011 09:12:21 +0000 (11:12 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Tue, 27 Dec 2011 22:16:50 +0000 (23:16 +0100)
application/resources/harmattan/qml/StationListPage.js
application/resources/harmattan/qml/StationListPage.qml

index 747be56..09cbafb 100644 (file)
@@ -1,4 +1,15 @@
 var view = undefined
+var about = undefined
+
+function showAboutPage()
+{
+    var component = Qt.createComponent("AboutPage.qml")
+    if (component.status == Component.Ready) {
+        about = component.createObject(stationListPage)
+        pageStack.push(about)
+    } else
+        console.log('Cannot load component: ' + component.errorString());
+}
 
 function loadStation(name)
 {
@@ -18,7 +29,6 @@ function highlightSearch(s, color)
 {
     // TODO compile RegExp on change, or find a way to cleanly use
     // stationListProxyModel.filterRegExp
-    console.log("string:" + s + " color: " + color)
     if (searchField.text.length) {
         var r = new RegExp(searchField.text, 'i')
         var match = r.exec(s)
index 1687c00..a8668aa 100644 (file)
@@ -11,11 +11,20 @@ Page {
     Component.onCompleted: {
         stationListProxyModel.sortingMode = StationListProxyModel.AlphaSorting
     }
+    Menu {
+        id: menu
+        content: MenuLayout {
+            MenuItem {
+                text: qsTr("About Quando Parte")
+                onClicked: Private.showAboutPage()
+            }
+        }
+    }
     tools: ToolBarLayout {
         id: toolBar
         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
         ToolIcon { iconId: "icon-m-toolbar-settings"; onClicked: settingsSheet.open(); }
-        ToolIcon { iconId: "icon-m-toolbar-view-menu"; }
+        ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
     }
 
     DataProvider {