[GRASS-SVN] r48565 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 30 09:22:06 EDT 2011


Author: martinl
Date: 2011-09-30 06:22:06 -0700 (Fri, 30 Sep 2011)
New Revision: 48565

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI: add extra dialog when trying to remove gislock (#1407)


Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2011-09-29 23:51:26 UTC (rev 48564)
+++ grass/trunk/gui/wxpython/gis_set.py	2011-09-30 13:22:06 UTC (rev 48565)
@@ -748,12 +748,27 @@
                                    wx.ICON_QUESTION | wx.CENTRE)
             
             ret = dlg.ShowModal()
+            dlg.Destroy()
             if ret == wx.ID_YES:
-                try:
-                    os.remove(lockfile)
-                except IOError, e:
-                    GError(_("Unable to remove '%(lock)s'.\n\n"
-                             "Details: %(reason)s") % { 'lock' : lockfile, 'reason' : e})
+                dlg1 = wx.MessageDialog(parent = self,
+                                        message = _("ARE YOU REALLY SURE?\n\n"
+                                                    "If you really are running another GRASS session doing this "
+                                                    "could corrupt your data. Have another look in the processor "
+                                                    "manager just to be sure..."),
+                                        caption = _("Lock file found"),
+                                        style = wx.YES_NO | wx.NO_DEFAULT |
+                                        wx.ICON_QUESTION | wx.CENTRE)
+                
+                ret = dlg1.ShowModal()
+                dlg1.Destroy()
+                
+                if ret == wx.ID_YES:
+                    try:
+                        os.remove(lockfile)
+                    except IOError, e:
+                        GError(_("Unable to remove '%(lock)s'.\n\n"
+                                 "Details: %(reason)s") % { 'lock' : lockfile, 'reason' : e})
+                else:
                     return
             else:
                 return



More information about the grass-commit mailing list