[QGIS-trac] [Quantum GIS] #1716: improvements to ZoomLast,
ZoomNext tools (extent history)
Quantum GIS
qgis at qgis.org
Tue May 26 21:16:37 EDT 2009
#1716: improvements to ZoomLast, ZoomNext tools (extent history)
-----------------------------------------------+----------------------------
Reporter: smizuno | Owner: nobody
Type: patch | Status: new
Priority: minor: annoyance or enhancement | Milestone:
Component: GUI | Version: HEAD
Keywords: | Platform_version:
Platform: All | Must_fix: No
Status_info: 0 |
-----------------------------------------------+----------------------------
I have found the addition of the view extent history using the
ZoomLast/ZoomNext tools to be very useful. However, because there was no
status indicated on the buttons it was not easy to tell whether there was
an extent to zoom to.
Also, I found that loading a project did not set its extent in the history
list.
I believe the extent history should be cleared when a project (new or
existing) is loaded because the map extent is set to the extent of a
project or the first layer loaded making this point the logical beginning
for the extent history.
Some people might argue that the previous view extents might be useful
with a new project or even an existing project, but I believe that it is
more likely that these extents are of little use.
Note that on program start, the map extent is set twice - once by fileNew,
then by the command-line extent processing - so there are two extents in
the history instead of one.
I provide a patch to do the following:
Improvements-
+ to make the ZoomLast and ZoomNext buttons show whether there is an
extent to zoom to (in various functions, signals are emitted to update the
button state)
+ provide a new function to clear the extent history and set the current
extent as the first item: QgsMapCanvas::clearExtentHistory()
+ clear the extent history on new project (this is mostly cosmetic as
other actions will also clear the history)
+ clear the extent history when the first layer is loaded
+ clear the extent history on project loading (the extent is set in
QgsMapRenderer, but the list of extents wasn't updated)
minor updates in QgsMapCanvas -
+ in zoomToPreviousExtent() and zoomToNextExtent(): refresh() was moved
inside the if block so that it is called only if there is a previous or
next extent (this doesn't mean much when the now disabled button won't
allow a click event in such a case, but was an unnecessary map redraw
before the button got status indication)
+ in zoomToPreviousExtent(): mLastExtentIndex was tested for >1 -- it
should be >0.
qgsmapcanvas.sip is updated for the new function and signals, so Python
can make use of them.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1716>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list