浏览代码

fix https://trac.osgeo.org/grass/ticket/1097
(merge https://trac.osgeo.org/grass/changeset/42637 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42638 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 15 年之前
父节点
当前提交
686c75c653
共有 2 个文件被更改,包括 10 次插入18 次删除
  1. 4 2
      gui/wxpython/gui_modules/mcalc_builder.py
  2. 6 16
      gui/wxpython/wxgui.py

+ 4 - 2
gui/wxpython/gui_modules/mcalc_builder.py

@@ -38,7 +38,7 @@ class MapCalcFrame(wx.Frame):
     """!Mapcalc Frame class. Calculator-style window to create and run
     r(3).mapcalc statements
     """
-    def __init__(self, parent, cmd, id = wx.ID_ANY, title = _('Map calculator'), 
+    def __init__(self, parent, cmd, id = wx.ID_ANY,
                  style = wx.DEFAULT_FRAME_STYLE | wx.RESIZE_BORDER, **kwargs):
         self.parent = parent
         if self.parent:
@@ -51,9 +51,11 @@ class MapCalcFrame(wx.Frame):
 
         if self.cmd == 'r.mapcalc':
             self.rast3d = False
+            title = _('GRASS GIS Raster Calculator')
         if self.cmd == 'r3.mapcalc':
             self.rast3d = True
-
+            title = _('GRASS GIS 3D Raster Calculator')
+            
         wx.Frame.__init__(self, parent, id = id, title = title, **kwargs)
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         

+ 6 - 16
gui/wxpython/wxgui.py

@@ -400,10 +400,10 @@ class GMFrame(wx.Frame):
             cmdlist = cmd.split(' ')
         except: # already list?
             cmdlist = cmd
-            
+        
         # check list of dummy commands for GUI modules that do not have GRASS
         # bin modules or scripts. 
-        if cmd in ['vcolors']:
+        if cmd in ['vcolors', 'r.mapcalc', 'r3.mapcalc']:
             return cmdlist
 
         try:
@@ -412,13 +412,14 @@ class GMFrame(wx.Frame):
             type = self.curr_page.maptree.GetPyData(layer)[0]['type']
         except:
             layer = None
+
         if layer and len(cmdlist) == 1: # only if no paramaters given
             if (type == 'raster' and cmdlist[0][0] == 'r' and cmdlist[0][1] != '3') or \
                     (type == 'vector' and cmdlist[0][0] == 'v'):
                 input = menuform.GUI().GetCommandInputMapParamKey(cmdlist[0])
                 if input:
                     cmdlist.append("%s=%s" % (input, name))
-
+        
         return cmdlist
 
     def RunMenuCmd(self, event, cmd = ''):
@@ -963,22 +964,11 @@ class GMFrame(wx.Frame):
         if event:
             cmd = self.GetMenuCmd(event)
 
-        win = mapcalculator.MapCalcFrame(parent = self, title = _('GRASS GIS Map Calculator'),
-                                         cmd=cmd[0])
-        win.CentreOnScreen()
-        win.Show()
-        
-    def OnMapCalculator3D(self, event, cmd =''):
-        """!Init map calculator for interactive creation of mapcalc statements
-        """
-        if event:
-            cmd = self.GetMenuCmd(event)
-
-        win = mapcalculator.MapCalcFrame(parent = self, title = _('GRASS GIS Map Calculator (3D raster)'),
+        win = mapcalculator.MapCalcFrame(parent = self,
                                          cmd=cmd[0])
         win.CentreOnScreen()
         win.Show()
-
+    
     def OnVectorCleaning(self, event, cmd = ''):
         """!Init interactive vector cleaning
         """