[gnome-maps/wip/mlundblad/transit-routing: 32/32] printOperation: Use transit print layout when requested
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/transit-routing: 32/32] printOperation: Use transit print layout when requested
- Date: Tue, 14 Feb 2017 21:14:49 +0000 (UTC)
commit b86cde93c14779c893d39ad555fb62b12ecc3358
Author: Marcus Lundblad <ml update uu se>
Date: Tue Sep 20 23:56:19 2016 +0200
printOperation: Use transit print layout when requested
Use the transit print layout when a transit itinerary was selected.
https://bugzilla.gnome.org/show_bug.cgi?id=755808
src/printOperation.js | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/printOperation.js b/src/printOperation.js
index e90c158..5d8e49a 100644
--- a/src/printOperation.js
+++ b/src/printOperation.js
@@ -23,6 +23,7 @@ const Mainloop = imports.mainloop;
const Application = imports.application;
const PrintLayout = imports.printLayout;
+const TransitPrintLayout = imports.transitPrintLayout;
const Utils = imports.utils;
const _MIN_TIME_TO_ABORT = 3000;
@@ -57,6 +58,8 @@ const PrintOperation = new Lang.Class({
_beginPrint: function(operation, context, data) {
let route = Application.routingDelegator.graphHopper.route;
+ let selectedTransitItinerary =
+ Application.routingDelegator.openTripPlanner.plan.selectedItinerary;
let width = context.get_width();
let height = context.get_height();
@@ -67,7 +70,14 @@ const PrintOperation = new Lang.Class({
return false;
}).bind(this), null);
- this._layout = PrintLayout.newFromRoute(route, width, height);
+ if (selectedTransitItinerary) {
+ this._layout =
+ new TransitPrintLayout.TransitPrintLayout({ itinerary: selectedTransitItinerary,
+ pageWidth: width,
+ pageHeight: height });
+ } else {
+ this._layout = PrintLayout.newFromRoute(route, width, height);
+ }
this._layout.render();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]