[GRASS-SVN] r68049 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 12 15:15:57 PST 2016


Author: martinl
Date: 2016-03-12 15:15:57 -0800 (Sat, 12 Mar 2016)
New Revision: 68049

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI/forms: fix datasource handling in modeler (do not backport)

Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2016-03-12 18:34:10 UTC (rev 68048)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2016-03-12 23:15:57 UTC (rev 68049)
@@ -1713,18 +1713,19 @@
                     which_sizer.Add(item = self.win1, proportion = 0,
                                     flag = wx.EXPAND | wx.ALL, border = 3)
                     porf = self.task.get_param('input', element = 'name', raiseError = False)
-                    winDataSource = self.FindWindowById(porf['wxId'][0])
-                    winDataSource.reloadDataRequired.connect(lambda listData: self.win1.LoadData(listData, False))
-                    p['wxId'] = [self.win1.GetId()]
-                    def OnCheckItem(index, flag):
-                        layers = list()
-                        for layer, match, listId in self.win1.GetLayers():
-                            layers.append(layer)
-                        porf = self.task.get_param('layer', element = 'name', raiseError = False)
-                        porf['value'] = ','.join(layers)
-                        self.OnUpdateValues() # TODO: replace by signal
-                    
-                    self.win1.OnCheckItem = OnCheckItem
+                    if porf and 'wxId' in porf:
+                        winDataSource = self.FindWindowById(porf['wxId'][0])
+                        winDataSource.reloadDataRequired.connect(lambda listData: self.win1.LoadData(listData, False))
+                        p['wxId'] = [self.win1.GetId()]
+                        def OnCheckItem(index, flag):
+                            layers = list()
+                            for layer, match, listId in self.win1.GetLayers():
+                                layers.append(layer)
+                            porf = self.task.get_param('layer', element = 'name', raiseError = False)
+                            porf['value'] = ','.join(layers)
+                            self.OnUpdateValues() # TODO: replace by signal
+
+                        self.win1.OnCheckItem = OnCheckItem
                           
             if self.parent.GetName() == 'MainFrame' and (self._giface and hasattr(self._giface, "_model")):
                 parChk = wx.CheckBox(parent = which_panel, id = wx.ID_ANY,



More information about the grass-commit mailing list