Opened 16 years ago

Closed 15 years ago

#588 closed defect (fixed)

wxGUI: About GRASS GIS window doesn't let you view full lic or devs

Reported by: hamish Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Compiling Version: 6.4.0 RCs
Keywords: wingrass, license Cc: martinl
CPU: Unspecified Platform: MSWindows XP

Description

In the latest wingrass installers if you do help-> about grass gis you get a window with License >> and Developers >> buttons. they expand but do not have scrollable boxes so you only see the first few lines of text.

Hamish

Attachments (4)

menudata.xml (84.4 KB ) - added by xpolok00 15 years ago.
Patched gui/wxpython/menudata.xml
wxgui.py (61.4 KB ) - added by xpolok00 15 years ago.
Patched gui/wxpython/wxgui.py
wxgui.py.diff (3.7 KB ) - added by xpolok00 15 years ago.
Patch of gui/wxpython/wxgui.py from grass-6.4.svn_src_snapshot_2009_05_23.tar.gz
menudata.xml.diff (1.1 KB ) - added by xpolok00 15 years ago.
Patch of gui/wxpython/xml/menudata.xml from grass-6.4.svn_src_snapshot_2009_05_23.tar.gz

Download all attachments as: .zip

Change History (19)

comment:1 by xpolok00, 15 years ago

Resolution: worksforme
Status: newclosed

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 ...

by xpolok00, 15 years ago

Attachment: menudata.xml added

Patched gui/wxpython/menudata.xml

by xpolok00, 15 years ago

Attachment: wxgui.py added

Patched gui/wxpython/wxgui.py

comment:2 by hamish, 15 years ago

Resolution: worksforme
Status: closedreopened

reopening ticket. the job ain't done until changes have been committed into the SVN repository.

thanks for the patch; context diffs are ok, but fyi 'diff -u' is preferable.

comment:3 by hamish, 15 years ago

Keywords: wingrass license added

... oh yeah, I'll mention that the old setup works perfectly in latest Linux devbr6 (opens new popup window), it's only on MS-Windows where the expansion breaks.

in reply to:  2 comment:4 by martinl, 15 years ago

Replying to hamish:

reopening ticket. the job ain't done until changes have been committed into the SVN repository.

thanks for the patch; context diffs are ok, but fyi 'diff -u' is preferable.

yes, next time please attach patches produced 'diff -u' format not patched files...

Martin

comment:5 by xpolok00, 15 years ago

appologies. i selected original files by accident. will keep that in mind. am i supposed to commit something to svn, or did someone do so already?

l.

in reply to:  5 comment:6 by martinl, 15 years ago

Replying to xpolok00:

appologies. i selected original files by accident. will keep that in mind. am i supposed to commit something to svn, or did someone do so already?

It's not so easy, you need write access to SVN first [1]. Good start is to attach diffs against selected SVN branch, it will simplify life of developers...

Martin

[1] http://trac.osgeo.org/grass/wiki/HowToContribute#WriteaccesstotheMainGRASS-SVNrepository

by xpolok00, 15 years ago

Attachment: wxgui.py.diff added

Patch of gui/wxpython/wxgui.py from grass-6.4.svn_src_snapshot_2009_05_23.tar.gz

by xpolok00, 15 years ago

Attachment: menudata.xml.diff added

Patch of gui/wxpython/xml/menudata.xml from grass-6.4.svn_src_snapshot_2009_05_23.tar.gz

comment:7 by cmbarton, 15 years ago

Completely broken on my Mac now. I get the error...

Traceback (most recent call last):

File "/Applications/Grass/GRASS-6.4.app/Contents/MacOS/etc

/wxpython/wxgui.py", line 551, in OnAboutGRASS

copyrightFile = open(os.path.join(os.getenv("GISBASE"), "COPYING"), 'r') IOError : [Errno 2] No such file or directory: '/Applications/Grass/GRASS-6.4.app/Contents/MacOS/COPYING'

Why not just make this an HTML file and have it open like the rest of the help files?

Michael

in reply to:  7 comment:8 by martinl, 15 years ago

Replying to cmbarton:

Completely broken on my Mac now. I get the error...

Traceback (most recent call last):

File "/Applications/Grass/GRASS-6.4.app/Contents/MacOS/etc

/wxpython/wxgui.py", line 551, in OnAboutGRASS

copyrightFile = open(os.path.join(os.getenv("GISBASE"), "COPYING"), 'r') IOError : [Errno 2] No such file or directory: '/Applications/Grass/GRASS-6.4.app/Contents/MacOS/COPYING'

It's seems to me that you are reporting another bug - missing COPYING file in your installation (which is critical issue).

Why not just make this an HTML file and have it open like the rest of the help files?

Do you mean "about window"? Why not use the default widget which is provided by wxPython library?

Martin

comment:9 by cmbarton, 15 years ago

Fixed in develbranch_6 r39300. The AboutBox dialog is too small for all the GRASS information and you can't add scrollbars. So I've made this a tabbed notebook that visually matches the rest of the interface. Please test. If it works on other platforms (Linux and Windows), I'll backport to releasebranch and trunk.

Michael

comment:10 by cmbarton, 15 years ago

Component: wxGUICompiling

Backported to releasebranch and trunk.

Changing to compiling because the requisite files have not been getting into the compiled binaries in Windows and Mac. Once the files (AUTHORS, COPYING, GPL.TXT, etc.) get copied into the binaries correctly, they will also display in full.

Michael

in reply to:  10 comment:11 by hamish, 15 years ago

Replying to cmbarton:

Backported to releasebranch and trunk.

I'm not too crazy about the aesthetics of the fix (tabs come out on a dark grey background for me), but it solves the main problem and I don't have any better ideas to offer.

Changing to compiling because the requisite files have not been getting into the compiled binaries in Windows and Mac. Once the files (AUTHORS, COPYING, GPL.TXT, etc.) get copied into the binaries correctly, they will also display in full.

does 'g.version -c' display the GPL message and project contact details on Mac ??? The Makefile should be copying that stuff into $(ETC), not the packager.

Hamish

in reply to:  9 comment:12 by martinl, 15 years ago

Cc: martinl added

Replying to cmbarton:

Fixed in develbranch_6 r39300. The AboutBox dialog is too small for all the GRASS information and you can't add scrollbars. So I've made this a tabbed notebook that visually matches the rest of the interface. Please test. If it works on other platforms (Linux and Windows), I'll backport to releasebranch and trunk.

I am no happy with this change. I would really incline to use *standard* dialogs as much as possible. I hope that the reported bug can be fixed without removing wx.AboutDialog.

Martin

comment:13 by cmbarton, 15 years ago

There are 2 things. The worst bug is that the needed files are/were not being copied into the binaries by the makefile. William says he has fixed this on the Mac (I haven't yet tested) but I saw comments on the same issue in Windows today.

The 2nd thing is that the information in the files (AUTHOR, COPYING, etc) is too big to go into a standard AboutDialog. It is cut off and there is no way to add scroll bars to the AboutDialog. Even with the new menu buttons, it is still too big (the AUTHORS and GPL.TXT files are several screen pages long). So this just won't fit into a standard AboutDialog and we have to do something custom in any case. I thought the flatnotebook at least matches the rest of the interface, but if someone wants to try another kind of control that's OK. However, any control used for this information will need scrollbars at the least and it would be better to break the information up into its natural chunks (represented by the files in $GISBASE).

I'd recommend either changing this to closed or at least to enhancement rather than defect once the Makefiles are fixed on Mac and Windows.

Michael

comment:14 by hellik, 15 years ago

grass64.svn rev39432 self compiled in the osgeo4w-stack

info, copyright, license, authors are readable

closing the report?

best regards helli

comment:15 by cmbarton, 15 years ago

Resolution: fixed
Status: reopenedclosed

Sure. I'll close it.

Michael

Note: See TracTickets for help on using tickets.