Explorar o código

wxGUI: various fixes
GPrompt in progress


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40027 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa %!s(int64=15) %!d(string=hai) anos
pai
achega
f15067a2cb

+ 1 - 1
gui/wxpython/gui_modules/gdialogs.py

@@ -728,7 +728,7 @@ class LoadMapLayersDialog(wx.Dialog):
         # buttons
         # buttons
         #
         #
         btnCancel = wx.Button(self, wx.ID_CANCEL)
         btnCancel = wx.Button(self, wx.ID_CANCEL)
-        btnOk = wx.Button(self, wx.ID_OK, _("Load") )
+        btnOk = wx.Button(self, wx.ID_OK, _("&Load") )
         btnOk.SetDefault()
         btnOk.SetDefault()
         
         
         #
         #

+ 11 - 11
gui/wxpython/gui_modules/goutput.py

@@ -618,23 +618,23 @@ class GMConsole(wx.Panel):
                         mapTree = self.parent.parent.parent.curr_page.maptree
                         mapTree = self.parent.parent.parent.curr_page.maptree
                     else: # GMConsole
                     else: # GMConsole
                         mapTree = self.parent.parent.parent.parent.curr_page.maptree
                         mapTree = self.parent.parent.parent.parent.curr_page.maptree
+                    if not mapTree.GetMap().GetListOfLayers(l_name = name):
+                        if dialog.outputType == 'raster':
+                            lcmd = ['d.rast',
+                                    'map=%s' % name]
+                        else:
+                            lcmd = ['d.vect',
+                                    'map=%s' % name]
+                        mapTree.AddLayer(ltype=dialog.outputType,
+                                         lcmd=lcmd,
+                                         lname=name)
                     
                     
-                    if dialog.outputType == 'raster':
-                        lcmd = ['d.rast',
-                                'map=%s' % name]
-                    else:
-                        lcmd = ['d.vect',
-                                'map=%s' % name]
-                    mapTree.AddLayer(ltype=dialog.outputType,
-                                     lcmd=lcmd,
-                                     lname=name)
-            
             if hasattr(dialog, "get_dcmd") and \
             if hasattr(dialog, "get_dcmd") and \
                     dialog.get_dcmd is None and \
                     dialog.get_dcmd is None and \
                     dialog.closebox.IsChecked():
                     dialog.closebox.IsChecked():
                 time.sleep(1)
                 time.sleep(1)
                 dialog.Close()
                 dialog.Close()
-
+        
         event.Skip()
         event.Skip()
         
         
     def OnProcessPendingOutputWindowEvents(self, event):
     def OnProcessPendingOutputWindowEvents(self, event):

+ 7 - 4
gui/wxpython/gui_modules/help.py

@@ -366,15 +366,18 @@ class AboutWindow(wx.Frame):
         wx.Frame.__init__(self, parent=parent, id=wx.ID_ANY, size=(550,400), 
         wx.Frame.__init__(self, parent=parent, id=wx.ID_ANY, size=(550,400), 
                           title=_('About GRASS GIS'))
                           title=_('About GRASS GIS'))
         
         
+        panel = wx.Panel(parent = self, id = wx.ID_ANY)
+        
         # icon
         # icon
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
 
 
         # get version and web site
         # get version and web site
         version, svn_gis_h_rev, svn_gis_h_date = gcmd.RunCommand('g.version',
         version, svn_gis_h_rev, svn_gis_h_date = gcmd.RunCommand('g.version',
+                                                                 verbose = True, # -> svn revision
                                                                  flags = 'r',
                                                                  flags = 'r',
                                                                  read = True).splitlines()
                                                                  read = True).splitlines()
 
 
-        infoTxt = wx.Panel(parent = self, id = wx.ID_ANY)
+        infoTxt = wx.Panel(parent = panel, id = wx.ID_ANY)
         infoSizer = wx.BoxSizer(wx.VERTICAL)
         infoSizer = wx.BoxSizer(wx.VERTICAL)
         logo = os.path.join(globalvar.ETCDIR, "gui", "icons", "grass.ico")
         logo = os.path.join(globalvar.ETCDIR, "gui", "icons", "grass.ico")
         logoBitmap = wx.StaticBitmap(parent = infoTxt, id = wx.ID_ANY,
         logoBitmap = wx.StaticBitmap(parent = infoTxt, id = wx.ID_ANY,
@@ -412,7 +415,7 @@ class AboutWindow(wx.Frame):
                 FN.FNB_NO_X_BUTTON | \
                 FN.FNB_NO_X_BUTTON | \
                 FN.FNB_NO_NAV_BUTTONS
                 FN.FNB_NO_NAV_BUTTONS
                 
                 
-        aboutNotebook = FN.FlatNotebook(self, id=wx.ID_ANY, style=nbstyle)
+        aboutNotebook = FN.FlatNotebook(panel, id=wx.ID_ANY, style=nbstyle)
         aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
         aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
         
         
         # make pages for About GRASS notebook
         # make pages for About GRASS notebook
@@ -424,7 +427,7 @@ class AboutWindow(wx.Frame):
         pg5 = aboutNotebook.AddPage(transwin,     text=_("Translators"))
         pg5 = aboutNotebook.AddPage(transwin,     text=_("Translators"))
         
         
         # buttons
         # buttons
-        btnClose = wx.Button(parent = self, id = wx.ID_CLOSE)
+        btnClose = wx.Button(parent = panel, id = wx.ID_CLOSE)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer.Add(item = btnClose, proportion = 1,
         btnSizer.Add(item = btnClose, proportion = 1,
                      flag = wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT,
                      flag = wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT,
@@ -441,7 +444,7 @@ class AboutWindow(wx.Frame):
                   flag=wx.EXPAND | wx.ALL, border=1)
                   flag=wx.EXPAND | wx.ALL, border=1)
         sizer.Add(item=btnSizer, proportion=0,
         sizer.Add(item=btnSizer, proportion=0,
                   flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=1)
                   flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=1)
-        self.SetSizer(sizer)
+        panel.SetSizer(sizer)
         self.Layout()
         self.Layout()
     
     
     def PageCopyright(self):
     def PageCopyright(self):

+ 5 - 5
gui/wxpython/gui_modules/ogc_services.py

@@ -1,9 +1,9 @@
-"""
+"""!
 @package ogc_services.py
 @package ogc_services.py
 
 
 @brief Dialogs for OGC services
 @brief Dialogs for OGC services
 
 
-Currently is implemeted only WMS.
+Currently only implemeted WMS.
 
 
 List of classes:
 List of classes:
  - WMSDialog
  - WMSDialog
@@ -279,20 +279,20 @@ class LayersList(TreeListCtrl, listmix.ListCtrlAutoWidthMixin):
 
 
     def GetSelectedLayers(self):
     def GetSelectedLayers(self):
         """!Get selected layers/styles"""
         """!Get selected layers/styles"""
-        layers = {}
+        layers = dict()
 
 
         for item in self.GetSelections():
         for item in self.GetSelections():
             parent = self.GetItemParent(item)
             parent = self.GetItemParent(item)
             if parent == self.root: # -> layer
             if parent == self.root: # -> layer
                 layer = self.GetItemText(item, 0)
                 layer = self.GetItemText(item, 0)
-                layers[layer] = []
+                layers[layer] = list()
                 sitem, cookie = self.GetFirstChild(item)
                 sitem, cookie = self.GetFirstChild(item)
                 while sitem:
                 while sitem:
                     layers[layer].append(self.GetItemText(sitem, 0))
                     layers[layer].append(self.GetItemText(sitem, 0))
                     sitem, cookie = self.GetNextChild(item, cookie)
                     sitem, cookie = self.GetNextChild(item, cookie)
             else: # -> style
             else: # -> style
                 layer = self.GetItemText(parent, 0)
                 layer = self.GetItemText(parent, 0)
-                layers[layer] = []
+                layers[layer] = list()
                 layers[layer].append(self.GetItemText(item, 0))
                 layers[layer].append(self.GetItemText(item, 0))
         
         
         return layers
         return layers

+ 5 - 4
gui/wxpython/gui_modules/preferences.py

@@ -117,8 +117,9 @@ class Settings:
             #
             #
             'projection' : {
             'projection' : {
                 'statusbar' : {
                 'statusbar' : {
-                    'proj4'   : '',
-                    'epsg'    : '',
+                    'proj4'    : '',
+                    'epsg'     : '',
+                    'projFile' : utils.PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg'),
                     },
                     },
                 'format' : {
                 'format' : {
                     'll'  : 'DMS',
                     'll'  : 'DMS',
@@ -197,7 +198,7 @@ class Settings:
                         },
                         },
                     },
                     },
                 'addNewLayer' : {
                 'addNewLayer' : {
-                    'enabled' : False
+                    'enabled' : True,
                     },
                     },
                 },
                 },
             #
             #
@@ -1469,7 +1470,7 @@ class PreferencesDialog(wx.Dialog):
         label = wx.StaticText(parent=panel, id=wx.ID_ANY,
         label = wx.StaticText(parent=panel, id=wx.ID_ANY,
                               label=_("EPSG file:"))
                               label=_("EPSG file:"))
         projFile = wx.TextCtrl(parent=panel, id=wx.ID_ANY,
         projFile = wx.TextCtrl(parent=panel, id=wx.ID_ANY,
-                               value=utils.PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg'),
+                               value = self.settings.Get(group='projection', key='statusbar', subkey='projFile'),
                                name="GetValue", size=(400, -1))
                                name="GetValue", size=(400, -1))
         self.winId['projection:statusbar:projFile'] = projFile.GetId()
         self.winId['projection:statusbar:projFile'] = projFile.GetId()
         gridSizer.Add(item=label,
         gridSizer.Add(item=label,

+ 98 - 54
gui/wxpython/gui_modules/prompt.py

@@ -1,7 +1,7 @@
 """!
 """!
 @package prompt.py
 @package prompt.py
 
 
-@brief GRASS prompt
+@brief wxGUI prompt
 
 
 Classes:
 Classes:
  - GPrompt
  - GPrompt
@@ -51,7 +51,7 @@ class GPrompt:
         # search
         # search
         #
         #
         searchTxt = wx.StaticText(parent = cmdprompt, id = wx.ID_ANY,
         searchTxt = wx.StaticText(parent = cmdprompt, id = wx.ID_ANY,
-                                  label = _("Search:"))
+                                  label = _("Find module:"))
         
         
         self.searchBy = wx.Choice(parent = cmdprompt, id = wx.ID_ANY,
         self.searchBy = wx.Choice(parent = cmdprompt, id = wx.ID_ANY,
                              choices = [_("description"),
                              choices = [_("description"),
@@ -62,7 +62,7 @@ class GPrompt:
                              value = "", size = (-1, 25))
                              value = "", size = (-1, 25))
         
         
         label = wx.Button(parent = cmdprompt, id = wx.ID_ANY,
         label = wx.Button(parent = cmdprompt, id = wx.ID_ANY,
-                          label = _("Cmd >"), size = (-1, winHeight))
+                          label = _("&Cmd >"), size = (-1, winHeight))
         label.SetToolTipString(_("Click for erasing command prompt"))
         label.SetToolTipString(_("Click for erasing command prompt"))
 
 
         ### todo: fix TextCtrlAutoComplete to work also on Macs
         ### todo: fix TextCtrlAutoComplete to work also on Macs
@@ -95,6 +95,7 @@ class GPrompt:
         
         
         # layout
         # layout
         sizer = wx.GridBagSizer(hgap=5, vgap=5)
         sizer = wx.GridBagSizer(hgap=5, vgap=5)
+        sizer.AddGrowableRow(1)
         sizer.AddGrowableCol(2)
         sizer.AddGrowableCol(2)
 
 
         sizer.Add(item = searchTxt,
         sizer.Add(item = searchTxt,
@@ -344,42 +345,83 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
         if toSel == -1:
         if toSel == -1:
             return
             return
         self.dropdownlistbox.EnsureVisible(toSel)
         self.dropdownlistbox.EnsureVisible(toSel)
+
+    def _setModule(self, name):
+        """!Set module's choices (flags, parameters)""" 
+        # get module's description
+        if name in self._choicesCmd and not self._module:
+            try:
+                self._module = menuform.GUI().ParseInterface(cmd = [name])
+            except IOError:
+                self._module = None
+             
+        # set choices (flags)
+        self._choicesMap['flag'] = self._module.get_list_flags()
+        for idx in range(len(self._choicesMap['flag'])):
+            item = self._choicesMap['flag'][idx]
+            desc = self._module.get_flag(item)['label']
+            if not desc:
+                desc = self._module.get_flag(item)['description']
+            
+            self._choicesMap['flag'][idx] = '%s (%s)' % (item, desc)
+        
+        # set choices (parameters)
+        self._choicesMap['param'] = self._module.get_list_params()
+        for idx in range(len(self._choicesMap['param'])):
+            item = self._choicesMap['param'][idx]
+            desc = self._module.get_param(item)['label']
+            if not desc:
+                desc = self._module.get_param(item)['description']
+            
+            self._choicesMap['param'][idx] = '%s (%s)' % (item, desc)
     
     
     def _setValueFromSelected(self):
     def _setValueFromSelected(self):
          """!Sets the wx.TextCtrl value from the selected wx.ListCtrl item.
          """!Sets the wx.TextCtrl value from the selected wx.ListCtrl item.
          Will do nothing if no item is selected in the wx.ListCtrl.
          Will do nothing if no item is selected in the wx.ListCtrl.
          """
          """
          sel = self.dropdownlistbox.GetFirstSelected()
          sel = self.dropdownlistbox.GetFirstSelected()
-         if sel > -1:
-            if self._colFetch != -1:
-                col = self._colFetch
-            else:
-                col = self._colSearch
-            itemtext = self.dropdownlistbox.GetItem(sel, col).GetText()
-            
-            cmd = shlex.split(str(self.GetValue()))
-            if len(cmd) > 1:
-                # -> append text (skip last item)
-                if self._choiceType == 'param':
-                    self.SetValue(' '.join(cmd[:-1]) + ' ' + itemtext + '=')
-                    optType = self._module.get_param(itemtext)['prompt']
-                    if optType in ('raster', 'vector'):
-                        # -> raster/vector map
-                        self.SetChoices(self._choicesMap[optType], optType)
-                elif self._choiceType == 'flag':
-                    if len(itemtext) > 1:
-                        prefix = '--'
-                    else:
-                        prefix = '-'
-                    self.SetValue(' '.join(cmd[:-1]) + ' ' + prefix + itemtext)
-                elif self._choiceType in ('raster', 'vector'):
-                    self.SetValue(' '.join(cmd[:-1]) + ' ' + cmd[-1].split('=', 1)[0] + '=' + itemtext)
-            else:
-                # -> reset text
-                self.SetValue(itemtext + ' ')
-            self.SetInsertionPointEnd()
-            
-            self._showDropDown(False)
+         if sel < 0:
+             return
+         
+         if self._colFetch != -1:
+             col = self._colFetch
+         else:
+             col = self._colSearch
+         itemtext = self.dropdownlistbox.GetItem(sel, col).GetText()
+         
+         cmd = shlex.split(str(self.GetValue()))
+         if len(cmd) > 0 and cmd[0] in self._choicesCmd:
+             # -> append text (skip last item)
+             if self._choiceType == 'param':
+                 itemtext = itemtext.split(' ')[0]
+                 self.SetValue(' '.join(cmd) + ' ' + itemtext + '=')
+                 optType = self._module.get_param(itemtext)['prompt']
+                 if optType in ('raster', 'vector'):
+                     # -> raster/vector map
+                     self.SetChoices(self._choicesMap[optType], optType)
+             elif self._choiceType == 'flag':
+                 itemtext = itemtext.split(' ')[0]
+                 if len(itemtext) > 1:
+                     prefix = '--'
+                 else:
+                     prefix = '-'
+                 self.SetValue(' '.join(cmd[:-1]) + ' ' + prefix + itemtext)
+             elif self._choiceType in ('raster', 'vector'):
+                 self.SetValue(' '.join(cmd[:-1]) + ' ' + cmd[-1].split('=', 1)[0] + '=' + itemtext)
+         else:
+             # -> reset text
+             self.SetValue(itemtext + ' ')
+             
+             # define module
+             self._setModule(itemtext)
+             
+             # use parameters as default choices
+             self._choiceType = 'param'
+             self.SetChoices(self._choicesMap['param'], type = 'param')
+         
+         self.SetInsertionPointEnd()
+         
+         self._showDropDown(False)
          
          
     def GetListCtrl(self):
     def GetListCtrl(self):
         """!Method required by listmix.ColumnSorterMixin"""
         """!Method required by listmix.ColumnSorterMixin"""
@@ -412,12 +454,15 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
     def SetChoices(self, choices, type = 'module'):
     def SetChoices(self, choices, type = 'module'):
         """!Sets the choices available in the popup wx.ListBox.
         """!Sets the choices available in the popup wx.ListBox.
         The items will be sorted case insensitively.
         The items will be sorted case insensitively.
+
+        @param choices list of choices
+        @param type type of choices (module, param, flag, raster, vector)
         """
         """
         self._choices = choices
         self._choices = choices
         self._choiceType = type
         self._choiceType = type
         
         
-        self.dropdownlistbox.SetWindowStyleFlag(wx.LC_REPORT | wx.LC_SINGLE_SEL | \
-                                                    wx.LC_SORT_ASCENDING | wx.LC_NO_HEADER)
+        self.dropdownlistbox.SetWindowStyleFlag(wx.LC_REPORT | wx.LC_SINGLE_SEL |
+                                                wx.LC_SORT_ASCENDING | wx.LC_NO_HEADER)
         if not isinstance(choices, list):
         if not isinstance(choices, list):
             self._choices = [ x for x in choices ]
             self._choices = [ x for x in choices ]
         if self._choiceType not in ('raster', 'vector'):
         if self._choiceType not in ('raster', 'vector'):
@@ -452,6 +497,7 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
         
         
     def OnCommandSelect(self, event):
     def OnCommandSelect(self, event):
         """!Command selected from history"""
         """!Command selected from history"""
+        self._historyItem = event.GetSelection() - len(self.GetItems())
         self.SetFocus()
         self.SetFocus()
         
         
     def OnListClick(self, evt):
     def OnListClick(self, evt):
@@ -496,26 +542,21 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
         except ValueError, e:
         except ValueError, e:
             self.statusbar.SetStatusText(str(e))
             self.statusbar.SetStatusText(str(e))
             cmd = text.split(' ')
             cmd = text.split(' ')
-        
         pattern = str(text)
         pattern = str(text)
-        if len(cmd) > 1:
-            # search for module's options
-            if cmd[0] in self._choicesCmd and not self._module:
-                try:
-                    self._module = menuform.GUI().ParseInterface(cmd = cmd)
-                except IOError:
-                    self._module = None
-
+        
+        if len(cmd) > 0 and cmd[0] in self._choicesCmd and not self._module:
+            self._setModule(cmd[0])
+        elif len(cmd) > 1 and cmd[0] in self._choicesCmd:
             if self._module:
             if self._module:
                 if len(cmd[-1].split('=', 1)) == 1:
                 if len(cmd[-1].split('=', 1)) == 1:
                     # new option
                     # new option
                     if cmd[-1][0] == '-':
                     if cmd[-1][0] == '-':
                         # -> flags
                         # -> flags
-                        self.SetChoices(self._module.get_list_flags(), type = 'flag')
+                        self.SetChoices(self._choicesMap['flag'], type = 'flag')
                         pattern = cmd[-1].lstrip('-')
                         pattern = cmd[-1].lstrip('-')
                     else:
                     else:
                         # -> options
                         # -> options
-                        self.SetChoices(self._module.get_list_params(), type = 'param')
+                        self.SetChoices(self._choicesMap['param'], type = 'param')
                         pattern = cmd[-1]
                         pattern = cmd[-1]
                 else:
                 else:
                     # value
                     # value
@@ -528,6 +569,8 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
                 self._module = None
                 self._module = None
                 self._choiceType = None
                 self._choiceType = None
         
         
+        self._choiceType
+        self._choicesMap
         found = False
         found = False
         choices = self._choices
         choices = self._choices
         for numCh, choice in enumerate(choices):
         for numCh, choice in enumerate(choices):
@@ -547,10 +590,10 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
                 if self._module and '=' not in cmd[-1]:
                 if self._module and '=' not in cmd[-1]:
                     message = ''
                     message = ''
                     if cmd[-1][0] == '-': # flag
                     if cmd[-1][0] == '-': # flag
-                        message = "Warning: flag <%s> not found in '%s'" % \
+                        message = _("Warning: flag <%s> not found in '%s'") % \
                             (cmd[-1][1:], self._module.name)
                             (cmd[-1][1:], self._module.name)
                     else: # option
                     else: # option
-                        message = "Warning: option <%s> not found in '%s'" % \
+                        message = _("Warning: option <%s> not found in '%s'") % \
                             (cmd[-1], self._module.name)
                             (cmd[-1], self._module.name)
                     self.statusbar.SetStatusText(message)
                     self.statusbar.SetStatusText(message)
         
         
@@ -572,13 +615,14 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
         sel = self.dropdownlistbox.GetFirstSelected()
         sel = self.dropdownlistbox.GetFirstSelected()
         visible = self.dropdown.IsShown()
         visible = self.dropdown.IsShown()
         KC = event.GetKeyCode()
         KC = event.GetKeyCode()
+        
         if KC == wx.WXK_RIGHT:
         if KC == wx.WXK_RIGHT:
-            if len(self.GetValue()) < 1 and not visible:
-                if sel < (self.dropdownlistbox.GetItemCount() - 1):
-                    self.dropdownlistbox.Select(sel + 1)
-                    self._listItemVisible()
-                self._showDropDown()
-                skip = False
+            # right -> show choices
+            if sel < (self.dropdownlistbox.GetItemCount() - 1):
+                self.dropdownlistbox.Select(sel + 1)
+                self._listItemVisible()
+            self._showDropDown()
+            skip = False
         elif KC == wx.WXK_UP:
         elif KC == wx.WXK_UP:
             if visible:
             if visible:
                 if sel > 0:
                 if sel > 0:

+ 5 - 1
gui/wxpython/gui_modules/wxgui_utils.py

@@ -195,7 +195,11 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.Bind(wx.EVT_KEY_UP,                self.OnKeyUp)
         self.Bind(wx.EVT_KEY_UP,                self.OnKeyUp)
         # self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
         # self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
         self.Bind(wx.EVT_IDLE,                  self.OnIdle)
         self.Bind(wx.EVT_IDLE,                  self.OnIdle)
-                
+
+    def GetMap(self):
+        """!Get map instace"""
+        return self.Map
+    
     def OnIdle(self, event):
     def OnIdle(self, event):
         """
         """
         Only re-order and re-render a composite map image from GRASS during
         Only re-order and re-render a composite map image from GRASS during

+ 11 - 13
gui/wxpython/wxgui.py

@@ -1,4 +1,4 @@
-"""
+"""!
 @package wxgui.py
 @package wxgui.py
 
 
 @brief Main Python app for GRASS wxPython GUI. Main menu, layer management
 @brief Main Python app for GRASS wxPython GUI. Main menu, layer management
@@ -119,7 +119,6 @@ class GMFrame(wx.Frame):
         self.disp_idx      = 0            # index value for map displays and layer trees
         self.disp_idx      = 0            # index value for map displays and layer trees
         self.curr_page     = ''           # currently selected page for layer tree notebook
         self.curr_page     = ''           # currently selected page for layer tree notebook
         self.curr_pagenum  = ''           # currently selected page number for layer tree notebook
         self.curr_pagenum  = ''           # currently selected page number for layer tree notebook
-        self.encoding      = 'ISO-8859-1' # default encoding for display fonts
         self.workspaceFile = workspace    # workspace file
         self.workspaceFile = workspace    # workspace file
         self.menucmd       = dict()       # menuId / cmd
         self.menucmd       = dict()       # menuId / cmd
         self.georectifying = None         # reference to GCP class or None
         self.georectifying = None         # reference to GCP class or None
@@ -144,14 +143,11 @@ class GMFrame(wx.Frame):
         self.SetMinSize((500, 400))
         self.SetMinSize((500, 400))
 
 
         # AUI stuff
         # AUI stuff
-        #       self._auimgr.AddPane(self.toolbar, wx.aui.AuiPaneInfo().ToolbarPane().
-        #                              Top().Dockable(False).CloseButton(False).
-        #                              DestroyOnClose(True).Row(0).Layer(0))
         self._auimgr.AddPane(self.notebook, wx.aui.AuiPaneInfo().
         self._auimgr.AddPane(self.notebook, wx.aui.AuiPaneInfo().
                              Left().CentrePane().BestSize((-1,-1)).Dockable(False).
                              Left().CentrePane().BestSize((-1,-1)).Dockable(False).
                              CloseButton(False).DestroyOnClose(True).Row(1).Layer(0))
                              CloseButton(False).DestroyOnClose(True).Row(1).Layer(0))
         self._auimgr.AddPane(self.cmdprompt, wx.aui.AuiPaneInfo().
         self._auimgr.AddPane(self.cmdprompt, wx.aui.AuiPaneInfo().
-                             Bottom().BestSize((-1, 65)).Dockable(False).
+                             Bottom().BestSize((-1, -1)).Dockable(False).
                              CloseButton(False).DestroyOnClose(True).
                              CloseButton(False).DestroyOnClose(True).
                              PaneBorder(False).Row(1).Layer(0).Position(0).
                              PaneBorder(False).Row(1).Layer(0).Position(0).
                              CaptionVisible(False))
                              CaptionVisible(False))
@@ -552,7 +548,7 @@ class GMFrame(wx.Frame):
     def OnAboutGRASS(self, event):
     def OnAboutGRASS(self, event):
         """!Display 'About GRASS' dialog"""
         """!Display 'About GRASS' dialog"""
         win = AboutWindow(self)
         win = AboutWindow(self)
-        win.Centre()
+        win.CentreOnScreen()
         win.Show(True)  
         win.Show(True)  
         
         
     def OnWorkspace(self, event):
     def OnWorkspace(self, event):
@@ -1492,17 +1488,19 @@ class GMFrame(wx.Frame):
         event.Skip()
         event.Skip()
 
 
     def OnQuit(self, event):
     def OnQuit(self, event):
-        """!Quit GRASS"""
+        """!Quit GRASS session (wxGUI and shell)"""
         # quit wxGUI session
         # quit wxGUI session
         self.OnCloseWindow(event)
         self.OnCloseWindow(event)
-
+        
         # quit GRASS shell
         # quit GRASS shell
         try:
         try:
-            pid = os.environ['GRASS_SHELL_PID']
-        except KeyError:
+            pid = int(os.environ['GIS_LOCK'])
+        except (KeyError, ValueError):
+            sys.stderr.write('\n')
+            sys.stderr.write(_("WARNING: Unable to quit GRASS, uknown GIS_LOCK"))
             return
             return
-
-        os.kill(int(pid), signal.SIGQUIT)
+        
+        os.kill(pid, signal.SIGQUIT)
         
         
     def OnCloseWindow(self, event):
     def OnCloseWindow(self, event):
         """!Cleanup when wxGUI is quit"""
         """!Cleanup when wxGUI is quit"""