[GRASS-SVN] r64669 - in grass/branches/releasebranch_7_0/gui/wxpython: core mapwin
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 17 13:59:13 PST 2015
Author: annakrat
Date: 2015-02-17 13:59:13 -0800 (Tue, 17 Feb 2015)
New Revision: 64669
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/core/render.py
grass/branches/releasebranch_7_0/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 (merge from trunk, r64668)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/render.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/render.py 2015-02-17 21:55:58 UTC (rev 64668)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/render.py 2015-02-17 21:59:13 UTC (rev 64669)
@@ -262,6 +262,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/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py 2015-02-17 21:55:58 UTC (rev 64668)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py 2015-02-17 21:59:13 UTC (rev 64669)
@@ -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