[GRASS-SVN] r62114 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 27 13:06:00 PDT 2014


Author: annakrat
Date: 2014-09-27 13:06:00 -0700 (Sat, 27 Sep 2014)
New Revision: 62114

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
wxGUI: do not fail because of missing icon when running d.histogram from GUI command line

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2014-09-27 17:04:07 UTC (rev 62113)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2014-09-27 20:06:00 UTC (rev 62114)
@@ -1086,11 +1086,15 @@
             self.SetItemImage(layer, self.folder_open, CT.TreeItemIcon_Expanded)
             self.SetItemText(layer, grouptext)
         else:
-            self.SetItemImage(layer, self._icon[ltype])
-            # do not use title() - will not work with ltype == '3d-raster'
-            self.SetItemText(layer, '%s %s' % (LMIcons["layer"+ltype[0].upper()+ltype[1:]].GetLabel(),
-                                               _('(double click to set properties)') + ' ' * 15))
-            
+            if ltype in self._icon:
+                self.SetItemImage(layer, self._icon[ltype])
+                # do not use title() - will not work with ltype == '3d-raster'
+                self.SetItemText(layer, '%s %s' % (LMIcons["layer"+ltype[0].upper()+ltype[1:]].GetLabel(),
+                                                   _('(double click to set properties)') + ' ' * 15))
+            else:
+                self.SetItemImage(layer, self._icon['cmd'])
+                self.SetItemText(layer, ltype)
+
         if ltype != 'group':
             if lcmd and len(lcmd) > 1:
                 cmd = lcmd



More information about the grass-commit mailing list