Skip to content

Commit

Permalink
show warning before updating exisiting shapefile (fix #5335)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy authored and jef-n committed May 17, 2012
1 parent d6ea1b9 commit 52a35ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/plugins/fTools/tools/doGeometry.py
Expand Up @@ -232,6 +232,14 @@ def geometry( self, myLayer, myParam, myField ):
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,
Expand Down
8 changes: 8 additions & 0 deletions python/plugins/fTools/tools/doSimplify.py
Expand Up @@ -104,6 +104,14 @@ def accept( self ):
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 )

Expand Down

0 comments on commit 52a35ed

Please sign in to comment.