[GRASS-SVN] r66356 - in grass/branches/releasebranch_7_0/gui/wxpython: dbmgr vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 27 15:40:22 PDT 2015


Author: annakrat
Date: 2015-09-27 15:40:22 -0700 (Sun, 27 Sep 2015)
New Revision: 66356

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/vdigit/mapwindow.py
Log:
wxGUI/vdigit: fix attribute dialog blocking window on MacOSX with wxpython 3 (merge from trunk, r65606)

Modified: grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py	2015-09-27 22:12:26 UTC (rev 66355)
+++ grass/branches/releasebranch_7_0/gui/wxpython/dbmgr/dialogs.py	2015-09-27 22:40:22 UTC (rev 66356)
@@ -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/branches/releasebranch_7_0/gui/wxpython/vdigit/mapwindow.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vdigit/mapwindow.py	2015-09-27 22:12:26 UTC (rev 66355)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vdigit/mapwindow.py	2015-09-27 22:40:22 UTC (rev 66356)
@@ -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