[GRASS-SVN] r64668 - in grass/trunk/gui/wxpython: core mapwin

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 17 13:55:58 PST 2015


Author: annakrat
Date: 2015-02-17 13:55:58 -0800 (Tue, 17 Feb 2015)
New Revision: 64668

Modified:
   grass/trunk/gui/wxpython/core/render.py
   grass/trunk/gui/wxpython/mapwin/decorations.py
Log:
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

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2015-02-17 21:01:42 UTC (rev 64667)
+++ grass/trunk/gui/wxpython/core/render.py	2015-02-17 21:55:58 UTC (rev 64668)
@@ -264,6 +264,12 @@
         """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']:

Modified: grass/trunk/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/decorations.py	2015-02-17 21:01:42 UTC (rev 64667)
+++ grass/trunk/gui/wxpython/mapwin/decorations.py	2015-02-17 21:55:58 UTC (rev 64668)
@@ -18,6 +18,7 @@
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 
+import os
 from core.utils import _
 
 import wx
@@ -56,6 +57,8 @@
         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 @@
     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
 



More information about the grass-commit mailing list