[Marble-commits] KDE/kdeedu/marble/src/lib/routing

Dennis Nienhüser earthwings at gentoo.org
Sun May 9 17:45:42 CEST 2010


SVN commit 1124595 by nienhueser:

When only two input fields (source and destination) are there, make the remove button only clear the input. Otherwise the destination point becomes the start point when removing the start point, which feels unnatural.

 M  +13 -0     RoutingInputWidget.cpp  
 M  +5 -0      RoutingInputWidget.h  
 M  +4 -0      RoutingWidget.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingInputWidget.cpp #1124594:1124595
@@ -326,6 +326,19 @@
     d->m_workOffline = offline;
 }
 
+void RoutingInputWidget::clear()
+{
+    d->m_nominatimTimer.stop();
+    d->m_progressTimer.stop();
+    d->m_pickButton->setChecked( false );
+    d->m_pickButton->setVisible( true );
+    d->m_stateButton->setVisible( false );
+    d->m_stateButton->setIcon( d->m_route->pixmap( d->m_index ) );
+    d->m_route->setPosition( d->m_index, GeoDataCoordinates() );
+    d->m_lineEdit->clear();
+    emit targetValidityChanged( false );
+}
+
 } // namespace Marble
 
 #include "RoutingInputWidget.moc"
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingInputWidget.h #1124594:1124595
@@ -75,6 +75,11 @@
       */
     void setWorkOffline( bool offline );
 
+    /**
+      * Remove target position and user input, if any
+      */
+    void clear();
+
 public Q_SLOTS:
     /**
       * Search for placemarks matching the current input text. Does nothing
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1124594:1124595
@@ -337,7 +337,11 @@
 {
     int index = d->m_inputWidgets.indexOf( widget );
     if ( index >= 0 ) {
+        if ( d->m_inputWidgets.size() < 3 ) {
+            widget->clear();
+        } else {
         d->m_routeSkeleton->remove( index );
+        }
         d->m_routingManager->updateRoute();
     }
 }


More information about the Marble-commits mailing list