瀏覽代碼

v.db.connect: age: old_layer -> new_layer
(merge from devbr6, https://trac.osgeo.org/grass/changeset/34180)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34181 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父節點
當前提交
ec8610e791
共有 2 個文件被更改,包括 13 次插入6 次删除
  1. 11 5
      gui/wxpython/gui_modules/menuform.py
  2. 2 1
      vector/v.db.connect/main.c

+ 11 - 5
gui/wxpython/gui_modules/menuform.py

@@ -1190,11 +1190,17 @@ class cmdPanel(wx.Panel):
                             all = True
                         else:
                             all = False
-                        win = gselect.LayerSelect(parent=which_panel,
-                                                  all=all)
-                        p['wxGetValue'] = win.GetStringSelection
-                        win.Bind(wx.EVT_CHOICE, self.OnUpdateSelection)
-                        win.Bind(wx.EVT_CHOICE, self.OnSetValue)
+                        if p.get('age', 'old_layer') == 'old_layer':
+                            win = gselect.LayerSelect(parent=which_panel,
+                                                      all=all)
+                            p['wxGetValue'] = win.GetStringSelection
+                            win.Bind(wx.EVT_CHOICE, self.OnUpdateSelection)
+                            win.Bind(wx.EVT_CHOICE, self.OnSetValue)
+                        else:
+                            win = wx.SpinCtrl(parent=which_panel, id=wx.ID_ANY,
+                                              min=1, max=100, initial=1)
+                            win.Bind(wx.EVT_SPINCTRL, self.OnSetValue)
+
                     elif p.get('prompt', '') == 'dbdriver':
                         win = gselect.DriverSelect(parent=which_panel,
                                                    choices=p['values'],

+ 2 - 1
vector/v.db.connect/main.c

@@ -7,7 +7,7 @@
  *               
  * PURPOSE:      sets/prints DB connection for a given vector map
  *               
- * COPYRIGHT:    (C) 2002 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2002-2008 by the GRASS Development Team
  *
  *               This program is free software under the 
  *               GNU General Public License (>=v2). 
@@ -71,6 +71,7 @@ int main(int argc, char **argv)
     dbkey->description = _("Must refer to an integer column");
 
     field_opt = G_define_standard_option(G_OPT_V_FIELD);
+    field_opt->gisprompt = "new_layer,layer,layer";
 
     sep_opt = G_define_standard_option(G_OPT_F_SEP);
     sep_opt->answer = " ";