[GRASS-SVN] r36336 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 11 13:55:40 EDT 2009


Author: martinl
Date: 2009-03-11 13:55:39 -0400 (Wed, 11 Mar 2009)
New Revision: 36336

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: fix InsertLayers


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-03-11 11:18:04 UTC (rev 36335)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py	2009-03-11 17:55:39 UTC (rev 36336)
@@ -22,7 +22,6 @@
 
 import os
 import sys
-import copy
 
 import wx
 import wx.combo
@@ -431,11 +430,15 @@
         
     def InsertLayers(self, vector):
         """Insert layers for a vector into the layer combobox"""
-        layerchoices = []
-        if self.initial:
-            layerchoices = copy.copy(self.initial)
-        layerchoices += utils.GetVectorNumberOfLayers(vector)
+        layerchoices = utils.GetVectorNumberOfLayers(vector)
+        for layer in self.initial:
+            if layer in layerchoices:
+                continue
+            layerchoices.append(layer)
         
+        # sort list of available layers
+        utils.ListSortLower(layerchoices)
+        
         if len(layerchoices) > 1:
             self.SetItems(layerchoices)
             self.SetStringSelection('1')



More information about the grass-commit mailing list