disable console logging
authorFlorian Schweikert <kelvan@logic.at>
Wed, 7 Dec 2011 21:07:58 +0000 (22:07 +0100)
committerFlorian Schweikert <kelvan@logic.at>
Wed, 7 Dec 2011 21:07:58 +0000 (22:07 +0100)
added Selectionlist for stations

qml/MainPage.qml
qml/ResultRealtime.qml

index af36767..7969c75 100644 (file)
@@ -39,6 +39,32 @@ Page {
         }
     }
 
+    SelectionDialog {
+        id: stationSelector
+        titleText: 'Select nearby station'
+
+        model: ListModel {
+            id: stationSelectorModel
+
+            Component.onCompleted: {
+                var stations = itip.get_nearby_stations(positionSource.position.coordinate.latitude, positionSource.position.coordinate.longitude)
+
+                for (var idx in stations) {
+                    stationSelectorModel.append({'name': stations[idx]})
+                }
+            }
+        }
+
+        // XXX It would be nice if we could make a delegate with
+        // icons (i.e. U1, U2, ... in the right colors), but we
+        // would have to "copy" the default delegate style
+
+        onAccepted: {
+            console.log('accepted: ' + selectedIndex)
+            //gline.text = lineSelectorModel.get(selectedIndex).name
+        }
+    }
+
     TextField {
         placeholderText: 'Line'
 
index 60b2d76..c21dea5 100644 (file)
@@ -35,7 +35,7 @@ Item {
             var departures = itip.get_departures()
 
             for (var d in departures) {
-                console.log('time: ' + departures[d].time)
+                //console.log('time: ' + departures[d].time)
                 var row = {'line': departures[d].line, 'station': departures[d].station, 'destination': departures[d].direction, 'departure': departures[d].time, 'lowfloor': departures[d].lowfloor}
                 departuresModel.append(row)
             }