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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 3 09:03:15 EST 2012


Author: martinl
Date: 2012-01-03 06:03:15 -0800 (Tue, 03 Jan 2012)
New Revision: 50050

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py
Log:
wxGUI: don't close 'display attributes' dialog on error

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	2012-01-03 12:56:47 UTC (rev 50049)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/dbm_dialogs.py	2012-01-03 14:03:15 UTC (rev 50050)
@@ -288,6 +288,7 @@
 
     def OnSubmit(self, event):
         """!Submit records"""
+        ret = 0
         for sql in self.GetSQLString(updateValues = True):
             enc = UserSettings.Get(group = 'atm', key = 'encoding', subkey = 'value')
             if not enc and 'GRASS_DB_ENCODING' in os.environ:
@@ -295,14 +296,14 @@
             if enc:
                 sql = sql.encode(enc)
             
-            gcmd.RunCommand('db.execute',
-                            parent = self,
-                            quiet = True,
-                            stdin = sql)
+            ret += gcmd.RunCommand('db.execute',
+                                   parent = self,
+                                   quiet = True,
+                                   stdin = sql)
         
-        if self.closeDialog.IsChecked():
+        if ret == 0 and self.closeDialog.IsChecked():
             self.OnCancel(event)
-
+        
     def OnFeature(self, event):
         self.fid = int(event.GetString())
         self.UpdateDialog(cats = self.cats, fid = self.fid)



More information about the grass-commit mailing list