[gnome-maps/wip/mlundblad/transit-routing: 1/3] routeQuery: WIP: add support for setting time and arrival/departure



commit 69aa0949186393a7a1ce68cf36b0480aeb120369
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Mar 14 23:34:26 2016 +0100

    routeQuery: WIP: add support for setting time and arrival/departure
    
    Adds a trip time and arrival/departure parameter, indicating if the
    time means "arrive no later than the time specified" or "depart not
    before the time specified".
    This would be used for transit routing.

 src/routeQuery.js |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/src/routeQuery.js b/src/routeQuery.js
index 43e38f6..48f0d58 100644
--- a/src/routeQuery.js
+++ b/src/routeQuery.js
@@ -74,7 +74,9 @@ const RouteQuery = new Lang.Class({
     Signals: {
         'reset': { },
         'point-added': { param_types: [GObject.TYPE_OBJECT, GObject.TYPE_INT] },
-        'point-removed': { param_types: [GObject.TYPE_OBJECT, GObject.TYPE_INT] }
+        'point-removed': { param_types: [GObject.TYPE_OBJECT, GObject.TYPE_INT] },
+        'time-set': { param_types: [GObject.TYPE_BOXED] },
+        'arrive-by-set': { param_types: [GObject.TYPE_BOOLEAN]}
     },
     Properties: {
         'points': GObject.ParamSpec.object('points',
@@ -112,6 +114,26 @@ const RouteQuery = new Lang.Class({
         return this._latest;
     },
 
+    get time() {
+        return this._time;
+    },
+
+    set time(datetime) {
+        this._time = datetime;
+        this.emit('time-set', datetime);
+        this.notify('points');
+    },
+
+    get arriveBy() {
+        return this._arriveBy;
+    },
+
+    set arriveBy(arriveBy) {
+        this._arriveBy = arriveBy;
+        this.emit('arrive-by-set', arriveBy);
+        this.notify('points');
+    },
+
     _init: function(args) {
         this.parent(args);
         this._points = [];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]