Procházet zdrojové kódy

wxGUI: fix GetCmdString() (dictionary instead of tuple)
(merge https://trac.osgeo.org/grass/changeset/39502 from devbr6)


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

Martin Landa před 15 roky
rodič
revize
a24082d711
2 změnil soubory, kde provedl 17 přidání a 3 odebrání
  1. 10 3
      gui/wxpython/gui_modules/utils.py
  2. 7 0
      gui/wxpython/xml/menudata.xml

+ 10 - 3
gui/wxpython/gui_modules/utils.py

@@ -411,16 +411,23 @@ def GetCmdString(cmd):
     """
     Get GRASS command as string.
     
-    @param cmd GRASS command given as tuple
+    @param cmd GRASS command given as dictionary
     
     @return command string
     """
     scmd = ''
     if not cmd:
-        return ''
+        return scmd
+    
     scmd = cmd[0]
+    
+    if cmd[1].has_key('flags'):
+        for flag in cmd[1]['flags']:
+            scmd += ' -' + flag
     for k, v in cmd[1].iteritems():
-        scmd += ' %s=%s' % (k, v)
+        if k != 'flags':
+            scmd += ' %s=%s' % (k, v)
+    
     return scmd
 
 def CmdToTuple(cmd):

+ 7 - 0
gui/wxpython/xml/menudata.xml

@@ -2402,6 +2402,13 @@
               <handler>self.OnMenuCmd</handler>
 	      <command>i.zc</command>
 	    </menuitem>
+	    <menuitem>
+	      <label>Matrix/convolving filter</label>
+	      <help>Raster map matrix filter.</help>
+	      <keywords>raster,map algebra</keywords>
+	      <handler>self.OnMenuCmd</handler>
+	      <command>r.mfilter</command>
+	    </menuitem>
 	  </items>
 	</menu>
 	<menuitem>