[GRASS-SVN] r58166 - grass/trunk/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 7 05:00:36 PST 2013


Author: lucadelu
Date: 2013-11-07 05:00:35 -0800 (Thu, 07 Nov 2013)
New Revision: 58166

Modified:
   grass/trunk/gui/wxpython/dbmgr/base.py
Log:
in attribute table manager if remove more columns all the names are written in the warning dialog

Modified: grass/trunk/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/base.py	2013-11-07 12:12:19 UTC (rev 58165)
+++ grass/trunk/gui/wxpython/dbmgr/base.py	2013-11-07 13:00:35 UTC (rev 58166)
@@ -2229,17 +2229,27 @@
         tlist = self.FindWindowById(self.layerPage[self.selLayer]['tableData'])
         
         item = tlist.GetFirstSelected()
-        
+        countSelected = tlist.GetSelectedItemCount()
         if UserSettings.Get(group = 'atm', key = 'askOnDeleteRec', subkey = 'enabled'):
+            # if the user select more columns to delete, all the columns name
+            # will appear the the warning dialog
+            if tlist.GetSelectedItemCount() > 1:
+                deleteColumns = "columns '%s'" % tlist.GetItemText(item)
+                while item != -1:
+                    item = tlist.GetNextSelected(item)
+                    if item != -1:
+                        deleteColumns += ", '%s'" % tlist.GetItemText(item)
+            else:
+                deleteColumns = "column '%s'" % tlist.GetItemText(item)
             deleteDialog = wx.MessageBox(parent = self,
-                                         message = _("Selected column '%s' will PERMANENTLY removed "
+                                         message = _("Selected column %s will PERMANENTLY removed "
                                                    "from table. Do you want to drop the column?") % \
-                                             (tlist.GetItemText(item)),
+                                             (deleteColumns),
                                          caption = _("Drop column(s)"),
                                          style = wx.YES_NO | wx.CENTRE)
             if deleteDialog != wx.YES:
                 return False
-        
+        item = tlist.GetFirstSelected()
         while item != -1:
             self.listOfCommands.append(('v.db.dropcolumn',
                                         { 'map' : self.dbMgrData['vectName'],



More information about the grass-commit mailing list