[GRASS-SVN] r57989 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 13 13:47:05 PDT 2013


Author: martinl
Date: 2013-10-13 13:47:05 -0700 (Sun, 13 Oct 2013)
New Revision: 57989

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
Log:
wxGUI/forms: fix dialogs with more 'save as' buttons (like r.colors)


Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2013-10-13 20:32:19 UTC (rev 57988)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2013-10-13 20:47:05 UTC (rev 57989)
@@ -1500,7 +1500,7 @@
                         
                         btnLoad = wx.Button(parent = which_panel, id = wx.ID_ANY, label = _("&Load"))
                         btnLoad.Bind(wx.EVT_BUTTON, self.OnFileLoad)
-                        btnSave = wx.Button(parent = which_panel, id = wx.ID_SAVEAS)
+                        btnSave = wx.Button(parent = which_panel, id = wx.ID_ANY, label = _("&Save as"))
                         btnSave.Bind(wx.EVT_BUTTON, self.OnFileSave)
                         
                         which_sizer.Add(item = wx.StaticText(parent = which_panel, id = wx.ID_ANY,
@@ -1819,8 +1819,14 @@
             return
         
         data = ''
-        f = open(path, "r")
         try:
+            f = open(path, "r")
+        except IOError, e:
+            gcmd.GError(parent = self, showTraceback = False,
+                        message = _("Unable to load file.\n\nReason: %s") % e)
+            return
+        
+        try:
             data = f.read()
         finally:
             f.close()



More information about the grass-commit mailing list