Browse Source

wxGUI: add extra dialog when trying to remove gislock (https://trac.osgeo.org/grass/ticket/1407)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48565 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 years ago
parent
commit
2ef32055cd
1 changed files with 20 additions and 5 deletions
  1. 20 5
      gui/wxpython/gis_set.py

+ 20 - 5
gui/wxpython/gis_set.py

@@ -748,12 +748,27 @@ class GRASSStartup(wx.Frame):
                                    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