Explorar o código

wxGUI/wxpsmap bug https://trac.osgeo.org/grass/ticket/1531 fixed (again)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50113 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová %!s(int64=13) %!d(string=hai) anos
pai
achega
0d3b0d1b5c
Modificáronse 1 ficheiros con 11 adicións e 8 borrados
  1. 11 8
      gui/wxpython/psmap/dialogs.py

+ 11 - 8
gui/wxpython/psmap/dialogs.py

@@ -2925,9 +2925,11 @@ class VectorPanel(wx.Panel):
         self.select = Select(self, id = wx.ID_ANY,# size = globalvar.DIALOG_GSELECT_SIZE,
                              type = 'vector', multiple = False,
                              updateOnPopup = True, onPopup = None)
-        topologyType = [_("points"), _("lines"), _("areas")]
-        self.vectorType = wx.RadioBox(self, id = wx.ID_ANY, label = " %s " % _("Data Type"), choices = topologyType,
-                                        majorDimension = 3, style = wx.RA_SPECIFY_COLS)
+        topologyTypeTr = [_("points"), _("lines"), _("areas")]
+        self.topologyTypeList = ["points", "lines", "areas"]
+        self.vectorType = wx.RadioBox(self, id = wx.ID_ANY, label = " %s " % _("Data Type"), choices = topologyTypeTr,
+                                      majorDimension = 3, style = wx.RA_SPECIFY_COLS)
+            
         self.AddVector = wx.Button(self, id = wx.ID_ANY, label = _("Add"))
         
         gridBagSizer.Add(text, pos = (0,0), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)
@@ -3008,16 +3010,17 @@ class VectorPanel(wx.Panel):
                 mapset = '(' + vmap.split('@')[1] + ')'
             except IndexError:
                 mapset = ''
-            type = self.vectorType.GetStringSelection()
-            record = "%s - %s" % (vmap,type)
+            idx = self.vectorType.GetSelection()
+            ttype = self.topologyTypeList[idx]
+            record = "%s - %s" % (vmap, ttype)
             id = wx.NewId()
             lpos = 1
             label = mapname + mapset 
-            self.vectorList.insert(0, [vmap, type, id, lpos, label])
+            self.vectorList.insert(0, [vmap, ttype, id, lpos, label])
             self.reposition()
             self.listbox.InsertItems([record], 0)
             
-            vector = VProperties(id, type)
+            vector = VProperties(id, ttype)
             self.tmpDialogDict[id] = vector.GetInstruction()
             self.tmpDialogDict[id]['name'] = vmap
 
@@ -3224,7 +3227,7 @@ class VPropertiesDialog(PsmapDialog):
             if id == item[2]:
                 self.vectorName = item[0]
                 self.type = item[1]
-        self.SetTitle(self.vectorName + " "+ _("properties"))
+        self.SetTitle(_("%s properties") % self.vectorName)
         
         #vector map info
         self.connection = True