[GRASS-SVN] r41043 - in grass/branches/develbranch_6/gui/wxpython:
. xml
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 16 07:43:41 EST 2010
Author: martinl
Date: 2010-02-16 07:43:40 -0500 (Tue, 16 Feb 2010)
New Revision: 41043
Modified:
grass/branches/develbranch_6/gui/wxpython/wxgui.py
grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
Log:
wxGUI: OnXTermNoXMon introduced (#945)
(merge r41041 from relbr64)
Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py 2010-02-16 12:16:29 UTC (rev 41042)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py 2010-02-16 12:43:40 UTC (rev 41043)
@@ -934,41 +934,48 @@
self.goutput.RunCmd(cmdlist)
+ def OnXTermNoXMon(self, event):
+ """!
+ Run commands that need xterm
+ """
+ self.OnXTerm(event, need_xmon = False)
+
def OnXTerm(self, event, need_xmon = True):
- """
+ """!
Run commands that need interactive xmon
+
+ @param need_xmon True to start X monitor
"""
# unset display mode
del os.environ['GRASS_RENDER_IMMEDIATE']
-
- if(need_xmon):
+
+ if need_xmon:
# open next available xmon
xmonlist = []
-
+
# make list of xmons that are not running
ret = gcmd.RunCommand('d.mon',
flags = 'L',
read = True)
-
+
for line in ret.split('\n'):
line = line.strip()
if line.startswith('x') and 'not running' in line:
xmonlist.append(line[0:2])
-
+
# find available xmon
xmon = xmonlist[0]
-
+
# bring up the xmon
cmdlist = ['d.mon', xmon]
p = gcmd.Command(cmdlist, wait=False)
-
-
+
# run the command
command = self.GetMenuCmd(event)
command = ' '.join(command)
-
+
gisbase = os.environ['GISBASE']
-
+
if sys.platform == "win32":
runbat = os.path.join(gisbase,'etc','grass-run.bat')
cmdlist = ["cmd.exe", "/c", 'start "%s"' % runbat, command]
@@ -977,12 +984,12 @@
xtermwrapper = os.path.join(gisbase,'etc','grass-xterm-mac')
else:
xtermwrapper = os.path.join(gisbase,'etc','grass-xterm-wrapper')
-
+
grassrun = os.path.join(gisbase,'etc','grass-run.sh')
cmdlist = [xtermwrapper, '-e', grassrun, command]
-
+
p = gcmd.Command(cmdlist, wait=False)
-
+
# reset display mode
os.environ['GRASS_RENDER_IMMEDIATE'] = 'TRUE'
Modified: grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml 2010-02-16 12:16:29 UTC (rev 41042)
+++ grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml 2010-02-16 12:43:40 UTC (rev 41043)
@@ -772,7 +772,7 @@
<label>Projection for current location</label>
<help>Interactively reset the location's projection settings.</help>
<keywords>general,projection</keywords>
- <handler>self.OnXTerm</handler>
+ <handler>self.OnXTermNoXMon</handler>
<command>g.setproj</command>
</menuitem>
<separator />
@@ -2854,4 +2854,4 @@
</items>
</menu>
</menubar>
-</menudata>
\ No newline at end of file
+</menudata>
More information about the grass-commit
mailing list