From 6991d5966ad5e0a5176b00048e52c357e18fd10e Mon Sep 17 00:00:00 2001 From: Luciano Montanaro Date: Wed, 10 Aug 2011 11:12:21 +0200 Subject: [PATCH] Added Menu item to open the about page --- .../resources/harmattan/qml/StationListPage.js | 12 +++++++++++- .../resources/harmattan/qml/StationListPage.qml | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/application/resources/harmattan/qml/StationListPage.js b/application/resources/harmattan/qml/StationListPage.js index 747be56..09cbafb 100644 --- a/application/resources/harmattan/qml/StationListPage.js +++ b/application/resources/harmattan/qml/StationListPage.js @@ -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) diff --git a/application/resources/harmattan/qml/StationListPage.qml b/application/resources/harmattan/qml/StationListPage.qml index 1687c00..a8668aa 100644 --- a/application/resources/harmattan/qml/StationListPage.qml +++ b/application/resources/harmattan/qml/StationListPage.qml @@ -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 { -- 1.7.9.5