[gnome-maps/wip/mlundblad/transit-routing: 21/33] application: Add a function to switch to/from transit route mode
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/transit-routing: 21/33] application: Add a function to switch to/from transit route mode
- Date: Tue, 29 Nov 2016 22:47:33 +0000 (UTC)
commit c44ca5d554c520907832b8fea5f3188bfafcf761
Author: Marcus Lundblad <ml update uu se>
Date: Thu Nov 17 22:29:51 2016 +0100
application: Add a function to switch to/from transit route mode
Add a utility function in the Application module to switch routing
"engine", so that modules such as the sidebar won't have to handle
it themselves.
https://bugzilla.gnome.org/show_bug.cgi?id=755808
src/application.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 3fc8550..a6e4008 100644
--- a/src/application.js
+++ b/src/application.js
@@ -60,10 +60,25 @@ let openTripPlanner = null;
let osmEdit = null;
let normalStartup = true;
let routeQuery = null;
+let transitRoutingEnabled = false;
const _ensuredTypes = [WebKit2.WebView,
OSMTypeSearchEntry.OSMTypeSearchEntry];
+function setTransitRouting(enabled) {
+ if (enabled !== transitRoutingEnabled) {
+ if (enabled) {
+ routeService.disconnect();
+ openTripPlanner.connect();
+ } else {
+ openTripPlanner.disconnect();
+ routeService.connect();
+ }
+
+ transitRoutingEnabled = enabled;
+ }
+}
+
const Application = new Lang.Class({
Name: 'Application',
Extends: Gtk.Application,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]