### Eclipse Workspace Patch 1.0 #P Release-1_0_0 Index: src/app/qgisappinterface.cpp =================================================================== --- src/app/qgisappinterface.cpp (revision 10051) +++ src/app/qgisappinterface.cpp (working copy) @@ -219,6 +219,7 @@ QAction *QgisAppInterface::actionZoomToLayer() { return qgis->actionZoomToLayer(); } QAction *QgisAppInterface::actionZoomToSelected() { return qgis->actionZoomToSelected(); } QAction *QgisAppInterface::actionZoomLast() { return qgis->actionZoomLast(); } +QAction *QgisAppInterface::actionZoomNext() { return qgis->actionZoomNext(); } QAction *QgisAppInterface::actionZoomActualSize() { return qgis->actionZoomActualSize(); } QAction *QgisAppInterface::actionViewSeparator2() { return qgis->actionViewSeparator2(); } QAction *QgisAppInterface::actionMapTips() { return qgis->actionMapTips(); } Index: src/gui/qgsmapcanvas.h =================================================================== --- src/gui/qgsmapcanvas.h (revision 10051) +++ src/gui/qgsmapcanvas.h (working copy) @@ -29,6 +29,7 @@ #include #include +#include class QWheelEvent; class QPixmap; @@ -142,6 +143,9 @@ //! Zoom to the previous extent (view) void zoomToPreviousExtent(); + //! Zoom to the Next extent (view) + void zoomToNextExtent(); + /**Zooms to the extend of the selected features*/ void zoomToSelected(); @@ -412,7 +416,8 @@ QgsMapTool* mLastNonZoomMapTool; //! recently used extent - QgsRectangle mLastExtent; + QList mLastExtent; + int mLastExtentIndex; //! Scale factor multiple for default zoom in/out double mWheelZoomFactor; Index: src/app/qgisapp.cpp =================================================================== --- src/app/qgisapp.cpp (revision 10051) +++ src/app/qgisapp.cpp (working copy) @@ -723,6 +723,10 @@ mActionZoomLast->setStatusTip( tr( "Zoom to Last Extent" ) ); connect( mActionZoomLast, SIGNAL( triggered() ), this, SLOT( zoomToPrevious() ) ); + mActionZoomNext = new QAction( getThemeIcon( "mActionZoomNext.png" ), tr( "Zoom Next" ), this ); + mActionZoomNext->setStatusTip( tr( "Zoom to Forward Extent" ) ); + connect( mActionZoomNext, SIGNAL( triggered() ), this, SLOT( zoomToNext() ) ); + mActionZoomActualSize = new QAction( tr( "Zoom Actual Size" ), this ); mActionZoomActualSize->setStatusTip( tr( "Zoom to Actual Size" ) ); connect( mActionZoomActualSize, SIGNAL( triggered() ), this, SLOT( zoomActualSize() ) ); @@ -1085,6 +1089,7 @@ mViewMenu->addAction( mActionZoomToLayer ); mViewMenu->addAction( mActionZoomToSelected ); mViewMenu->addAction( mActionZoomLast ); + mViewMenu->addAction( mActionZoomNext ); mViewMenu->addAction( mActionZoomActualSize ); mActionViewSeparator2 = mViewMenu->addSeparator(); @@ -1255,6 +1260,7 @@ mMapNavToolBar->addAction( mActionZoomToSelected ); mMapNavToolBar->addAction( mActionZoomToLayer ); mMapNavToolBar->addAction( mActionZoomLast ); + mMapNavToolBar->addAction( mActionZoomNext ); mMapNavToolBar->addAction( mActionDraw ); mToolbarMenu->addAction( mMapNavToolBar->toggleViewAction() ); // @@ -1469,6 +1475,7 @@ mActionZoomToSelected->setIcon( getThemeIcon( "/mActionZoomToSelected.png" ) ); mActionPan->setIcon( getThemeIcon( "/mActionPan.png" ) ); mActionZoomLast->setIcon( getThemeIcon( "/mActionZoomLast.png" ) ); + mActionZoomNext->setIcon( getThemeIcon( "/mActionZoomNext.png" ) ); mActionZoomToLayer->setIcon( getThemeIcon( "/mActionZoomToLayer.png" ) ); mActionIdentify->setIcon( getThemeIcon( "/mActionIdentify.png" ) ); mActionSelect->setIcon( getThemeIcon( "/mActionSelect.png" ) ); @@ -3602,6 +3609,14 @@ } +void QgisApp::zoomToNext() +{ + mMapCanvas->zoomToNextExtent(); + // notify the project we've made a change + QgsProject::instance()->dirty( true ); + +} + void QgisApp::zoomActualSize() { mMapLegend->legendLayerZoomNative(); @@ -5559,4 +5574,3 @@ return QPixmap( myDefaultPath ); } } - Index: src/app/qgisappinterface.h =================================================================== --- src/app/qgisappinterface.h (revision 10051) +++ src/app/qgisappinterface.h (working copy) @@ -178,6 +178,7 @@ virtual QAction *actionZoomToLayer(); virtual QAction *actionZoomToSelected(); virtual QAction *actionZoomLast(); + virtual QAction *actionZoomNext(); virtual QAction *actionZoomActualSize(); virtual QAction *actionViewSeparator2(); virtual QAction *actionMapTips(); Index: src/app/qgisapp.h =================================================================== --- src/app/qgisapp.h (revision 10051) +++ src/app/qgisapp.h (working copy) @@ -230,6 +230,7 @@ QAction *actionZoomToLayer() { return mActionZoomToLayer; } QAction *actionZoomToSelected() { return mActionZoomToSelected; } QAction *actionZoomLast() { return mActionZoomLast; } + QAction *actionZoomNext() { return mActionZoomNext; } QAction *actionZoomActualSize() { return mActionZoomActualSize; } QAction *actionViewSeparator2() { return mActionViewSeparator2; } QAction *actionMapTips() { return mActionMapTips; } @@ -320,6 +321,8 @@ void zoomFull(); //! Zoom to the previous extent void zoomToPrevious(); + //! Zoom to the forward extent + void zoomToNext(); //! Zoom to selected features void zoomToSelected(); @@ -689,6 +692,7 @@ QAction *mActionZoomToLayer; QAction *mActionZoomToSelected; QAction *mActionZoomLast; + QAction *mActionZoomNext; QAction *mActionZoomActualSize; QAction *mActionViewSeparator2; QAction *mActionMapTips; Index: images/themes/default/mActionZoomNext.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: images/themes/default/mActionZoomNext.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: src/gui/qgsmapcanvas.cpp =================================================================== --- src/gui/qgsmapcanvas.cpp (revision 10051) +++ src/gui/qgsmapcanvas.cpp (working copy) @@ -82,7 +82,7 @@ setScene( mScene ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - + mLastExtentIndex=-1; mCurrentLayer = NULL; mMapOverview = NULL; mMapTool = NULL; @@ -464,8 +464,17 @@ updateScale(); if ( mMapOverview ) mMapOverview->drawExtentRect(); - mLastExtent = current; + if (mLastExtent.size()>20) mLastExtent.removeAt(0); + + //clear all extent items after current index + for (int i=mLastExtent.size()-1; i>mLastExtentIndex; i--) + { + mLastExtent.removeAt(i); + } + + mLastExtent.append(extent()) ; + mLastExtentIndex=mLastExtent.size()-1; // notify canvas items of change updateCanvasItemPositions(); @@ -512,17 +521,43 @@ void QgsMapCanvas::zoomToPreviousExtent() { - if ( mDrawing ) - { - return; - } + if ( mDrawing ) + { + return; + } + + if (mLastExtentIndex>1) + { + mLastExtentIndex--; + mMapRenderer->setExtent(mLastExtent[mLastExtentIndex]); + emit extentsChanged(); + updateScale(); + if ( mMapOverview ) + mMapOverview->drawExtentRect(); + } - QgsRectangle current = extent(); - setExtent( mLastExtent ); - mLastExtent = current; refresh(); } // zoomToPreviousExtent +void QgsMapCanvas::zoomToNextExtent() +{ + if ( mDrawing ) + { + return; + } + if (mLastExtentIndexsetExtent(mLastExtent[mLastExtentIndex]); + emit extentsChanged(); + updateScale(); + if ( mMapOverview ) + mMapOverview->drawExtentRect(); + } + refresh(); +}// zoomToNextExtent + + bool QgsMapCanvas::hasCrsTransformEnabled() {