From: Luciano Montanaro Date: Wed, 10 Aug 2011 09:12:21 +0000 (+0200) Subject: Added Menu item to open the about page X-Git-Tag: tags/0.4.81~67 X-Git-Url: http://git.maemo.org/git/?p=quandoparte;a=commitdiff_plain;h=6991d5966ad5e0a5176b00048e52c357e18fd10e Added Menu item to open the about page --- 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 {