[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 12

2016-08-14 Thread Ondřej Pešek
Hi all,

here is my last week report.

Wiki page: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

A link to my commits: https://github.com/pesekon2/GRASS-Qt-based-GUI/commits

The goal of the project was to create new GUI for modules based on PyQt.
The old one is based on wxPython. The reason is that there are some bugs in
wxPython and PyQt is now much more powerfull. The second reason is that the
code of old GUI is written bad way. It's almost impossible to read what
something do and work with that. So the second goal was try to write
higher-quality code.

My project is now usable.
It's interface is mostly based on the old one to avoid the need for
studying new approach (the code isn't), but some widgets were changed due
to my and my mentor's opinion. For example we use spinbox for int widgets
or there is completely new widget for choosing quiet/normal/verbose module
output.

What have been done is visible in github repository. Screenshots of widgets
and other stuff is at wikipage.
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 10

2016-07-29 Thread Ondřej Pešek
Hi all!

Here is the tenth report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff see its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?

* New widgets: Mapsets, locations and dbtable (created dependencies between
those), special widget for quiet/normal/verbose module output

* Created definitive (I hope) size policy. ialog width and height still
depends on content volume, but now just till some limit. After that, the
tab gets sliders to scroll.

* Fixes and updates: Widgets Columns and Layers now work with map in widget
'map' when 'input' does not exist; fix widget Colors for default value in
'r:g:b' style

* Main window and dialogs now have grass logo and icon

* Required widget is highlighted by red star

* Tab 'required' isn't visible when it's empty

* Was created documentation for .py files and for individual class,
methods...

* key_desc used instead of type (when showing widget name)

* Big refactoring using default pep8


What do you plan on doing next week?

* I'm sorry but I will be now for two weeks (as I said at the beginning)
off. Off the internet, off the computer. I hope that I can can turn for one
day to civilization and work. I have unfinished one widget (icons choosing
in d.vect) and I hope that I will be able to work little bit next week and
finish it...


Have a nice week,
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 9

2016-07-22 Thread Ondřej Pešek
Hi all!

Here is the ninth report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff see its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?

* New widget: dbtable

* I had finally ordered tabs. Required tab is the first one and Optional
tab the last one. And if widget has defined guisection, it is now prior to
Required.

* I had fixed problems with spinboxes. They now allow you to input number
greater than 100 and also negative numbers.

* Was created first version of sizepolicy. Dialog width and height still
depends on content volume, but now just till some limit. After that, the
tab gets sliders to scroll.
What do you plan on doing next week?

* Finish things with sizepolicy, clear little bit the code, there are still
some widgets which I plan to design better way

Are you blocked on anything?

* I was really blocked on the sizepolicy for a while. I'm talking 'bout it
with my mentor and it seems that it will be okay in a while.

Have a nice weekend,
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 8

2016-07-16 Thread Ondřej Pešek
Hi all!

Here is the eigth report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff see its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?

* New widgets: layer, columns, multiple values with values_desc, separator,
group, colors

* helpButton and closeButton work

* Help/tooltip also for flags

* Fix: Float or int equals 0 -> delete from cmd, more flags than one will
not call overwrite, set minimum size to browsebutton

* Refactoring (using methods as callbacks)
What do you plan on doing next week?

* DB widgets with dependencies

Are you blocked on anything?

* Nope


Thank you and have a real cool time!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 7

2016-07-09 Thread Ondřej Pešek
Hi all!

Here is the seventh report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff see its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?

* New widgets: cats, multiple values, raster_3d

* Little changes in other widgets: Mapset is not selectable in treewidget,
flags and default widget were moved into its own classes

* If widgets have both label and description, description is used as
help/tooltip

* Massive refactoring of code for command (running, changing dictionary,
changing cmd string that user see)

What do you plan on doing next week?

* I want to start coding the widges with dependencies (column, layer); I
will also check my code with pep8

Are you blocked on anything?

* I was blocked for some while on the refactoring, but it's OK now


Have a sunny weekend!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 6

2016-07-02 Thread Ondřej Pešek
Hi all!

Here is the sixth report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff se its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?

* The Run button works now also with flags. Also the user can see flags in
string below.(it works with both long and short flags)

* For prompt=file I implemented lineedit with Browse button to choose file.
What do you plan on doing next week?

* The main thing will be refactoring some code - especially for
CodeChanger. I'm now discussing about it with my mentor.

* I think that I can implement some more types of widgets. I also want to
start study (and code) the dependencies between widgets.

Are you blocked on anything?

* Nope


Thank you and have a real cool time!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 5

2016-06-26 Thread Ondřej Pešek
Hi all!

Here is thefifth report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff se its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?
* As I said, due to my exams, I didn't do anything. Sorry. But by next
week, I'm again ready to work.

What do you plan on doing next week?
* I want to implement also flags into the string user see and into Run
button. Also I want to start working on choosing files with browse button.
I hope that it everything will be smooth and I will also finish this browse
widget.

Are you blocked on anything?
* Not now


Thank you and have a real cool time!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 4

2016-06-18 Thread Ondřej Pešek
Hi all!

Here is the third report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML. For screenshots and other stuff se its
wiki: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

What did you get done this week?
* The Run button really runs (but still not with flags). It's still the
only button with any function. Also the code-string on the bottom of GUI
was recreated. Now it's just one (only readable) textedit. When the string
is too long, you will get the scrollbar.

* Completely retyped code in parameters.py. Now it works like Factory.
Factory is dynamically creating the list of methods classes with canHandle
method and the called class depends on the values in this method. It means
that there are not so many "ifs" and the code is better readable. And those
classes return "self" instead of method get().

* Float coords is lineedit.

* When the string has values, it's editable combobox with implemented
values.

* Nearly last thing: I implemented the TreeComboBox for inouts/outputs.
Both raster and vector. It works very similarly to the one in old GUI.
Mapset is parent and then you have many children to choose. It's in
gselect.py and in parameters.py is just the class inheriting it from
gselect with added canHandle method. It's much readable for anyone than
just directing program elsewhere. Now you can also choose the mapset; this
possibility will be banned in next coding.

* For not implemented thing I use lineedit (because You can write there
anything manually). Now I highlight it with red colour and word TODO in
GUI. It's just for me and will not be in the real version.

What do you plan on doing next week?
* I'm sorry but at June the 27th, I have my final exams for bachelor at
school so I won't be able to do anything related to GSoC in next week (I
really have to learn something before exams). I have done everything in my
timeline for next week so I hope it's okay. I will of course answer to
mails and such thing, I mean I will not be able to code anything. Thanks.

Thank you and have a sunny weekend!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 3

2016-06-10 Thread Ondřej Pešek
Hi all!

Here is the third report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML

What did you get done this week?
* I have upgraded GUI - now it works also with the string and integer
types. (on the basic level)
* I also have made some changes - SqlQuery is now lineedit and when the
float isn't multiple, the GUI generates QDoubleSpinBox.
* The important thing is the first version of copyable/runable code. The
buttons don't work yet, but user can see it and it automatically reads the
code.
*And one elegant thing - all the widgets are now stretched upper.

What do you plan on doing next week?
* Main goal: Implement some other types/make more variable the current types
* Additional goals: Make the Run button working; recreate little bit the
code (not so many ifs)

Are you blocked on anything?
* Not yet

Have a nice weekend!
Ondrej
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-09 Thread Moritz Lennert

On 08/06/16 15:37, Anna Petrášová wrote:

On Wed, Jun 8, 2016 at 3:30 AM, Blumentrath, Stefan
 wrote:

Side question: do the parser rules include flags ? I thought they were only 
available for options.


Actually, I have no idea. I just checked the add-ons I wrote, and saw that I 
only used them for options. I was not aware of this limitation...
Thanks for pointing that out...


Check the manual:

https://grass.osgeo.org/grass72/manuals/g.parser.html

It's implemented and I used it couple of times successfully.


Right. Sorry. I'd tried it without the '-' and it didn't work, so I just 
assumed it didn't... Not sure if I find it intuitive to require the dash...


Moritz
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-08 Thread Anna Petrášová
On Wed, Jun 8, 2016 at 3:30 AM, Blumentrath, Stefan
 wrote:
>> Side question: do the parser rules include flags ? I thought they were only 
>> available for options.
>
> Actually, I have no idea. I just checked the add-ons I wrote, and saw that I 
> only used them for options. I was not aware of this limitation...
> Thanks for pointing that out...

Check the manual:

https://grass.osgeo.org/grass72/manuals/g.parser.html

It's implemented and I used it couple of times successfully.

Anna

>
> Cheers
> Stefan
> ___
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-08 Thread Ondřej Pešek
Hi,

it sounds good, thank you for opening new possibilities. To be honest, I
didn't know about the g.parser rules.

Now I'm just looking on that. It looks nice. In some latest version, I will
try to implement it. Especially the mutually exclusive ones, it should be
nice.

Thanks

2016-06-08 9:30 GMT+02:00 Blumentrath, Stefan :

> > Side question: do the parser rules include flags ? I thought they were
> only available for options.
>
> Actually, I have no idea. I just checked the add-ons I wrote, and saw that
> I only used them for options. I was not aware of this limitation...
> Thanks for pointing that out...
>
> Cheers
> Stefan
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-08 Thread Blumentrath, Stefan
> Side question: do the parser rules include flags ? I thought they were only 
> available for options.

Actually, I have no idea. I just checked the add-ons I wrote, and saw that I 
only used them for options. I was not aware of this limitation...
Thanks for pointing that out...

Cheers
Stefan
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-08 Thread Moritz Lennert

On 08/06/16 08:57, Blumentrath, Stefan wrote:

Hei,

And thanks for your work on the PyQT-GSoC project!

When it comes to possible GUI improvements, I am wondering if it would
be feasible to take e.g. parser rules into account by means of either

a)generating widgets depending on parser rules (if e.g. two flags are
mutually exclusive, use radio button instead of two tick-boxes)


Side question: do the parser rules include flags ? I thought they were 
only available for options.


Moritz
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-08 Thread Blumentrath, Stefan
Hei,

And thanks for your work on the PyQT-GSoC project!

When it comes to possible GUI improvements, I am wondering if it would be 
feasible to take e.g. parser rules into account by means of either

a)  generating widgets depending on parser rules (if e.g. two flags are 
mutually exclusive, use radio button instead of two tick-boxes)

b)  making the GUI “interactive” (e.g. a flag and an option are mutually 
exclusive, grey out the option when the flag is set, and the other way around)

If it in principle would be possible to make the GUI more dynamic that would be 
nice. Here I am thinking of e.g. to be able to generate lists for selections or 
default values, from for example a python script that is run before the GUI 
opens... A use-case would be the i.ortho.* modules (which still have not been 
ported to G7), where for example the values stored in a camera file (which is a 
simple text file) would have to be read into the GUI, so users can edit camera 
definitions, camera exposure parameters ...

Nothing essential, but it might open some new possibilities...

Kind regards,
Stefan

From: grass-dev [mailto:grass-dev-boun...@lists.osgeo.org] On Behalf Of Ondrej 
Pešek
Sent: 5. juni 2016 10:22
To: Vaclav Petras <wenzesl...@gmail.com>
Cc: GRASS developers list <grass-dev@lists.osgeo.org>
Subject: Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

Hi,

2016-06-04 20:47 GMT+02:00 Vaclav Petras 
<wenzesl...@gmail.com<mailto:wenzesl...@gmail.com>>:

the screenshots looks good. For the code, it might little bit too soon to judge 
it, but just keep in mind the need for design we talked about earlier. For some 
simple help, you can use pylint tool which will demand some code style. Start 
with the file tools/pylintrc.txt in the GRASS source code.


yes, I want to write there also some comments etc. And I'll try the pylint.


When I ran it for v.buffer I see you are using text edit / line edit for float 
even when it is not [multiple]. I think Qt has double spin box which you can 
use. In general, you don't have to fully follow the current look or behavior. 
If you think that something can be done in a better way, do it.

For example, this would be one thing we can reconsider. The shorter description 
(label or description field) shows as the name/label for a field while the 
longer description (description field) shows as a tooltip of the label. One 
improvement could be showing it as a tooltip for the input field as well (or 
perhaps in a completely different way).

I will consider it all. While coding I was experimenting, but everytime I 
considered that the original widget = the best widget. Thanks for tips, I will 
try it your way. And the tooltip version sounds good. Should I put the name and 
type (input=string) upper (where now is description) or on the right side (as 
in current version).

Thanks for tips and have a nice time,
Ondrej


[Image removed by 
sender.]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>

Bez virů. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail>


___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-05 Thread Ondřej Pešek
Hi,


2016-06-04 20:47 GMT+02:00 Vaclav Petras :

>
> the screenshots looks good. For the code, it might little bit too soon to
> judge it, but just keep in mind the need for design we talked about
> earlier. For some simple help, you can use pylint tool which will demand
> some code style. Start with the file tools/pylintrc.txt in the GRASS source
> code.
>
>
yes, I want to write there also some comments etc. And I'll try the pylint.



> When I ran it for v.buffer I see you are using text edit / line edit for
> float even when it is not [multiple]. I think Qt has double spin box which
> you can use. In general, you don't have to fully follow the current look or
> behavior. If you think that something can be done in a better way, do it.
>
> For example, this would be one thing we can reconsider. The shorter
> description (label or description field) shows as the name/label for a
> field while the longer description (description field) shows as a tooltip
> of the label. One improvement could be showing it as a tooltip for the
> input field as well (or perhaps in a completely different way).
>
>

I will consider it all. While coding I was experimenting, but everytime I
considered that the original widget = the best widget. Thanks for tips, I
will try it your way. And the tooltip version sounds good. Should I put the
name and type (input=string) upper (where now is description) or on the
right side (as in current version).


Thanks for tips and have a nice time,
Ondrej



Bez
virů. www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-04 Thread Vaclav Petras
Hi Ondrej,

the screenshots looks good. For the code, it might little bit too soon to
judge it, but just keep in mind the need for design we talked about
earlier. For some simple help, you can use pylint tool which will demand
some code style. Start with the file tools/pylintrc.txt in the GRASS source
code.

On Sat, Jun 4, 2016 at 5:27 AM, Ondřej Pešek  wrote:

> What did you get done this week?
> * Now the code is reading those types - float, range, sql_query, flags
>

When I ran it for v.buffer I see you are using text edit / line edit for
float even when it is not [multiple]. I think Qt has double spin box which
you can use. In general, you don't have to fully follow the current look or
behavior. If you think that something can be done in a better way, do it.


> * It also writes their names or labels and types into GUI
>

For example, this would be one thing we can reconsider. The shorter
description (label or description field) shows as the name/label for a
field while the longer description (description field) shows as a tooltip
of the label. One improvement could be showing it as a tooltip for the
input field as well (or perhaps in a completely different way).

Another thing to consider would be the visibility or emphasis of the actual
name of the parameter, but we can leave that for later.


>
> * I also want to make the GUI little bit more elegant. It means I want to
> insert spacer on the end of every tab -> it means that widgets will be at
> the top, not averagely placed.
>

Also note that sometimes the list of widgets can be long, see e.g. g.region
Resolution tab.

Best,
Vaclav
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt GRASS - Report 2

2016-06-04 Thread Ondřej Pešek
Hi all!

Here is the second report of my GSoC project - PyQt based GUI of GRASS
automatically generated from XML

What did you get done this week?
* Now the code is reading those types - float, range, sql_query, flags
* It also writes their names or labels and types into GUI

What do you plan on doing next week?
* Other types - especially I have on my mind string and name
* I also want to make the GUI little bit more elegant. It means I want to
insert spacer on the end of every tab -> it means that widgets will be at
the top, not averagely placed.


Are you blocked on anything?
* Not yet


Here is the wiki with screenshots etc.:
https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt

2016-05-30 Thread Ondřej Pešek
Thanks, I'm going on that.


Bez
virů. www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2016-05-30 9:14 GMT+02:00 Luca Delucchi :

> On 27 May 2016 at 23:27, Ondřej Pešek  wrote:
> >
> > Hi,
> >
>
> Hi Ondrej,
>
> > here is report of what I have done during this week in my GRASS
> >
> > GSoC Project:
> >
> > WEEK 1
> >
> > Designed basic GUI shuck. From XML is now automatically generated GUI
> with name, keywords and basic layouts (description, tabs, buttons).
> >
> > Code now works as a script with parameter - for example r.buffer (python
> forms.py r.buffer).
> >
> > Take a look at screenshots.
> >
>
> These look really a good starting point, please could you extend the
> README file adding how to test the code, for example dependencies and
> how to compile/use
>
> >
> > Best regards,
> > Ondrej
> >
>
>
> --
> ciao
> Luca
>
> www.lucadelu.org
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt

2016-05-30 Thread Luca Delucchi
On 27 May 2016 at 23:27, Ondřej Pešek  wrote:
>
> Hi,
>

Hi Ondrej,

> here is report of what I have done during this week in my GRASS
>
> GSoC Project:
>
> WEEK 1
>
> Designed basic GUI shuck. From XML is now automatically generated GUI with 
> name, keywords and basic layouts (description, tabs, buttons).
>
> Code now works as a script with parameter - for example r.buffer (python 
> forms.py r.buffer).
>
> Take a look at screenshots.
>

These look really a good starting point, please could you extend the
README file adding how to test the code, for example dependencies and
how to compile/use

>
> Best regards,
> Ondrej
>


-- 
ciao
Luca

www.lucadelu.org
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt

2016-05-27 Thread Ondřej Pešek
Hi,

thanks for your response.

2016-05-25 17:26 GMT+02:00 Pietro :

>
> Perhaps, it could be useful to have a look at pygrass `Module` class [0],
> that already parse the generated xml and instantiate `Parameter` class [1]
> that validate the input from the user in the `_check_value` function [2].
> So should be possible to dynamically generate a `Qt Widget` from a
> `Parameter` instance and then compose everything in complete final
> `QtWidget`/`QtDialog`. If you think that  in the `Module` / `Parameter`
> class definition something is missing/wrong or bad implemented, after
> discussion, we can change it. They were not developed with this use case in
> mind and perhaps some changes are needed however I do think they are a
> starting point...
>
>
Thank you, 'Module' is really nice. I was working with 'task', but 'Module'
looks much better.



> I think that we should support both: PyQt and PySide, and I think you
> should use as primary choice for development Python3, support for Python2
> it is much easier to add later if needed.
>
>
Well, I have never worked with Python3. But of course I can try it. It
might be useful to learn it and if you think it's better. I have created
basics in Python2 but it was one week - so it's not thousands of lines. I
can still retype it. Thanks for idea.


I'm studying the rest (thanks, it really helps me),
Ondrej



Bez
virů. www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GSoC 2016 - PyQt

2016-05-25 Thread Pietro
Hi Ondrej,

On Tue, May 24, 2016 at 12:48 PM, Ondřej Pešek 
wrote:
>
> the period of GSoC starts. I just want to present myself. My name is
> Ondrej Pesek and I'm from Czech Republic. I study geodesy, cartography and
> geomatics at Czech technical university in Prague. My project for GSoC 2016
> is reimplementation of GUI generated from xml, wxpython -> PyQt. You can
> see everything at [1].
>
> I'm open to all your requests, comments and hates. Don't hesitate to write
> me, I would appreciate it.
>

Perhaps, it could be useful to have a look at pygrass `Module` class [0],
that already parse the generated xml and instantiate `Parameter` class [1]
that validate the input from the user in the `_check_value` function [2].
So should be possible to dynamically generate a `Qt Widget` from a
`Parameter` instance and then compose everything in complete final
`QtWidget`/`QtDialog`. If you think that  in the `Module` / `Parameter`
class definition something is missing/wrong or bad implemented, after
discussion, we can change it. They were not developed with this use case in
mind and perhaps some changes are needed however I do think they are a
starting point...

You can see a good implementation of this logic in the fromlayout
project[3] that it is well written, support both PyQt and PySide and
Python2 and Python3.

Together with Francesco Geri we started writing a plugin for QGis (a proof
of concept (it works, but a lot of things are missing), just few hours of
work of our spare time..) that generate dynamically the form for the GRASS
modules, the code is not good and it is using qgis API... but I think that
can explain what I have in mind.

I think that we should support both: PyQt and PySide, and I think you
should use as primary choice for development Python3, support for Python2
it is much easier to add later if needed.

I hope these information/ideas can be useful for your GSoC.
Have fun!

all the best

Pietro


[0]
https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/module.py#L266
[1]
https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/parameter.py#L97
[2]
https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/parameter.py#L15
[3] https://github.com/PierreRaybaut/formlayout
[4] https://bitbucket.org/fragit/rgreengui/src
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] GSoC 2016 - PyQt

2016-05-24 Thread Ondřej Pešek
Hi everyone,

the period of GSoC starts. I just want to present myself. My name is Ondrej
Pesek and I'm from Czech Republic. I study geodesy, cartography and
geomatics at Czech technical university in Prague. My project for GSoC 2016
is reimplementation of GUI generated from xml, wxpython -> PyQt. You can
see everything at [1].

I'm open to all your requests, comments and hates. Don't hesitate to write
me, I would appreciate it.

Have a nice day,
Ondrej


[1]  https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI


Bez
virů. www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev