[GRASS-SVN] r41442 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 15 08:18:25 EDT 2010
Author: martinl
Date: 2010-03-15 08:18:24 -0400 (Mon, 15 Mar 2010)
New Revision: 41442
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
bugfix #928
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py 2010-03-14 21:10:06 UTC (rev 41441)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/goutput.py 2010-03-15 12:18:24 UTC (rev 41442)
@@ -95,13 +95,13 @@
aborted = False
time.sleep(.1)
-
+
event = wxCmdDone(aborted = aborted,
returncode = returncode,
time = requestTime,
pid = requestId,
onDone = onDone)
-
+
wx.PostEvent(self.parent, event)
def abort(self):
@@ -289,17 +289,17 @@
self.Map = curr_disp.GetRender()
except:
curr_disp = None
-
+
# command given as a string ?
try:
cmdlist = command.strip().split(' ')
except:
cmdlist = command
-
+
if cmdlist[0] in globalvar.grassCmd['all']:
# send GRASS command without arguments to GUI command interface
# except display commands (they are handled differently)
- if cmdlist[0][0:2] == "d.":
+ if self.parent.GetName() == "LayerManager" and cmdlist[0][0:2] == "d.":
#
# display GRASS commands
#
@@ -319,13 +319,15 @@
'd.rhumbline' : 'rhumb',
'd.labels' : 'labels'}[cmdlist[0]]
except KeyError:
- wx.MessageBox(message=_("Command '%s' not yet implemented in the GUI. Try adding it as a command layer instead.") % cmdlist[0])
+ wx.MessageBox(caption = _("Message"),
+ message=_("Command '%s' not yet implemented in the GUI. "
+ "Try adding it as a command layer instead.") % cmdlist[0])
return None
# add layer into layer tree
- self.parent.curr_page.maptree.AddLayer(ltype=layertype,
- lcmd=cmdlist)
-
+ if self.parent.GetName() == "LayerManager":
+ self.parent.curr_page.maptree.AddLayer(ltype=layertype,
+ lcmd=cmdlist)
else:
#
# other GRASS commands (r|v|g|...)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-03-14 21:10:06 UTC (rev 41441)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-03-15 12:18:24 UTC (rev 41442)
@@ -936,13 +936,13 @@
return cmd
def OnRun(self, event):
- """Run the command"""
+ """!Run the command"""
cmd = self.createCmd()
if cmd == None or len(cmd) < 2:
return
- if cmd[0][0:2] != "d.":
+ if self.standalone or cmd[0][0:2] != "d.":
# Send any non-display command to parent window (probably wxgui.py)
# put to parents
# switch to 'Command output'
@@ -951,13 +951,13 @@
try:
self.goutput.RunCmd(cmd)
- except AttributeError,e:
+ except AttributeError, e:
print >> sys.stderr, "%s: Propably not running in wxgui.py session?" % (e)
print >> sys.stderr, "parent window is: %s" % (str(self.parent))
# Send any other command to the shell.
else:
gcmd.Command(cmd)
-
+
# update buttons status
for btn in (self.btn_run,
self.btn_cancel,
More information about the grass-commit
mailing list