jan: thuban/Thuban/UI mainwindow.py,1.128.2.1,1.128.2.2
cvs@intevation.de
cvs at intevation.de
Fri Jan 21 15:03:09 CET 2005
Author: jan
Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv21185
Modified Files:
Tag: thuban-1-0-branch
mainwindow.py
Log Message:
(view_position_changed):
Backport from HEAD: Warn user about
misprojected layers when their lat/lon bounding
box exceeds rational lat/lon values.
Index: mainwindow.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/mainwindow.py,v
retrieving revision 1.128.2.1
retrieving revision 1.128.2.2
diff -u -d -r1.128.2.1 -r1.128.2.2
--- mainwindow.py 10 Jan 2005 17:08:50 -0000 1.128.2.1
+++ mainwindow.py 21 Jan 2005 14:03:07 -0000 1.128.2.2
@@ -338,6 +338,37 @@
text = "(%10.10g, %10.10g)" % pos
else:
text = ""
+ # XXX This is a hack until we find a better place for this code.
+ # (BER 20050120)
+ # BH wrote (20050120):
+ # this branch is only executed when the mouse
+ # leaves the canvas window, so it's not that often [..]
+ # [Here] not the right place to put this code.
+ # I don't have a better solution at hand,
+ # but the view_position_changed is only there to update
+ # the current position. If other information is to
+ # be shown in the status bar it should
+ # be handled in a different way and
+ # by other methods.
+ #
+ # The status bar widget supports some kind of stack of texts.
+ # maybe that can be used to distinguis
+ # between short-lived information such as the mouse position
+ # and more permanent information such as the hint
+ # about the projections.
+ map = self.canvas.Map()
+ for layer in map.layers:
+ bbox = layer.LatLongBoundingBox()
+ if bbox:
+ left, bottom, right, top = bbox
+ if not (-180 <= left <= 180 and
+ -180 <= right <= 180 and
+ -90 <= top <= 90 and
+ -90 <= bottom <= 90):
+ text = _("Select layer '%s' and pick a projection "
+ "using Layer/Projection...") % layer.title
+ break
+
self.set_position_text(text)
def set_position_text(self, text):
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)