[GRASS-SVN] r31215 - in grass/trunk/gui/wxpython: gui_modules icons icons/silk

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 2 15:08:37 EDT 2008


Author: martinl
Date: 2008-05-02 15:08:36 -0400 (Fri, 02 May 2008)
New Revision: 31215

Modified:
   grass/trunk/gui/wxpython/gui_modules/georect.py
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/preferences.py
   grass/trunk/gui/wxpython/gui_modules/profile.py
   grass/trunk/gui/wxpython/gui_modules/render.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/icons/icon.py
   grass/trunk/gui/wxpython/icons/silk/__init__.py
Log:
wxGUI sync'ed with develbr6 (profile and georect related fixes)

Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -1,53 +1,47 @@
 """
-MODULE:    georect.py
+ at package georect.py
 
-CLASSES:
-    * Georectify
-    * GCP
-    * GRMap
+Georectification module for GRASS GIS. Includes ground control
+point management and interactive point and click GCP creation
 
-PURPOSE:   Georectification module for GRASS GIS. Includes ground control
-            point management and interactive point and click GCP creation
+Classes:
+ - Georectify
+ - GCP
+ - GRMap
+ - GrSettingsDialog
 
-AUTHORS:   The GRASS Development Team
-           Michael Barton
-
-COPYRIGHT: (C) 2006-2007 by the GRASS Development Team
+COPYRIGHT: (C) 2006-2008 by the GRASS Development Team
            This program is free software under the GNU General Public
            License (>=v2). Read the file COPYING that comes with GRASS
            for details.
+
+ at author Michael Barton
+Updated by Martin Landa <landa.martin gmail.com>
 """
 
 # recheck once completed to see how many of these are still needed
 import os
 import sys
-import time
-import glob
-import math
 import tempfile
 import shutil
 
 import wx
-import wx.aui
-import wx.lib.filebrowsebutton as filebrowse
 from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin, TextEditMixin
+import wx.lib.colourselect as  csel
 import wx.wizard as wiz
-import wx.grid as gridlib
 
-from threading import Thread
-
 import globalvar
 import mapdisp
 import render
 import toolbars
 import menuform
 import gselect
-import disp_print
 import gcmd
 import utils
-import menuform
 from debug import Debug as Debug
 from icon import Icons as Icons
+from location_wizard import TitledPage as TitledPage
+from preferences import globalSettings as UserSettings
 
 try:
     import subprocess # Not needed if GRASS commands could actually be quiet
@@ -59,140 +53,131 @@
 gmpath = os.path.join(globalvar.ETCWXDIR, "icons")
 sys.path.append(gmpath)
 
-import images
-imagepath = images.__path__[0]
-sys.path.append(imagepath)
-
+#
 # global variables
+#
 global xy_map
-
 global maptype
 
 xy_map = ''
 maptype = 'cell'
 
-
-class TitledPage(wiz.WizardPageSimple):
-    """
-    Class to make wizard pages. Generic methods to make
-    labels, text entries, and buttons.
-    """
-    def __init__(self, parent, title):
-        wiz.WizardPageSimple.__init__(self, parent)
-
-        self.title = wx.StaticText(self,-1,title)
-        self.title.SetFont(wx.Font(13, wx.SWISS, wx.NORMAL, wx.BOLD))
-        self.sizer = wx.BoxSizer(wx.VERTICAL)
-
-        tmpsizer = wx.BoxSizer(wx.VERTICAL)
-
-        tmpsizer.Add(self.title, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
-        tmpsizer.AddSpacer(10)
-        tmpsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 0)
-        tmpsizer.Add(self.sizer, wx.EXPAND)
-
-        self.SetSizer(tmpsizer)
-        self.SetAutoLayout(True)
-        tmpsizer.Fit(self)
-
 class GeorectWizard(object):
     """
     Start wizard here and finish wizard here
     """
 
     def __init__(self, parent):
+        self.parent = parent # GMFrame
+
         #
-        # define wizard image
+        # get environmental variables
         #
-        # file = "loc_wizard.png"
-        #file = "loc_wizard_qgis.png"
-        #imagePath = os.path.join(globalvar.ETCWXDIR, "images",
-        #                         file)
-        #wizbmp = wx.Image(imagePath, wx.BITMAP_TYPE_PNG)
-        ## wizbmp.Rescale(250,600)
-        #wizbmp = wizbmp.ConvertToBitmap()
+        p = gcmd.Command(['g.gisenv', 'get=GISDBASE'])
+        self.grassdatabase = p.ReadStdOutput()[0]
 
-        self.parent = parent
-
-        #set environmental variables
-        cmdlist = ['g.gisenv', 'get=GISDBASE']
-        #global grassdatabase
-        p = gcmd.Command(cmdlist)
-        self.grassdatabase = p.ReadStdOutput()[0]
-        
+        #
         # read original environment settings
-        #self.orig_env = os.environ.copy()
+        #
         self.orig_gisrc = os.environ['GISRC']
-        f = open(self.orig_gisrc)
         self.gisrc_dict = {}
         try:
-            for line in f:
+            f = open(self.orig_gisrc, 'r')
+            for line in f.readlines():
                 if line != '':
-                    line = line.strip(' \n')
-                    self.gisrc_dict[line.split(':')[0]] = line.split(':')[1].strip()
+                    line = line.replace('\n', '').strip()
+                    key, value = line.split(':')
+                    self.gisrc_dict[key.strip()] = value.strip()
         finally:
             f.close()
             
         self.currentlocation = self.gisrc_dict['LOCATION_NAME']
         self.currentmapset = self.gisrc_dict['MAPSET']
-        self.newlocation = '' #location for xy map to georectify
-        self.newmapset = '' #mapset for xy map to georectify
-        
-        self.new_gisrc = '' #GISRC file for source location/mapset of map(s) to georectify
-        
+        # location for xy map to georectify
+        self.newlocation = ''
+        # mapset for xy map to georectify
+        self.newmapset = '' 
+
+        # GISRC file for source location/mapset of map(s) to georectify
+        self.new_gisrc = ''
+
+        #
         # define wizard pages
-        self.wizard = wiz.Wizard(parent, -1, "Setup for georectification")
+        #
+        self.wizard = wiz.Wizard(parent=parent, id=wx.ID_ANY, title=_("Setup for georectification"))
         self.startpage = LocationPage(self.wizard, self)
         self.grouppage = GroupPage(self.wizard, self)
         self.mappage = DispMapPage(self.wizard, self)
 
         # Set the initial order of the pages
         self.startpage.SetNext(self.grouppage)
-
         self.grouppage.SetPrev(self.startpage)
         self.grouppage.SetNext(self.mappage)
-
         self.mappage.SetPrev(self.grouppage)
-
+        
+        #
+        # do pages layout
+        #
+        self.startpage.DoLayout()
+        self.grouppage.DoLayout()
+        self.mappage.DoLayout()
         self.wizard.FitToPage(self.startpage)
 
-        #self.Bind(wx.EVT_CLOSE,    self.Cleanup)
-        self.parent.Bind(wx.EVT_ACTIVATE, self.OnGLMFocus)
+        # self.Bind(wx.EVT_CLOSE,    self.Cleanup)
+        # self.parent.Bind(wx.EVT_ACTIVATE, self.OnGLMFocus)
 
         success = False
 
+        #
+        # run wizard
+        #
         if self.wizard.RunWizard(self.startpage):
-            success = self.onWizFinished()
-            if success == True:
-                pass
-            else:
-                wx.MessageBox("Georectifying setup canceled.")
+            success = self.OnWizFinished()
+            if success == False:
+                wx.MessageBox(_("Georectifying setup canceled."))
                 self.Cleanup()
         else:
-            wx.MessageBox("Georectifying setup canceled.")
+            wx.MessageBox(_("Georectifying setup canceled."))
             self.Cleanup()
 
+        #
         # start display showing xymap
+        #
         if success != False:
-            self.Map = render.Map()    # instance of render.Map to be associated with display
-    
+            # instance of render.Map to be associated with display
+            self.Map = render.Map(gisrc=self.new_gisrc) 
+            
             global maptype
             global xy_map
-    
+
+            #
+            # add layer to map
+            #
             if maptype == 'cell':
                 rendertype = 'raster'
                 cmdlist = ['d.rast', 'map=%s' % xy_map]
             elif maptype == 'vector':
                 rendertype = 'vector'
                 cmdlist = ['d.vect', 'map=%s' % xy_map]
-    
-            self.Map.AddLayer(type=rendertype, command=cmdlist,l_active=True,
-                              l_hidden=False, l_opacity=1, l_render=False)
-                
-            self.xy_mapdisp = mapdisp.MapFrame(self.parent, title="Set ground control points (GCPs)",
-                 pos=wx.DefaultPosition, size=(640,480),
-                 style=wx.DEFAULT_FRAME_STYLE, toolbars=["georect"],
-                 Map=self.Map, gismgr=self.parent, georect=True)
+
+            self.Map.AddLayer(type=rendertype, command=cmdlist, l_active=True,
+                              l_hidden=False, l_opacity=1.0, l_render=False)
+
+            #
+            # start GCP form
+            #
+            self.gcpmgr = GCP(self.parent, grwiz=self)
+            self.gcpmgr.Show()
+
+            #
+            # start map display
+            #
+            self.xy_mapdisp = mapdisp.MapFrame(self.gcpmgr, title=_("Set ground control points (GCPs)"),
+                                               size=globalvar.MAP_WINDOW_SIZE,
+                                               toolbars=["georect"],
+                                               Map=self.Map, gismgr=self.parent)
+
+            self.gcpmgr.SetMapDisplay(self.xy_mapdisp)
             
             self.mapwin = self.xy_mapdisp.MapWindow
             
@@ -202,82 +187,91 @@
             self.mapwin.zoomtype = 0
             self.mapwin.pen = wx.Pen(colour='black', width=2, style=wx.SOLID)
             self.mapwin.SetCursor(self.xy_mapdisp.cursors["cross"])
-            
-            # draw selected xy map
-            self.xy_mapdisp.MapWindow.UpdateMap()
 
-            #show new display
+            #
+            # show new display & draw map
+            #
             self.xy_mapdisp.Show()
-            self.xy_mapdisp.Refresh()
-            self.xy_mapdisp.Update()
-    
-            # start GCP form
-            self.gcpmgr = GCP(self.parent, grwiz=self)
-            self.gcpmgr.Show()
-            self.gcpmgr.Refresh()
-            self.gcpmgr.Update()
         else:
             self.Cleanup()
                             
     def SetSrcEnv(self, location, mapset):
         """Create environment to use for location and mapset
-        that are the source of the file(s) to georectify"""
+        that are the source of the file(s) to georectify
+
+        @param location source location
+        @param mapset source mapset
+
+        @return False on error
+        @return True on success
+        """
         
         self.newlocation = location
         self.newmapset = mapset
         
         # check to see if we are georectifying map in current working location/mapset
         if self.newlocation == self.currentlocation and self.newmapset == self.currentmapset:
-            return
+            return False
         
         self.gisrc_dict['LOCATION_NAME'] = location
         self.gisrc_dict['MAPSET'] = mapset
-        self.new_gisrc = utils.GetTempfile()     
-        f = open(self.new_gisrc, mode='w')        
-        for line in self.gisrc_dict.items():
-            f.write(line[0]+": "+line[1]+"\n")
-        f.close()
+        
+        self.new_gisrc = utils.GetTempfile()
 
+        try:
+            f = open(self.new_gisrc, mode='w')        
+            for line in self.gisrc_dict.items():
+                f.write(line[0] + ": " + line[1] + "\n")
+        finally:
+            f.close()
+
+        return True
+
     def SwitchEnv(self, grc):
         """
         Switches between original working location/mapset and
         location/mapset that is source of file(s) to georectify
         """
-
         # check to see if we are georectifying map in current working location/mapset
         if self.newlocation == self.currentlocation and self.newmapset == self.currentmapset:
-            return
+            return False
 
         if grc == 'original':
             os.environ["GISRC"] = str(self.orig_gisrc)
         elif grc == 'new':
             os.environ["GISRC"] = str(self.new_gisrc)
-        
-    def onWizFinished(self):
+
         return True
-        self.Cleanup()
+    
+    def OnWizFinished(self):
+        # self.Cleanup()
+
+        return True
         
     def OnGLMFocus(self, event):
-        #self.SwitchEnv('original')
-        pass
+        """Layer Manager focus"""
+        # self.SwitchEnv('original')
+        
+        event.Skip()
 
     def Cleanup(self):
-        # return to current location and mapset
+        """Return to current location and mapset"""
         self.SwitchEnv('original')
-        self.parent.georectifying = False
-        try:
-            self.xy_mapdisp.Destroy()
-            self.wizard.Destroy()
-        except:
-            pass
+        self.parent.georectifying = None
 
+        if hasattr(self, "xy_mapdisp"):
+            self.xy_mapdisp.Close()
+            self.xy_mapdisp = None
+
+        self.wizard.Destroy()
+
 class LocationPage(TitledPage):
     """
     Set map type (raster or vector) to georectify and
     select location/mapset of map(s) to georectify.
     """
     def __init__(self, wizard, parent):
-        TitledPage.__init__(self, wizard, "Select map type and location/mapset")
+        TitledPage.__init__(self, wizard, _("Select map type and location/mapset"))
 
         self.parent = parent
         self.grassdatabase = self.parent.grassdatabase
@@ -286,258 +280,320 @@
         self.xymapset = ''
 
         tmplist = os.listdir(self.grassdatabase)
-
         self.locList = []
-
-        # Create a list of valid locations
+        self.mapsetList = []
+        
+        #
+        # create a list of valid locations
+        #
         for item in tmplist:
-            if os.path.isdir(os.path.join(self.grassdatabase,item)) and \
-                os.path.exists(os.path.join(self.grassdatabase,item,'PERMANENT')):
+            if os.path.isdir(os.path.join(self.grassdatabase, item)) and \
+                    os.path.exists(os.path.join(self.grassdatabase, item, 'PERMANENT')):
                 self.locList.append(item)
 
-        self.mapsetList = []
+        utils.ListSortLower(self.locList)
+        
+        #
+        # layout
+        #
+        self.sizer.AddGrowableCol(2)
+        # map type
+        self.rb_maptype = wx.RadioBox(parent=self, id=wx.ID_ANY, label=' %s ' % _("Map type to georectify"),
+                                      choices=[_('raster'), _('vector')], majorDimension=wx.RA_SPECIFY_COLS)
+        self.sizer.Add(item=self.rb_maptype,
+                       flag=wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, border=5,
+                       pos=(1, 1), span=(1, 2))
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        self.rb_maptype = wx.RadioBox(self, -1, "Map type to georectify",
-                                   wx.DefaultPosition, wx.DefaultSize,
-                                   ['raster','vector'], 2, wx.RA_SPECIFY_COLS)
-        box.Add(self.rb_maptype, 0, wx.ALIGN_CENTER|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
+        # location
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select source location:')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(2, 1))
+        self.cb_location = wx.ComboBox(parent=self, id=wx.ID_ANY, 
+                                     choices = self.locList, size=(300, -1),
+                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)
+        self.sizer.Add(item=self.cb_location,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(2, 2))
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'select location:',
-                style=wx.ALIGN_RIGHT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.cb_location = wx.ComboBox(self, wx.ID_ANY, "",
-                                     wx.DefaultPosition,
-                                     wx.DefaultSize,
-                                     choices = self.locList,
-                                     style=wx.CB_DROPDOWN|wx.CB_READONLY)
-        box.Add(self.cb_location, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
+        # mapset
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select source mapset:')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(3, 1))
+        self.cb_mapset = wx.ComboBox(parent=self, id=wx.ID_ANY,
+                                     choices = self.mapsetList, size=(300, -1),
+                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)
+        self.sizer.Add(item=self.cb_mapset,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(3,2))
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'select mapset:',
-                style=wx.ALIGN_RIGHT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.cb_mapset = wx.ComboBox(self, wx.ID_ANY, "",
-                                     wx.DefaultPosition,
-                                     wx.DefaultSize,
-                                     choices = self.mapsetList,
-                                     style=wx.CB_DROPDOWN|wx.CB_READONLY)
-        box.Add(self.cb_mapset, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
+        #
+        # bindings
+        #
         self.Bind(wx.EVT_RADIOBOX, self.OnMaptype, self.rb_maptype)
         self.Bind(wx.EVT_COMBOBOX, self.OnLocation, self.cb_location)
         self.Bind(wx.EVT_COMBOBOX, self.OnMapset, self.cb_mapset)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.onPageChanging)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)
-        self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
+        # self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
 
     def OnMaptype(self,event):
+        """Change map type"""
         global maptype
 
         if event.GetInt() == 0:
             maptype = 'cell'
-        elif event.GetInt() == 1:
+        else:
             maptype = 'vector'
 
     def OnLocation(self, event):
         """Sets source location for map(s) to georectify"""
-
         self.xylocation = event.GetString()
         
         #create a list of valid mapsets
-        tmplist = os.listdir(os.path.join(self.grassdatabase,self.xylocation))
+        tmplist = os.listdir(os.path.join(self.grassdatabase, self.xylocation))
         self.mapsetList = []
         for item in tmplist:
-            if os.path.isdir(os.path.join(self.grassdatabase,self.xylocation,item)) and \
-                os.path.exists(os.path.join(self.grassdatabase,self.xylocation,item,'WIND')):
-                self.mapsetList.append(item)
+            if os.path.isdir(os.path.join(self.grassdatabase, self.xylocation, item)) and \
+                os.path.exists(os.path.join(self.grassdatabase, self.xylocation, item, 'WIND')):
+                if item != 'PERMANENT':
+                    self.mapsetList.append(item)
 
+        self.xymapset = 'PERMANENT'
+        utils.ListSortLower(self.mapsetList)
+        self.mapsetList.insert(0, 'PERMANENT')
         self.cb_mapset.SetItems(self.mapsetList)
+        self.cb_mapset.SetStringSelection(self.xymapset)
+        
+        if not wx.FindWindowById(wx.ID_FORWARD).IsEnabled():
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
     def OnMapset(self, event):
         """Sets source mapset for map(s) to georectify"""
-
         if self.xylocation == '':
-            wx.MessageBox('You must select a valid location before selecting a mapset')
+            wx.MessageBox(_('You must select a valid location before selecting a mapset'))
             return
 
         self.xymapset = event.GetString()
+        
+        if not wx.FindWindowById(wx.ID_FORWARD).IsEnabled():
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
-    def onPageChanging(self,event=None):
-
-        if event.GetDirection() and (self.xylocation == '' or self.xymapset == ''):
-            wx.MessageBox('You must select a valid location and mapset in order to continue')
+    def OnPageChanging(self, event=None):
+        if event.GetDirection() and \
+               (self.xylocation == '' or self.xymapset == ''):
+            wx.MessageBox(_('You must select a valid location and mapset in order to continue'))
             event.Veto()
             return
         else:
             self.parent.SetSrcEnv(self.xylocation, self.xymapset)
 
-    def OnPageChanged(self,event=None):
-        pass
+    def OnEnterPage(self, event=None):
+        if self.xylocation == '' or self.xymapset == '':
+            wx.FindWindowById(wx.ID_FORWARD).Enable(False)
+        else:
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
 class GroupPage(TitledPage):
     """
     Set group to georectify. Create group if desired.
     """
     def __init__(self, wizard, parent):
-        TitledPage.__init__(self, wizard, "Select image/map group to georectify")
+        TitledPage.__init__(self, wizard, _("Select image/map group to georectify"))
 
         self.parent = parent
+        
+        self.grassdatabase = self.parent.grassdatabase
         self.groupList = []
-        self.grassdatabase = self.parent.grassdatabase
+        
         self.xylocation = ''
         self.xymapset = ''
         self.xygroup = ''
+
+        # default extension
+        self.extension = 'georect' + str(os.getpid())
+
+        #
+        # layout
+        #
+        self.sizer.AddGrowableCol(2)
+        # group
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select group:')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(1, 1))
+        self.cb_group = wx.ComboBox(parent=self, id=wx.ID_ANY,
+                                    choices=self.groupList, size=(350, -1),
+                                    style=wx.CB_DROPDOWN | wx.CB_READONLY)
+        self.sizer.Add(item=self.cb_group,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(1, 2))
         
-        self.extension = 'georect'+str(os.getpid())
+        # create group               
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Create group if none exists')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(2, 1))
+        self.btn_mkgroup = wx.Button(parent=self, id=wx.ID_ANY, label=_("Create/edit group..."))
+        self.sizer.Add(item=self.btn_mkgroup,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(2, 2))
         
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'select group:',
-                style=wx.ALIGN_RIGHT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.cb_group = wx.ComboBox(self, wx.ID_ANY, "",
-                                     wx.DefaultPosition,
-                                     wx.DefaultSize,
-                                     choices = self.groupList,
-                                     style=wx.CB_DROPDOWN|wx.CB_READONLY)
-        box.Add(self.cb_group, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'Create group if none exists', style=wx.ALIGN_LEFT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.btn_mkgroup = wx.Button(self, wx.ID_ANY, "Create/edit group ...")
-        box.Add(self.btn_mkgroup, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'Extension for output maps:', style=wx.ALIGN_LEFT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.ext_txt = wx.wx.TextCtrl(self, -1, "", size=(150,-1))
+        # extension
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Extension for output maps:')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(3, 1))
+        self.ext_txt = wx.TextCtrl(parent=self, id=wx.ID_ANY, value="", size=(350,-1))
         self.ext_txt.SetValue(self.extension)
-        box.Add(self.ext_txt, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
+        self.sizer.Add(item=self.ext_txt,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(3, 2))
 
+        #
+        # bindings
+        #
         self.Bind(wx.EVT_COMBOBOX, self.OnGroup, self.cb_group)
         self.Bind(wx.EVT_BUTTON, self.OnMkGroup, self.btn_mkgroup)
         self.Bind(wx.EVT_TEXT, self.OnExtension, self.ext_txt)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.onPageChanging)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
         self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
 
     def OnGroup(self, event):        
         self.xygroup = event.GetString()
         
     def OnMkGroup(self, event):
+        """Create new group in source location/mapset"""
         global maptype
-        
-        self.parent.SwitchEnv('new')
+
+        # open dialog
         if maptype == 'cell':
-            cmdlist = ['i.group']       
-            menuform.GUI().ParseCommand(cmdlist, parentframe=self.parent.parent)
+            menuform.GUI().ParseCommand(['i.group'],
+                                        completed=(self.GetOptData, None, ''),
+                                        parentframe=self.parent.parent, modal=True)
         elif maptype == 'vector':
             dlg = VectGroup(self, wx.ID_ANY, self.grassdatabase, self.xylocation, self.xymapset, self.xygroup)
             if dlg.ShowModal() == wx.ID_OK:
                 dlg.MakeVGroup()
-                
-        #refresh combobox list
-        try:
-            tmplist = os.listdir(os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group'))
-        except:
-            return
-        if tmplist != []:
-            for item in tmplist:
-                if os.path.isdir(os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',item)):
-                    self.groupList.append(item)
+                self.OnEnterPage()
 
-            self.cb_group.SetItems(self.groupList)
+    def GetOptData(self, dcmd, layer, params, propwin):
+        """Process i.group"""
+        # update the page
+        if dcmd:
+            gcmd.Command(dcmd, stderr=None)
+
+        self.OnEnterPage()
+        self.Update()
         
     def OnExtension(self, event):
         self.extension = event.GetString()
 
-    def onPageChanging(self,event=None):
+    def OnPageChanging(self, event=None):
         if event.GetDirection() and self.xygroup == '':
-            wx.MessageBox('You must select a valid image/map group in order to continue')
+            wx.MessageBox(_('You must select a valid image/map group in order to continue'))
             event.Veto()
             return
 
         if event.GetDirection() and self.extension == '':
-            wx.MessageBox('You must enter an map name extension in order to continue')
+            wx.MessageBox(_('You must enter an map name extension in order to continue'))
             event.Veto()
             return
 
-    def OnPageChanged(self,event=None):
+    def OnEnterPage(self, event=None):
         self.groupList = []
         tmplist = []
+
         self.xylocation = self.parent.gisrc_dict['LOCATION_NAME']
         self.xymapset = self.parent.gisrc_dict['MAPSET']
 
         # create a list of groups in selected mapset
-        tmplist = os.listdir(os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group'))
+        if os.path.isdir(os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group')):
+            tmplist = os.listdir(os.path.join(self.grassdatabase, self.xylocation, self.xymapset, 'group'))
+        else:
+            tmplist = []
+        # if (event and event.GetDirection()) and self.xygroup == '':
+        #             if tmplist == []:
+        #                 wx.MessageBox(_('No map/imagery groups exist to georectify. '
+        #                                 'You will need to create one.'))
+        #             else:
+        for item in tmplist:
+            if os.path.isdir(os.path.join(self.grassdatabase, self.xylocation, self.xymapset, 'group', item)):
+                self.groupList.append(item)
+                
+        utils.ListSortLower(self.groupList)
+        self.cb_group.SetItems(self.groupList)
+        if len(self.groupList) > 0:
+            self.cb_group.SetSelection(0)
+            self.xygroup = self.groupList[0]
+            
+        if self.xygroup == '' or self.extension == '':
+            wx.FindWindowById(wx.ID_FORWARD).Enable(False)
+        else:
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
-        if event.GetDirection() and self.xygroup == '':
-            if tmplist == []:
-                wx.MessageBox('No map/imagery groups exist to georectify. You will need to create one')
-            else:
-                for item in tmplist:
-                    if os.path.isdir(os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',item)):
-                        self.groupList.append(item)
-    
-                self.cb_group.SetItems(self.groupList)
-                
+        # switch to source
+        self.parent.SwitchEnv('new')
+
 class DispMapPage(TitledPage):
     """
     Select ungeoreferenced map to display for interactively
     setting ground control points (GCPs).
     """
     def __init__(self, wizard, parent):
-        TitledPage.__init__(self, wizard, "Select image/map to display for ground control point (GCP) creation")
+        TitledPage.__init__(self, wizard, _("Select image/map to display for ground control point (GCP) creation"))
 
         self.parent = parent
         global maptype
 
-        self.parent = parent
+        #
+        # layout
+        #
+        self.sizer.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_('Select display image/map:')),
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(1, 1))
+        self.selection = gselect.Select(self, id=wx.ID_ANY, size=globalvar.DIALOG_GSELECT_SIZE,
+                                        type=maptype)
+        self.sizer.Add(item=self.selection,
+                       flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5,
+                       pos=(1, 2))
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        label = wx.StaticText(self, -1, 'Select display image/map:', style=wx.ALIGN_LEFT)
-        box.Add(label, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.selection = gselect.Select(self, id=wx.ID_ANY, size=(300,-1),
-                                              type=maptype )
-        box.Add(self.selection, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
-
+        #
+        # bindings
+        #
         self.selection.Bind(wx.EVT_TEXT, self.OnSelection)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.onPageChanging)
-        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
+        self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
         self.Bind(wx.EVT_CLOSE, self.parent.Cleanup)
 
     def OnSelection(self,event):
+        """Map to display selected"""
         global xy_map
 
         xy_map = event.GetString()
 
-    def onPageChanging(self,event=None):
+        if xy_map == '':
+            wx.FindWindowById(wx.ID_FORWARD).Enable(False)
+        else:
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
+
+    def OnPageChanging(self, event=None):
         global xy_map
 
         if event.GetDirection() and xy_map == '':
-            wx.MessageBox('You must select a valid image/map in order to continue')
+            wx.MessageBox(_('You must select a valid image/map in order to continue'))
             event.Veto()
             return
 
-    def OnPageChanged(self,event=None):
+        self.parent.SwitchEnv('original')
+        
+    def OnEnterPage(self, event=None):
         global maptype
+        global xy_map
+        
+        self.selection.SetElementList(maptype)
 
-        if event.GetDirection():
-            # switch to xy location if coming into the page from preceding
-            self.parent.SwitchEnv('new')
-            self.selection.SetElementList(maptype)
+        if xy_map == '':
+            wx.FindWindowById(wx.ID_FORWARD).Enable(False)
         else:
-            # switch back to current location if leaving the page
-            self.parent.SwitchEnv('original')
+            wx.FindWindowById(wx.ID_FORWARD).Enable(True)
 
 class GCP(wx.Frame):
     """
@@ -545,153 +601,263 @@
     Calls i.rectify or v.transform to georectify map.
     """
 
-    def __init__(self,parent,id=-1,title="Create & manage ground control points",
-                 size=wx.DefaultSize, grwiz=None):
-        wx.Frame.__init__(self, parent, id , title, size=(600,300))
-        self.Centre(wx.HORIZONTAL)
+    def __init__(self, parent, grwiz, mapdisp=None, id=wx.ID_ANY,
+                 title=_("Create & manage ground control points"),
+                 size=wx.DefaultSize):
 
-        toolbar = self.__createToolBar()
+        wx.Frame.__init__(self, parent, id, title, size=(625, 300))
+
+        self.SetIcon(wx.Icon(os.path.join(globalvar.ETCDIR, 'grass_map.ico'), wx.BITMAP_TYPE_ICO))
         
-        self.parent = parent
-        self.grwiz = grwiz
+        #
+        # init variables
+        #
+        self.parent = parent # GMFrame
+        self.parent.georectifying = self
+        
+        self.mapdisp = mapdisp # XY-location Map Display
+        self.grwiz = grwiz # GR Wizard
+
         self.grassdatabase = self.grwiz.grassdatabase
+
         self.currentlocation = self.grwiz.currentlocation
         self.currentmapset = self.grwiz.currentmapset
+
         self.newlocation = self.grwiz.newlocation
         self.newmapset = self.grwiz.newmapset
+
         self.xylocation = self.grwiz.gisrc_dict['LOCATION_NAME']
         self.xymapset = self.grwiz.gisrc_dict['MAPSET']
         self.xygroup = self.grwiz.grouppage.xygroup
         self.extension = self.grwiz.grouppage.extension
-        self.pointsfile = os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',self.xygroup,'POINTS')
-        self.rgrpfile = os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',self.xygroup,'REF')
-        self.vgrpfile = os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',self.xygroup,'VREF')
-        self.targetfile = os.path.join(self.grassdatabase,self.xylocation,self.xymapset,'group',self.xygroup,'TARGET')
+
+        self.file = {
+            'points' : os.path.join(self.grassdatabase,
+                                    self.xylocation,
+                                    self.xymapset,
+                                    'group',
+                                    self.xygroup,
+                                    'POINTS'),
+            'rgrp' : os.path.join(self.grassdatabase,
+                                  self.xylocation,
+                                  self.xymapset,
+                                  'group',
+                                  self.xygroup,
+                                  'REF'),
+            'vgrp' : os.path.join(self.grassdatabase,
+                                  self.xylocation,
+                                  self.xymapset,
+                                  'group',
+                                  self.xygroup,
+                                  'VREF'),
+            'target' : os.path.join(self.grassdatabase,
+                                    self.xylocation,
+                                    self.xymapset,
+                                    'group',
+                                    self.xygroup,
+                                    'TARGET'),
+            }
         
+        # polynomial order transformation for georectification
+        self.gr_order = 1 
+        # number of GCPs selected to be used for georectification (checked)
+        self.GCPcount = 0
+        # forward RMS error
+        self.fwd_rmserror = 0.0
+        # backward RMS error
+        self.bkw_rmserror = 0.0
+        # list map coords and ID of map display they came from
+        self.mapcoordlist = [] 
+
         self.SetTarget(self.xygroup, self.currentlocation, self.currentmapset)
 
-        self.gr_order = 1 #polynomial order transformation for georectification
-        self.selected = 0 #gcp list item selected
-        self.GCPcount = 0 #number of GCPs selected to be used for georectification (checked)
-        self.fwd_rmserror = 0.0 # forward RMS error
-        self.bkw_rmserror = 0.0 # backward RMS error
-        self.mapcoordlist = [(0000000.00,0000000.00,'')] #list map coords and ID of map display they came from
+        #
+        # toolbar
+        #
+        self.SetMapDisplay(self.mapdisp)
+
+        #
+        # statusbar 
+        #
+        self.CreateStatusBar(number=1)
         
-        self.CreateStatusBar(3,1,-1,'gcpstatusbar')
-        self.SetStatusText('RMS error for selected points',0)
-        
         # can put guage into custom statusbar for progress if can figure out how to get progress text from i.rectify
-        #self.gr_gauge = wx.Gauge(self, -1, 100, (-1,-1), (100, 25))
-        #self.gr_guage.Pulse()
+        # self.gr_gauge = wx.Gauge(self, -1, 100, (-1,-1), (100, 25))
+        # self.gr_guage.Pulse()
 
-        p = wx.Panel(self, -1, style=0)
+        panel = wx.Panel(parent=self)
 
-        self.sizer = wx.BoxSizer(wx.VERTICAL)
+        #
+        # do layout
+        #
+        sizer = wx.BoxSizer(wx.VERTICAL)
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        self.rb_grmethod = wx.RadioBox(p, -1, "Select rectification method for rasters ",
-                                   wx.DefaultPosition, wx.DefaultSize,
-                                   ['1st order','2nd order', '3rd order'], 3, wx.RA_SPECIFY_COLS)
-        box.Add(self.rb_grmethod, 0, wx.ALIGN_CENTER|wx.ALL, 5)
-        self.sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
+        self.rb_grmethod = wx.RadioBox(parent=panel, id=wx.ID_ANY,
+                                       label=" %s " % _("Select rectification method for rasters"),
+                                       choices=[_('1st order'), _('2nd order'), _('3rd order')],
+                                       majorDimension=wx.RA_SPECIFY_COLS)
+        sizer.Add(item=self.rb_grmethod, proportion=0,
+                       flag=wx.EXPAND | wx.ALL, border=5)
 
+        box = wx.StaticBox (parent=panel, id=wx.ID_ANY,
+                            label=" %s " % _("Ground Control Points"))
+        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
+
         # initialize list control for GCP management
-        self.list = CheckListCtrl(p, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_HRULES)
-        self.list.InsertColumn(0, 'use| X coord', width=120)
-        self.list.InsertColumn(1, 'Y coord')
-        self.list.InsertColumn(2, 'N coord')
-        self.list.InsertColumn(3, 'E coord')
-        self.list.InsertColumn(4, 'Forward error')
-        self.list.InsertColumn(5, 'Backward error')
-        
-        if os.path.isfile(self.pointsfile):
-            self.ReadGCPs()
-            self.ResizeColumns()
-        elif self.list.GetItemCount() == 0:
-            # initialize 3 blank lines in the GCP list (minimum for georectification)
-            i = ('0000000.00','0000000.00','0000000.00','0000000.00','','')
-            index = self.list.InsertStringItem(sys.maxint, i[0])
-            self.list.SetStringItem(index, 1, i[1])
-            self.list.SetStringItem(index, 2, i[2])
-            self.list.SetStringItem(index, 3, i[3])
-            self.list.SetStringItem(index, 4, i[4])
-            self.list.SetStringItem(index, 5, i[5])
-            self.list.CheckItem(0, True)
-            self.AddGCP(None)
-            self.AddGCP(None)
-            self.ResizeColumns()
+        self.list = GCPList(parent=panel, gcp=self)
 
-        self.sizer.Add(self.list, 1, wx.EXPAND|wx.ALL, 5)
-        p.SetSizer(self.sizer)
+        boxSizer.Add(item=self.list, proportion=1,
+                     flag=wx.EXPAND | wx.ALL, border=3)
 
+        sizer.Add(item=boxSizer, proportion=1,
+                  flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
+
+        #
+        # bindigs
+        #
         self.Bind(wx.EVT_RADIOBOX, self.OnGRMethod, self.rb_grmethod)
-        self.list.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
-        self.list.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
         self.Bind(wx.EVT_ACTIVATE, self.OnFocus)
-        self.Bind(wx.EVT_CLOSE, self.grwiz.Cleanup)
+        self.Bind(wx.EVT_CLOSE, self.OnQuit)
 
-    def __createToolBar(self):
-        """Creates toolbar"""
+        panel.SetSizer(sizer)
+        # sizer.Fit(self)
 
-        toolbar = self.CreateToolBar()
-        for each in self.toolbarData():
-            self.addToolbarButton(toolbar, *each)
-        toolbar.Realize()
+    def __del__(self):
+        """Disable georectification mode"""
+        self.parent.georectifying = None
         
-    def OnFocus(self, event):
-        self.grwiz.SwitchEnv('new')
-        
-    def ResizeColumns(self):
-        for i in range(6):
-            self.list.SetColumnWidth(i, wx.LIST_AUTOSIZE)
-        
+    def SetMapDisplay(self, win):
+        self.mapdisp = win
+        if self.mapdisp:
+            self.toolbar = toolbars.GCPToolbar(parent=self, mapdisplay=self.mapdisp, map=self.mapdisp.Map).GetToolbar()
+            self.SetToolBar(self.toolbar)
+
+            self.list.LoadData()
+        else:
+            self.toolbar = None
+
     def SetTarget(self, tgroup, tlocation, tmapset):
         """
         Sets rectification target to current location and mapset
         """
-
-       # check to see if we are georectifying map in current working location/mapset
+        # check to see if we are georectifying map in current working location/mapset
         if self.newlocation == self.currentlocation and self.newmapset == self.currentmapset:
-            cmdlist = ['i.target', 'c', 'group=%s' % tgroup]
+            cmdlist = ['i.target',
+                       '-c',
+                       'group=%s' % tgroup]
         else:
             self.grwiz.SwitchEnv('new')
-            cmdlist = ['i.target', 'group=%s' % tgroup, 'location=%s' % tlocation, 'mapset=%s' % tmapset]
-        gcmd.Command(cmd=cmdlist)
+            cmdlist = ['i.target',
+                       'group=%s' % tgroup,
+                       'location=%s' % tlocation,
+                       'mapset=%s' % tmapset]
+        gcmd.Command(cmd=cmdlist, stderr=None)
 
-    def addToolbarButton(self, toolbar, label, icon, help, handler):
-        """Adds button to the given toolbar"""
+        self.grwiz.SwitchEnv('original')
 
-        if not label:
-            toolbar.AddSeparator()
+    def AddGCP(self, event):
+        """
+        Appends an item to GCP list
+        """
+        self.list.AddGCPItem()
+        # x, y, MapWindow instance
+        self.mapcoordlist.append({ 'gcpcoord' : (0.0, 0.0, None),
+                                   'mapcoord' : (0.0, 0.0, None) })
+
+    def DeleteGCP(self, event):
+        """
+        Deletes selected item in GCP list
+        """
+        minNumOfItems = self.OnGRMethod(None)
+
+        if self.list.GetItemCount() <= minNumOfItems:
+            wx.MessageBox(parent=self, message=_("At least %d GCPs required. Operation cancelled.") % minNumOfItems,
+                          caption=_("Delete GCP"), style=wx.OK | wx.ICON_INFORMATION)
             return
-        tool = toolbar.AddLabelTool(id=wx.ID_ANY, label=label, bitmap=icon, shortHelp=help)
-        self.Bind(wx.EVT_TOOL, handler, tool)
 
-    def toolbarData(self):
+        item = self.list.DeleteGCPItem()
+        del self.mapcoordlist[item]
 
-        return   (
-                 ('savegcp', Icons["savefile"].GetBitmap(), 'Save GCPs to POINTS file', self.SaveGCPs),
-                 ('addgcp',  wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, (16,16)), 'Add new GCP', self.AddGCP),
-                 ('deletegcp',  wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR, (16,16)), 'Delete selected GCP', self.DeleteGCP),
-                 ('cleargcp', Icons["cleargcp"].GetBitmap(), Icons["cleargcp"].GetLabel(), self.ClearGCP),
-                 ('refreshgcp', Icons["refreshgcp"].GetBitmap(), Icons["refreshgcp"].GetLabel(), self.RefreshGCPMarks),
-                 ('rms', Icons["rms"].GetBitmap(), Icons["rms"].GetLabel(), self.OnRMS),
-                 ('georect',  Icons["georect"].GetBitmap(),  Icons["georect"].GetLabel(),  self.OnGeorect),
-                 ('quit',  wx.ArtProvider.GetBitmap(wx.ART_QUIT, wx.ART_TOOLBAR, (16,16)), 'Quit georectification module', self.OnQuit)
-                  )
+    def ClearGCP(self, event):
+        """
+        Clears all values in selected item of GCP list and unchecks it
+        """
+        index = self.list.GetSelected()
 
+        for i in range(4):
+            self.list.SetStringItem(index, i, '0.0')
+        self.list.SetStringItem(index, 4, '')
+        self.list.SetStringItem(index, 5, '')
+        self.list.CheckItem(index, False)
+
+        self.mapcoordlist[index] = { 'gcpcoord' : (0.0, 0.0, None),
+                                     'mapcoord' : (0.0, 0.0, None) }
+
+    def DrawGCP(self, coordtype):
+        """
+        Updates GCP and map coord maps and redraws
+        active (checked) GCP markers
+        """
+        col = UserSettings.Get(group='georect', key='symbol', subkey='color')
+        wxCol = wx.Colour(col[0], col[1], col[2], 255)
+        wpx = UserSettings.Get(group='georect', key='symbol', subkey='width')
+        font = self.GetFont()
+
+        idx = 0
+        for gcp in self.mapcoordlist:
+            mapWin = gcp[coordtype][2]
+            if not self.list.IsChecked(idx) or not mapWin:
+                idx += 1
+                continue
+
+            mapWin.pen = wx.Pen(colour=wxCol, width=wpx, style=wx.SOLID)
+            mapWin.polypen = wx.Pen(colour=wxCol, width=wpx, style=wx.SOLID) # ?
+            coord = mapWin.Cell2Pixel((gcp[coordtype][0], gcp[coordtype][1]))
+            mapWin.DrawCross(pdc=mapWin.pdcTmp, coords=coord,
+                             size=5, text=('%s' % str(idx + 1), font, wxCol, 0.0))
+            
+            idx += 1
+            
+    def SetGCPData(self, coordtype, coord, mapdisp=None, check=True):
+        """
+        Inserts coordinates from mouse click on map
+        into selected item of GCP list and checks it for use
+        """
+        
+        index = self.list.GetSelected()
+        if index == wx.NOT_FOUND:
+            return
+
+        coord0 = str(coord[0])
+        coord1 = str(coord[1])
+
+        if coordtype == 'gcpcoord':
+            self.list.SetStringItem(index, 0, coord0)
+            self.list.SetStringItem(index, 1, coord1)
+            self.mapcoordlist[index]['gcpcoord'] = (coord[0], coord[1], mapdisp)
+        elif coordtype == 'mapcoord':
+            self.list.SetStringItem(index, 2, coord0)
+            self.list.SetStringItem(index, 3, coord1)
+            
+        self.mapcoordlist[index][coordtype] = (coord[0], coord[1], mapdisp)
+
+        self.list.CheckItem(index, check)
+
+        # self.list.ResizeColumns()
+
     def SaveGCPs(self, event):
         """
         Make a POINTS file or save GCP coordinates to existing POINTS file
         """
         
         self.GCPcount = 0
-        f = open(self.pointsfile, mode='w')
         try:
+            f = open(self.file['points'], mode='w')
+            # use os.linesep or '\n' here ???
             f.write('# Ground Control Points File\n')
             f.write("# \n")
-            f.write("# target location: "+self.currentlocation+'\n')
-            f.write("# target mapset: "+self.currentmapset+'\n')
+            f.write("# target location: " + self.currentlocation + '\n')
+            f.write("# target mapset: " + self.currentmapset + '\n')
             f.write("#unrectified xy     georectified east north     1=use gcp point\n")
             f.write("#--------------     -----------------------     ---------------\n")
 
@@ -705,93 +871,77 @@
                 coord1 = self.list.GetItem(index, 1).GetText()
                 coord2 = self.list.GetItem(index, 2).GetText()
                 coord3 = self.list.GetItem(index, 3).GetText()
-                f.write(coord0+' '+coord1+'     '+coord2+' '+coord3+'     '+check+'\n')
-        finally:
-            f.close()
-        pass
+                f.write(coord0 + ' ' + coord1 + '     ' + coord2 + ' ' + coord3 + '     ' + check + '\n')
 
-    def DeleteGCP(self, event):
-        """
-        Deletes selected item in GCP list
-        """
-        
-        self.list.DeleteItem(self.selected)
-        del self.mapcoordlist[self.selected]
+            self.parent.goutput.WriteLog(_('POINTS file <%s> saved') % self.file['points'])
+            self.SetStatusText(_('POINTS file saved'))
+        except IOError, err:
+            wx.MessageBox(parent=self,
+                          message="%s <%s>. %s%s" % (_("Writing POINTS file failed"),
+                                                     self.file['points'], os.linesep, err),
+                          caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            return
 
-    def AddGCP(self, event):
-        """
-        Appends an item to GCP list
-        """
-        
-        self.list.Append(['0000000.00','0000000.00','0000000.00','0000000.00','',''])
-        index = self.list.GetItemCount() - 1
-        self.mapcoordlist.append((0000000.00,0000000.00,''))
-        self.list.SetItemState(index, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
-        self.ResizeColumns()
-        return index
-        
-    def SetGCPData(self, coordtype, coord, mapdisp=None, check=True):
-        """
-        Inserts coordinates from mouse click on map
-        into selected item of GCP list and checks it for use
-        """
-        
-        index = self.selected
-        coord0 = str(coord[0])
-        coord1 = str(coord[1])
+        f.close()
 
-        if coordtype == 'gcpcoord':
-            self.list.SetStringItem(index, 0, coord0)
-            self.list.SetStringItem(index, 1, coord1)
-        if coordtype == 'mapcoord':
-            self.list.SetStringItem(index, 2, coord0)
-            self.list.SetStringItem(index, 3, coord1)
-            self.mapcoordlist[index] = (coord[0], coord[1], mapdisp)
-        self.list.CheckItem(index, check)
-        self.ResizeColumns()
-
-    def ClearGCP(self, event):
-        """
-        Clears all values in selected item of GCP list and unchecks it
-        """
-        
-        index = self.selected
-        for i in range(4):
-            self.list.SetStringItem(index, i, '0000000.00')
-        self.list.SetStringItem(index, 4, '')
-        self.list.SetStringItem(index, 5, '')
-        self.mapcoordlist[index] = (0000000.00,0000000.00,'')
-        self.list.CheckItem(index, False)
-        
     def ReadGCPs(self):
         """
         Reads GCPs and georectified coordinates from POINTS file
         """
         
         self.GCPcount = 0
-        f = open(self.pointsfile)
+
+        sourceMapWin = self.mapdisp.MapWindow
+        targetMapWin = self.parent.curr_page.maptree.mapdisplay.MapWindow
+            
         try:
+            f = open(self.file['points'], 'r')
             GCPcnt = 0
-            for line in f:
-                if line[0] != '#' and line !='':
-                    line = line.strip(' \n')
-                    coords = line.split()
-                    if coords[4] == '1':
-                        check = True
-                        self.GCPcount +=1
-                    else:
-                        check = False
-                    index = self.AddGCP(event=None)
-                    for i in range(4):
-                        self.list.SetStringItem(index, i, coords[i])
-                    self.list.CheckItem(index, check)
-        finally:
-            f.close()
-        self.RefreshGCPMarks(None)
+            
+            for line in f.readlines():
+                if line[0] == '#' or line =='':
+                    continue
+                line = line.replace('\n', '').strip()
+                coords = map(float, line.split())
+                if coords[4] == 1:
+                    check = True
+                    self.GCPcount +=1
+                else:
+                    check = False
+                index = self.AddGCP(event=None)
+                self.SetGCPData('gcpcoord', (coords[0], coords[1]), sourceMapWin, check)
+                self.SetGCPData('mapcoord', (coords[2], coords[3]), targetMapWin, check)
 
+        except IOError, err:
+            wx.MessageBox(parent=self,
+                          message="%s <%s>. %s%s" % (_("Reading POINTS file failed"),
+                                                     self.file['points'], os.linesep, err),
+                          caption=_("Error"), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
+            return
+
+        f.close()
+
+        #
+        # draw GCPs (source and target)
+        #
+        sourceMapWin.UpdateMap(render=False, renderVector=False)
+        if targetMapWin:
+            targetMapWin.UpdateMap(render=False, renderVector=False)
+
+        #
+        # calculate RMS
+        #
         if self.CheckGCPcount():
             self.RMSError(self.xygroup, self.gr_order)
-            
+
+    def ReloadGCPs(self, event):
+        """Reload data from file"""
+        self.list.LoadData()
+    
+    def OnFocus(self, event):
+        # self.grwiz.SwitchEnv('new')
+        pass
+        
     def OnRMS(self, event):
         """
         RMS button handler
@@ -807,13 +957,15 @@
             (self.GCPcount < 6 and self.gr_order == 2) or \
             (self.GCPcount < 10 and self.gr_order == 3):
             if msg:
-                s1 = 'Insufficient points defined and active (checked)\n'
-                s2 = 'for selected rectification method.\n'
-                s3 = '3+ points needed for 1st order,\n'
-                s4 = '6+ points for 2nd order, and\n'
-                s5 = '10+ points for 3rd order.'
-                wx.MessageBox('%s%s%s%s%s' % (s1, s2, s3, s4, s5))
-            return False
+                wx.MessageBox(parent=self,
+                              caption=_("RMS Error"),
+                              message=_('Insufficient points defined and active (checked) '
+                                        'for selected rectification method.\n'
+                                        '3+ points needed for 1st order,\n'
+                                        '6+ points for 2nd order, and\n'
+                                        '10+ points for 3rd order.'),
+                              style=wx.ICON_INFORMATION | wx.ID_OK | wx.CENTRE)
+                return False
         else:
             return True
 
@@ -822,27 +974,22 @@
         Georectifies map(s) in group using i.rectify or v.transform
         """
         global maptype
-        self.SaveGCPs()
+        self.SaveGCPs(None)
         
         if self.CheckGCPcount(msg=True) == False:
             return
                 
         if maptype == 'cell':
-            cmdlist = ['i.rectify', '-ca', 'group=%s' % self.xygroup, 'extension=%s' % self.extension, 'order=%s' % self.gr_order]
-            p = gcmd.Command(cmd=cmdlist)
-            stdout = p.ReadStdOutput()
-            stderr = p.ReadErrOutput()
-            msg = err = ''
-            if p.returncode == 0:
-                for line in stdout:
-                    msg = msg+line+'\n'
-                for line in stderr:
-                    err = err+line+'\n'
-                wx.MessageBox('All maps georectified successfully\n'+msg+'\n'+err)
-            else:
-                for line in stderr:
-                    err = err+line+'\n'
-                wx.MessageBox(err)
+            self.grwiz.SwitchEnv('new')
+
+            self.parent.goutput.RunCmd(['i.rectify',
+                                        '-ca',
+                                        'group=%s' % self.xygroup,
+                                        'extension=%s' % self.extension,
+                                        'order=%s' % self.gr_order])
+
+            self.grwiz.SwitchEnv('original')
+
         elif maptype == 'vector':
             # loop through all vectors in VREF and move resulting vector to target location
             f = open(self.vgrpfile)
@@ -880,101 +1027,85 @@
                 wx.MessageBox('Some maps were not georectified successfully')
         else:
             return
+        
+    def OnSettings(self, event):
+        """Georectifier settings"""
+        dlg = GrSettingsDialog(parent=self, id=wx.ID_ANY, title=_('Georectifier settings'))
+        
+        if dlg.ShowModal() == wx.ID_OK:
+            pass
+        
+        dlg.Destroy()
 
     def OnQuit(self, event):
-        self.Destroy()
+        """Quit georectifier"""
         self.grwiz.Cleanup()
 
-    def OnItemSelected(self, event):
-        self.selected = event.GetIndex()
-        
-    def OnItemActivated(self, event):
-        """
-        When item double clicked, open editor to update coordinate values
-        """
-        coords = []
-        index = event.m_itemIndex
-        for i in range(4):
-            coords.append(self.list.GetItem(index, i).GetText())
-        
-        dlg = EditGPC(self, -1, data=coords)
-        if dlg.ShowModal() == wx.ID_OK:
-            values = dlg.GetValues() # string
-            
-            for i in range(4):
-                if values[i] != coords[i]:
-                    self.list.SetStringItem(index, i, values[i])
-                    
+        self.Destroy()
 
-    def RefreshGCPMarks(self, event):
-        """
-        Updates GCP and map coord maps and redraws
-        active (checked) GCP markers
-        """
-        self.grwiz.SwitchEnv("new")
-        self.grwiz.mapwin.UpdateMap()
-        self.grwiz.SwitchEnv("original")
-        mapid = ''
-        for map in self.mapcoordlist:
-            if map[2] != mapid and map[2] != '':
-                map[2].UpdateMap()
-                mapid = map[2]
-        for index in range(self.list.GetItemCount()):
-            if self.list.IsChecked(index) and (
-                (self.list.GetItem(index, 0).GetText() != '0000000.00' and 
-                 self.list.GetItem(index, 1).GetText() != '0000000.00') or 
-                (self.list.GetItem(index, 2).GetText() != '0000000.00' and 
-                 self.list.GetItem(index, 3).GetText() != '0000000.00')
-                ):
-                coord0 = float(self.list.GetItem(index, 0).GetText())
-                coord1 = float(self.list.GetItem(index, 1).GetText())
-                coord2 = float(self.list.GetItem(index, 2).GetText())
-                coord3 = float(self.list.GetItem(index, 3).GetText())
-                
-                self.grwiz.SwitchEnv("new")
-                pxcoord1 = self.grwiz.mapwin.Cell2Pixel((coord0, coord1))
-                self.grwiz.mapwin.DrawCross(pdc=self.grwiz.mapwin.pdcTmp,
-                                            coords=pxcoord1, size=5)
-                if self.mapcoordlist != [] and self.mapcoordlist[index][2] != '':
-                    self.grwiz.SwitchEnv("original")
-                    pxcoord2 = self.mapcoordlist[index][2].Cell2Pixel((coord2, coord3))
-                    self.mapcoordlist[index][2].DrawCross(pdc=self.mapcoordlist[index][2].pdcTmp,
-                                                      coords=pxcoord2, size=5)
-                
+        event.Skip()
+
     def OnGRMethod(self, event):
         """
         sets transformation order for georectifying
         """
-        self.gr_order = event.GetInt() + 1
+        if event:
+            self.gr_order = event.GetInt() + 1
+
+        numOfItems = self.list.GetItemCount()
+        minNumOfItems = numOfItems
         
+        if self.gr_order == 1:
+            minNumOfItems = 3
+            # self.SetStatusText(_('Insufficient points, 3+ points needed for 1st order'))
+
+        elif self.gr_order == 2:
+            minNumOfItems = 6
+            diff = 6 - numOfItems
+            # self.SetStatusText(_('Insufficient points, 6+ points needed for 2nd order'))
+
+        elif self.gr_order == 3:
+            minNumOfItems = 10
+            # self.SetStatusText(_('Insufficient points, 10+ points needed for 3rd order'))
+
+        for i in range(minNumOfItems - numOfItems):
+            self.AddGCP(None)
+
+        return minNumOfItems
+    
     def RMSError(self, xygroup, order):
         """
         Uses g.transform to calculate forward and backward error for each used GCP
         in POINTS file and insert error values into GCP list.
         Calculates total forward and backward RMS error for all used points
         """
-        
         # save GCPs to points file to make sure that all checked GCPs are used
         self.SaveGCPs(None)
         
         if self.CheckGCPcount(msg=True) == False:
             return
         
-        #get list of forward and reverse rms error values for each point
+        # get list of forward and reverse rms error values for each point
         self.grwiz.SwitchEnv('new')
-        cmdlist = ['g.transform', 'group=%s' % xygroup, 'order=%s' % order]
-        p = gcmd.Command(cmdlist)
+        
+        p = gcmd.Command(['g.transform',
+                          'group=%s' % xygroup,
+                          'order=%s' % order])
+        
+        self.grwiz.SwitchEnv('original')
+
         errlist = p.ReadStdOutput()
         if errlist == []:
             return
         
-        #insert error values into GCP list for checked items
+        # insert error values into GCP list for checked items
         i = 0
         sumsq_fwd_err = 0.0
         sumsq_bkw_err = 0.0
+        
         for index in range(self.list.GetItemCount()):
             if self.list.IsChecked(index):
-                fwd_err,bkw_err = errlist[i].split()
+                fwd_err, bkw_err = errlist[i].split()
                 self.list.SetStringItem(index, 4, fwd_err)
                 self.list.SetStringItem(index, 5, bkw_err)
                 sumsq_fwd_err += float(fwd_err)**2
@@ -984,28 +1115,161 @@
                 self.list.SetStringItem(index, 4, '')
                 self.list.SetStringItem(index, 5, '')
         
-        #calculate RMS error
+        # calculate RMS error
         self.fwd_rmserror = round((sumsq_fwd_err/i)**0.5,4)
         self.bkw_rmserror = round((sumsq_bkw_err/i)**0.5,4)
-        self.ResizeColumns()
-        self.SetStatusText('forward: %s' % self.fwd_rmserror,1)
-        self.SetStatusText('backward: %s' % self.bkw_rmserror,2)
+        self.list.ResizeColumns()
 
-class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin):
-    def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, size=wx.DefaultSize,
-                 style=0):
-        wx.ListCtrl.__init__(self, parent, -ID, pos, size, style)
+        self.SetStatusText(_('RMS error for selected points forward: %s backward: %s') % \
+                           (self.fwd_rmserror, self.bkw_rmserror))
+        
+class GCPList(wx.ListCtrl,
+              CheckListCtrlMixin,
+              ListCtrlAutoWidthMixin):
+              
+    def __init__(self, parent, gcp, id=wx.ID_ANY,
+                 pos=wx.DefaultPosition, size=wx.DefaultSize,
+                 style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_HRULES |
+                 wx.LC_SINGLE_SEL):
+
+        wx.ListCtrl.__init__(self, parent, id, pos, size, style)
+
+        # Mixin settings
         CheckListCtrlMixin.__init__(self)
         ListCtrlAutoWidthMixin.__init__(self)
+        # TextEditMixin.__init__(self)
+
+        self.gcp = gcp # GCP class
+
+        # tracks whether list items are checked or not
+        self.CheckList = [] 
+
+        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
+        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
+
+        self._Create()
+
+        self.selected = wx.NOT_FOUND
+
+    def _Create(self):
+        idx_col = 0
+        for col in (_('use| X coord'),
+                    _('Y coord'),
+                    _('E coord'),
+                    _('N coord'),
+                    _('Forward error'),
+                    _('Backward error')):
+            self.InsertColumn(idx_col, col)
+            idx_col += 1
         
-        self.CheckList = [] # tracks whether list items are checked or not
-        #self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
+    def LoadData(self):
+        """Load data into list"""
+        self.DeleteAllItems()
 
-    # this is called by the base class when an item is checked/unchecked
+        if os.path.isfile(self.gcp.file['points']):
+            self.gcp.ReadGCPs()
+        else:
+            # 3 gcp is minimum
+            for i in range(3):
+                self.gcp.AddGCP(None)
+
+        # select first point by default
+        self.selected = 0
+        self.SetItemState(self.selected,
+                          wx.LIST_STATE_SELECTED,
+                          wx.LIST_STATE_SELECTED)
+
+        self.ResizeColumns()
+
     def OnCheckItem(self, index, flag):
+        """Item is checked/unchecked"""
         pass
     
+    def AddGCPItem(self):
+        """
+        Appends an item to GCP list
+        """
+        self.Append(['0.0',
+                     '0.0',
+                     '0.0',
+                     '0.0',
+                     '',
+                     ''])
 
+        self.selected = self.GetItemCount() - 1
+
+        self.SetItemState(self.selected,
+                          wx.LIST_STATE_SELECTED,
+                          wx.LIST_STATE_SELECTED)
+
+        self.ResizeColumns()
+
+        return self.selected
+
+    def DeleteGCPItem(self):
+        """
+        Deletes selected item in GCP list
+        """
+        if self.selected == wx.NOT_FOUND:
+            return
+
+        self.DeleteItem(self.selected)
+
+        if self.GetItemCount() > 0:
+            self.selected = self.GetItemCount() - 1
+            self.SetItemState(self.selected,
+                              wx.LIST_STATE_SELECTED,
+                              wx.LIST_STATE_SELECTED)
+        else:
+            self.selected = wx.NOT_FOUND
+
+        return self.selected
+        
+    def ResizeColumns(self):
+        """Resize columns"""
+        minWidth = 90
+        for i in range(self.GetColumnCount()):
+            self.SetColumnWidth(i, wx.LIST_AUTOSIZE)
+            if self.GetColumnWidth(i) < minWidth:
+                self.SetColumnWidth(i, minWidth)
+
+        self.SendSizeEvent()
+
+    def GetSelected(self):
+        """Get index of selected item"""
+        return self.selected
+
+    def OnItemSelected(self, event):
+        self.selected = event.GetIndex()
+        
+    def OnItemActivated(self, event):
+        """
+        When item double clicked, open editor to update coordinate values
+        """
+        coords = []
+        index = event.GetIndex()
+
+        for i in range(4):
+            coords.append(self.GetItem(index, i).GetText())
+        
+        dlg = EditGPC(parent=self, id=wx.ID_ANY, data=coords)
+        if dlg.ShowModal() == wx.ID_OK:
+            values = dlg.GetValues() # string
+            
+            if len(values) == 0:
+                wx.MessageBox(parent=self,
+                              caption=_("Edit GCP"),
+                              message=_("Invalid coordinate value. Operation cancelled."),
+                              style=wx.CENTRE | wx.ICON_ERROR | wx.ID_OK)
+            else:
+                for i in range(len(values)):
+                    if values[i] != coords[i]:
+                        self.SetStringItem(index, i, values[i])
+                mapdisp = self.gcp.mapcoordlist[index]['gcpcoord'][2]
+                self.gcp.mapcoordlist[index]['gcpcoord'] = (float(values[0]), float(values[1]), mapdisp)
+                mapdisp = self.gcp.mapcoordlist[index]['mapcoord'][2]
+                self.gcp.mapcoordlist[index]['mapcoord'] = (float(values[0]), float(values[1]), mapdisp)
+        
 class VectGroup(wx.Dialog):
     """
     Dialog to create a vector group (VREF file) for georectifying
@@ -1101,65 +1365,91 @@
          
 
 class EditGPC(wx.Dialog):
-    """Dialog for editing GPC and map coordinates in list control"""
-    def __init__(self, parent, id, data, 
-                style=wx.DEFAULT_DIALOG_STYLE):
-  
-        wx.Dialog.__init__(self, parent, id, style=style)
+    def __init__(self, parent, data, id=wx.ID_ANY,
+                 title=_("Edit GCP"),
+                 style=wx.DEFAULT_DIALOG_STYLE):
+        """Dialog for editing GPC and map coordinates in list control"""
 
-        self.btnCancel = wx.Button(self, wx.ID_CANCEL)
-        self.btnSubmit = wx.Button(self, wx.ID_OK)
-        self.btnSubmit.SetDefault()
+        wx.Dialog.__init__(self, parent, id, title=title, style=style)
 
+        panel = wx.Panel(parent=self)
+
         sizer = wx.BoxSizer(wx.VERTICAL)
+
+        box = wx.StaticBox (parent=panel, id=wx.ID_ANY,
+                            label=" %s " % _("Ground Control Point"))
+        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
+
+        # source coordinates
+        gridSizer = wx.GridBagSizer(vgap=5, hgap=5)
        
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        xlabel = wx.StaticText(parent=self, id=wx.ID_ANY,
-                              label='X:')
-        box.Add(xlabel, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.LEFT, border=5)
-        self.xcoord = wx.TextCtrl(parent=self, id=wx.ID_ANY,
-                            value=data[0], size=(150, -1))
-        box.Add(self.xcoord, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT| wx.LEFT, border=5)
-        ylabel = wx.StaticText(parent=self, id=wx.ID_ANY,
-                              label='Y:')
-        box.Add(ylabel, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT| wx.LEFT, border=5)
-        self.ycoord = wx.TextCtrl(parent=self, id=wx.ID_ANY,
-                            value=data[1], size=(150, -1))
-        box.Add(self.ycoord, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT| wx.LEFT | wx.RIGHT, border=5)
-        sizer.Add(box, flag=wx.ALL, border=3)
+        self.xcoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1))
+        self.ycoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1))
+        self.ncoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1))
+        self.ecoord = wx.TextCtrl(parent=panel, id=wx.ID_ANY, size=(150, -1))
 
-        box = wx.BoxSizer(wx.HORIZONTAL)
-        elabel = wx.StaticText(parent=self, id=wx.ID_ANY,
-                              label='E:')
-        box.Add(elabel, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT| wx.LEFT, border=5)
-        self.ecoord = wx.TextCtrl(parent=self, id=wx.ID_ANY,
-                            value=data[2], size=(150, -1))
-        box.Add(self.ecoord, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT| wx.LEFT, border=5)
-        nlabel = wx.StaticText(parent=self, id=wx.ID_ANY,
-                              label='N:')
-        box.Add(nlabel, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT| wx.LEFT, border=5)
-        self.ncoord = wx.TextCtrl(parent=self, id=wx.ID_ANY,
-                            value=data[3], size=(150, -1))
-        box.Add(self.ncoord, flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT| wx.LEFT | wx.RIGHT, border=5)
-        sizer.Add(box, flag=wx.ALL, border=3)
+        row = 0
+        col = 0
+        idx = 0
+        for label, win in ((_("X:"), self.xcoord),
+                           (_("Y:"), self.ycoord),
+                           (_("E:"), self.ecoord),
+                           (_("N:"), self.ncoord)):
+            label = wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                  label=label)
+            gridSizer.Add(item=label,
+                          flag=wx.ALIGN_CENTER_VERTICAL,
+                          pos=(row, col))
 
+            col += 1
+            win.SetValue(str(data[idx]))
+
+            gridSizer.Add(item=win,
+                          pos=(row, col))
+
+            col += 1
+            idx += 1
+
+            if col > 3:
+                row += 1
+                col = 0
+
+        boxSizer.Add(item=gridSizer, proportion=1,
+                  flag=wx.EXPAND | wx.ALL, border=5)
+
+        sizer.Add(item=boxSizer, proportion=1,
+                  flag=wx.EXPAND | wx.ALL, border=5)
+
+        #
         # buttons
+        #
+        self.btnCancel = wx.Button(panel, wx.ID_CANCEL)
+        self.btnOk = wx.Button(panel, wx.ID_OK)
+        self.btnOk.SetDefault()
+
         btnSizer = wx.StdDialogButtonSizer()
         btnSizer.AddButton(self.btnCancel)
-        btnSizer.AddButton(self.btnSubmit)
+        btnSizer.AddButton(self.btnOk)
         btnSizer.Realize()
 
         sizer.Add(item=btnSizer, proportion=0,
-                  flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                  flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
 
-        self.SetSizer(sizer)
+        panel.SetSizer(sizer)
         sizer.Fit(self)
-        self.Layout()
 
     def GetValues(self, columns=None):
         """Return list of values (as strings).
         """
         valuelist = []
+        try:
+            float(self.xcoord.GetValue())
+            float(self.ycoord.GetValue())
+            float(self.ecoord.GetValue())
+            float(self.ncoord.GetValue())
+        except ValueError:
+            return valuelist
+
         valuelist.append(self.xcoord.GetValue())
         valuelist.append(self.ycoord.GetValue())
         valuelist.append(self.ecoord.GetValue())
@@ -1167,3 +1457,123 @@
 
         return valuelist
 
+class GrSettingsDialog(wx.Dialog):
+    def __init__(self, parent, id, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
+                 style=wx.DEFAULT_DIALOG_STYLE):
+        wx.Dialog.__init__(self, parent, id, title, pos, size, style)
+        """
+        Dialog to set profile text options: font, title
+        and font size, axis labels and font size
+        """
+        #
+        # initialize variables
+        #
+        self.parent = parent
+
+        self.symbol = {}
+
+        self._do_layout()
+        
+    def _do_layout(self):
+        """Do layout"""
+        # dialog layout
+        sizer = wx.BoxSizer(wx.VERTICAL)
+
+        box = wx.StaticBox(parent=self, id=wx.ID_ANY,
+                           label=" %s " % _("Symbol settings"))
+        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
+        gridSizer = wx.GridBagSizer(vgap=5, hgap=5)
+        gridSizer.AddGrowableCol(1)
+
+        #
+        # symbol color
+        #
+        row = 0
+        label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Color:"))
+        gridSizer.Add(item=label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0))
+        col = UserSettings.Get(group='georect', key='symbol', subkey='color')
+        colWin = csel.ColourSelect(parent=self, id=wx.ID_ANY,
+                                   colour=wx.Colour(col[0],
+                                                    col[1],
+                                                    col[2],
+                                                    255))
+        self.symbol['color'] = colWin.GetId()
+        gridSizer.Add(item=colWin,
+                      flag=wx.ALIGN_RIGHT,
+                      pos=(row, 1))
+
+        #
+        # symbol width
+        #
+        row += 1
+        label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Width:"))
+        gridSizer.Add(item=label, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0))
+        width = int(UserSettings.Get(group='georect', key='symbol', subkey='width'))
+        widWin = wx.SpinCtrl(parent=self, id=wx.ID_ANY,
+                             min=1, max=10)
+        widWin.SetValue(width)
+        self.symbol['width'] = widWin.GetId()
+        gridSizer.Add(item=widWin,
+                      flag=wx.ALIGN_RIGHT,
+                      pos=(row, 1))
+        
+        boxSizer.Add(item=gridSizer, flag=wx.EXPAND)
+        sizer.Add(item=boxSizer, flag=wx.EXPAND | wx.ALL, border=5)
+
+        line = wx.StaticLine(parent=self, id=wx.ID_ANY, size=(20, -1), style=wx.LI_HORIZONTAL)
+        sizer.Add(item=line, proportion=0,
+                  flag=wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT, border=3)
+
+        #
+        # buttons
+        #
+        btnSave = wx.Button(self, wx.ID_SAVE)
+        btnApply = wx.Button(self, wx.ID_APPLY)
+        btnCancel = wx.Button(self, wx.ID_CANCEL)
+        btnSave.SetDefault()
+
+        # bindigs
+        btnApply.Bind(wx.EVT_BUTTON, self.OnApply)
+        btnApply.SetToolTipString(_("Apply changes for the current session"))
+        btnSave.Bind(wx.EVT_BUTTON, self.OnSave)
+        btnSave.SetToolTipString(_("Apply and save changes to user settings file (default for next sessions)"))
+        btnSave.SetDefault()
+        btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel)
+        btnCancel.SetToolTipString(_("Close dialog and ignore changes"))
+
+        # sizers
+        btnStdSizer = wx.StdDialogButtonSizer()
+        btnStdSizer.AddButton(btnCancel)
+        btnStdSizer.AddButton(btnSave)
+        btnStdSizer.AddButton(btnApply)
+        btnStdSizer.Realize()
+        
+        sizer.Add(item=btnStdSizer, proportion=0, flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
+
+        self.SetSizer(sizer)
+        sizer.Fit(self)
+
+    def UpdateSettings(self):
+        UserSettings.Set(group='georect', key='symbol', subkey='color',
+                         value=wx.FindWindowById(self.symbol['color']).GetColour())
+        UserSettings.Set(group='georect', key='symbol', subkey='width',
+                         value=wx.FindWindowById(self.symbol['width']).GetValue())
+
+    def OnSave(self, event):
+        """Button 'Save' pressed"""
+        self.UpdateSettings()
+        fileSettings = {}
+        UserSettings.ReadSettingsFile(settings=fileSettings)
+        fileSettings['georect'] = UserSettings.Get(group='georect')
+        file = UserSettings.SaveToFile(fileSettings)
+        self.parent.parent.goutput.WriteLog(_('Georectifier settings saved to file \'%s\'.') % file)
+        self.Close()
+
+    def OnApply(self, event):
+        """Button 'Apply' pressed"""
+        self.UpdateSettings()
+        self.Close()
+
+    def OnCancel(self, event):
+        """Button 'Cancel' pressed"""
+        self.Close()

Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -80,6 +80,8 @@
 DIALOG_GSELECT_SIZE = (400, -1)
 DIALOG_TEXTCTRL_SIZE = (400, -1)
 
+MAP_WINDOW_SIZE = (680, 520)
+
 """File name extension binaries/scripts"""
 if subprocess.mswindows:
     EXT_BIN = '.exe'

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -231,7 +231,7 @@
         self.dragid   = -1
         self.lastpos  = (0, 0)
 
-    def Draw(self, pdc, img=None, drawid=None, pdctype='image', coords=[0,0,0,0]):
+    def Draw(self, pdc, img=None, drawid=None, pdctype='image', coords=[0, 0, 0, 0]):
         """
         Draws map and overlay decorations
         """
@@ -632,10 +632,19 @@
 
         self.DrawCompRegionExtent()
 
+        #
         # redraw pdcTmp if needed
+        #
         if len(self.polycoords) > 0:
             self.DrawLines(self.pdcTmp)
-
+        if self.parent.gismanager.georectifying:
+            # -> georectifier (redraw GCPs)
+            if self.parent.grtoolbar:
+                coordtype = 'gcpcoord'
+            else:
+                coordtype = 'mapcoord'
+            self.parent.gismanager.georectifying.DrawGCP(coordtype)
+            
         stop = time.clock()
 
         #
@@ -831,10 +840,18 @@
 
         return -1
 
-    def DrawCross(self, pdc, coords, size, rotation=0):
+    def DrawCross(self, pdc, coords, size, rotation=0,
+                  text=None, textAlign='lr', textOffset=(5, 5)):
         """Draw cross in PseudoDC
 
-           TODO: implement rotation
+        @todo implement rotation
+
+        @param pdc PseudoDC
+        @param coord center coordinates
+        @param rotation rotate symbol
+        @param text draw also text (text, font, color, rotation)
+        @param textAlign alignment (default 'lower-right')
+        @textOffset offset for text (from center point)
         """
         Debug.msg(4, "BufferedWindow.DrawCross(): pdc=%s, coords=%s, size=%d" % \
                   (pdc, coords, size))
@@ -845,6 +862,21 @@
         for lineCoords in coordsCross:
             self.Draw(pdc, drawid=self.lineid, pdctype='line', coords=lineCoords)
 
+        if not text:
+            return self.lineid
+
+        if textAlign == 'ul':
+            coord = [coords[0] - textOffset[0], coords[1] - textOffset[1], 0, 0]
+        elif textAlign == 'ur':
+            coord = [coords[0] + textOffset[0], coords[1] - textOffset[1], 0, 0]
+        elif textAlign == 'lr':
+            coord = [coords[0] + textOffset[0], coords[1] + textOffset[1], 0, 0]
+        else:
+            coord = [coords[0] - textOffset[0], coords[1] + textOffset[1], 0, 0]
+        
+        self.Draw(pdc, img=text,
+                  pdctype='text', coords=coord)
+
         return self.lineid
 
     def MouseActions(self, event):
@@ -1229,17 +1261,18 @@
                 self.DrawLines(pdc=self.pdcTmp)
             except:
                 pass
+
         elif self.mouse["use"] == "pointer" and self.parent.gismanager.georectifying:
-            self.SetCursor(self.parent.cursors["cross"])
+            # -> georectifying
             coord = self.Pixel2Cell(self.mouse['end'])
-            if self.parent.georect:
+            if self.parent.grtoolbar:
                 coordtype = 'gcpcoord'
             else:
                 coordtype = 'mapcoord'
-            self.gismanager.gr.gcpmgr.SetGCPData(coordtype, coord, self)
-            self.DrawCross(pdc=self.pdcTmp, coords=self.mouse['end'],
-                                       size=5)
 
+            self.parent.gismanager.georectifying.SetGCPData(coordtype, coord, self)
+            self.UpdateMap(render=False, renderVector=False)
+
         elif self.mouse["use"] == "pointer" and self.parent.digittoolbar:
             # digitization tool active
             digitToolbar = self.parent.digittoolbar
@@ -1985,7 +2018,7 @@
         zoomreg = {}
 
         # find selected map
-        if not self.tree.GetSelection():
+        if not self.tree or not self.tree.GetSelection():
             return
 
         item  = self.tree.GetSelection()
@@ -2187,26 +2220,17 @@
                  pos=wx.DefaultPosition, size=wx.DefaultSize,
                  style=wx.DEFAULT_FRAME_STYLE, toolbars=["map"],
                  tree=None, notebook=None, gismgr=None, page=None,
-                 Map=None, auimgr=None, georect=False):
+                 Map=None, auimgr=None):
         """
-            Main map display window with toolbars, statusbar and
-            DrawWindow
+        Main map display window with toolbars, statusbar and
+        DrawWindow
 
-            Parameters:
-                parent  -- parent window, None, wx.Window()
-                id      -- window ID, int, wx.ID_ANY
-                title   -- window title, string
-                pos     -- where to place it, tupple, wx.Position
-                size    -- window size, tupple, wx.Size
-                style   -- window style
-                toolbars-- array of default toolbars, which should appear,
-                           currently: ['map', 'digit']
-                notebook-- control book ID in GIS Manager
-                tree    -- associated layer tree
-                gismgr  -- GIS Manager panel
-                page    -- notebook page with layer tree
-                Map     -- instance of render.Map
-                georect -- is window used by georectifier
+        @param toolbars array of activated toolbars, e.g. ['map', 'digit']
+        @param tree reference to layer tree
+        @param notebook control book ID in Layer Manager
+        @param gismgr Layer Manager panel
+        @param page notebook page with layer tree
+        @param Map instance of render.Map
         """
 
         wx.Frame.__init__(self, parent, id, title, pos, size, style)
@@ -2216,7 +2240,6 @@
         self.tree       = tree      # GIS Manager layer tree object
         self.page       = page      # Notebook page holding the layer tree
         self.layerbook  = notebook  # GIS Manager layer tree notebook
-        self.georect    = georect   # Map display used for setting GCPs for georectifier
         self.parent     = parent
 
         #
@@ -2380,28 +2403,28 @@
         Add defined toolbar to the window
 
         Currently known toolbars are:
-            * map
-            * digit
-            * georect
-        """
+         - map basic map toolbar
+         - digit vector digitizer
+         - georect georectifier
+         """
         if name == "map":
             self.maptoolbar = toolbars.MapToolbar(self, self.Map)
 
             self._mgr.AddPane(self.maptoolbar.toolbar,
                               wx.aui.AuiPaneInfo().
-                              Name("maptoolbar").Caption("Map Toolbar").
+                              Name("maptoolbar").Caption(_("Map Toolbar")).
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
                               CloseButton(False).Layer(2))
 
-        elif name == "digit":
+        if name == "digit":
             self.digittoolbar = toolbars.VDigitToolbar(self, self.Map, self.tree)
 
             for toolRow in range(0, self.digittoolbar.numOfRows):
                 self._mgr.AddPane(self.digittoolbar.toolbar[toolRow],
                                   wx.aui.AuiPaneInfo().
-                                  Name("digittoolbar" + str(toolRow)).Caption("Digit Toolbar").
+                                  Name("digittoolbar" + str(toolRow)).Caption(_("Digit Toolbar")).
                                   ToolbarPane().Top().Row(toolRow + 1).
                                   LeftDockable(False).RightDockable(False).
                                   BottomDockable(False).TopDockable(True).
@@ -2413,12 +2436,12 @@
             self.MapWindow.pen     = wx.Pen(colour='red',   width=2, style=wx.SOLID)
             self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SOLID)
 
-        elif name == "georect":
+        if name == "georect":
             self.grtoolbar = toolbars.GRToolbar(self, self.Map)
 
             self._mgr.AddPane(self.grtoolbar.toolbar,
                               wx.aui.AuiPaneInfo().
-                              Name("grtoolbar").Caption("Georectification Toolbar").
+                              Name("grtoolbar").Caption(_("Georectification Toolbar")).
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
@@ -2462,27 +2485,17 @@
         Change choicebook page to match display.
         Or set display for georectifying
         """
-        if self.georect:
-            # display used to set GCPs in map to georectify
-            try:
-                if event.GetActive():
-                    self.gismanager.gr.SwitchEnv('new')
-                else:
-                    self.gismanager.gr.SwitchEnv('original')
-            except:
-                pass
-            
-        elif self.gismanager.georectifying:
+        if self.gismanager.georectifying:
             # in georectifying session; display used to get get geographic
             # coordinates for GCPs
-            self.MapWindow.pen = wx.Pen(colour='black', width=2, style=wx.SOLID)
-            self.MapWindow.SetCursor(self.cursors["cross"])
+            self.OnPointer(event)
         else:
             # change bookcontrol page to page associated with display
-            if self.page :
+            if self.page:
                 pgnum = self.layerbook.GetPageIndex(self.page)
                 if pgnum > -1:
                     self.layerbook.SetSelection(pgnum)
+        
         event.Skip()
 
     def OnMotion(self, event):
@@ -2687,17 +2700,17 @@
                                          (self.Map.region["w"], self.Map.region["e"],
                                           self.Map.region["s"], self.Map.region["n"]), 0)
 
-        elif self.toggleStatus.GetSelection() == 2: # Show comp. extent
-            self.statusbar.SetStatusText("", 0)
-            self.showRegion.Show()
-
-        elif self.toggleStatus.GetSelection() == 3: # Comp. region
+        elif self.toggleStatus.GetSelection() == 2: # Comp. region
             compregion = self.Map.GetRegion()
             self.statusbar.SetStatusText("%.2f - %.2f, %.2f - %.2f (%.2f, %.2f)" %
                                          (compregion["w"], compregion["e"],
                                           compregion["s"], compregion["n"],
                                           compregion["ewres"], compregion["nsres"]), 0)
 
+        elif self.toggleStatus.GetSelection() == 3: # Show comp. extent
+            self.statusbar.SetStatusText("", 0)
+            self.showRegion.Show()
+
         elif self.toggleStatus.GetSelection() == 4: # Display mode
             self.statusbar.SetStatusText("", 0)
             self.compResolution.Show()

Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -149,44 +149,49 @@
                 'saveOnExit'            : { 'enabled' : False },
                 },
             'profile': {
-            'raster0' : { 'pcolor' : (0, 0, 255, 255), # profile line color
-                          'pwidth' : 1, # profile line width
-                          'pstyle' : 'solid', # profile line pen style
-                          },
-            'raster1' : { 'pcolor' : (255, 0, 0, 255), 
-                          'pwidth' : 1, 
-                          'pstyle' : 'solid', 
-                          },
-            'raster2' : { 'pcolor' : (0, 255, 0, 255), 
-                          'pwidth' : 1, 
-                          'pstyle' : 'solid', 
-                          },
-            'font' : { 'titleSize' : 12,
-                       'axisSize' : 11,
-                       'legendSize' : 10,
-                       },
-            'marker' : { 'color' : wx.Colour(0, 0, 0),
-                         'fill' : 'transparent',
-                         'size' : 2,
-                         'type' : 'triangle',
-                         'legend' : _('Segment break'),
-                         },
-            'grid' : { 'color' : wx.Colour(200,200,200) ,
-                       'enabled' : True,
-                       },
-            'x-axis' : { 'type' : 'auto', # axis format
-                         'min' : 0, # axis min for custom axis range
-                         'max': 0, # axis max for custom axis range
-                         'log' : False,
-                         },
-            'y-axis' : { 'type' : 'auto', # axis format
-                         'min' : 0, # axis min for custom axis range
-                         'max': 0, # axis max for custom axis range
-                         'log' : False,
-                         },
-            'legend' : { 'enabled' : True
-                         },
-            },
+                'raster0' : { 'pcolor' : (0, 0, 255, 255), # profile line color
+                              'pwidth' : 1, # profile line width
+                              'pstyle' : 'solid', # profile line pen style
+                              },
+                'raster1' : { 'pcolor' : (255, 0, 0, 255), 
+                              'pwidth' : 1, 
+                              'pstyle' : 'solid', 
+                              },
+                'raster2' : { 'pcolor' : (0, 255, 0, 255), 
+                              'pwidth' : 1, 
+                              'pstyle' : 'solid', 
+                              },
+                'font' : { 'titleSize' : 12,
+                           'axisSize' : 11,
+                           'legendSize' : 10,
+                           },
+                'marker' : { 'color' : wx.Colour(0, 0, 0),
+                             'fill' : 'transparent',
+                             'size' : 2,
+                             'type' : 'triangle',
+                             'legend' : _('Segment break'),
+                             },
+                'grid' : { 'color' : wx.Colour(200,200,200) ,
+                           'enabled' : True,
+                           },
+                'x-axis' : { 'type' : 'auto', # axis format
+                             'min' : 0, # axis min for custom axis range
+                             'max': 0, # axis max for custom axis range
+                             'log' : False,
+                             },
+                'y-axis' : { 'type' : 'auto', # axis format
+                             'min' : 0, # axis min for custom axis range
+                             'max': 0, # axis max for custom axis range
+                             'log' : False,
+                             },
+                'legend' : { 'enabled' : True
+                             },
+                },
+            'georect' : {
+                'symbol' : { 'color' : (0, 0, 255, 255),
+                             'width' : 2,
+                             },
+                },
             }
 
         #

Modified: grass/trunk/gui/wxpython/gui_modules/profile.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/profile.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/profile.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -38,8 +38,6 @@
     downloading source or binaries."""
     print >> sys.stderr, "profile.py: " + msg
 
-from threading import Thread
-
 import globalvar
 try:
     import subprocess

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -24,7 +24,6 @@
 import sys
 import glob
 import math
-# import time
 try:
     import subprocess
 except:
@@ -262,7 +261,7 @@
     """
     Map composition (stack of map layers and overlays)
     """
-    def __init__(self):
+    def __init__(self, gisrc=None):
         # 
         # region/extent settigns
         #
@@ -282,8 +281,11 @@
         #
         # environment settings
         #
-        self.env       = {}  # enviroment variables, like MAPSET, LOCATION_NAME, etc.
-
+        # enviroment variables, like MAPSET, LOCATION_NAME, etc.
+        self.env         = {}
+        # path to external gisrc
+        self.gisrc = gisrc
+        
         # 
         # generated file for rendering the map
         #
@@ -334,6 +336,11 @@
         if not os.getenv("GISBASE"):
             print >> sys.stderr, _("GISBASE not set. You must be in GRASS GIS to run this program.")
             sys.exit(1)
+            
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
 
         gisenvCmd = gcmd.Command(["g.gisenv"])
 
@@ -344,6 +351,10 @@
             val = val.replace("'","")
             self.env[key] = val
 
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
+
     def GetWindow(self):
         """Read WIND file and set up self.wind dictionary"""
         # FIXME: duplicated region WIND == g.region (at least some values)
@@ -484,6 +495,11 @@
         tmpreg = os.getenv("GRASS_REGION")
         os.unsetenv("GRASS_REGION")
 
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
+
         # do not update & shell style output
         cmdList = ["g.region", "-u", "-g", "-p", "-c"]
 
@@ -524,6 +540,10 @@
             except ValueError:
                 region[key] = val
 
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
+
         # restore region
         if tmpreg:
             os.environ["GRASS_REGION"] = tmpreg
@@ -701,12 +721,15 @@
         @return name of file with rendered image or None
         """
 
-        # startTime = time.time()
-
         maps = []
         masks =[]
         opacities = []
 
+        # use external gisrc if defined
+        gisrc_orig = os.getenv("GISRC")
+        if self.gisrc:
+            os.environ["GISRC"] = self.gisrc
+
         tmp_region = os.getenv("GRASS_REGION")
         os.environ["GRASS_REGION"] = self.SetRegion(windres)
         os.environ["GRASS_WIDTH"]  = str(self.width)
@@ -789,10 +812,12 @@
             print >> sys.stderr, e
             return None
 
+        # back to original gisrc
+        if self.gisrc:
+            os.environ["GISRC"] = gisrc_orig
+
         Debug.msg (2, "Map.Render() force=%s file=%s" % (force, self.mapfile))
 
-        # print time.time() - startTime
-
         return self.mapfile
 
     def AddLayer(self, type, command, name=None,

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -5,6 +5,7 @@
     * AbstractToolbar
     * MapToolbar
     * GRToolbar
+    * GCPToolbar
     * VDigitToolbar
     * ProfileToolbar
     
@@ -67,8 +68,8 @@
 
         if label:
             toolWin = toolbar.AddLabelTool(tool, label, bitmap,
-                                        bmpDisabled, kind,
-                                        shortHelp, longHelp)
+                                           bmpDisabled, kind,
+                                           shortHelp, longHelp)
             parent.Bind(wx.EVT_TOOL, handler, toolWin)
         else: # add separator
             toolbar.AddSeparator()
@@ -225,8 +226,8 @@
              wx.ITEM_NORMAL, Icons["erase"].GetLabel(), Icons["erase"].GetDesc(),
              self.mapdisplay.OnErase),
             ("", "", "", "", "", "", ""),
-            (self.gcpset, "gcpset", Icons["gcpset"].GetBitmap(),
-             wx.ITEM_RADIO, Icons["gcpset"].GetLabel(), Icons["gcpset"].GetDesc(),
+            (self.gcpset, "grGcpSet", Icons["grGcpSet"].GetBitmap(),
+             wx.ITEM_RADIO, Icons["grGcpSet"].GetLabel(), Icons["grGcpSet"].GetDesc(),
              self.mapdisplay.OnPointer),
             (self.pan, "pan", Icons["pan"].GetBitmap(),
              wx.ITEM_RADIO, Icons["pan"].GetLabel(), Icons["pan"].GetDesc(),
@@ -243,18 +244,72 @@
             (self.zoommenu, "zoommenu", Icons["zoommenu"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["zoommenu"].GetLabel(), Icons["zoommenu"].GetDesc(),
              self.mapdisplay.OnZoomMenu),
-            ("", "", "", "", "", "", "")
             )
 
-    def OnSelect(self, event):
-        """
-        Select / enable tool available in tools list
-        """
-        tool =  event.GetString()
+class GCPToolbar(AbstractToolbar):
+    """
+    Toolbar for digitization
+    """
+    def __init__(self, parent, mapdisplay, map):
+        self.parent     = parent # GCP
+        self.mapcontent = map
+        self.mapdisplay = mapdisplay
 
-        if tool == "Digitize" and not self.mapdisplay.digittoolbar:
-            self.mapdisplay.AddToolbar("digit")
+        self.toolbar = wx.ToolBar(parent=self.mapdisplay, id=wx.ID_ANY)
 
+        # self.SetToolBar(self.toolbar)
+        self.toolbar.SetToolBitmapSize(globalvar.toolbarSize)
+
+        self.InitToolbar(self.mapdisplay, self.toolbar, self.ToolbarData())
+
+        # realize the toolbar
+        self.toolbar.Realize()
+
+    def ToolbarData(self):
+        
+        self.gcpSave = wx.NewId()
+        self.gcpAdd = wx.NewId()
+        self.gcpDelete = wx.NewId()
+        self.gcpClear = wx.NewId()
+        self.gcpReload = wx.NewId()
+        self.rms = wx.NewId()
+        self.georect = wx.NewId()
+        self.settings = wx.NewId()
+        self.quit = wx.NewId()
+
+        return (
+            (self.gcpSave, 'grGcpSave', Icons["grGcpSave"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpSave"].GetLabel(), Icons["grGcpSave"].GetDesc(),
+             self.parent.SaveGCPs),
+            (self.gcpAdd, 'grGrGcpAdd', Icons["grGcpAdd"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpAdd"].GetLabel(), Icons["grGcpAdd"].GetDesc(),
+             self.parent.AddGCP),
+            (self.gcpDelete, 'grGrGcpDelete', Icons["grGcpDelete"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpDelete"].GetLabel(), Icons["grGcpDelete"].GetDesc(), 
+             self.parent.DeleteGCP),
+            (self.gcpClear, 'grGcpClear', Icons["grGcpClear"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpClear"].GetLabel(), Icons["grGcpClear"].GetDesc(), 
+             self.parent.ClearGCP),
+            (self.gcpReload, 'grGcpReload', Icons["grGcpReload"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpReload"].GetLabel(), Icons["grGcpReload"].GetDesc(), 
+             self.parent.ReloadGCPs),
+
+            ("", "", "", "", "", "", ""),
+            (self.rms, 'grGcpRms', Icons["grGcpRms"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["grGcpRms"].GetLabel(), Icons["grGcpRms"].GetDesc(),
+             self.parent.OnRMS),
+            (self.georect, 'grGeorect', Icons["grGeorect"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grGeorect"].GetLabel(), Icons["grGeorect"].GetDesc(),
+             self.parent.OnGeorect),
+            ("", "", "", "", "", "", ""),
+            (self.settings, 'grSettings', Icons["grSettings"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grSettings"].GetLabel(), Icons["grSettings"].GetDesc(),
+             self.parent.OnSettings),
+            (self.quit, 'grGcpQuit', Icons["grGcpQuit"].GetBitmap(), 
+             wx.ITEM_NORMAL, Icons["grGcpQuit"].GetLabel(), Icons["grGcpQuit"].GetDesc(),
+             self.parent.OnQuit)
+            )
+    
 class VDigitToolbar(AbstractToolbar):
     """
     Toolbar for digitization

Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/icons/icon.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -77,9 +77,9 @@
     ## attributes
     "digDispAttr" : 'display.attributes.gif',
     ## general
-    "digUndo" : wx.ART_ERROR,
+    "digUndo" : wx.ART_ERROR, # FIXME
     "digSettings" : 'settings.gif',
-    "digAdditionalTools" : wx.ART_ERROR,
+    "digAdditionalTools" : wx.ART_ERROR, # FIXME
     # gis manager
     "newdisplay" : 'gui-startmon.gif',
     "workspaceNew" : 'file-new.gif',
@@ -115,18 +115,24 @@
     "font"       : 'gui-font.gif',
     "histogram"  : 'module-d.histogram.gif',
     "color"      : 'edit-color.gif',
-    "options"    : wx.ART_ERROR,
+    "options"    :  wx.ART_ERROR, # FIXME
+    # profile 
     "profile"    : 'gui-profile.gif',
     "transect"   : 'gui-profiledefine.gif',
-#    "profiledraw": 'gui-profiledraw.gif',
-    "profiledraw"  : 'gui-redraw.gif',
+    # "profiledraw": 'gui-profiledraw.gif',
+    "profiledraw" : 'gui-redraw.gif',
     "profileopt" : 'gui-profileopt.gif',
     # georectify
-    'cleargcp'   : 'gui-gcperase.gif',
-    'gcpset'     : 'gui-gcpset.gif',
-    'georect'    : 'gui-georect.gif',
-    'rms'        : 'gui-rms.gif',
-    'refreshgcp' : 'gui-display.gif'
+    'grGcpClear'   : 'gui-gcperase.gif',
+    'grGcpSet'     : 'gui-gcpset.gif',
+    'grGeorect'    : 'gui-georect.gif',
+    'grGcpRms'     : 'gui-rms.gif',
+    'grGcpRefresh' : 'gui-display.gif',
+    "grGcpSave"    : 'file-save.gif', 
+    "grGcpAdd"     : wx.ART_ERROR, # FIXME
+    "grGcpDelete"  : wx.ART_ERROR, # FIXME
+    "grGcpReload"  : 'gui-redraw.gif',
+    "grSettings"   : 'edit-color.gif', 
     }
 
 # merge icons dictionaries, join paths
@@ -215,113 +221,204 @@
 #
 Icons = {
     # map display
-    "displaymap" : MetaIcon (img=icons_img["displaymap"], label="Display map"),
-    "rendermap"  : MetaIcon (img=icons_img["rendermap"], label="Re-render map",
-                             desc="Force re-rendering of all layers"),
-    "erase"      : MetaIcon (img=icons_img["erase"], label="Erase display"),
-    "pointer"    : MetaIcon (img=icons_img["pointer"], label="Pointer"),
-    "zoom_in"    : MetaIcon (img=icons_img["zoom_in"], label="Zoom in",
-                             desc="Drag or click mouse to zoom"),
-    "zoom_out"   : MetaIcon (img=icons_img["zoom_out"], label="Zoom out",
-                             desc="Drag or click mouse to unzoom"),
-    "pan"        : MetaIcon (img=icons_img["pan"], label="Pan",
-                             desc="Drag with mouse to pan"),
-    "queryDisplay" : MetaIcon (img=icons_img["query"], label="Query raster/vector map(s) (display mode)",
-                             desc="Query selected raster/vector map(s)"),
-    "queryModify" : MetaIcon (img=icons_img["query"], label="Query vector map (editable mode)",
-                             desc="Query selected vector map in editable mode"),
-    "zoom_back"  : MetaIcon (img=icons_img["zoom_back"], label="Return to previous zoom"),
-    "zoommenu"   : MetaIcon (img=icons_img["zoommenu"], label="Zoom options",
-                             desc="Display zoom management"),
-    "overlay"    : MetaIcon (img=icons_img["overlay"], label="Add overlay",
-                             desc="Add graphic overlays to map"),
-    "addbarscale": MetaIcon (img=icons_img["addbarscale"], label="Add scalebar and north arrow"),
-    "addlegend"  : MetaIcon (img=icons_img["addlegend"], label="Add legend"),
-    "savefile"   : MetaIcon (img=icons_img["savefile"], label="Save display to PNG file"),
-    "printmap"   : MetaIcon (img=icons_img["printmap"], label="Print display"),
+    "displaymap" : MetaIcon (img=icons_img["displaymap"],
+                             label=_("Display map")),
+    "rendermap"  : MetaIcon (img=icons_img["rendermap"],
+                             label=_("Re-render map"),
+                             desc=_("Force re-rendering of all layers")),
+    "erase"      : MetaIcon (img=icons_img["erase"],
+                             label=_("Erase display")),
+    "pointer"    : MetaIcon (img=icons_img["pointer"],
+                             label=_("Pointer")),
+    "zoom_in"    : MetaIcon (img=icons_img["zoom_in"],
+                             label=_("Zoom in"),
+                             desc=_("Drag or click mouse to zoom")),
+    "zoom_out"   : MetaIcon (img=icons_img["zoom_out"],
+                             label=_("Zoom out"),
+                             desc=_("Drag or click mouse to unzoom")),
+    "pan"        : MetaIcon (img=icons_img["pan"],
+                             label=_("Pan"),
+                             desc=_("Drag with mouse to pan")),
+    "queryDisplay" : MetaIcon (img=icons_img["query"],
+                               label=_("Query raster/vector map(s) (display mode)"),
+                               desc=_("Query selected raster/vector map(s)")),
+    "queryModify" : MetaIcon (img=icons_img["query"],
+                              label=_("Query vector map (editable mode)"),
+                             desc=_("Query selected vector map in editable mode")),
+    "zoom_back"  : MetaIcon (img=icons_img["zoom_back"],
+                             label=_("Return to previous zoom")),
+    "zoommenu"   : MetaIcon (img=icons_img["zoommenu"],
+                             label=_("Zoom options"),
+                             desc=_("Display zoom management")),
+    "overlay"    : MetaIcon (img=icons_img["overlay"],
+                             label=_("Add overlay"),
+                             desc=_("Add graphic overlays to map")),
+    "addbarscale": MetaIcon (img=icons_img["addbarscale"],
+                             label=_("Add scalebar and north arrow")),
+    "addlegend"  : MetaIcon (img=icons_img["addlegend"],
+                             label=_("Add legend")),
+    "savefile"   : MetaIcon (img=icons_img["savefile"],
+                             label=_("Save display to PNG file")),
+    "printmap"   : MetaIcon (img=icons_img["printmap"],
+                             label=_("Print display")),
     # gis manager
-    "newdisplay" : MetaIcon (img=icons_img["newdisplay"], label="Start new display"),
-    "workspaceNew" : MetaIcon (img=icons_img["workspaceNew"], label="Create new workspace file"),
-    "workspaceLoad" : MetaIcon (img=icons_img["workspaceLoad"], label="Load map layers into workspace"),
-    "workspaceOpen" : MetaIcon (img=icons_img["workspaceOpen"], label="Open existing workspace file"),
-    "workspaceSave" : MetaIcon (img=icons_img["workspaceSave"], label="Save current workspace to file"),
+    "newdisplay" : MetaIcon (img=icons_img["newdisplay"],
+                             label=_("Start new display")),
+    "workspaceNew" : MetaIcon (img=icons_img["workspaceNew"],
+                               label=_("Create new workspace file")),
+    "workspaceLoad" : MetaIcon (img=icons_img["workspaceLoad"],
+                                label=_("Load map layers into workspace")),
+    "workspaceOpen" : MetaIcon (img=icons_img["workspaceOpen"],
+                                label=_("Open existing workspace file")),
+    "workspaceSave" : MetaIcon (img=icons_img["workspaceSave"],
+                                label=_("Save current workspace to file")),
     # TODO: "layer" is not conformant with GRASS vocabulary (vector layer: 1..x) ! 
-    "addrast"    : MetaIcon (img=icons_img["addrast"], label="Add raster map layer"),
-    "addvect"    : MetaIcon (img=icons_img["addvect"], label="Add vector map layer"),
-    "addcmd"     : MetaIcon (img=icons_img["addcmd"], label="Add command layer"),
-    "addgrp"     : MetaIcon (img=icons_img["addgrp"], label="Add layer group"),
-    "addovl"     : MetaIcon (img=icons_img["addovl"], label="Add grid or vector labels overlay"),
-    "delcmd"     : MetaIcon (img=icons_img["delcmd"], label="Delete selected layer"),
-    "quit"       : MetaIcon (img=icons_img["quit"], label="Quit"),
-    "attrtable"  : MetaIcon (img=icons_img["attrtable"], label="Show attribute table"),
-    "addrgb"     : MetaIcon (img=icons_img["addrgb"], label="Add RGB layer"),
-    "addhis"     : MetaIcon (img=icons_img["addhis"], label="Add HIS layer"),
-    "addshaded"  : MetaIcon (img=icons_img["addshaded"], label="Add shaded relief map layer"),
-    "addrarrow"  : MetaIcon (img=icons_img["addrarrow"], label="Add raster flow arrows"),
-    "addrnum"    : MetaIcon (img=icons_img["addrnum"], label="Add raster cell numbers"),
-    "elvect"     : MetaIcon (img=icons_img["elvect"], label=""),
-    "addthematic": MetaIcon (img=icons_img["addthematic"], label="Add thematic layer"),
-    "addchart"   : MetaIcon (img=icons_img["addchart"], label="Add thematic chart layer"),
-    "addgrid"    : MetaIcon (img=icons_img["addgrid"], label="Add grid layer"),
-    "addgeodesic": MetaIcon (img=icons_img["addgeodesic"], label="Add geodesic line layer"),
-    "addrhumb"   : MetaIcon (img=icons_img["addrhumb"], label="Add rhumbline layer"),
-    "addlabels"  : MetaIcon (img=icons_img["addlabels"], label="Add labels"),
-    "addtext"    : MetaIcon (img=icons_img["addtext"], label="Add text layer"),
+    "addrast"    : MetaIcon (img=icons_img["addrast"],
+                             label=_("Add raster map layer")),
+    "addvect"    : MetaIcon (img=icons_img["addvect"],
+                             label=_("Add vector map layer")),
+    "addcmd"     : MetaIcon (img=icons_img["addcmd"],
+                             label=_("Add command layer")),
+    "addgrp"     : MetaIcon (img=icons_img["addgrp"],
+                             label=_("Add layer group")),
+    "addovl"     : MetaIcon (img=icons_img["addovl"],
+                             label=_("Add grid or vector labels overlay")),
+    "delcmd"     : MetaIcon (img=icons_img["delcmd"],
+                             label=_("Delete selected layer")),
+    "quit"       : MetaIcon (img=icons_img["quit"],
+                             label=_("Quit")),
+    "attrtable"  : MetaIcon (img=icons_img["attrtable"],
+                             label=_("Show attribute table")),
+    "addrgb"     : MetaIcon (img=icons_img["addrgb"],
+                             label=_("Add RGB layer")),
+    "addhis"     : MetaIcon (img=icons_img["addhis"],
+                             label=_("Add HIS layer")),
+    "addshaded"  : MetaIcon (img=icons_img["addshaded"],
+                             label=_("Add shaded relief map layer")),
+    "addrarrow"  : MetaIcon (img=icons_img["addrarrow"],
+                             label=_("Add raster flow arrows")),
+    "addrnum"    : MetaIcon (img=icons_img["addrnum"],
+                             label=_("Add raster cell numbers")),
+    "elvect"     : MetaIcon (img=icons_img["elvect"],
+                             label=_("")),
+    "addthematic": MetaIcon (img=icons_img["addthematic"],
+                             label=_("Add thematic layer")),
+    "addchart"   : MetaIcon (img=icons_img["addchart"],
+                             label=_("Add thematic chart layer")),
+    "addgrid"    : MetaIcon (img=icons_img["addgrid"],
+                             label=_("Add grid layer")),
+    "addgeodesic": MetaIcon (img=icons_img["addgeodesic"],
+                             label=_("Add geodesic line layer")),
+    "addrhumb"   : MetaIcon (img=icons_img["addrhumb"],
+                             label=_("Add rhumbline layer")),
+    "addlabels"  : MetaIcon (img=icons_img["addlabels"],
+                             label=_("Add labels")),
+    "addtext"    : MetaIcon (img=icons_img["addtext"],
+                             label=_("Add text layer")),
     # digit
-    "digAddPoint": MetaIcon (img=icons_img["digAddPoint"], label="Digitize new point",
-                             desc="Left: new point"),
-    "digAddLine" : MetaIcon (img=icons_img["digAddLine"], label="Digitize new line",
-                             desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digAddBoundary": MetaIcon (img=icons_img["digAddBoundary"], label="Digitize new boundary",
-                             desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digAddCentroid": MetaIcon (img=icons_img["digAddCentroid"], label="Digitize new centroid",
-                             desc="Left: new point"),
-    "digAddVertex": MetaIcon (img=icons_img["digAddVertex"], label="Add new vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digCopyCats": MetaIcon (img=icons_img["digCopyCats"], label="Copy categories",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digDeleteLine": MetaIcon (img=icons_img["digDeleteLine"], label="Delete feature(s)",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digDispAttr": MetaIcon (img=icons_img["digDispAttr"], label="Display/update attributes",
-                              desc="Left: Select"),
-    "digDispCats": MetaIcon (img=icons_img["digDispCats"], label="Display/update categories",
-                              desc="Left: Select"),
-    "digEditLine": MetaIcon (img=icons_img["digEditLine"], label="Edit line/boundary",
-                              desc="Left: new point; Middle: undo last point; Right: close line"),
-    "digMoveLine": MetaIcon (img=icons_img["digMoveLine"], label="Move feature(s)",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digMoveVertex": MetaIcon (img=icons_img["digMoveVertex"], label="Move vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digRemoveVertex": MetaIcon (img=icons_img["digRemoveVertex"], label="Remove vertex",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digSettings": MetaIcon (img=icons_img["digSettings"], label="Settings",
-                              desc="Settings dialog for digitization tool"),
-    "digSplitLine": MetaIcon (img=icons_img["digSplitLine"], label="Split line/boundary",
-                              desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digExit"    : MetaIcon (img=icons_img["quit"], label="Quit digitization tool"),
-    "digAdditionalTools" : MetaIcon (img=icons_img["digAdditionalTools"], label="Additional tools " \
-                                         "(copy, flip, connect, etc.)",
-                                     desc="Left: Select; Middle: Unselect; Right: Confirm"),
-    "digUndo" : MetaIcon (img=icons_img["digUndo"], label="Undo",
-                          desc="Undo previous changes"),
+    "digAddPoint": MetaIcon (img=icons_img["digAddPoint"],
+                             label=_("Digitize new point"),
+                             desc=_("Left: new point")),
+    "digAddLine" : MetaIcon (img=icons_img["digAddLine"],
+                             label=_("Digitize new line"),
+                             desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digAddBoundary": MetaIcon (img=icons_img["digAddBoundary"],
+                                label=_("Digitize new boundary"),
+                                desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digAddCentroid": MetaIcon (img=icons_img["digAddCentroid"],
+                                label=_("Digitize new centroid"),
+                             desc=_("Left: new point")),
+    "digAddVertex": MetaIcon (img=icons_img["digAddVertex"],
+                              label=_("Add new vertex"),
+                              desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digCopyCats": MetaIcon (img=icons_img["digCopyCats"],
+                             label=_("Copy categories"),
+                             desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digDeleteLine": MetaIcon (img=icons_img["digDeleteLine"],
+                               label=_("Delete feature(s)"),
+                               desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digDispAttr": MetaIcon (img=icons_img["digDispAttr"],
+                             label=_("Display/update attributes"),
+                             desc=_("Left: Select")),
+    "digDispCats": MetaIcon (img=icons_img["digDispCats"],
+                             label=_("Display/update categories"),
+                             desc=_("Left: Select")),
+    "digEditLine": MetaIcon (img=icons_img["digEditLine"],
+                             label=_("Edit line/boundary"),
+                             desc=_("Left: new point; Middle: undo last point; Right: close line")),
+    "digMoveLine": MetaIcon (img=icons_img["digMoveLine"],
+                             label=_("Move feature(s)"),
+                             desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digMoveVertex": MetaIcon (img=icons_img["digMoveVertex"],
+                               label=_("Move vertex"),
+                               desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digRemoveVertex": MetaIcon (img=icons_img["digRemoveVertex"],
+                                 label=_("Remove vertex"),
+                                 desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digSettings": MetaIcon (img=icons_img["digSettings"],
+                             label=_("Settings"),
+                             desc=_("Settings dialog for digitization tool")),
+    "digSplitLine": MetaIcon (img=icons_img["digSplitLine"],
+                              label=_("Split line/boundary"),
+                              desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digExit"    : MetaIcon (img=icons_img["quit"],
+                             label=_("Quit digitization tool")),
+    "digAdditionalTools" : MetaIcon (img=icons_img["digAdditionalTools"],
+                                     label=_("Additional tools " \
+                                                 "(copy, flip, connect, etc.)"),
+                                     desc=_("Left: Select; Middle: Unselect; Right: Confirm")),
+    "digUndo" : MetaIcon (img=icons_img["digUndo"],
+                          label=_("Undo"),
+                          desc=_("Undo previous changes")),
     # analyze raster
-    "analyze"    : MetaIcon (img=icons_img["analyze"], label="Analyze map"),
-    "measure"    : MetaIcon (img=icons_img["measure"], label="Measure distance"),
-    "transect"   : MetaIcon (img=icons_img["transect"], label="Draw transect in map display window to profile"),
-    "profile"    : MetaIcon (img=icons_img["profile"], label="Profile surface map"),
-    "profiledraw": MetaIcon (img=icons_img["profiledraw"], label="Draw/re-draw profile"),
-    "profileopt" : MetaIcon (img=icons_img["profileopt"], label="Profile options"),
-    "histogram"  : MetaIcon (img=icons_img["histogram"], label="Create histogram of image or raster file"),
-    "font"       : MetaIcon (img=icons_img["font"], label="Select font"),
-    "color"      : MetaIcon (img=icons_img["color"], label="Select color"),
-    "options"    : MetaIcon (img=icons_img["options"], label="Set histogram options"),
-    "analyze"    : MetaIcon (img=icons_img["analyze"], label="Analyze"),
+    "analyze"    : MetaIcon (img=icons_img["analyze"],
+                             label=_("Analyze map")),
+    "measure"    : MetaIcon (img=icons_img["measure"],
+                             label=_("Measure distance")),
+    "transect"   : MetaIcon (img=icons_img["transect"],
+                             label=_("Draw transect in map display window to profile")),
+    "profile"    : MetaIcon (img=icons_img["profile"],
+                             label=_("Profile surface map")),
+    "profiledraw": MetaIcon (img=icons_img["profiledraw"],
+                             label=_("Draw/re-draw profile")),
+    "profileopt" : MetaIcon (img=icons_img["profileopt"],
+                             label=_("Profile options")),
+    "histogram"  : MetaIcon (img=icons_img["histogram"],
+                             label=_("Create histogram of image or raster file")),
+    "font"       : MetaIcon (img=icons_img["font"],
+                             label=_("Select font")),
+    "color"      : MetaIcon (img=icons_img["color"],
+                             label=_("Select color")),
+    "options"    : MetaIcon (img=icons_img["options"],
+                             label=_("Set histogram options")),
+    "analyze"    : MetaIcon (img=icons_img["analyze"],
+                             label=_("Analyze")),
     # georectify
-    'cleargcp'   : MetaIcon (img=icons_img["cleargcp"], label="Clear selected GCP"),
-    'gcpset'     : MetaIcon (img=icons_img["gcpset"], label="Set GCP"),
-    'georect'    : MetaIcon (img=icons_img["georect"], label="Georectify"),
-    'rms'        : MetaIcon (img=icons_img["rms"], label="Recalculate RMS error"),
-    'refreshgcp' : MetaIcon (img=icons_img["refreshgcp"], label="Redraw GCP markers in map displays")}
+    'grGcpSet'     : MetaIcon (img=icons_img["grGcpSet"],
+                             label=_("Set GCP"),
+                             desc=_("Define GCP (Ground Control Points)")),
+    'grGeorect'    : MetaIcon (img=icons_img["grGeorect"],
+                             label=_("Georectify")),
+    'grGcpRms'        : MetaIcon (img=icons_img["grGcpRms"],
+                                  label=_("Recalculate RMS error")),
+    'grGcpRefresh' : MetaIcon (img=icons_img["grGcpRefresh"],
+                               label=_("Redraw GCP markers in map displays")),
+    'grGcpSave' : MetaIcon (img=icons_img["grGcpSave"],
+                            label=_("Save GCPs to POINTS file")),
+    'grGcpAdd' : MetaIcon (img=icons_img["grGcpAdd"],
+                           label=_("Add new GCP")),
+    'grGcpDelete' : MetaIcon (img=icons_img["grGcpDelete"],
+                              label=_("Delete selected GCP")),
+    'grGcpClear' : MetaIcon (img=icons_img["grGcpClear"],
+                             label=_("Clear selected GCP")),
+    'grGcpReload' : MetaIcon (img=icons_img["grGcpReload"],
+                              label=_("Reload GCPs from selected POINTS file")),
+    'grGcpQuit' : MetaIcon (img=icons_img["quit"],
+                            label=_("Quit georectification module")),
+    "grSettings": MetaIcon (img=icons_img["grSettings"],
+                            label=_("Settings"),
+                            desc=_("Settings dialog for georectification tool")),
+    }
 
 # testing ...
 if __name__ == "__main__":

Modified: grass/trunk/gui/wxpython/icons/silk/__init__.py
===================================================================
--- grass/trunk/gui/wxpython/icons/silk/__init__.py	2008-05-02 18:51:37 UTC (rev 31214)
+++ grass/trunk/gui/wxpython/icons/silk/__init__.py	2008-05-02 19:08:36 UTC (rev 31215)
@@ -80,7 +80,17 @@
     "addchart"   : 'chart_bar.png',
     # profile analysis
     "transect"   : 'image_edit.png',
-#    "profiledraw"   : 'page_white_lightning.png',
     "profiledraw"  : 'arrow_refresh.png',
     "profileopt"   : 'color_swatch.png',
+    # georectify
+    "grGcpSet"     : 'bullet_add.png',
+    'grGcpClear'   : 'cross.png',
+    'grGeorect'    : 'application_lightning.png',
+    'grGcpRms'     : 'error.png',
+    'grGcpRefresh' : 'arrow_refresh.png',
+    "grGcpSave"    : 'picture_save.png',
+    "grGcpAdd"     : 'bullet_add.png', 
+    "grGcpDelete"  : 'bullet_delete.png',
+    "grGcpReload"  : 'arrow_refresh.png',
+    "grSettings"   : 'color_swatch.png',
     }



More information about the grass-commit mailing list