[GRASS-dev] QGIS GRASS Plugin Upgrade Crowdfunding

Pietro peter.zamb at gmail.com
Tue Mar 24 10:30:52 PDT 2015


Hi Vaclav,

On Tue, Mar 24, 2015 at 3:54 PM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
> On Tue, Mar 24, 2015 at 2:00 AM, Pietro <peter.zamb at gmail.com> wrote:
>> together with Francesco Geri, last week we started to write a first
>> draft that generate the GUI for the GRASS module dynamically (based on
>> the xml generated with: --interface-description), so far it is based
>> on grass7 but should work also on grass6 (not tested, should be enough
>> to backport the pygrass.modules.Module class).
>
> Hi Pietro and Francesco,
>
> this sounds good. Are you speaking about QGIS GUI (in Python) generated from
> --interface-description? Do you think it would be possible to write it in a
> way which would be GUI framework independent so that it is usable in both
> GRASS and QGIS? The GUIs for modules in GRASS are quite good now but the
> code should be rewritten and this would be a great way how to get this new
> implementation.

yes, actually what I wrote it is completely independent from QGIS, it
is compatible with pyqt/pyside and with python2/python3,
It is just a proof of concept. Now Francesco it is working to better
integrate this draft with QGIS stuff.

The idea was heavily based on formlayout code:

https://code.google.com/p/formlayout/

Basically each parameter is a GUI field that it is add to the main
window, therefore based on the parameter type the field could be:

if "raster"/"vector" => a combo box with the rasters/vectors available
if "integer" => a spinbox
if "string"/"double" => a text field
if "file" => a file dialog

based on the guisection parameter all the options are organized in tabs.

The code is under 500 lines of code.

I guess should be possible to follow the same approach using the wxpython.
I think that with a bit more effort should be possible to make it
general enough to make it independent from the GUI framework (Qt/Wx)
that we want to use.

I have not link to share at this stage because we are still working on it.
But I guess we can share the code as soon as we have something that it
is able to cover the basic needs.


Pietro


More information about the grass-dev mailing list