From d18529fc266cf03992a35244164b73e04e505a0e Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Wed, 16 May 2012 17:23:38 +0300 Subject: [PATCH] show warning before updating exisiting shapefile (fix #5335) --- python/plugins/fTools/tools/doGeometry.py | 8 ++++++++ python/plugins/fTools/tools/doSimplify.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/python/plugins/fTools/tools/doGeometry.py b/python/plugins/fTools/tools/doGeometry.py index 12c6ffe5033..d2441541437 100644 --- a/python/plugins/fTools/tools/doGeometry.py +++ b/python/plugins/fTools/tools/doGeometry.py @@ -232,6 +232,14 @@ class GeometryDialog( QDialog, Ui_Dialog ): self.shapefileName = None self.encoding = None + res = QMessageBox.warning( self, self.tr( "Geometry"), + self.tr( "Currently QGIS doesn't allow simultaneous access from \ + different threads to the same datasource. Make sure your layer's \ + attribute tables are closed. Continue?"), + QMessageBox.Yes | QMessageBox.No ) + if res == QMessageBox.No: + return + self.buttonOk.setEnabled( False ) self.testThread = geometryThread( self.iface.mainWindow(), self, self.myFunction, vlayer, myParam, myField, self.shapefileName, self.encoding, diff --git a/python/plugins/fTools/tools/doSimplify.py b/python/plugins/fTools/tools/doSimplify.py index 276e233cdb7..025d234999c 100644 --- a/python/plugins/fTools/tools/doSimplify.py +++ b/python/plugins/fTools/tools/doSimplify.py @@ -104,6 +104,14 @@ class Dialog( QDialog, Ui_Dialog ): self.workThread = GeomThread( self.myFunction, vLayer, self.chkUseSelection.isChecked(), self.spnTolerance.value(), True, outFileName, self.encoding ) else: + res = QMessageBox.warning( self, self.tr( "Warning"), + self.tr( "Currently QGIS doesn't allow simultaneous access from \ + different threads to the same datasource. Make sure your layer's \ + attribute tables are closed. Continue?"), + QMessageBox.Yes | QMessageBox.No ) + if res == QMessageBox.No: + return + self.workThread = GeomThread( self.myFunction, vLayer, self.chkUseSelection.isChecked(), self.spnTolerance.value(), False, None, None )