[GRASS-dev] G_OPT_V_TYPE cannot be recognized in --interface-description in GRASS GIS
Vaclav Petras
wenzeslaus at gmail.com
Tue Sep 1 07:32:39 PDT 2015
On Tue, Sep 1, 2015 at 5:14 AM, Radim Blazek <radim.blazek at gmail.com> wrote:
>
> On Tue, Aug 25, 2015 at 3:31 AM, Vaclav Petras <wenzeslaus at gmail.com>
wrote:
> > Was: [Qgis-developer] QGIS GRASS plugin - modules upgrade
> >> >> 2) define relations between options (e.g. type or column option
> >> >> relation with input vector) or special options which has dedicated
> >> >> widget in UI (e.g. GDAL/OGR input).
> >> >
> >> > This should be defined in GRASS GIS. If it is missing in GRASS or in
the
> >> > --interface-description then it is a bug which should be solved.
> >>
> >> How can I recognize G_OPT_V_TYPE in --interface-description? It does
> >> not have gisprompt.
> >
> >
> > Right [1]. I think this is a bug. No gisprompt is there. I think wxGUI
> > doesn't need it because the values for the combo box are defined there
> > already.
>
> How does the wxGUI know that the option should be placed in Selection tab?
It is defined using guisection:
https://trac.osgeo.org/grass/browser/grass/trunk/vector/v.distance/main.c#L97
In the XML it looks like:
<parameter name="from_layer" type="string" required="no" multiple="no">
<label>
Layer number or name (from)
</label>
...
<guisection>
From
</guisection>
</parameter>
It is not defined what should happen with the ones which do not have
guisection, i.e. it is up to you to decide and it doesn't make sense for
GRASS GIS to enforce one representation or the other. The old behavior in
wxGUI was that all required options/parameters were in the Required tab and
all with non defined guisection were in Optional tab together with all
flags without guisection specified. The current (and better) behavior is
that wxGUI respects the guisection specified for required
options/parameters and (if it is actually specified) includes a red star to
a field description. In this case, it is up to the module to have it
defined nicely which means that module should specify guisection for every
required parameter if it is defining it for at least one (i.e. define all
or nothing). The Optional tab still behaves the same and contains all
not-required options/parameters without guisection. So now Required and
Optional behave the same -- as fallbacks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150901/d92e1d95/attachment.html>
More information about the grass-dev
mailing list