[GRASS-SVN] r57899 - grass/trunk/gui/wxpython/animation
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 30 20:31:44 PDT 2013
Author: annakrat
Date: 2013-09-30 20:31:44 -0700 (Mon, 30 Sep 2013)
New Revision: 57899
Modified:
grass/trunk/gui/wxpython/animation/mapwindow.py
Log:
wxGUI/animation: add warning when rendering fails
Modified: grass/trunk/gui/wxpython/animation/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/animation/mapwindow.py 2013-09-30 22:47:24 UTC (rev 57898)
+++ grass/trunk/gui/wxpython/animation/mapwindow.py 2013-10-01 03:31:44 UTC (rev 57899)
@@ -285,7 +285,7 @@
"""!Sets size when size of related window changes."""
self.imageWidth, self.imageHeight = width, height
- def _createNoDataBitmap(self, width, height):
+ def _createNoDataBitmap(self, width, height, text="No data"):
"""!Creates 'no data' bitmap.
Used when requested bitmap is not available (loading data was not successful) or
@@ -295,7 +295,7 @@
dc = wx.MemoryDC()
dc.SelectObject(bitmap)
dc.Clear()
- text = _("No data")
+ text = _(text)
dc.SetFont(wx.Font(pointSize = 40, family = wx.FONTFAMILY_SCRIPT,
style = wx.FONTSTYLE_NORMAL, weight = wx.FONTWEIGHT_BOLD))
tw, th = dc.GetTextExtent(text)
@@ -424,7 +424,8 @@
# Unfortunately the png files must be read here,
# since the swig wx objects can not be serialized by the Queue object :(
if filename == None:
- self.bitmapPool[name_list[i]] = wx.EmptyBitmap(imageWidth, imageHeight)
+ self.bitmapPool[name_list[i]] = self._createNoDataBitmap(imageWidth, imageHeight,
+ text="Failed to render")
else:
self.bitmapPool[name_list[i]] = wx.BitmapFromImage(wx.Image(filename))
os.remove(filename)
@@ -535,6 +536,7 @@
return
if returncode != 0:
+ grass.warning("Rendering failed:\n" + messages)
fileQueue.put(None)
os.remove(filename)
return
More information about the grass-commit
mailing list