Hi Borys,<br><br>That is an excellent plugin, but I found an error and fixed for xp. The error occurs when insert a new field and click the save button in win xp. <br><br>i actually do not know how to prepare a python patch in pythonic way, but i marked my changed code between the commented blocks like  &quot;BEGIN SECTION&quot;<br>
<br>you can find more explanation in the code.<br><br>could you look at my suggestion and if it is ok for you, could you let me know when the plugin is revised in your repo?<br><br>i want to test your plugin.<br><br>regards,<br>
volkan.<br><br>  def doSave(self): # Called when appropriate button was pressed<br>    # I believe the procedure below is as much safe as it&#39;s only possible...<br><br>    ##temporary checking<br>    for i in self.fields:<br>
      for j in self.fields:<br>        if self.fields[i].name().toUpper() == self.fields[j].name().toUpper() and self.fields[i]!=self.fields[j]:<br>          QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;The names of two fields (%s and %s) are the same.\nQuantum GIS isn\&#39;t fully case-sensitive yet, so you have to type unique field names, without distinguishing lower and upper case.&#39; % (self.fields[i].name(), self.fields[j].name()))<br>
          return<br>    ##end of temporary checking<br><br>    tmpDir = QDir.tempPath()<br>    srcPath = self.provider.dataSourceUri()<br><br>    # BEGIN SECTION: PATCH #1    <br>    # without this one line code in win xp, srcName return something wrong, see below.<br>
    srcPath = srcPath.replace(&quot;\\&quot;,&quot;/&quot;)<br>    # END PATCH<br>    <br>    if srcPath.right(4).toUpper() == &#39;.SHP&#39;: # if the path points to the shp file, remove the extension...<br>      srcPath.chop(4)<br>
      srcName = srcPath.right(srcPath.size() - srcPath.lastIndexOf(&#39;/&#39;) - 1)<br>    else: # ...but if it points only to a directory, try to determine the name of the file inside!<br>      qPath = QDir(srcPath)<br>
      qPath.setNameFilters([&#39;*.shp&#39;, &#39;*.SHP&#39;])<br>      if len(qPath.entryList()) == 1: # there is exactly one shapefile inside<br>        srcName = qPath.entryList()[0]<br>        srcName.chop(4)<br>        srcPath += &#39;/&#39; + srcName <br>
      else:<br>        QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;I cannot determine the layer source file: &#39; + srcPath + &quot; !\nThe layer won&#39;t be changed, please use the Save As button.&quot;)<br>
        return<br>    <br>    # BEGIN SECTION: PATCH #2   <br>    # if one line code - srcPath = srcPath.replace(&quot;\\&quot;,&quot;/&quot;) - is NOT added, the error with msgbox is - Error creating file. Check permissions. -, because<br>
    # srcPath returns: &quot;C:\temp\noNumeric&quot;<br>    # and srcName is &quot;C:\temp\noNumeric&quot; -- that is not OK for writeToShp function<br><br>    # when this code added, now is ok, because then both variable returns:<br>
    # srcPath: &quot;C:/temp/noNumeric&quot;<br>    # srcName: &quot;noNumeric&quot;<br><br>    # these suggestions are specific to win xp, but NOT tested in linux.<br>    # END PATCH<br>    <br>    # write the layer to the temporary directory<br>
    if self.writeToShp(tmpDir+&#39;/&#39;+srcName+&#39;.shp&#39;, self.provider.encoding()) != 0:<br>      QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;Failed saving the changes to the temporary directory: &#39; + tmpDir + &quot; !\nThe layer won&#39;t be changed, please use the Save As button.&quot;)<br>
      QgsVectorFileWriter.deleteShapeFile(tmpDir+&#39;/&#39;+srcName+&#39;.shp&#39;)<br>      return<br>    # try to remove the old .dbf~ backup<br>    QFile(srcPath+&#39;.dbf~&#39;).remove()<br>    # rename the oryginal .dbf file to .dbf~<br>
    if not QFile(srcPath+&#39;.dbf&#39;).rename(srcPath+&#39;.dbf~&#39;):<br>      QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;Failed backuping the old table to &#39;+srcPath+&quot;.dbf~\nThe layer won&#39;t be changed, please use the Save As button.&quot;)<br>
      QgsVectorFileWriter.deleteShapeFile(tmpDir+&#39;/&#39;+srcName+&#39;.shp&#39;)<br>      return<br><br>    # BEGIN SECTION: PATCH #3<br>    # QFile can not overwrite for copy and rename. srcPath+&#39;.dbf&#39; file is already exist. instead of QFile, i used shutil.copy<br>
    import shutil<br>    shutil.copy(tmpDir+&#39;/&#39;+srcName+&#39;.dbf&#39;, srcPath+&#39;.dbf&#39;)<br>    QFile(srcPath+&#39;.dbf~&#39;).remove() <br>    &quot;&quot;&quot;<br>    # copy the .dbf from the temp directory to the target location<br>
    #if not QFile(tmpDir+&#39;/&#39;+srcName+&#39;.dbf&#39;).copy(srcPath+&#39;.dbf&#39;):<br>      # something went wrong. Restore the dbf~ file<br>      if not QFile(srcPath+&#39;.dbf~&#39;).rename(srcPath+&#39;.dbf&#39;):<br>
        QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;WARNING! I can neither save the new &#39;+srcPath+&#39;.dbf file\nnor restore it from the &#39;+srcPath+&#39;.dbf~ backup.\nPlease check it manually!&#39;)<br>
        return<br>      QMessageBox.warning(self, &#39;Table Manager&#39;, &#39;Failed saving the changes to &#39;+srcPath+&quot;.dbf\nThe layer will not be changed, please use the Save As button.&quot;)<br>      QgsVectorFileWriter.deleteShapeFile(tmpDir+&#39;/&#39;+srcName+&#39;.shp&#39;)<br>
      return<br>    &quot;&quot;&quot;<br>    # END PATCH<br>    <br>    # clean the temp directory<br>    QgsVectorFileWriter.deleteShapeFile(tmpDir+&#39;/&#39;+srcName+&#39;.shp&#39;)<br>    # create the new layer<br>    layerName = <a href="http://self.layer.name">self.layer.name</a>()<br>
    newLayer = QgsVectorLayer(srcPath+&#39;.shp&#39;, layerName, &#39;ogr&#39;)<br>    if not newLayer.isValid():<br>      QMessageBox.warning(self, &#39;Table Manager&#39;, &quot;WARNING! The changes seem to be commited, but I can&#39;t reload the layer!\nPlease check it out!\nThe old table is backuped as &quot;+srcName+&#39;.dbf~.&#39;)<br>
      return<br>    # copy the symbology (it&#39;s possible only if the clasyfying field was not moved nor changed!)<br>    if QMessageBox.question(self, &#39;Saving successful&#39;,&#39;Saving successful. The old table has been backuped as &#39;+srcName+&quot;.dbf~. Do you wish to keep the old symbology? Note that if the clasyfying field was moved, all objects can become invisible. In that case please adjust the symbology manually.&quot;, QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes:<br>
      newLayer.copySymbologySettings(self.layer)<br>    # reload the layer<br>    QgsMapLayerRegistry.instance().removeMapLayer(self.layer.getLayerID())<br>    QgsMapLayerRegistry.instance().addMapLayer(newLayer)<br>    # point the self.layer to the new one.<br>
    self.layer = self.iface.activeLayer()<br>    self.provider = self.layer.dataProvider()<br>    self.fields = self.provider.fields()<br>    self.butSave.setEnabled(False)<br>    self.saveCfg() # save cfg only in case of any successfull operations, not when user just play ;)<br>
    self.isUnsaved = False<br><br>