[GRASS-SVN] r46471 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 31 08:04:02 EDT 2011


Author: martinl
Date: 2011-05-31 05:04:02 -0700 (Tue, 31 May 2011)
New Revision: 46471

Modified:
   grass/trunk/gui/wxpython/gui_modules/layertree.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/gui_modules/wxvdigit.py
Log:
wxGUI/vdigit: minor fixes in vector digitizer


Modified: grass/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py	2011-05-31 09:57:43 UTC (rev 46470)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py	2011-05-31 12:04:02 UTC (rev 46471)
@@ -717,7 +717,7 @@
         
         self.first = True
         params = {} # no initial options parameters
-
+        
         # deselect active item
         if self.layer_selected:
             self.SelectItem(self.layer_selected, select = False)
@@ -770,19 +770,15 @@
                                             text = '', ct_type = 1, wnd = ctrl)
         else: # add first layer to the layer tree (first child of root)
             layer = self.PrependItem(parent = self.root, text = '', ct_type = 1, wnd = ctrl)
-
+        
         # layer is initially unchecked as inactive (beside 'command')
         # use predefined value if given
         if lchecked is not None:
             checked = lchecked
         else:
             checked = True
-
+        
         self.CheckItem(layer, checked = checked)
-
-        # select new item
-        self.SelectItem(layer, select = True)
-        self.layer_selected = layer
         
         # add text and icons for each layer ltype
         label =  _('(double click to set properties)') + ' ' * 35
@@ -833,9 +829,9 @@
         elif ltype == 'group':
             self.SetItemImage(layer, self.folder)
             self.SetItemText(layer, grouptext)
-
+        
         self.first = False
-
+        
         if ltype != 'group':
             if lcmd and len(lcmd) > 1:
                 cmd = lcmd
@@ -886,7 +882,7 @@
                                          l_active = checked, l_hidden = False,
                                          l_opacity = lopacity, l_render = render)
             self.GetPyData(layer)[0]['maplayer'] = maplayer
-
+            
             # run properties dialog if no properties given
             if len(cmd) == 0:
                 self.PropertiesDialog(layer, show = True)
@@ -899,7 +895,11 @@
                                     'maplayer' : None,
                                     'propwin'  : None}, 
                                    None))
-
+        
+        # select new item
+        self.SelectItem(layer, select = True)
+        self.layer_selected = layer
+        
         # use predefined layer name if given
         if lname:
             if ltype == 'group':
@@ -1170,7 +1170,6 @@
             bgmap = UserSettings.Get(group = 'vdigit', key = 'bgmap', subkey = 'value',
                                      internal = True)
             
-        if digitToolbar:
             if digitToolbar.GetLayer() == mapLayer:
                 self._setGradient('vdigit')
             elif bgmap == mapLayer.GetName():

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-05-31 09:57:43 UTC (rev 46470)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2011-05-31 12:04:02 UTC (rev 46471)
@@ -1072,8 +1072,7 @@
         self.parent.MapWindow.mouse['box'] = 'box'
 
     def OnSelectMap (self, event):
-        """
-        Select vector map layer for editing
+        """!Select vector map layer for editing
 
         If there is a vector map layer already edited, this action is
         firstly terminated. The map layer is closed. After this the

Modified: grass/trunk/gui/wxpython/gui_modules/wxvdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxvdigit.py	2011-05-31 09:57:43 UTC (rev 46470)
+++ grass/trunk/gui/wxpython/gui_modules/wxvdigit.py	2011-05-31 12:04:02 UTC (rev 46471)
@@ -403,8 +403,8 @@
                                             'line'   : line,
                                             'offset' : offset })
         
-        Debug.msg(3, "IVDigit._addActionToChangeset(): changeset=%d, type=%d, line=%d, offset=%d",
-                  changeset, type, line, offset)
+        Debug.msg(3, "IVDigit._addActionToChangeset(): changeset=%d, add=%d, line=%d, offset=%d",
+                  changeset, add, line, offset)
         
     def _removeActionFromChangeset(self, changeset, line, add):
         """!Remove action from changeset



More information about the grass-commit mailing list