[GRASS-SVN] r41849 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 13 14:40:08 EDT 2010


Author: martinl
Date: 2010-04-13 14:40:06 -0400 (Tue, 13 Apr 2010)
New Revision: 41849

Modified:
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
   grass/trunk/gui/wxpython/gui_modules/gmodeler.py
   grass/trunk/gui/wxpython/gui_modules/help.py
Log:
wxGUI/modeler: more Windows fixes
(merge from r41848 from trunk)


Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-04-13 18:36:19 UTC (rev 41848)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-04-13 18:40:06 UTC (rev 41849)
@@ -117,29 +117,31 @@
     EXT_SCT = ''
 
 def GetGRASSCmds(bin=True, scripts=True, gui_scripts=True):
-    """
-    Create list of all available GRASS commands to use when
+    """!Create list of all available GRASS commands to use when
     parsing string from the command line
     """
     gisbase = os.environ['GISBASE']
-    list = []
+    cmd = list()
     if bin is True:
-        list = os.listdir(os.path.join(gisbase, 'bin'))
+        for file in os.listdir(os.path.join(gisbase, 'bin')):
+            if not EXT_BIN or file[-4:] == EXT_BIN:
+                cmd.append(file)
+        
         # add special call for setting vector colors
-        list.append('vcolors')
+        cmd.append('vcolors')
     if scripts is True:
-        list = list + os.listdir(os.path.join(gisbase, 'scripts')) 
+        cmd = cmd + os.listdir(os.path.join(gisbase, 'scripts')) 
     if gui_scripts is True:
         os.environ["PATH"] = os.getenv("PATH") + os.pathsep + os.path.join(gisbase, 'etc', 'gui', 'scripts')
-        list = list + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
+        cmd = cmd + os.listdir(os.path.join(gisbase, 'etc', 'gui', 'scripts'))
        
     if subprocess.mswindows:
-        for idx in range(len(list)):
-            list[idx] = list[idx].replace(EXT_BIN, '')
-            list[idx] = list[idx].replace(EXT_SCT, '')
+        for idx in range(len(cmd)):
+            cmd[idx] = cmd[idx].replace(EXT_BIN, '')
+            cmd[idx] = cmd[idx].replace(EXT_SCT, '')
+    
+    return cmd
 
-    return list
-
 """@brief Collected GRASS-relared binaries/scripts"""
 grassCmd = {}
 grassCmd['all'] = GetGRASSCmds()

Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-04-13 18:36:19 UTC (rev 41848)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-04-13 18:40:06 UTC (rev 41849)
@@ -110,6 +110,10 @@
         self.SetMinSize((350, 200))
         self.SetSize((640, 480))
         
+        # fix goutput's pane size
+        if self.goutput:
+            self.goutput.SetSashPosition(int(self.GetSize()[1] * .75))
+        
     def _layout(self):
         """!Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
@@ -556,7 +560,7 @@
         info.SetWebSite('http://grass.osgeo.org')
         info.SetDescription(_('(C) 2010 by the GRASS Development Team\n\n') + 
                             '\n'.join(textwrap.wrap(_('This program is free software under the GNU General Public License'
-                                                      '(>=v2). Read the file COPYING that comes with GRASS for details.'), 100)))
+                                                      '(>=v2). Read the file COPYING that comes with GRASS for details.'), 75)))
         
         wx.AboutBox(info)
         
@@ -1122,6 +1126,7 @@
         self.searchBy = wx.Choice(parent = self.panel, id = wx.ID_ANY,
                                   choices = [_("description"),
                                              _("keywords")])
+        self.searchBy.SetSelection(0)
         self.search = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY,
                                   value = "", size = (-1, 25))
         self.searchTip  = menuform.StaticWrapText(parent = self.panel, id = wx.ID_ANY,
@@ -1145,7 +1150,7 @@
         
         self._layout()
         
-        self.SetSize((500, 250))
+        self.SetSize((500, 275))
         
     def _layout(self):
         btnSizer = wx.StdDialogButtonSizer()

Modified: grass/trunk/gui/wxpython/gui_modules/help.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/help.py	2010-04-13 18:36:19 UTC (rev 41848)
+++ grass/trunk/gui/wxpython/gui_modules/help.py	2010-04-13 18:40:06 UTC (rev 41849)
@@ -82,6 +82,8 @@
                                              _('help'),
                                              _('command'),
                                              _('keywords')])
+        self.searchBy.SetSelection(3)
+        
         self.search = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY,
                                   value = "", size = (-1, 25),
                                   style = wx.TE_PROCESS_ENTER)



More information about the grass-commit mailing list