瀏覽代碼

wxGUI: update GdalOutputDialog (pg support)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51115 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 年之前
父節點
當前提交
52f13beb2a
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      gui/wxpython/gui_core/gselect.py

+ 11 - 5
gui/wxpython/gui_core/gselect.py

@@ -1130,7 +1130,7 @@ class GdalSelect(wx.Panel):
                            'pro'    : -1,
                            'native' : -1 }
         idx = 0
-        if ogr and link:
+        if ogr and (link or dest):
             extraLabel = " (OGR)"
         else:
             extraLabel = ""
@@ -1154,7 +1154,7 @@ class GdalSelect(wx.Panel):
             sources.append(_("Protocol") + extraLabel)
             self.sourceMap['pro'] = idx
             idx += 1
-        if 'database' not in exclude and ogr and link:
+        if 'database' not in exclude and ogr and (link or dest):
             sources.append(_("PostGIS (PG)"))
             self.sourceMap['db-pg'] = idx
         
@@ -1518,10 +1518,16 @@ class GdalSelect(wx.Panel):
             self.creationOpt.Enable(False)
             self.parent.btnOk.Enable(True)
         else:
-            if not self.format.IsEnabled():
+            if not win.IsEnabled():
                 win.Enable(True)
-                self.format.Enable(True)
-                self.creationOpt.Enable(True)
+            if sel == self.sourceMap['db-pg']:
+                if self.format.IsEnabled():
+                    self.format.Enable(False)
+                    self.creationOpt.Enable(False)
+            else:
+                if not self.format.IsEnabled():
+                    self.format.Enable(True)
+                    self.creationOpt.Enable(True)
             self.dsnText.SetLabel(self.input[self.dsnType][0])
             self.format.SetItems(self.input[self.dsnType][2])
             if self.parent.GetName() == 'MultiImportDialog':