[Marble-commits] KDE/kdeedu/marble/src/lib/routing
Dennis Nienhüser
earthwings at gentoo.org
Wed Apr 14 21:42:35 CEST 2010
SVN commit 1114871 by nienhueser:
Limit route interaction to the left mouse button. Fixes interferences with zooming and context menu. Fix missing map repaint after adding points. Only adjust the viewport (map zoom/center position) when retrieving new routes (user clicked on Get Directions button), but not when editing the route in the map. The latter is annoying when fine-tuning routes in the map.
CCMAIL: arnd.baecker at web.de
M +8 -0 RoutingLayer.cpp
M +7 -2 RoutingWidget.cpp
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingLayer.cpp #1114870:1114871
@@ -240,6 +240,10 @@
bool RoutingLayerPrivate::handleMouseButtonPress(QMouseEvent* e)
{
+ if (e->button() != Qt::LeftButton) {
+ return false;
+ }
+
if (m_pointSelection) {
return true;
}
@@ -282,6 +286,10 @@
bool RoutingLayerPrivate::handleMouseButtonRelease(QMouseEvent* e)
{
+ if (e->button() != Qt::LeftButton) {
+ return false;
+ }
+
if (m_pointSelection) {
qreal lon(0.0), lat(0.0);
if (m_marbleWidget->geoCoordinates(e->pos().x(), e->pos().y(),
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1114870:1114871
@@ -51,6 +51,8 @@
RouteSkeleton* m_routeSkeleton;
+ bool m_zoomRouteAfterDownload;
+
/** Constructor */
RoutingWidgetPrivate();
@@ -74,7 +76,7 @@
RoutingWidgetPrivate::RoutingWidgetPrivate() :
m_widget(0), m_routingManager(0), m_routingLayer(0),
m_activeInput(0), m_inputRequest(0), m_routingProxyModel(0),
- m_routeSkeleton(0)
+ m_routeSkeleton(0), m_zoomRouteAfterDownload(false)
{
// nothing to do
}
@@ -218,6 +220,7 @@
d->m_activeInput = 0;
if (d->m_routeSkeleton->size() > 1) {
+ d->m_zoomRouteAfterDownload = true;
d->m_routingLayer->setModel( d->m_routingManager->routingModel() );
d->m_routingManager->retrieveRoute(d->m_routeSkeleton);
d->m_ui.directionsListView->setModel(d->m_routingProxyModel);
@@ -334,7 +337,8 @@
{
Q_UNUSED(route);
- if (state == RoutingManager::Retrieved) {
+ if (d->m_zoomRouteAfterDownload && state == RoutingManager::Retrieved) {
+ d->m_zoomRouteAfterDownload = false;
// Parts of the route may lie outside the route trip points
GeoDataLineString bbox;
for (int i=0; i<d->m_routingManager->routingModel()->rowCount(); ++i) {
@@ -378,6 +382,7 @@
if (d->m_inputRequest && d->m_inputWidgets.contains(d->m_inputRequest)) {
d->m_inputRequest->setTargetPosition(coordinates);
d->m_inputRequest = 0;
+ d->m_widget->update();
}
d->m_routingLayer->setPointSelectionEnabled(false);
More information about the Marble-commits
mailing list