[gnome-maps] openTripPlanner: Indicate no more results found



commit 9daa6cb1c8a227f298e07a3d82c886b9b4f703d0
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 49bced8..4ca0da9 100644
--- a/src/openTripPlanner.js
+++ b/src/openTripPlanner.js
@@ -616,12 +616,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]