瀏覽代碼

wxGUI: https://trac.osgeo.org/grass/ticket/1743 (WXGUI About GRASS dialog should allow to copy version information)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53292 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
756a78526d
共有 3 個文件被更改,包括 28 次插入7 次删除
  1. 5 7
      gui/wxpython/gui_core/ghelp.py
  2. 18 0
      gui/wxpython/lmgr/frame.py
  3. 5 0
      gui/wxpython/xml/menudata.xml

+ 5 - 7
gui/wxpython/gui_core/ghelp.py

@@ -393,8 +393,6 @@ class AboutWindow(wx.Frame):
 
 
         # notebook
         # notebook
         self.aboutNotebook = FormListbook(self.panel, style = wx.BK_LEFT)
         self.aboutNotebook = FormListbook(self.panel, style = wx.BK_LEFT)
-        #self.aboutNotebook = GNotebook(self.panel, style = globalvar.FNPageStyle | FN.FNB_NO_X_BUTTON) 
-        #self.aboutNotebook.SetTabAreaColour(globalvar.FNPageColor)
         
         
         for title, win in ((_("Info"), self._pageInfo()),
         for title, win in ((_("Info"), self._pageInfo()),
                            (_("Copyright"), self._pageCopyright()),
                            (_("Copyright"), self._pageCopyright()),
@@ -472,7 +470,7 @@ class AboutWindow(wx.Frame):
 
 
         row += 2
         row += 2
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = _('SVN Revision:')),
+                                               label = '%s:' % _('SVN Revision')),
                           pos = (row, 0),
                           pos = (row, 0),
                           flag = wx.ALIGN_RIGHT)
                           flag = wx.ALIGN_RIGHT)
         
         
@@ -483,7 +481,7 @@ class AboutWindow(wx.Frame):
         
         
         row += 1
         row += 1
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = _('GIS Library Revision:')),
+                                               label = '%s:' % _('GIS Library Revision')),
                           pos = (row, 0),
                           pos = (row, 0),
                           flag = wx.ALIGN_RIGHT)
                           flag = wx.ALIGN_RIGHT)
         
         
@@ -495,7 +493,7 @@ class AboutWindow(wx.Frame):
 
 
         row += 2
         row += 2
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = _('Python:')),
+                                               label = 'Python:'),
                           pos = (row, 0),
                           pos = (row, 0),
                           flag = wx.ALIGN_RIGHT)
                           flag = wx.ALIGN_RIGHT)
         
         
@@ -506,7 +504,7 @@ class AboutWindow(wx.Frame):
 
 
         row += 1
         row += 1
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = _('wxPython:')),
+                                               label =  'wxPython:'),
                           pos = (row, 0),
                           pos = (row, 0),
                           flag = wx.ALIGN_RIGHT)
                           flag = wx.ALIGN_RIGHT)
         
         
@@ -521,7 +519,7 @@ class AboutWindow(wx.Frame):
         
         
         row += 2
         row += 2
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
         infoGridSizer.Add(item = wx.StaticText(parent = infoTxt, id = wx.ID_ANY,
-                                               label = _('Language:')),
+                                               label = "%s:" % _('Language')),
                           pos = (row, 0),
                           pos = (row, 0),
                           flag = wx.ALIGN_RIGHT)
                           flag = wx.ALIGN_RIGHT)
         self.langUsed = grass.gisenv().get('LANG', None)
         self.langUsed = grass.gisenv().get('LANG', None)

+ 18 - 0
gui/wxpython/lmgr/frame.py

@@ -22,6 +22,7 @@ import sys
 import os
 import os
 import tempfile
 import tempfile
 import stat
 import stat
+import platform
 try:
 try:
     import xml.etree.ElementTree as etree
     import xml.etree.ElementTree as etree
 except ImportError:
 except ImportError:
@@ -775,6 +776,23 @@ class GMFrame(wx.Frame):
                                             lcmd = ['d.vect', 'map=%s' % name])
                                             lcmd = ['d.vect', 'map=%s' % name])
         dlg.Destroy()
         dlg.Destroy()
         
         
+    def OnSystemInfo(self, event):
+        """!Print system information"""
+        vInfo = grass.version()
+        
+        self.goutput.WriteLog("%s: %s\n"
+                              "%s: %s\n"
+                              "%s: %s (%s)\n"
+                              "Python: %s\n"
+                              "wxPython: %s\n"
+                              "%s: %s\n"% (_("GRASS version"), vInfo['version'],
+                                           _("GRASS SVN Revision"), vInfo['revision'],
+                                           _("GIS Library Revision"), vInfo['libgis_revision'], vInfo['libgis_date'].split(' ', 1)[0],
+                                           platform.python_version(),
+                                           wx.__version__,
+                                           _("Platform"), platform.platform()),
+                              switchPage = True)
+    
     def OnAboutGRASS(self, event):
     def OnAboutGRASS(self, event):
         """!Display 'About GRASS' dialog"""
         """!Display 'About GRASS' dialog"""
         win = AboutWindow(self)
         win = AboutWindow(self)

+ 5 - 0
gui/wxpython/xml/menudata.xml

@@ -3380,6 +3380,11 @@
         </menuitem>
         </menuitem>
         <separator />
         <separator />
         <menuitem>
         <menuitem>
+          <label>About system</label>
+          <help>Prints system information</help>
+          <handler>OnSystemInfo</handler>
+        </menuitem>
+        <menuitem>
           <label>About GRASS GIS</label>
           <label>About GRASS GIS</label>
           <help>About GRASS GIS</help>
           <help>About GRASS GIS</help>
           <handler>OnAboutGRASS</handler>
           <handler>OnAboutGRASS</handler>