[gnome-maps] routeQuery: Store the transportation type used
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] routeQuery: Store the transportation type used
- Date: Mon, 19 Jun 2017 19:53:29 +0000 (UTC)
commit bf9305bfc9c84245b874cbe158ff2a5c22953669
Author: Marcus Lundblad <ml update uu se>
Date: Sun May 28 23:33:45 2017 +0200
routeQuery: Store the transportation type used
Store the last used transportation type to gsettings and use
that when initing.
https://bugzilla.gnome.org/show_bug.cgi?id=783089
src/routeQuery.js | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/routeQuery.js b/src/routeQuery.js
index 034d123..af2c2cf 100644
--- a/src/routeQuery.js
+++ b/src/routeQuery.js
@@ -167,9 +167,16 @@ const RouteQuery = new Lang.Class({
this._time = null;
this._date = null;
this._transitOptions = new TransitOptions.TransitOptions();
+ this._initTransportation();
this.reset();
},
+ _initTransportation: function() {
+ let transportationType = Application.settings.get_enum('transportation-type');
+
+ this.transportation = transportationType;
+ },
+
addPoint: function(index) {
let point = new QueryPoint();
@@ -207,6 +214,7 @@ const RouteQuery = new Lang.Class({
},
set transportation(transportation) {
+ Application.settings.set_enum('transportation-type', transportation);
this._transportation = transportation;
this.notify('transportation');
this.notify('points');
@@ -216,7 +224,6 @@ const RouteQuery = new Lang.Class({
},
reset: function() {
- this.transportation = Transportation.CAR;
this.freeze_notify();
this._points.forEach(function(point) {
point.place = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]