[GRASS-SVN] r36337 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 11 14:03:37 EDT 2009


Author: martinl
Date: 2009-03-11 14:03:36 -0400 (Wed, 11 Mar 2009)
New Revision: 36337

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: fix InsertLayers
	(merge from devbr6, r36336) 


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-03-11 17:55:39 UTC (rev 36336)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gselect.py	2009-03-11 18:03:36 UTC (rev 36337)
@@ -22,7 +22,6 @@
 
 import os
 import sys
-import copy
 
 import wx
 import wx.combo
@@ -441,11 +440,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