[gnome-maps/wip/mlundblad/transit-no-later-alternatives: 2/3] openTripPlanner: Indicate no more results found
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/transit-no-later-alternatives: 2/3] openTripPlanner: Indicate no more results found
- Date: Wed, 22 Mar 2017 21:14:27 +0000 (UTC)
commit b2e48f1d649a8a2286374a6ca96c566f30e9de16
Author: Marcus Lundblad <ml update uu se>
Date: Wed Mar 22 22:03:14 2017 +0100
openTripPlanner: Indicate no more results found
When doing a query for later or earlier alternatives, and no more itineraries
where found, signal to the transit plan that no more results are available.
https://bugzilla.gnome.org/show_bug.cgi?id=780374
src/openTripPlanner.js | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/openTripPlanner.js b/src/openTripPlanner.js
index d73e88a..7925fd2 100644
--- a/src/openTripPlanner.js
+++ b/src/openTripPlanner.js
@@ -611,12 +611,20 @@ const OpenTripPlanner = new Lang.Class({
}).bind(this));
if (itineraries.length === 0) {
- Application.notificationManager.showMessage(_("No route found."));
/* don't reset query points, unlike for turn-based
* routing, since options and timeing might influence
* results */
- this._extendPrevious = false;
- this.plan.reset();
+ if (this._extendPrevious) {
+ let message = this._query.arriveBy ?
+ _("No earlier alternatives found.") :
+ _("No later alternatives found.");
+ Application.notificationManager.showMessage(message);
+ this._extendPrevious = false;
+ this.plan.noMoreResults();
+ } else {
+ Application.notificationManager.showMessage(_("No route found."));
+ this.plan.reset();
+ }
} else {
this._recalculateItineraries(itineraries);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]