[GRASS-dev] [GRASS GIS] #860: wxGUI: About Copyright missing its middle

#860: wxGUI: About Copyright missing its middle
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: license | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
Hi,

when I do help -> about in the 6.4/6.5 wx GUI menu and look in the
Copyright tab I get the text from `g.region -c`, but only the very top and
bottom lines. The middle is missing. It skips from the end of the second
paragraph all the way to "BOSTON, MA ..." & past all the "don't sue us"
stuff.

fwiw, gis.m and g.version -c are fine.

also I notice the "&" gets treated as a keyboard shortcut designator in
some of the other tab text.

?
Hamish

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by glynn):

Replying to [ticket:860 hamish]:

> when I do help -> about in the 6.4/6.5 wx GUI menu and look in the
Copyright tab I get the text from `g.region -c`, but only the very top and
bottom lines. The middle is missing. It skips from the end of the second
paragraph all the way to "BOSTON, MA ..." & past all the "don't sue us"
stuff.

This appears to have been intentional; `AboutWindow.PageCopyright` at
help.py:458:
{{{
             copytext = wordwrap(''.join(copyright[:11] +
copyright[26:-3]),
                                 575, wx.ClientDC(self))
}}}
Presumably this was to make it fit the window, but that's not necessary
now that it's embedded in a `ScrolledPanel`.

I suggest:
{{{
--- gui/wxpython/gui_modules/help.py (revision 40258)
+++ gui/wxpython/gui_modules/help.py (working copy)
@@ -453,10 +453,7 @@
          copyfile = os.path.join(os.getenv("GISBASE"), "COPYING")
          if os.path.exists(copyfile):
              copyrightFile = open(copyfile, 'r')
- copyrightOut =
- copyright = copyrightFile.readlines()
- copytext = wordwrap(''.join(copyright[:11] +
copyright[26:-3]),
- 575, wx.ClientDC(self))
+ copytext = copyrightFile.read()
              copyrightFile.close()
          else:
              copytext = _('%s file missing') % 'COPYING'
}}}

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by hamish):

ok, thanks. tested & committed in 6.5, to be ported around as soon as I
get the chance.

I notice that the Copyright, Contributers, and Translators tabs seem to
start their display on line[1] instead of line[0] of the file.
(content is there, it's just the scrollbar)
?

Hamish

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by glynn):

Replying to [comment:2 hamish]:

> I notice that the Copyright, Contributers, and Translators tabs seem to
start their display on line![1] instead of line![0] of the file. (content
is there, it's just the scrollbar)

Also, if you scroll to the top, switch tabs, then switch back, it reverts
the scrollbar position. This suggests a bug in `ScrolledPanel`, possibly
in its interactions with `FlatNotebook`. Both of those are wxPython
extensions (i.e. not part of wxWidgets), which generally seem to have more
rough edges than the core wxWidgets components.

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by neteler):

I just recompiled: help -> about in 6.4 does no longer open a Window.
Confirmed on Linux and Windows (latest installer from today).

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by hamish):

Replying to [comment:4 neteler]:
> I just recompiled: help -> about in 6.4 does no longer open a
> Window. Confirmed on Linux and Windows (latest installer from
> today).

presumably this has now been fixed by the str(authors) l10n commit.

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Comment (by hamish):

testing with the latest 6.4 wingrass installer (6.4.svn r40456)
all Help->About content now displays.

the weirdness of the tabs starting their scrolling on the 2nd paragraph or
so remains.

Hamish

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by martinl):

* cc: martinl (added)

Comment:

It's seems to be wxPython bug. Could we close this ticket?

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

#860: wxGUI: About Copyright missing its middle
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: fixed | Keywords: license
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by hamish):

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

Comment:

Replying to [comment:8 martinl]:
> It's seems to be wxPython bug.

(Just to note that it happens on both WinGrass and Linux.)

> Could we close this ticket?

If that is your expert opinion, sure.

Perhaps the scroll-bug could be reported to the tab/form/widget
class authors?

Hamish

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