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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 27 12:28:12 EST 2007


Author: martinl
Date: 2007-12-27 12:28:12 -0500 (Thu, 27 Dec 2007)
New Revision: 29524

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
Log:
wxGUI: Page changed in dialog to 'command output' tab when 'Run' button pressed.
Write command messages always to the end of log area.
Use fixed width for command header in command log area.


Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2007-12-27 16:53:15 UTC (rev 29523)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2007-12-27 17:28:12 UTC (rev 29524)
@@ -696,11 +696,6 @@
         if cmd == [] or cmd == None:
             return
 
-        if self.standalone:
-            # change page if needed
-            if self.notebookpanel.notebook.GetSelection() != self.notebookpanel.outpageid:
-                self.notebookpanel.notebook.SetSelection(self.notebookpanel.outpageid)
-        
         if cmd[0][0:2] != "d.":
             # Send any non-display command to parent window (probably wxgui.py)
             # put to parents
@@ -713,6 +708,11 @@
         else:
             runCmd = gcmd.Command(cmd)
 
+        if self.standalone:
+            # change page if needed
+            if self.notebookpanel.notebook.GetSelection() != self.notebookpanel.outpageid:
+                self.notebookpanel.notebook.SetSelection(self.notebookpanel.outpageid)
+        
     def OnCopy(self, event):
         """Copy the command"""
         cmddata = wx.TextDataObject()

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2007-12-27 16:53:15 UTC (rev 29523)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2007-12-27 17:28:12 UTC (rev 29524)
@@ -1154,12 +1154,18 @@
                     os.unsetenv("GRASS_REGION")
 
                     # process GRASS command with argument
+                    self.cmd_output.GotoPos(self.cmd_output.GetEndStyled())
                     p1 = self.cmd_output.GetCurrentPos()
-                    self.cmd_output.AddText('$ %s' % ' '.join(cmdlist) + os.linesep)
+                    line = '$ %s' % ' '.join(cmdlist)
+                    if len(line) < 80:
+                        diff = 80 - len(line)
+                        line += diff * ' '
+                    line += '%s' % os.linesep
+                    self.cmd_output.AddText(line)
                     self.cmd_output.EnsureCaretVisible()
                     p2 = self.cmd_output.GetCurrentPos()
                     self.cmd_output.StartStyling(p1, 0xff)
-                    self.cmd_output.SetStyling(p2 - p1 + 1, self.cmd_output.StyleCommand)
+                    self.cmd_output.SetStyling(p2 - p1, self.cmd_output.StyleCommand)
 
                     
 #                     grassCmd = gcmd.Command(cmdlist, verbose=3, wait=False,



More information about the grass-commit mailing list