[GRASS-SVN] r43567 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 21 07:49:16 EDT 2010


Author: martinl
Date: 2010-09-21 11:49:16 +0000 (Tue, 21 Sep 2010)
New Revision: 43567

Modified:
   grass/branches/develbranch_6/gui/wxpython/gis_set.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
Log:
trac #1167

Modified: grass/branches/develbranch_6/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gis_set.py	2010-09-21 10:47:07 UTC (rev 43566)
+++ grass/branches/develbranch_6/gui/wxpython/gis_set.py	2010-09-21 11:49:16 UTC (rev 43567)
@@ -438,8 +438,7 @@
         if mapset ==  'PERMANENT':
             GMessage(parent = self,
                      message = _('Mapset <PERMANENT> is required for valid GRASS location.\n\n'
-                                 'This mapset cannot be renamed.'),
-                     msgType = 'info')
+                                 'This mapset cannot be renamed.'))
             return
         
         dlg = wx.TextEntryDialog(parent = self,
@@ -516,8 +515,7 @@
         if mapset ==  'PERMANENT':
             GMessage(parent = self,
                      message = _('Mapset <PERMANENT> is required for valid GRASS location.\n\n'
-                                 'This mapset cannot be deleted.'),
-                     msgType = 'info')
+                                 'This mapset cannot be deleted.'))
             return
         
         dlg = wx.MessageDialog(parent = self, message = _("Do you want to continue with deleting mapset <%(mapset)s> "

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-09-21 10:47:07 UTC (rev 43566)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2010-09-21 11:49:16 UTC (rev 43567)
@@ -125,9 +125,8 @@
         self.Layout()
 
 class DatabasePage(TitledPage):
+    """!Wizard page for setting GIS data directory and location name
     """
-    Wizard page for setting GIS data directory and location name
-    """
     def __init__(self, wizard, parent, grassdatabase):
         TitledPage.__init__(self, wizard, _("Define GRASS Database and Location Name"))
 
@@ -1575,15 +1574,13 @@
                 nextButton.Enable()
 
 class SummaryPage(TitledPage):
-    """
-    Shows summary result of choosing coordinate system parameters
+    """!Shows summary result of choosing coordinate system parameters
     prior to creating location
     """
     def __init__(self, wizard, parent):
         TitledPage.__init__(self, wizard, _("Summary"))
-
         self.parent = parent
-
+        
         # labels
         self.ldatabase  = self.MakeLabel("")
         self.llocation  = self.MakeLabel("")
@@ -1591,11 +1588,8 @@
         self.lproj4string = self.MakeLabel("")
         self.lproj4stringLabel = self.MakeLabel("")
         
-        self.lprojection.Wrap(400)
-        
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
-        # self.Bind(wx.EVT_BUTTON, self.OnFinish, wx.ID_FINISH)
-
+        
         # do sub-page layout
         self.__DoLayout()
         
@@ -1631,10 +1625,9 @@
                        border=5, pos=(5, 0), span=(1, 2))
 
     def OnEnterPage(self,event):
+        """!Insert values into text controls for summary of location
+        creation options
         """
-        Insert values into text controls for summary of location creation options
-        """
-
         database = self.parent.startpage.grassdatabase
         location = self.parent.startpage.location
         proj4string = self.parent.CreateProj4String()
@@ -1651,64 +1644,54 @@
             self.lproj4string.Show()
             self.lproj4stringLabel.SetLabel(_("PROJ.4 definition:"))
             if coordsys == 'proj':
-                ret, msg, err = gcmd.RunCommand('g.proj',
-                                       flags = 'j',
-                                       proj4 = proj4string,
-                                       datumtrans = dtrans,
-                                       location = location,
-                                       getErrorMsg = True,
-                                       read = True)
+                ret, projlabel, err = gcmd.RunCommand('g.proj',
+                                                      flags = 'jf',
+                                                      proj4 = proj4string,
+                                                      datumtrans = dtrans,
+                                                      location = location,
+                                                      getErrorMsg = True,
+                                                      read = True)
             elif coordsys == 'epsg':
-                ret, msg, err = gcmd.RunCommand('g.proj',
-                                       flags = 'j',
-                                       epsg = epsgcode,
-                                       datumtrans = dtrans,
-                                       location = location,
-                                       getErrorMsg = True,
-                                       read = True)
+                ret, projlabel, err = gcmd.RunCommand('g.proj',
+                                                      flags = 'jf',
+                                                      epsg = epsgcode,
+                                                      datumtrans = dtrans,
+                                                      location = location,
+                                                      getErrorMsg = True,
+                                                      read = True)
             
             if ret == 0:
-                projlabel = ''
-                for line in msg.splitlines():
-                    projlabel = projlabel + '%s ' % line
-                self.lproj4string.SetLabel(projlabel)
+                self.lproj4string.SetLabel(projlabel.replace(' ', os.linesep))
             else:
-                wx.MessageBox(err, 'Error', wx.ICON_ERROR)
-
-            self.lproj4string.Wrap(400)
-            
+                gcmd.GError(err, parent = self)
+        
         projdesc = self.parent.projpage.projdesc
         ellipsedesc = self.parent.ellipsepage.ellipsedesc
         datumdesc = self.parent.datumpage.datumdesc
         self.ldatabase.SetLabel(database)
         self.llocation.SetLabel(location)
-        label = ''
         
+        label = ''
         if coordsys == 'epsg':
             label = 'EPSG code %s (%s)' % (self.parent.epsgpage.epsgcode, self.parent.epsgpage.epsgdesc)
-            self.lprojection.SetLabel(label)
         elif coordsys == 'file':
             label = 'matches file %s' % self.parent.filepage.georeffile
-            self.lprojection.SetLabel(label)
         elif coordsys == 'wkt':
             label = 'matches file %s' % self.parent.wktpage.wktfile
-            self.lprojection.SetLabel(label)
         elif coordsys == 'proj':
             label = ('%s, %s %s' % (projdesc, datumdesc, ellipsedesc))
-            self.lprojection.SetLabel(label)
         elif coordsys == 'xy':
             label = ('XY coordinate system (not projected).')
-            self.lprojection.SetLabel(label)
         elif coordsys == 'custom':
-            label = ('%s' % self.parent.custompage.customstring)
-            self.lprojection.SetLabel(label)
-
+            label = ('%s' % self.parent.custompage.customstring.replace(' ', os.linesep))
+        self.lprojection.SetLabel(label)
+        
     def OnFinish(self, event):
         dlg = wx.MessageDialog(parent=self.wizard,
                                message=_("Do you want to create GRASS location <%s>?") % location,
                                caption=_("Create new location?"),
                                style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
-
+        
         if dlg.ShowModal() == wx.ID_NO:
             dlg.Destroy()
             event.Veto()
@@ -1717,15 +1700,14 @@
             event.Skip()
 
 class LocationWizard(wx.Object):
-    """!
-    Start wizard here and finish wizard here
+    """!Start wizard here and finish wizard here
     """
     def __init__(self, parent, grassdatabase):
         self.__cleanUp()
         
         global coordsys
         self.parent = parent
-
+        
         #
         # define wizard image
         #
@@ -1743,7 +1725,7 @@
         #
         self.datumtrans = 0
         self.proj4string = ''
-
+        
         #
         # define wizard pages
         #
@@ -1795,7 +1777,7 @@
         self.custompage.SetNext(self.sumpage)
 
         self.sumpage.SetPrev(self.csystemspage)
-
+        
         #
         # do pages layout
         #
@@ -1811,7 +1793,7 @@
         self.custompage.DoLayout()
         self.sumpage.DoLayout()
         self.wizard.FitToPage(self.datumpage)
-
+                
         # new location created?
         self.location = None 
         success = False
@@ -2093,7 +2075,8 @@
             proj4string = '%s %s' % (proj4string, item)
             
         # set datum and transform parameters if relevant
-        if datum != '': proj4string = '%s +datum=%s' % (proj4string, datum)
+        if datum != '':
+            proj4string = '%s +datum=%s' % (proj4string, datum)
         if datumparams:
             for item in datumparams:
                 proj4string = '%s +%s' % (proj4string,item)



More information about the grass-commit mailing list