فهرست منبع

wxGUI/legend: small improvements of its behavior; at param when used in command line is respected now, IsShown now reports False when the rendering failed

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64668 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 سال پیش
والد
کامیت
c96bd21439
2فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 6 0
      gui/wxpython/core/render.py
  2. 4 1
      gui/wxpython/mapwin/decorations.py

+ 6 - 0
gui/wxpython/core/render.py

@@ -264,6 +264,12 @@ class Layer(object):
         """Check if layer is hidden"""
         return self.hidden
 
+    def IsRendered(self):
+        """!Check if layer was rendered (if the image file exists)"""
+        if os.path.exists(self.mapfile):
+            return True
+        return False
+
     def SetType(self, ltype):
         """Set layer type"""
         if ltype not in utils.command2ltype.values() + ['overlay', 'command']:

+ 4 - 1
gui/wxpython/mapwin/decorations.py

@@ -18,6 +18,7 @@ This program is free software under the GNU General Public License
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 
+import os
 from core.utils import _
 
 import wx
@@ -56,6 +57,8 @@ class OverlayController(object):
         for i in cmd:
             if i.startswith("at="):
                 hasAt = True
+                # reset coordinates, 'at' values will be used, see GetCoords
+                self._coords = None
                 break
         if not hasAt:
             cmd.append(self._defaultAt)
@@ -114,7 +117,7 @@ class OverlayController(object):
     dialog = property(fget=GetDialog, fset=SetDialog)
 
     def IsShown(self):
-        if self._overlay and self._overlay.IsActive():
+        if self._overlay and self._overlay.IsActive() and self._overlay.IsRendered():
             return True
         return False