Added routing to current cursor position functionality
authorSami Rämö <sami.ramo@ixonos.com>
Wed, 1 Sep 2010 09:56:34 +0000 (12:56 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Wed, 1 Sep 2010 09:56:34 +0000 (12:56 +0300)
src/engine/engine.cpp
src/engine/engine.h
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/routingpanel.h

index 8b0ac3c..9e21ea7 100644 (file)
@@ -496,6 +496,13 @@ void SituareEngine::routeTo(const GeoCoordinate &endPointCoordinates)
         m_routingService->requestRoute(m_mapEngine->centerGeoCoordinate(), endPointCoordinates);
 }
 
+void SituareEngine::routeToCursor()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    routeTo(m_mapEngine->centerGeoCoordinate());
+}
+
 void SituareEngine::setAutoCentering(bool enabled)
 {
     qDebug() << __PRETTY_FUNCTION__ << enabled;
@@ -668,27 +675,33 @@ void SituareEngine::signalsFromMainWindow()
     connect(m_ui, SIGNAL(centerToCoordinates(GeoCoordinate)),
             m_mapEngine, SLOT(centerToCoordinates(GeoCoordinate)));
 
-    // signals from routing tab
+    // routing signal from friend list tab & search location tab
+    connect(m_ui, SIGNAL(routeTo(const GeoCoordinate&)),
+            this, SLOT(routeTo(const GeoCoordinate&)));
+
+    // signals from location search panel
     connect(m_ui,
             SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
             m_mapEngine,
             SLOT(showMapArea(const GeoCoordinate&, const GeoCoordinate&)));
 
+    // signals from routing tab
     connect(m_ui, SIGNAL(clearRoute()),
             m_mapEngine, SLOT(clearRoute()));
 
-    // signals from distence indicator button
+    connect(m_ui, SIGNAL(routeToCursor()),
+            this, SLOT(routeToCursor()));
+
+    // signals from distance indicator button
     connect(m_ui, SIGNAL(autoCenteringTriggered(bool)),
             this, SLOT(changeAutoCenteringSetting(bool)));
 
-    connect(m_ui, SIGNAL(searchForLocation(QString)),
-            this, SLOT(locationSearch(QString)));
-
     connect(m_ui, SIGNAL(draggingModeTriggered()),
             this, SLOT(draggingModeTriggered()));
 
-    connect(m_ui, SIGNAL(routeTo(const GeoCoordinate&)),
-            this, SLOT(routeTo(const GeoCoordinate&)));
+    // signal from search location dialog
+    connect(m_ui, SIGNAL(searchForLocation(QString)),
+            this, SLOT(locationSearch(QString)));
 }
 
 void SituareEngine::signalsFromMapEngine()
index 71bfc7a..422e2f1 100644 (file)
@@ -257,6 +257,11 @@ private slots:
     void routeTo(const GeoCoordinate &endPointCoordinates);
 
     /**
+    * @brief Route to current cursor position
+    */
+    void routeToCursor();
+
+    /**
     * @brief Slot for setting auto centering state.
     *
     * Calls gps to send last known position
index d67c56f..fe92ae0 100644 (file)
@@ -387,8 +387,8 @@ void MainWindow::buildRoutingPanel()
 
     m_routingPanel = new RoutingPanel(this);
 
-//    connect(m_routingPanel, SIGNAL(routeToCursor()),
-//            this, SIGNAL(routeToCursor()));
+    connect(m_routingPanel, SIGNAL(routeToCursor()),
+            this, SIGNAL(routeToCursor()));
 
     connect(this, SIGNAL(routeParsed(Route&)),
             m_routingPanel, SLOT(setRoute(Route&)));
index a89ddeb..3a2b923 100644 (file)
@@ -592,6 +592,11 @@ signals:
     void routeTo(const GeoCoordinate &coordinates);
 
     /**
+    * @brief Request routing to current cursor position
+    */
+    void routeToCursor();
+
+    /**
      * @brief Signal to save username to settings
      *
      * @param username Username
index 40d68d9..1f4d8cd 100644 (file)
@@ -93,6 +93,9 @@ signals:
     */
     void clearRoute();
 
+    /**
+    * @brief Request routing to current cursor position
+    */
     void routeToCursor();
 
     /**