[gnome-maps/wip/mlundblad/transit-routing: 27/27] 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: 27/27] printOperation: Use transit print layout when requested
- Date: Tue, 18 Oct 2016 20:12:06 +0000 (UTC)
commit eb94576ad16672b991033a68386c4d90a26a284f
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.
src/printOperation.js | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/printOperation.js b/src/printOperation.js
index 74b38b8..a81caa3 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.routeService.route;
+ let selectedTransitItinerary =
+ Application.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]