[GRASS-SVN] r49016 - grass/branches/releasebranch_6_4/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 30 19:04:52 EDT 2011


Author: martinl
Date: 2011-10-30 16:04:51 -0700 (Sun, 30 Oct 2011)
New Revision: 49016

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


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2011-10-30 21:28:35 UTC (rev 49015)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2011-10-30 23:04:51 UTC (rev 49016)
@@ -750,12 +750,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