|
@@ -102,7 +102,7 @@ class CmdThread(threading.Thread):
|
|
aborted = False
|
|
aborted = False
|
|
|
|
|
|
time.sleep(.1)
|
|
time.sleep(.1)
|
|
-
|
|
|
|
|
|
+
|
|
# set default color table for raster data
|
|
# set default color table for raster data
|
|
if UserSettings.Get(group='cmd', key='rasterColorTable', subkey='enabled') and \
|
|
if UserSettings.Get(group='cmd', key='rasterColorTable', subkey='enabled') and \
|
|
args[0][0][:2] == 'r.':
|
|
args[0][0][:2] == 'r.':
|
|
@@ -122,7 +122,7 @@ class CmdThread(threading.Thread):
|
|
time = requestTime,
|
|
time = requestTime,
|
|
pid = requestId,
|
|
pid = requestId,
|
|
onDone = onDone)
|
|
onDone = onDone)
|
|
-
|
|
|
|
|
|
+
|
|
# send event
|
|
# send event
|
|
wx.PostEvent(self.parent, event)
|
|
wx.PostEvent(self.parent, event)
|
|
|
|
|
|
@@ -401,7 +401,7 @@ class GMConsole(wx.SplitterWindow):
|
|
self.Map = curr_disp.GetRender()
|
|
self.Map = curr_disp.GetRender()
|
|
except:
|
|
except:
|
|
curr_disp = None
|
|
curr_disp = None
|
|
-
|
|
|
|
|
|
+
|
|
# command given as a string ?
|
|
# command given as a string ?
|
|
try:
|
|
try:
|
|
cmdlist = command.strip().split(' ')
|
|
cmdlist = command.strip().split(' ')
|
|
@@ -417,7 +417,7 @@ class GMConsole(wx.SplitterWindow):
|
|
fileHistory.write(cmdString + '\n')
|
|
fileHistory.write(cmdString + '\n')
|
|
finally:
|
|
finally:
|
|
fileHistory.close()
|
|
fileHistory.close()
|
|
-
|
|
|
|
|
|
+
|
|
# update history items
|
|
# update history items
|
|
if self.parent.GetName() == 'LayerManager':
|
|
if self.parent.GetName() == 'LayerManager':
|
|
try:
|
|
try:
|
|
@@ -428,7 +428,7 @@ class GMConsole(wx.SplitterWindow):
|
|
if cmdlist[0] in globalvar.grassCmd['all']:
|
|
if cmdlist[0] in globalvar.grassCmd['all']:
|
|
# send GRASS command without arguments to GUI command interface
|
|
# send GRASS command without arguments to GUI command interface
|
|
# except display commands (they are handled differently)
|
|
# 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
|
|
# display GRASS commands
|
|
#
|
|
#
|
|
@@ -448,7 +448,9 @@ class GMConsole(wx.SplitterWindow):
|
|
'd.rhumbline' : 'rhumb',
|
|
'd.rhumbline' : 'rhumb',
|
|
'd.labels' : 'labels'}[cmdlist[0]]
|
|
'd.labels' : 'labels'}[cmdlist[0]]
|
|
except KeyError:
|
|
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
|
|
return None
|
|
|
|
|
|
# add layer into layer tree
|
|
# add layer into layer tree
|
|
@@ -460,11 +462,12 @@ class GMConsole(wx.SplitterWindow):
|
|
layerType = 'vector')
|
|
layerType = 'vector')
|
|
else:
|
|
else:
|
|
lname = None
|
|
lname = None
|
|
-
|
|
|
|
- self.parent.curr_page.maptree.AddLayer(ltype=layertype,
|
|
|
|
- lname=lname,
|
|
|
|
- lcmd=cmdlist)
|
|
|
|
|
|
|
|
|
|
+ if self.parent.GetName() == "LayerManager":
|
|
|
|
+ self.parent.curr_page.maptree.AddLayer(ltype=layertype,
|
|
|
|
+ lname=lname,
|
|
|
|
+ lcmd=cmdlist)
|
|
|
|
+
|
|
else:
|
|
else:
|
|
#
|
|
#
|
|
# other GRASS commands (r|v|g|...)
|
|
# other GRASS commands (r|v|g|...)
|