[GRASS-dev] [GRASS GIS] #588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Keywords: | Platform: MSWindows XP
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/588&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@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&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

  * status: closed => reopened
  * resolution: worksforme =>

Comment:

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/588#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

  * keywords: => wingrass, license

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by martinl):

Replying to [comment:2 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by 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?

l.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by martinl):

Replying to [comment:5 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by 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'

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

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by martinl):

Replying to [comment:7 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by 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.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by cmbarton):

  * component: wxGUI => Compiling

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

Replying to [comment:10 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by martinl):

* cc: martinl (added)

Comment:

Replying to [comment:9 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by cmbarton):

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

grass64.svn rev39432
  self compiled in the osgeo4w-stack

info, copyright, license, authors are readable

closing the report?

best regards
helli

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#588: wxGUI: About GRASS GIS window doesn't let you view full lic or devs
---------------------------+------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Compiling | Version: 6.4.0 RCs
Resolution: fixed | Keywords: wingrass, license
  Platform: MSWindows XP | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by cmbarton):

  * status: reopened => closed
  * resolution: => fixed

Comment:

Sure. I'll close it.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/588#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>