Procházet zdrojové kódy

Quit wxGUI gracefully when g.region crashes (trac https://trac.osgeo.org/grass/ticket/493)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35852 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa před 16 roky
rodič
revize
e5f34b1936
1 změnil soubory, kde provedl 9 přidání a 3 odebrání
  1. 9 3
      gui/wxpython/gui_modules/render.py

+ 9 - 3
gui/wxpython/gui_modules/render.py

@@ -624,9 +624,15 @@ class Map(object):
             elif vect:
                 e.message = _("Unable to zoom to vector map <%s>.") % vect[0] + \
                 '%s%s' % (os.linesep, os.linesep) + e.message
-
-            print >> sys.stderr, e
-            return self.region
+            else:
+                e.message = _("Unable to get current geographic extent. "
+                              "Force quiting wxGUI. Please run manually g.region to "
+                              "fix the problem.")
+            e.Show()
+            if not rast and not vect:
+                sys.exit(1)
+            else:
+                return self.region
 
         for reg in ret.splitlines():
             key, val = reg.split("=", 1)