[GRASS-SVN] r68659 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 9 16:04:24 PDT 2016


Author: wenzeslaus
Date: 2016-06-09 16:04:24 -0700 (Thu, 09 Jun 2016)
New Revision: 68659

Modified:
   grass/trunk/gui/wxpython/gui_core/ghelp.py
Log:
wxGUI: add g.version citation info to About dialog (see #947, r68657, r68658)

Modified: grass/trunk/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/ghelp.py	2016-06-09 14:40:00 UTC (rev 68658)
+++ grass/trunk/gui/wxpython/gui_core/ghelp.py	2016-06-09 23:04:24 UTC (rev 68659)
@@ -70,6 +70,7 @@
         for title, win in ((_("Info"), self._pageInfo()),
                            (_("Copyright"), self._pageCopyright()),
                            (_("License"), self._pageLicense()),
+                           (_("Citation"), self._pageCitation()),
                            (_("Authors"), self._pageCredit()),
                            (_("Contributors"), self._pageContributors()),
                            (_("Extra contributors"), self._pageContributors(extra=True)),
@@ -284,6 +285,32 @@
 
         return licensewin
 
+    def _pageCitation(self):
+        """Citation information"""
+        try:
+            # import only when needed
+            import grass.script as gscript
+            text = gscript.read_command('g.version', flags='x')
+        except CalledModuleError as error:
+            text = _("Unable to provide citation suggestion,"
+                     " see GRASS GIS website instead."
+                     " The error was: {}").format(error)
+
+        # put text into a scrolling panel
+        window = ScrolledPanel(self.aboutNotebook)
+        window.SetBackgroundColour('WHITE')
+        stat_text = wx.StaticText(
+            window, id=wx.ID_ANY, label=text)
+        window.SetAutoLayout(True)
+        window.sizer = wx.BoxSizer(wx.VERTICAL)
+        window.sizer.Add(item=stat_text, proportion=1,
+                         flag=wx.EXPAND | wx.ALL, border=3)
+        window.SetSizer(window.sizer)
+        window.Layout()
+        window.SetupScrolling()
+
+        return window
+
     def _pageCredit(self):
         """Credit about"""
         # credits



More information about the grass-commit mailing list