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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Oct 20 06:43:11 EDT 2011


Author: martinl
Date: 2011-10-20 03:43:10 -0700 (Thu, 20 Oct 2011)
New Revision: 48880

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py
Log:
wxGUI/vector query: don't fail when no attribute table linked to the vector map
            (merge r48878 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py	2011-10-20 10:36:56 UTC (rev 48879)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_base.py	2011-10-20 10:43:10 UTC (rev 48880)
@@ -97,7 +97,7 @@
                                  coord = (float(queryCoords[0]), float(queryCoords[1])),
                                  distance = float(qdist))
 
-        if len(data) < 1:
+        if len(data) < 1 or 'Table' not in data[0]:
             return None
         
         # process attributes
@@ -137,7 +137,7 @@
             sql = "SELECT %s FROM %s" % (cols, table)
         else:
             sql = "SELECT %s FROM %s WHERE %s" % (cols, table, where)
-
+        
         ret = gcmd.RunCommand('db.select',
                               parent = self,
                               read = True,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py	2011-10-20 10:36:56 UTC (rev 48879)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py	2011-10-20 10:43:10 UTC (rev 48880)
@@ -67,14 +67,12 @@
             label = _("Database connection "
                       "is not defined in DB file.")
 
-            wx.MessageBox(parent = self.parent,
+            gcmd.GMessage(parent = self.parent,
                           message = _("No attribute table linked to "
-                                    "vector map <%(vector)s> found. %(msg)s"
-                                    "\nYou can disable this message from digitization settings. Or "
-                                    "you can create and link attribute table to the vector map "
-                                    "using Attribute Table Manager.") % 
-                          {'vector' : self.map, 'msg' : label},
-                          caption = _("Message"), style = wx.OK | wx.ICON_EXCLAMATION | wx.CENTRE)
+                                      "vector map <%(vector)s> found. %(msg)s\n\n"
+                                      "New attribute table can be created by "
+                                      "Attribute Table Manager.") % 
+                          {'vector' : self.map, 'msg' : label})
             self.mapDBInfo = None
 
         wx.Dialog.__init__(self, parent = self.parent, id = wx.ID_ANY,



More information about the grass-commit mailing list