[GRASS-SVN] r66952 - grass/branches/releasebranch_7_0/gui/wxpython/modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 27 16:17:38 PST 2015


Author: martinl
Date: 2015-11-27 16:17:38 -0800 (Fri, 27 Nov 2015)
New Revision: 66952

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
Log:
wxGUI/colortable: fix saving color table to file [news]
                  (merge r66951 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2015-11-28 00:14:07 UTC (rev 66951)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2015-11-28 00:17:38 UTC (rev 66952)
@@ -12,7 +12,7 @@
  - colorrules::ThematicVectorTable
  - colorrules::BufferedWindow
 
-(C) 2008, 2010-2012 by the GRASS Development Team
+(C) 2008-2015 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -598,9 +598,18 @@
     def OnSaveRulesFile(self, event):
         """Save color table to file"""
         path = event.GetString()
-        if not os.path.exists(path):
+        if not path:
             return
         
+        if os.path.exists(path):
+            dlgOw = wx.MessageDialog(parent,
+                                     message = _("File <%s> already already exists. "
+                                                 "Do you want to overwrite it?") % path,
+                                     caption = _("Overwrite?"),
+                                     style = wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
+            if dlgOw.ShowModal() != wx.ID_YES:
+                return
+        
         rulestxt = ''   
         for rule in self.rulesPanel.ruleslines.itervalues():
             if 'value' not in rule:



More information about the grass-commit mailing list