[GRASS-SVN] r49005 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 30 08:25:56 EDT 2011


Author: annakrat
Date: 2011-10-30 05:25:56 -0700 (Sun, 30 Oct 2011)
New Revision: 49005

Modified:
   grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py
Log:
wxGUI:map composer - fixed #1483

Modified: grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py	2011-10-30 10:58:28 UTC (rev 49004)
+++ grass/trunk/gui/wxpython/gui_modules/psmap_dialogs.py	2011-10-30 12:25:56 UTC (rev 49005)
@@ -2602,24 +2602,31 @@
         
     def update(self):
         #draw raster
-        map = self.instruction.FindInstructionByType('map')
+        mapInstr = self.instruction.FindInstructionByType('map')
+        if not mapInstr: # no map frame
+            GMessage(message = _("Please, create map frame first."))
+            return
+            
         if self.rasterNoRadio.GetValue() or not self.rasterSelect.GetValue():
             self.rasterDict['isRaster'] = False
             self.rasterDict['raster'] = None
-            map['drawMap'] = False
+            mapInstr['drawMap'] = False
             if self.id in self.instruction:
                 del self.instruction[self.id]
 
         else:
             self.rasterDict['isRaster'] = True
             self.rasterDict['raster'] = self.rasterSelect.GetValue()
-            if self.rasterDict['raster'] != map['drawMap']:
-                map['drawMap'] = False
-            
-            if self.id not in self.instruction:
+            if self.rasterDict['raster'] != mapInstr['drawMap']:
+                mapInstr['drawMap'] = False
+
+            raster = self.instruction.FindInstructionByType('raster')
+            if not raster:
                 raster = Raster(self.id)
                 self.instruction.AddInstruction(raster)
-            self.instruction[self.id].SetInstruction(self.rasterDict)
+                self.instruction[self.id].SetInstruction(self.rasterDict)
+            else:
+                self.instruction[raster.id].SetInstruction(self.rasterDict)
             
         if 'map' in self.mainDialog.parent.openDialogs:
             self.mainDialog.parent.openDialogs['map'].updateDialog()



More information about the grass-commit mailing list