~nik90/unav/unav-convergence-part-2

« back to all changes in this revision

Viewing changes to qml/PoiListPage.qml

  • Committer: Nekhelesh Ramananthan
  • Date: 2016-04-23 20:16:12 UTC
  • Revision ID: krnekhelesh@gmail.com-20160423201612-3o83i71fviro354g
Transitioned all the POI pages

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        title: poiType
37
37
        flickable: resultsListView
38
38
 
39
 
        // #FIXME: This back button is only here to allow the user to press Escape keyboard key to go back.
40
 
        // This feature will be implemented upstream by the SDK devs when they add keyboard shortcuts to pages,
41
 
        // at which point this back button can be removed.
42
 
        leadingActionBar.actions: Action {
43
 
            iconName: "back"
44
 
            text: i18n.tr("Back")
45
 
            shortcut: "Escape"
46
 
            onTriggered: {
47
 
                mainPageStack.pop()
48
 
            }
49
 
        }
50
 
 
51
39
        trailingActionBar.actions: Action {
52
40
            id: routeAction
53
41
            iconSource: "../nav/img/header/poimap.svg"
54
42
            text: i18n.tr("Show POIs on map")
55
43
            visible: sortedPoiModel.count !== 0
56
44
            onTriggered: {
57
 
                mainPageStack.clear();
 
45
                if (mainPageStack.columns === 1)
 
46
                    mainPageStack.removePages(mainPageStack.primaryPage)
58
47
                if (mainPageStack.center_onpos === 2)
59
48
                    mainPageStack.center_onpos = 1;
60
49
                mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(sortedPoiModel.allPOI()) + ")");
124
113
        visible: false
125
114
        z: 500
126
115
        anchors {
 
116
            left: parent.left
 
117
            right: parent.right
 
118
            margins: units.gu(2)
127
119
            top: distSlider.bottom
128
120
            topMargin: units.gu (1)
129
 
            horizontalCenter: parent.horizontalCenter
130
121
        }
131
122
        iconName: "reload"
132
123
        onClicked: {
267
258
        model: sortedPoiModel
268
259
        anchors.fill: parent
269
260
        visible: false
 
261
        clip: true
270
262
 
271
263
        delegate: ListItem {
272
264
            height: poiListItemLayout.height + divider.height
275
267
                    Action {
276
268
                        iconName: "send"
277
269
                        onTriggered: {
278
 
                            mainPageStack.clear()
 
270
                            if (mainPageStack.columns === 1)
 
271
                                mainPageStack.removePages(mainPageStack.primaryPage)
279
272
                            mainPageStack.center_onpos = 2;
280
273
                            mainPageStack.routeState = 'yes'
281
274
                            mainPageStack.executeJavaScript("calc2coord("+ model.lat + "," + model.lng + ");");
291
284
                    Action {
292
285
                        iconName: "info"
293
286
                        onTriggered: {
294
 
                            mainPageStack.push(Qt.resolvedUrl("PoiDetailsPage.qml"), {osm_id: model.osm_id, osm_type: model.osm_type, poiName: model.name !== "" ? model.name : poiListPage.poiType})
 
287
                            mainPageStack.addPageToCurrentColumn(poiListPage, Qt.resolvedUrl("PoiDetailsPage.qml"), {osm_id: model.osm_id, osm_type: model.osm_type, poiName: model.name !== "" ? model.name : poiListPage.poiType})
295
288
                        }
296
289
                    }
297
290
                ]
298
291
            }
299
292
 
300
293
            onClicked: {
301
 
                mainPageStack.clear();
 
294
                if (mainPageStack.columns === 1)
 
295
                    mainPageStack.removePages(mainPageStack.primaryPage)
302
296
                if (mainPageStack.center_onpos === 2)
303
297
                    mainPageStack.center_onpos = 1;
304
298
                mainPageStack.executeJavaScript("ui.markers_POI_set([{title: \"" + model.name + "\", lat: " + model.lat + ", lng: " + model.lng + ", osm_type: '" + model.osm_type + "', osm_id: " + model.osm_id + ", phone: \"" + model.phone + "\"}])");