瀏覽代碼

wxGUI: fix vector support in GCP manager (https://trac.osgeo.org/grass/ticket/3066)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71678 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 年之前
父節點
當前提交
421a96d8a6
共有 1 個文件被更改,包括 13 次插入2 次删除
  1. 13 2
      gui/wxpython/gcp/manager.py

+ 13 - 2
gui/wxpython/gcp/manager.py

@@ -506,7 +506,7 @@ class GroupPage(TitledPage):
             wx.StaticText(
                 parent=self,
                 id=wx.ID_ANY,
-                label=_('Select group:')),
+                label=_('Select/create group:')),
             flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
             border=5,
             pos=(
@@ -514,7 +514,7 @@ class GroupPage(TitledPage):
                 1))
         self.cb_group = wx.ComboBox(parent=self, id=wx.ID_ANY,
                                     choices=self.groupList, size=(350, -1),
-                                    style=wx.CB_DROPDOWN | wx.CB_READONLY)
+                                    style=wx.CB_DROPDOWN)
         self.sizer.Add(self.cb_group, flag=wx.ALIGN_LEFT |
                        wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5, pos=(1, 2))
 
@@ -588,6 +588,8 @@ class GroupPage(TitledPage):
 
     def OnMkGroup(self, event):
         """Create new group in source location/mapset"""
+	if self.xygroup == '':
+	    self.xygroup = self.cb_group.GetValue()
         dlg = GroupDialog(parent=self, defaultGroup=self.xygroup)
         dlg.DisableSubgroupEdit()
         dlg.ShowModal()
@@ -603,6 +605,10 @@ class GroupPage(TitledPage):
 
     def OnVGroup(self, event):
         """Add vector maps to group"""
+	
+	if self.xygroup == '':
+	    self.xygroup = self.cb_group.GetValue()
+
         dlg = VectGroup(parent=self,
                         id=wx.ID_ANY,
                         grassdb=self.grassdatabase,
@@ -2460,6 +2466,11 @@ class VectGroup(wx.Dialog):
                 '@' +
                 self.xymapset)
 
+	dirname = os.path.dirname(self.vgrpfile)
+	
+	if not os.path.exists(dirname):
+	    os.makedirs(dirname)
+
         f = open(self.vgrpfile, mode='w')
         try:
             for vect in vgrouplist: