[GRASS-SVN] r67771 - in grass/branches/releasebranch_7_0/gui/wxpython: core gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 7 13:53:00 PST 2016
Author: annakrat
Date: 2016-02-07 13:53:00 -0800 (Sun, 07 Feb 2016)
New Revision: 67771
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py
grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI: fix adding layers to tree in import dialog (#2860), merge from trunk r67644, r67770
Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py 2016-02-07 21:44:24 UTC (rev 67770)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/gconsole.py 2016-02-07 21:53:00 UTC (rev 67771)
@@ -116,7 +116,7 @@
os.environ['GRASS_MESSAGE_FORMAT'] = 'gui'
while True:
requestId, args, kwds = self.requestQ.get()
- for key in ('callable', 'onDone', 'onPrepare', 'userData', 'notification'):
+ for key in ('callable', 'onDone', 'onPrepare', 'userData', 'addLayer', 'notification'):
if key in kwds:
vars()[key] = kwds[key]
del kwds[key]
@@ -202,6 +202,7 @@
pid=requestId,
onDone=vars()['onDone'],
userData=vars()['userData'],
+ addLayer=vars()['addLayer'],
notification=vars()['notification'])
# send event
@@ -424,7 +425,8 @@
self.writeError.emit(text=text)
def RunCmd(self, command, compReg=True, skipInterface=False,
- onDone=None, onPrepare=None, userData=None, notification=Notification.MAKE_VISIBLE):
+ onDone=None, onPrepare=None, userData=None, addLayer=None,
+ notification=Notification.MAKE_VISIBLE):
"""Run command typed into console command prompt (GPrompt).
.. todo::
@@ -445,6 +447,7 @@
given
:param onDone: function to be called when command is finished
:param onPrepare: function to be called before command is launched
+ :param addLayer: to be passed in the mapCreated signal
:param userData: data defined for the command
"""
if len(command) == 0:
@@ -512,7 +515,7 @@
stdout=self.cmdStdOut,
stderr=self.cmdStdErr,
onDone=onDone, onPrepare=onPrepare,
- userData=userData,
+ userData=userData, addLayer=addLayer,
env=os.environ.copy(),
notification=notification)
self.cmdOutputTimer.Start(50)
@@ -564,7 +567,7 @@
stdout=self.cmdStdOut,
stderr=self.cmdStdErr,
onDone=onDone, onPrepare=onPrepare,
- userData=userData,
+ userData=userData, addLayer=addLayer,
notification=notification)
self.cmdOutputTimer.Start(50)
@@ -670,7 +673,7 @@
if '@' not in lname:
lname += '@' + grass.gisenv()['MAPSET']
if grass.find_file(lname, element=p.get('element'))['fullname']:
- self.mapCreated.emit(name=lname, ltype=prompt)
+ self.mapCreated.emit(name=lname, ltype=prompt, add=event.addLayer)
if name == 'r.mask':
self.updateMap.emit()
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py 2016-02-07 21:44:24 UTC (rev 67770)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py 2016-02-07 21:53:00 UTC (rev 67771)
@@ -1995,7 +1995,7 @@
cmd.append('--overwrite')
# run in Layer Manager
- self._giface.RunCmd(cmd, onDone = self.OnCmdDone, userData = userData)
+ self._giface.RunCmd(cmd, onDone=self.OnCmdDone, userData=userData, addLayer=False)
def OnCmdDone(self, event):
"""Load layers and close if required"""
@@ -2165,7 +2165,7 @@
cmd.append('--overwrite')
# run in Layer Manager
- self._giface.RunCmd(cmd, onDone=self.OnCmdDone)
+ self._giface.RunCmd(cmd, onDone=self.OnCmdDone, addLayer=False)
def OnCmdDone(self, event):
"""Load layers and close if required"""
More information about the grass-commit
mailing list