[GRASS-SVN] r65606 - in grass/trunk/gui/wxpython: dbmgr vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 18 06:31:48 PDT 2015


Author: annakrat
Date: 2015-07-18 06:31:48 -0700 (Sat, 18 Jul 2015)
New Revision: 65606

Modified:
   grass/trunk/gui/wxpython/dbmgr/dialogs.py
   grass/trunk/gui/wxpython/vdigit/mapwindow.py
Log:
wxGUI/vdigit: fix attribute dialog blocking window on MacOSX with wxpython 3

Modified: grass/trunk/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/dialogs.py	2015-07-18 13:02:23 UTC (rev 65605)
+++ grass/trunk/gui/wxpython/dbmgr/dialogs.py	2015-07-18 13:31:48 UTC (rev 65606)
@@ -310,9 +310,11 @@
         elif frame.IsAutoRendered():
             frame.RemoveQueryLayer()
             self.parent.UpdateMap(render = True)
+        if self.IsModal():
+            self.EndModal(wx.ID_OK)
+        else:
+            self.Destroy()
 
-        self.Destroy()
-
     def OnSubmit(self, event):
         """Submit records"""
         layer = 1

Modified: grass/trunk/gui/wxpython/vdigit/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/mapwindow.py	2015-07-18 13:02:23 UTC (rev 65605)
+++ grass/trunk/gui/wxpython/vdigit/mapwindow.py	2015-07-18 13:31:48 UTC (rev 65606)
@@ -194,22 +194,11 @@
                     for fid in fids:
                         self._geomAttrb(fid, addRecordDlg, 'area')
                         self._geomAttrb(fid, addRecordDlg, 'perimeter')
-                
-                if addRecordDlg.IsFound() and \
-                        addRecordDlg.ShowModal() == wx.ID_OK:
-                    sqlfile = tempfile.NamedTemporaryFile(mode = "w")
-                    for sql in addRecordDlg.GetSQLString():
-                        sqlfile.file.write(sql + ";\n")
-                    sqlfile.file.flush()
-                    
-                    RunCommand('db.execute',
-                               parent = self,
-                               quiet = True, 
-                               input = sqlfile.name)
-                
-                if addRecordDlg.mapDBInfo:
-                    self._updateATM()
-        
+
+                if addRecordDlg.IsFound():
+                    addRecordDlg.ShowModal()
+                addRecordDlg.Destroy()
+
         elif self.toolbar.GetAction('type') in ["line", "boundary", "area"]:
             # add new point to the line
             self.polycoords.append(self.Pixel2Cell(event.GetPositionTuple()[:]))
@@ -945,21 +934,10 @@
                         self._geomAttrb(fid, addRecordDlg, 'area')
                         self._geomAttrb(fid, addRecordDlg, 'perimeter')
 
-                    
-                    if addRecordDlg.mapDBInfo and \
-                            addRecordDlg.ShowModal() == wx.ID_OK:
-                        sqlfile = tempfile.NamedTemporaryFile(mode = "w")
-                        for sql in addRecordDlg.GetSQLString():
-                            sqlfile.file.write(sql + ";\n")
-                        sqlfile.file.flush()
-                        RunCommand('db.execute',
-                                   parent = True,
-                                   quiet = True,
-                                   input = sqlfile.name)
-                        
-                    if addRecordDlg.mapDBInfo:
-                        self._updateATM()
-            
+                    if addRecordDlg.IsFound():
+                        addRecordDlg.ShowModal()
+                    addRecordDlg.Destroy()
+
         elif action == "deleteLine":
             # -> delete selected vector features
             if self.digit.DeleteSelectedLines() < 0:



More information about the grass-commit mailing list