← Back to team overview

phatch-dev team mailing list archive

conditionally showing & hiding fields

 

Hi,

This was a tough one, but I hope I succeeded. Now it is possible to
show/hide fields conditionally. The method is very simple. Just add a
get_relevant_field_labels() method to the Action. It is very important
that the list of labels has EXACTLY the same order as defined in the
interface method.
I've implemented for these actions already:
modified phatch/actions/color_to_alpha.py
modified phatch/actions/crop.py
modified phatch/actions/save.py
modified phatch/actions/watermark.py

Try them out and see if you can find any bugs! Note that the update
will only take place after the field lost focus by clicking somewhere
else or moving your mouse away over the toolbar. Robin, this is very
important to be tested on the Mac & Windows, as these things sometimes
require cross-platform fine tuning. It is very possible that on the
mac it generates segmentation faults while it works fine on linux.

This opens a lot of nice possibilities. Please go through the actions
and see which ones could profit from this. From now on there should
not any field be shown which is not relevant. This means that for some
actions we need to add a ChoiceField which shows/hide the other
fields. This is for example the case for the rounded corners action.
It also might allow for more actions to add extra options.

Nadia, the crop action still need some (important) work. I added to
the white board of the blueprint:
https://blueprints.launchpad.net/phatch/+spec/crop-action

Best regards,

Stani

-- 
Phatch Photo Batch Processor - http://photobatch.stani.be
SPE Python IDE - http://pythonide.stani.be



Follow ups