[GRASS-dev] Re: [GRASS GIS] #588: wxGUI: About GRASS GIS window
doesn't let you view full lic or devs
GRASS GIS
trac at osgeo.org
Sat May 23 22:41:04 EDT 2009
#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: closed
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: worksforme | Keywords:
Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by xpolok00):
* status: new => closed
* resolution: => worksforme
Comment:
I've downloaded Grass 6.4.0 form SVN
(grass-6.4.svn_src_snapshot_2009_05_23.tar.gz) and was able to reprodice
the bug. I found out there's no way (AFAIK) to add scrollbars to
wx.AboutBox, so i solved the bug by adding two new menu items, "GRASS GIS
Authors" and "GRASS GIS License" and somewhat modified the original about
box.
modified files are:
* gui/wxpython/wxgui.py
* gui/wxpython/xml/menudata.xml
diff patch for wxgui.py:
{{{
$ diff -c wxgui.py patched_wxgui.py
*** wxgui.py Sat May 23 09:53:12 2009
--- patched_wxgui.py Sun May 24 02:19:34 2009
***************
*** 52,59 ****
import gui_modules.globalvar as globalvar
if not os.getenv("GRASS_WXBUNDLED"):
! globalvar.CheckForWx()
!
import wx
import wx.aui
import wx.combo
--- 52,61 ----
import gui_modules.globalvar as globalvar
if not os.getenv("GRASS_WXBUNDLED"):
! globalvar.CheckForWx()
!
! from wx.lib.dialogs import ScrolledMessageDialog
!
import wx
import wx.aui
import wx.combo
***************
*** 88,94 ****
from gui_modules.debug import Debug as Debug
from icons.icon import Icons as Icons
! UserSettings = preferences.globalSettings
class GMFrame(wx.Frame):
"""
--- 90,96 ----
from gui_modules.debug import Debug as Debug
from icons.icon import Icons as Icons
! UserSettings = preferences.globalSettings
class GMFrame(wx.Frame):
"""
***************
*** 527,535 ****
lchecked=True,
lopacity=1.0,
lcmd=['d.vect', 'map=%s' %
name])
!
def OnAboutGRASS(self, event):
! """Display 'About GRASS' dialog"""
info = wx.AboutDialogInfo()
# name
--- 529,551 ----
lchecked=True,
lopacity=1.0,
lcmd=['d.vect', 'map=%s' %
name])
!
! def OnGRASSLicense(self, event):
! """Display 'GRASS License' dialog"""
! licenceFile = open(os.path.join(os.getenv("GISBASE"),
"GPL.TXT"), 'r')
! dialog = ScrolledMessageDialog ( self,
''.join(licenceFile.readlines()), 'GRASS GIS License' )
! licenceFile.close()
! dialog.ShowModal()
!
! def OnGRASSAuthors(self, event):
! """Display 'GRASS Authors' dialog"""
! licenceFile = open(os.path.join(os.getenv("GISBASE"),
"AUTHORS"), 'r')
! dialog = ScrolledMessageDialog ( self,
''.join(licenceFile.readlines()), 'GRASS GIS Authors' )
! licenceFile.close()
! dialog.ShowModal()
!
def OnAboutGRASS(self, event):
! """Display 'About GRASS' dialog"""
info = wx.AboutDialogInfo()
# name
***************
*** 551,563 ****
# website
info.SetWebSite(("http://grass.osgeo.org", "The official GRASS
site"))
# licence
! licenceFile = open(os.path.join(os.getenv("GISBASE"),
"GPL.TXT"), 'r')
! info.SetLicence(''.join(licenceFile.readlines()))
! licenceFile.close()
# credits
! authorsFile = open(os.path.join(os.getenv("GISBASE"),
"AUTHORS"), 'r')
! info.SetDevelopers([unicode(''.join(authorsFile.readlines()),
"utf-8")])
! authorsFile.close()
wx.AboutBox(info)
--- 567,581 ----
# website
info.SetWebSite(("http://grass.osgeo.org", "The official GRASS
site"))
# licence
! #licenceFile = open(os.path.join(os.getenv("GISBASE"),
"GPL.TXT"), 'r')
! #info.SetLicence(''.join(licenceFile.readlines()))
! #licenceFile.close()
! info.SetLicence('Distributed under GNU License, Version 2, June
1991.\nUse menu Help - GRASS GIS License for more details')
# credits
! #authorsFile = open(os.path.join(os.getenv("GISBASE"),
"AUTHORS"), 'r')
! #info.SetDevelopers([unicode(''.join(authorsFile.readlines()),
"utf-8")])
! info.SetDevelopers([unicode('List of authors is too long to be
displayed here.\nUse menu Help - GRASS GIS Authors for more details',
"utf-8")])
! #authorsFile.close()
wx.AboutBox(info)
}}}
diff patch for menudata.xml:
{{{
$ diff -c menudata.xml patched_menudata.xml
*** menudata.xml Sat May 16 09:52:30 2009
--- patched_menudata.xml Sun May 24 02:14:54 2009
***************
*** 2378,2388 ****
<help>Display the HTML man pages of GRASS</help>
<handler>self.RunMenuCmd</handler>
<command>g.manual wxGUI</command>
! </menuitem>
! <menuitem>
! <label>About GRASS GIS</label>
! <help>About GRASS GIS</help>
! <handler>self.OnAboutGRASS</handler>
</menuitem>
</items>
</menu>
--- 2378,2398 ----
<help>Display the HTML man pages of GRASS</help>
<handler>self.RunMenuCmd</handler>
<command>g.manual wxGUI</command>
! </menuitem>
! <menuitem>
! <label>About GRASS GIS</label>
! <help>About GRASS GIS</help>
! <handler>self.OnAboutGRASS</handler>
! </menuitem>
! <menuitem>
! <label>GRASS GIS License</label>
! <help>GRASS GIS License</help>
! <handler>self.OnGRASSLicense</handler>
! </menuitem>
! <menuitem>
! <label>GRASS GIS Authors</label>
! <help>List of GRASS GIS Authors</help>
! <handler>self.OnGRASSAuthors</handler>
</menuitem>
</items>
</menu>
}}}
i'm attaching both files just in case ...
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:1>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list