[GRASS-dev] [GRASS GIS] #102: new tabs in GUI have required last

#102: new tabs in GUI have required last
----------------------+-----------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.3.0
Component: default | Version: unspecified
Keywords: |
----------------------+-----------------------------------------------------
Someone went through and added new tabs to several of the module interface
sections. This is nice. However, in the couple I've run into (e.g.
r.colors and v.in.ascii), the "required" tab is the bottom one on the
stack and rightmost tab. That is the stuff that is most important is the
most hidden. Also v.in.ascii required output vector name is in the options
section, not the required section, and while the input raster name for
r.colors is in the required section, its description says it is optional.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: default | Version: unspecified
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment (by hamish):

FWIW I don't really see the point in putting options in a Required tab
using the guisection control. That info is already supplied by the
opt->required parser switch.

I'm not completely sold on putting all parser required options in the
front tab. I would be happy if those options were just bolded.
(I can see the problem with something like d.vect where you would have to
hunt for them in lots of tabs, annoying)

For r.colors, v.in.ascii the input can come from stdin which is why those
input filenames are not required by the parser, although piping to stdin
isn't really an option from a GUI window.

I am not sure about the wxPython GUI but for the TclTk one IIRC tabs are
created in the order their options arrive, with flags having the first
pass, and all sorts of other funny rules. I think it is bad policy to do a
lot of option reordering to make the tabs look nice. IMO they should be
grouped in logical order when viewed serially from the help page. Special
care must be taken with the first option as users may expect it to be the
optional "opt=" from the command line. see trac task #88.

2c,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Python | Version: unspecified
Resolution: | Keywords: wxGUI
-----------------------+----------------------------------------------------
Changes (by martinl):

  * keywords: => wxGUI
  * component: default => Python

Comment:

Replying to [ticket:102 cmbarton]:
> Someone went through and added new tabs to several of the module
interface sections. This is nice. However, in the couple I've run into
(e.g. r.colors and v.in.ascii), the "required" tab is the bottom one on
the stack and rightmost tab. That is the stuff that is most important is
the most

strange, I cannot reproduce this behaviour, 'Required' tab is the most-
left on my machine. Looking at the code, 'Required' (formerly called
'Main') should be always first, see

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/menuform.py#L865

> hidden. Also v.in.ascii required output vector name is in the options
section, not the required

I see this option in 'Required tab', see the attached screenshot.

> section, and while the input raster name for r.colors is in the required
section, its description says it is optional.

The input parameter is option because

{{{
-l List available rules then exit
}}}

then you don't need to set dummy value for 'r.colors -l' (otherwise
'r.colors in=dummy -l'). For GUI dialog this parameter is forced to be
moved to 'Required' tab.

{{{
option->guisection = _("Required");
}}}

It seems to me less confusing for GUI user - "I want to change color table
of raster map, then I am expecting input raster map name to be required".
Maybe tab should called 'Main' not 'Required'.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Python | Version: unspecified
Resolution: | Keywords: wxGUI
-----------------------+----------------------------------------------------
Comment (by martinl):

Replying to [comment:1 hamish]:
> FWIW I don't really see the point in putting options in a Required tab
using the guisection control. That info is already supplied by the
opt->required parser switch.

Yes, that's true. But there are some exceptions like r.in/out.gdal,
v.in/out.ogr where naturally required parameters (input, output) are not
marked as required. Mainly because of 'list' flag. Otherwise you would
have to type

{{{
r.in.gdal in=dummy -f
}}}

instead of

{{{
r.in.gdal -f
}}}

which is a bit ugly. For GUI dialog it could be for user a bit confusing,
to launch r.in.gdal and to find input and output option in 'Optional' tab,
even dialog for importing raster file into GRASS without 'Required' tab.

> I'm not completely sold on putting all parser required options in the
front tab. I would be happy if those options were just bolded.
> (I can see the problem with something like d.vect where you would have
to hunt for them in lots of tabs, annoying)
>
> For r.colors, v.in.ascii the input can come from stdin which is why
those input filenames are not required by the parser, although piping to
stdin isn't really an option from a GUI window.

Maybe we could rename 'Required' tab to 'Main' tab, bolded required option
(option->required = YES) and move here few options like in the case of
r.in.gdal.

> I am not sure about the wxPython GUI but for the TclTk one IIRC tabs are
created in the order their options arrive, with flags having the first
pass, and all sorts of other funny rules. I

It should be same for wxPython, just 'Required' tab is always first and
'Optional' (i.e. parameter without guisection) the second.

> think it is bad policy to do a lot of option reordering to make the tabs
look nice. IMO they should be grouped in logical order when viewed
serially from the help page. Special care must be taken with the first
option as users may expect it to be the optional "opt=" from the command
line. see trac task #88.

I agree (CLI and GUI should be consistent here).

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Python | Version: unspecified
Resolution: | Keywords: wxGUI
-----------------------+----------------------------------------------------
Comment (by glynn):

Replying to [comment:1 hamish]:

> For r.colors, v.in.ascii the input can come from stdin which is why
those input filenames are not required by the parser, although piping to
stdin isn't really an option from a GUI window.

I suggest modifying the parser so that "-" is always accepted for
"old,file" options.

Providing incorrect type information so that "-" works is a rather ugly
hack.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

On Mar 19, 2008, at 3:12 AM, GRASS GIS wrote:

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Python | Version: unspecified
Resolution: | Keywords: wxGUI
-----------------------+----------------------------------------------------
Changes (by martinl):

  * keywords: => wxGUI
  * component: default => Python

Comment:

Replying to [ticket:102 cmbarton]:

Someone went through and added new tabs to several of the module

interface sections. This is nice. However, in the couple I've run into
(e.g. r.colors and v.in.ascii), the "required" tab is the bottom one on
the stack and rightmost tab. That is the stuff that is most important is
the most

strange, I cannot reproduce this behaviour, 'Required' tab is the most-
left on my machine. Looking at the code, 'Required' (formerly called
'Main') should be always first, see

http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/menuform.py#L865

This report was for TclTk, not for wxPython. It is the same on Mac and Linux.

Michael

hidden. Also v.in.ascii required output vector name is in the options

section, not the required

I see this option in 'Required tab', see the attached screenshot.

section, and while the input raster name for r.colors is in the required

section, its description says it is optional.

The input parameter is option because

{{{
-l List available rules then exit
}}}

then you don't need to set dummy value for 'r.colors -l' (otherwise
'r.colors in=dummy -l'). For GUI dialog this parameter is forced to be
moved to 'Required' tab.

{{{
option->guisection = _("Required");
}}}

It seems to me less confusing for GUI user - "I want to change color table
of raster map, then I am expecting input raster map name to be required".
Maybe tab should called 'Main' not 'Required'.

Martin

--
Ticket URL: <#102 (new tabs in GUI have required last) – GRASS GIS;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

On Mar 19, 2008, at 3:29 AM, GRASS GIS wrote:

look nice. IMO they should be grouped in logical order when viewed
serially from the help page. Special care must be taken with the first
option as users may expect it to be the optional "opt=" from the command
line. see trac task #88.

I agree (CLI and GUI should be consistent here).

Martin

There is no need for the CLI and GUI to be consistent with respect to options ordering. For the CLI, option order is irrelevant; options can be typed in any order.

For the GUI option order is very important because the user must access the options only in the order presented by the GUI. Thus we need to make sure the options order in the GUI section is the most logical and useable for the GUI. This section has no impact at all on the CLI.

Michael

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Python | Version: unspecified
Resolution: | Keywords: wxGUI
-----------------------+----------------------------------------------------
Comment (by martinl):

From grass-dev ML:

2008/3/20, Michael Barton <michael.barton@asu.edu>:
> There is no need for the CLI and GUI to be consistent with respect to
> options ordering. For the CLI, option order is irrelevant; options
> can be typed in any order.

I don't think so, there is no reason to leave CLI and GUI syntax
description inconsistent. The order of parameters should be logical. Yes,
you can type them in order whatever you like, the point here is module
usage description, e.g. v.in.ascii

input -> tab 'Required'
output -> tab 'Required'

fs -> not defined (tab 'Optional')
skip ->not defined (tab 'Optional')

columns -> tab 'Columns'
x > tab 'Columns'
y -> tab 'Columns'
z -> tab 'Columns'
cat -> tab 'Columns'

and some flags ...

> For the GUI option order is very important because the user must
> access the options only in the order presented by the GUI. Thus we
> need to make sure the options order in the GUI section is the most
> logical and useable for the GUI. This section has no impact at all on
> the CLI.

yes, anyway I think the order of parameters given to G_parser() should be
logical and be grouped by guisection identifier.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Tcl | Version: svn-trunk
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Changes (by martinl):

  * keywords: wxGUI =>
  * version: unspecified => svn-trunk
  * component: Python => Tcl

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Tcl | Version: svn-trunk
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment (by hamish):

Replying to [comment:4 glynn]:
> Replying to [comment:1 hamish]:
Hamish:
> > For r.colors, v.in.ascii the input can come from stdin which is why
those
> > input filenames are not required by the parser, although piping to
stdin isn't
> > really an option from a GUI window.
Glynn:
> I suggest modifying the parser so that "-" is always accepted for
"old,file"
> options.
>
> Providing incorrect type information so that "-" works is a rather ugly
hack.

What I was trying to get at was the modules work like "if input file is
NULL, assume input comes from stdin". I don't think those modules actually
have code to deal with input=-, they will treat that as a filename not
something special. Some modules do recognize that trick, for consistency's
sake I suppose all that can read from stdin should, and if the parser
needs to be aware of that then so be it.

And AFAIK the parser does not actually check to see if an "old,file"
option's answer actually exists. It leaves that to the module. All it
provides is the folder file picker GUI. (Same is true for cell, vector,
group, ... elements) (??)

So the type isn't being dropped to accomodate 'oldfile=-', ->required is
being dropped to accomodate "if input file is NULL, assume input comes
from stdin".

not sure if we're talking about the same thing here...

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

GRASS GIS wrote:

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.3.0
Component: Tcl | Version: svn-trunk
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Comment (by hamish):

Replying to [comment:4 glynn]:
> Replying to [comment:1 hamish]:
Hamish:
> > For r.colors, v.in.ascii the input can come from stdin which is why those
> > input filenames are not required by the parser, although piping to stdin isn't
> > really an option from a GUI window.
Glynn:
> I suggest modifying the parser so that "-" is always accepted for "old,file"
> options.
>
> Providing incorrect type information so that "-" works is a rather ugly hack.

What I was trying to get at was the modules work like "if input file is
NULL, assume input comes from stdin". I don't think those modules actually
have code to deal with input=-, they will treat that as a filename not
something special. Some modules do recognize that trick, for consistency's
sake I suppose all that can read from stdin should, and if the parser
needs to be aware of that then so be it.

And AFAIK the parser does not actually check to see if an "old,file"
option's answer actually exists. It leaves that to the module. All it
provides is the folder file picker GUI. (Same is true for cell, vector,
group, ... elements) (??)

So the type isn't being dropped to accomodate 'oldfile=-', ->required is
being dropped to accomodate "if input file is NULL, assume input comes
from stdin".

not sure if we're talking about the same thing here...

Okay. I misinterpreted "filenames are not required" as "files are not
required (to exist)".

Realistically, we either need a more expressive type system, with
union types, or we have to eliminate all of these special cases.

BTW, the specific issue with "mode" flags (e.g. "r.colors -l") could
be dealt with fairly easily by adding a field to "struct Flag" to
indicate that the flag suppresses any requirements. That way, you
wouldn't have to do without ->required settings because of
"exceptional" cases.

--
Glynn Clements <glynn@gclements.plus.com>

Hi,

2008/3/20, Glynn Clements <glynn@gclements.plus.com>:

BTW, the specific issue with "mode" flags (e.g. "r.colors -l") could
be dealt with fairly easily by adding a field to "struct Flag" to
indicate that the flag suppresses any requirements. That way, you
wouldn't have to do without ->required settings because of
"exceptional" cases.

I agree here, better then to hack around...

+1

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Tcl | Version: svn-trunk
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Changes (by neteler):

  * milestone: 6.3.0 => 6.4.0

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/102#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Tcl | Version: svn-develbranch6
Resolution: fixed | Keywords:
-----------------------+----------------------------------------------------
Changes (by cmbarton):

  * status: new => closed
  * version: svn-trunk => svn-develbranch6
  * resolution: => fixed

Comment:

I think I've fixed this. If a "Required" tab exists, it is not first and
is raised. If it doesn't exist, the parser reverts to option begin first.
This works on my Mac with OSX 10.5; please test on other confiurations.

Michael

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

A late night typo in the message below is misleading. It should say...

If a "Required" tab exists, it is placed first and is raised (i.e., is the
active page). If a "Required" tab does not exist, the tabs are placed in the
order the sections are listed and the first tab is raised.

Michael

On 5/13/08 11:37 PM, "GRASS GIS" <trac@osgeo.org> wrote:

#102: new tabs in GUI have required last
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: Tcl | Version: svn-develbranch6
Resolution: fixed | Keywords:
-----------------------+----------------------------------------------------
Changes (by cmbarton):

  * status: new => closed
  * version: svn-trunk => svn-develbranch6
  * resolution: => fixed

Comment:

I think I've fixed this. If a "Required" tab exists, it is not first and
is raised. If it doesn't exist, the parser reverts to option begin first.
This works on my Mac with OSX 10.5; please test on other confiurations.

Michael

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton