Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-14 Thread Duarte Carreira
Etienne, I was not opposing your idea. Just proposing a default behavior for the group/children visibility pattern. I sometimes do have need for your use case. Maybe there could be an option in the context menu when right-clicking a layer - eg Mutually exclusive layers. A popup window could

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-13 Thread Gino Pirelli
I'm reading this thread in a too fast way so probably I'll miss something we can distinguish two topics in this thread 1) api re-design... but I think is a Architecture re-design of the QgsLegend component 2) Enhancement of the Legend interface. Thread 1) more technical, at this moment is still

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Duarte Carreira
The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing the ctrl key when (un)checking the group checkbox. The primary behavior of the group switch should be to make the children invisible or visible,

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing the ctrl key when (un)checking the group checkbox. The primary behavior of the

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Andreas Neumann
Am 11.10.2013 09:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing the ctrl key when (un)checking

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Bernhard Ströbl
Am 11.10.2013 11:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing the ctrl key when (un)checking

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 11:35:12AM +0200, Bernhard Ströbl wrote: Am 11.10.2013 11:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 09:33:05AM +, Andreas Neumann wrote: Am 11.10.2013 09:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Fred Lehodey
Hi, just a thought, what about different Group Styles/behavior ? - default classic Layer Group - RadioButton exclusive group - etc... Fred. On Fri, Oct 11, 2013 at 10:35 AM, Bernhard Ströbl bernhard.stro...@jena.dewrote: Am 11.10.2013 11:22, schrieb Sandro Santilli: On Fri, Oct 11,

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Bernhard Ströbl
Am 11.10.2013 11:44, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 11:35:12AM +0200, Bernhard Ströbl wrote: Am 11.10.2013 11:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 12:02:08PM +0200, Bernhard Ströbl wrote: We would have these two cases: 1) Group is checked and although layer is unchecked it is visible I don't think this case exists. Are you saying you _want_ this to be possible ? Because for me an unchecked layer should _never_ be

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Bernhard Ströbl
this was the original proposal: Am 11.10.2013 11:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You should have a modifier to get this as a secondary behavior, like pressing

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 12:25:21PM +0200, Bernhard Ströbl wrote: I understand this in the way I wrote in my last message. You would make the children visible/unvisible regardless of the children's visibility being on or off. Indeed that wording was a bit confusing to me. If you confirm you

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Vincent Schut
On 10/11/13 11:48, Sandro Santilli wrote: On Fri, Oct 11, 2013 at 09:33:05AM +, Andreas Neumann wrote: Am 11.10.2013 09:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote: The group checkbox, imho, should *not always* switch children on/off. You

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Duarte Carreira
Yes, that's what I meant. -Mensagem original- De: Sandro Santilli [mailto:s...@keybit.net] Enviada: sexta-feira, 11 de Outubro de 2013 10:45 Para: Bernhard Ströbl Cc: qgis-developer@lists.osgeo.org Assunto: Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 01:35:44PM +0200, Vincent Schut wrote: On 10/11/13 11:48, Sandro Santilli wrote: On Fri, Oct 11, 2013 at 09:33:05AM +, Andreas Neumann wrote: Am 11.10.2013 09:22, schrieb Sandro Santilli: But there is still use-case for the radio-button like behaviour. Imagine

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Duarte Carreira
An unchecked layer is never visible... that would really confuse users... -Mensagem original- De: Bernhard Ströbl [mailto:bernhard.stro...@jena.de] Enviada: sexta-feira, 11 de Outubro de 2013 11:25 Para: qgis-developer@lists.osgeo.org Assunto: Re: [Qgis-developer] Reliable way to

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread kimaidou
+ 1 for not having an unchecked layer non visible, even if the group is not checked - this will confuse users For radio-like interaction, I think it would be nice inside a group. If you want to use it for layers outside a group or for group, we should really find a way to make the radio items

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 11:53:37AM +, Duarte Carreira wrote: An unchecked layer is never visible... that would really confuse users... I'm having an hard time understanding statements in this thread. Are you saying you agree that about this ? An unchecked layer should never be visible

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 02:15:09PM +0200, kimaidou wrote: + 1 for not having an unchecked layer non visible, even if the group is not checked - this will confuse users This is even more confusing %-| Triple negation ? Could you please rephrase ? PS: we highjacked a thread about reliable way to

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Duarte Carreira
Ok, sorry ;) If a layer is unchecked it is not drawn in the map. If a layer is checked but its parent is not, it is not drawn in the map. Duarte -Mensagem original- De: Sandro Santilli [mailto:sandro.santi...@gmail.com] Em nome de Sandro Santilli Enviada: sexta-feira, 11 de Outubro

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Sandro Santilli
On Fri, Oct 11, 2013 at 02:08:53PM +, Duarte Carreira wrote: Ok, sorry ;) If a layer is unchecked it is not drawn in the map. If a layer is checked but its parent is not, it is not drawn in the map. Thank you, we agree then :) --strk; ___

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Etienne Tourigny
On Fri, Oct 11, 2013 at 8:35 AM, Vincent Schut sc...@sarvision.nl wrote: On 10/11/13 11:48, Sandro Santilli wrote: On Fri, Oct 11, 2013 at 09:33:05AM +, Andreas Neumann wrote: Am 11.10.2013 09:22, schrieb Sandro Santilli: On Fri, Oct 11, 2013 at 09:13:03AM +, Duarte Carreira wrote:

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-11 Thread Nyall Dawson
If a layer is unchecked it is not drawn in the map. If a layer is checked but its parent is not, it is not drawn in the map. Thank you, we agree then :) To make it easier, maybe we should refer to the two different methods as AND/OR. Ie, a layer is displayed only if it's ticked AND all

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-10 Thread Gino Pirelli
no, not yet, I found structural limitation looking for adding customized legends (aka items)... I waited Brighton to check if it was a problem related to my ignorance or a structural one. I hadn't time to find what's the procedure to add a RFC in qgis with it's workflow (in mapserver is clear, I

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-10 Thread Vincent Schut
On 10/09/2013 11:41 PM, Nyall Dawson wrote: Personally, I am also interested in enhancing group options in the layer tree. Groups are not just stupid containers with only toggling of visibility. They could also have a group opacity and blending and group metadata. Later

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-10 Thread Nathan Woodrow
Check out the layer combinations plugin. It's really cool which let's you create combinations of layer states to turn on and off. Would be great to add this as a core feature. On 10 Oct 2013, at 6:08 pm, Vincent Schut sc...@sarvision.nl wrote: On 10/09/2013 11:41 PM, Nyall Dawson wrote:

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-10 Thread aperi2007
I guess instead that much better should be a group checkbox that enable/disable the under childs layer. This allow OFF the actual configuration or ON that same configuration. Actually the group checkbox when checked put ON all the layer. This often is mean too much information . Instead the

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Denis Rouzaud
Hi, I am not sure we should make any publicity to the legend API which is very bad. I hope these methods will deprecated soon ;) Cheers, Denis On 10/08/2013 04:08 PM, Andreas Neumann wrote: Hi, Thank you Bernhard. This works better than my code with the legend.groupLayerRelationship()

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Bernhard Ströbl
Hi Am 09.10.2013 08:12, schrieb Denis Rouzaud: Hi, I am not sure we should make any publicity to the legend API which is very bad. I hope these methods will deprecated soon ;) I think any change making the handling of groups easier is appreciated. Bernhard Cheers, Denis On

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Andreas Neumann
Am 09.10.2013 06:16, schrieb Bernhard Ströbl: Hi Am 09.10.2013 08:12, schrieb Denis Rouzaud: Hi, I am not sure we should make any publicity to the legend API which is very bad. I hope these methods will deprecated soon ;) So is there anyone working on fixing these legend API problems?

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Denis Rouzaud
I heard some discussions... from Matthias, Martin and Nathan. but there are probably others! On 10/09/2013 09:30 AM, Andreas Neumann wrote: Am 09.10.2013 06:16, schrieb Bernhard Ströbl: Hi Am 09.10.2013 08:12, schrieb Denis Rouzaud: Hi, I am not sure we should make any publicity to the

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Andreas Neumann
Hi Luigi, Do you have a written proposal already? Is it available on Google Docs so we can comment/append? Personally, I am also interested in enhancing group options in the layer tree. Groups are not just stupid containers with only toggling of visibility. They could also have a group opacity

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-09 Thread Nyall Dawson
Personally, I am also interested in enhancing group options in the layer tree. Groups are not just stupid containers with only toggling of visibility. They could also have a group opacity and blending and group metadata. Later on we may also have clipping and masking on groups. So we really

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-08 Thread Bernhard Ströbl
Hi Andreas, this is how I do it: def getGroupIndex(self, groupName): '''Find the index for group groupName''' retValue = -1 groups = self.iface.legendInterface().groups() for i in range(len(groups)): if groups[i] == groupName: retValue = i break

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-08 Thread Andreas Neumann
Hi, Thank you Bernhard. This works better than my code with the legend.groupLayerRelationship() We should add this to the Python Cookbook (http://www.qgis.org/en/docs/pyqgis_developer_cookbook/) - Do you mind? Or should I do a pull request? Do you have a clever strategy to make this same code

Re: [Qgis-developer] Reliable way to determine a groupIndex in the legend tree

2013-10-08 Thread Bernhard Ströbl
Hi Andreas, Am 08.10.2013 16:08, schrieb Andreas Neumann: Hi, Thank you Bernhard. This works better than my code with the legend.groupLayerRelationship() We should add this to the Python Cookbook (http://www.qgis.org/en/docs/pyqgis_developer_cookbook/) - Do you mind? You're welcome Or