Virtual Fields - Allow adding fields out of edit mode

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi,

I merged a commit today that fixes some problems with virtual fields, in
particular a crash when removing a virtual field.
As the virtual fields do not work on the data provider, they are not
directly linked to edit mode being turned on. This also allows to add
virtual fields on data providers that do not allow to add additional
fields. This led to a change in the GUI, that you are also allowed to
add fields when edit mode is turned off. I added an info, that editing
mode will be turned on, when adding real (provider) fields on the add
field dialog.
However, I am not sure how intuitive the current behavior is. As we are
approaching the final release date, I thought I'd explicitly point out
this change and ask for feedback so we can take measures if there is
hesitation to this approach.

Please share your impression and if you disagree with the current
approach it would be highly welcome if you could outline an improved way
of tackling this.

Matthias
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias,

there seems to be a small bug in the add field stuff: scenario
1) add a virtual field
2) add a permanent field => field is added but marked as virtual
(symbol) and name is that of the virtual field added in step 1) BUG!
3) close and reopen layer properties => field from step 2) is displayed
as it should, so the bug is on the display side only

tested with e5850f3

to your question: I think the current editing-mode behavior is
intuitive. What is not intuitive is that the expression editor can only
be launched when adding a virtual field. I am aware that I can add a
(permanent) field with the field calculator but this whole business is
IMHO not consistent.
This would be consistent:
1) in field calculator if choosing to add a new field offer to make it
virtual or permanent (permanent being default)
2) make add-field dialog be the same no matter if adding a permanent or
virtual field.

regards

Bernhard

Am 06.10.2014 21:12, schrieb Matthias Kuhn:

> Hi,
>
> I merged a commit today that fixes some problems with virtual fields, in
> particular a crash when removing a virtual field.
> As the virtual fields do not work on the data provider, they are not
> directly linked to edit mode being turned on. This also allows to add
> virtual fields on data providers that do not allow to add additional
> fields. This led to a change in the GUI, that you are also allowed to
> add fields when edit mode is turned off. I added an info, that editing
> mode will be turned on, when adding real (provider) fields on the add
> field dialog.
> However, I am not sure how intuitive the current behavior is. As we are
> approaching the final release date, I thought I'd explicitly point out
> this change and ask for feedback so we can take measures if there is
> hesitation to this approach.
>
> Please share your impression and if you disagree with the current
> approach it would be highly welcome if you could outline an improved way
> of tackling this.
>
> Matthias


__________ Information from ESET Mail Security, version of virus signature database 10522 (20141007) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Thank you for testing Bernhard,


On 07.10.2014 10:06, Bernhard Ströbl wrote:
> Hi Matthias,
>
> there seems to be a small bug in the add field stuff: scenario
> 1) add a virtual field
> 2) add a permanent field => field is added but marked as virtual
> (symbol) and name is that of the virtual field added in step 1) BUG!
> 3) close and reopen layer properties => field from step 2) is
> displayed as it should, so the bug is on the display side only

Could you open an issue report for this so we don't forget? Thank you.

>
> tested with e5850f3
>
> to your question: I think the current editing-mode behavior is
> intuitive. What is not intuitive is that the expression editor can
> only be launched when adding a virtual field. I am aware that I can
> add a (permanent) field with the field calculator but this whole
> business is IMHO not consistent.
> This would be consistent:
> 1) in field calculator if choosing to add a new field offer to make it
> virtual or permanent (permanent being default)

It could go there indeed, good idea.

> 2) make add-field dialog be the same no matter if adding a permanent
> or virtual field.

I don't completely follow. Do you propose to remove the "virtual field"
from the "add field" in favor of 1) or is the intention something else?

Best
Matthias

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias

Am 07.10.2014 14:06, schrieb Matthias Kuhn:

> Thank you for testing Bernhard,
>
>
> On 07.10.2014 10:06, Bernhard Ströbl wrote:
>> Hi Matthias,
>>
>> there seems to be a small bug in the add field stuff: scenario
>> 1) add a virtual field
>> 2) add a permanent field => field is added but marked as virtual
>> (symbol) and name is that of the virtual field added in step 1) BUG!
>> 3) close and reopen layer properties => field from step 2) is
>> displayed as it should, so the bug is on the display side only
>
> Could you open an issue report for this so we don't forget? Thank you.

done : http://hub.qgis.org/issues/11342
I assigned it to you

>
>>
>> tested with e5850f3
>>
>> to your question: I think the current editing-mode behavior is
>> intuitive. What is not intuitive is that the expression editor can
>> only be launched when adding a virtual field. I am aware that I can
>> add a (permanent) field with the field calculator but this whole
>> business is IMHO not consistent.
>> This would be consistent:
>> 1) in field calculator if choosing to add a new field offer to make it
>> virtual or permanent (permanent being default)
>
> It could go there indeed, good idea.

will the field calcuator be active all the time then?
just thinking of consequences....

>
>> 2) make add-field dialog be the same no matter if adding a permanent
>> or virtual field.
>
> I don't completely follow. Do you propose to remove the "virtual field"
> from the "add field" in favor of 1) or is the intention something else?

no, proposals 1) and 2) are independent from each other.
proposal 2) means, that the expression builder should be offered when
adding a permanent field, too, thus not changing the dialog when user
changes his choice of permanent/virtual.
Scenario is: user wants to add a permanent field and fill it with an
expression. Now it is either
1) add field and accept
2) open calculator, choose field
3) define expression and accept
or:
1) set editable
2) open calculator
3) define expression and accept

future behaviour would be:
1) add field
2) define expression and accept

Bernhard

>
> Best
> Matthias
>


__________ Information from ESET Mail Security, version of virus signature database 10524 (20141007) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi Bernhard,

On 07.10.2014 14:28, Bernhard Ströbl wrote:

>
>>
>>>
>>> tested with e5850f3
>>>
>>> to your question: I think the current editing-mode behavior is
>>> intuitive. What is not intuitive is that the expression editor can
>>> only be launched when adding a virtual field. I am aware that I can
>>> add a (permanent) field with the field calculator but this whole
>>> business is IMHO not consistent.
>>> This would be consistent:
>>> 1) in field calculator if choosing to add a new field offer to make it
>>> virtual or permanent (permanent being default)
>>
>> It could go there indeed, good idea.
>
> will the field calcuator be active all the time then?
> just thinking of consequences....

Yes

>
>>
>>> 2) make add-field dialog be the same no matter if adding a permanent
>>> or virtual field.
>>
>> I don't completely follow. Do you propose to remove the "virtual field"
>> from the "add field" in favor of 1) or is the intention something else?
>
> no, proposals 1) and 2) are independent from each other.
> proposal 2) means, that the expression builder should be offered when
> adding a permanent field, too, thus not changing the dialog when user
> changes his choice of permanent/virtual.
> Scenario is: user wants to add a permanent field and fill it with an
> expression. Now it is either
> 1) add field and accept
> 2) open calculator, choose field
> 3) define expression and accept
> or:
> 1) set editable
> 2) open calculator
> 3) define expression and accept
>
> future behaviour would be:
> 1) add field
> 2) define expression and accept

I think if the user wants to add a permanent field with the help of an
expression the current solution with the field calculator is fine. I
don't see any benefit that the "add field" dialog would have over that.
On the other hand defining the virtual fields in the field calculator
(and removing them from "add field") could make things more coherent.

Any opinions about this?

Matthias

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias,

Am 07.10.2014 14:40, schrieb Matthias Kuhn:

> Hi Bernhard,
>
> On 07.10.2014 14:28, Bernhard Ströbl wrote:
>>
>>>
>>>>
>>>> tested with e5850f3
>>>>
>>>> to your question: I think the current editing-mode behavior is
>>>> intuitive. What is not intuitive is that the expression editor can
>>>> only be launched when adding a virtual field. I am aware that I can
>>>> add a (permanent) field with the field calculator but this whole
>>>> business is IMHO not consistent.
>>>> This would be consistent:
>>>> 1) in field calculator if choosing to add a new field offer to make it
>>>> virtual or permanent (permanent being default)
>>>
>>> It could go there indeed, good idea.
>>
>> will the field calcuator be active all the time then?
>> just thinking of consequences....
>
> Yes
>>
>>>
>>>> 2) make add-field dialog be the same no matter if adding a permanent
>>>> or virtual field.
>>>
>>> I don't completely follow. Do you propose to remove the "virtual field"
>>> from the "add field" in favor of 1) or is the intention something else?
>>
>> no, proposals 1) and 2) are independent from each other.
>> proposal 2) means, that the expression builder should be offered when
>> adding a permanent field, too, thus not changing the dialog when user
>> changes his choice of permanent/virtual.
>> Scenario is: user wants to add a permanent field and fill it with an
>> expression. Now it is either
>> 1) add field and accept
>> 2) open calculator, choose field
>> 3) define expression and accept
>> or:
>> 1) set editable
>> 2) open calculator
>> 3) define expression and accept
>>
>> future behaviour would be:
>> 1) add field
>> 2) define expression and accept
>
> I think if the user wants to add a permanent field with the help of an
> expression the current solution with the field calculator is fine. I
> don't see any benefit that the "add field" dialog would have over that.

it does not really have any, but I was wondering why I can use an
expression for virtual fields and not for permanent fields

> On the other hand defining the virtual fields in the field calculator
> (and removing them from "add field") could make things more coherent.

+1, this would make the expression thing in the "add field" dialog needless
add/remove field would be only for working on the data structure; the
layer must be in editing mode, which makes your original question
obolete :) or now it is applicable to the calculator

all the best

Bernhard

>
> Any opinions about this?
>
> Matthias


__________ Information from ESET Mail Security, version of virus signature database 10524 (20141007) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi
On 07.10.2014 14:56, Bernhard Ströbl wrote:

>
>> I think if the user wants to add a permanent field with the help of an
>> expression the current solution with the field calculator is fine. I
>> don't see any benefit that the "add field" dialog would have over that.
>
> it does not really have any, but I was wondering why I can use an
> expression for virtual fields and not for permanent fields
>
>> On the other hand defining the virtual fields in the field calculator
>> (and removing them from "add field") could make things more coherent.
>
> +1, this would make the expression thing in the "add field" dialog
> needless
> add/remove field would be only for working on the data structure; the
> layer must be in editing mode, which makes your original question
> obolete :) or now it is applicable to the calculator

Remove field would still be available out of edit mode to remove virtual
fields.
Add field would only be available in edit mode. But the field calculator
instead available out of edit mode.


Best
Matthias
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl


Am 07.10.2014 15:07, schrieb Matthias Kuhn:

> Hi
> On 07.10.2014 14:56, Bernhard Ströbl wrote:
>>
>>> I think if the user wants to add a permanent field with the help of an
>>> expression the current solution with the field calculator is fine. I
>>> don't see any benefit that the "add field" dialog would have over that.
>>
>> it does not really have any, but I was wondering why I can use an
>> expression for virtual fields and not for permanent fields
>>
>>> On the other hand defining the virtual fields in the field calculator
>>> (and removing them from "add field") could make things more coherent.
>>
>> +1, this would make the expression thing in the "add field" dialog
>> needless
>> add/remove field would be only for working on the data structure; the
>> layer must be in editing mode, which makes your original question
>> obolete :) or now it is applicable to the calculator
>
> Remove field would still be available out of edit mode to remove virtual
> fields.
> Add field would only be available in edit mode. But the field calculator
> instead available out of edit mode.

ok, sounds good

Bernhard

>
>
> Best
> Matthias
>
>
> __________ Information from ESET Mail Security, version of virus signature database 10524 (20141007) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
>



__________ Information from ESET Mail Security, version of virus signature database 10524 (20141007) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi all,

The changes have been merged to master today.

  * Virtual fields are now defined from the field calculator.
  * The field calculator is always available, regardless of provider
support and edit mode.
  * If an action from the field calculator requires to turn edit mode
on, the user will be notified on the field calculator dialog that this
will happen automatically when clicking ok.

Please test this and open issue reports if things are not working as
expected. Thank you very much.

Matthias
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias,

thank you for your work!
However I have some small issues and a bug [1]
- I do not see any notification when not in edit mode but my action
requires edit mode (edit mode is turned on, though, when clicking OK)
- shouldn't "create virtual field" be the default when layer is not in
edit mode?
- could the check box "create virtual field" be placed to the right of
"create a new field"?

all the best

Bernhard

[1] http://hub.qgis.org/issues/11403

Am 13.10.2014 18:11, schrieb Matthias Kuhn:

> Hi all,
>
> The changes have been merged to master today.
>
>   * Virtual fields are now defined from the field calculator.
>   * The field calculator is always available, regardless of provider
> support and edit mode.
>   * If an action from the field calculator requires to turn edit mode
> on, the user will be notified on the field calculator dialog that this
> will happen automatically when clicking ok.
>
> Please test this and open issue reports if things are not working as
> expected. Thank you very much.
>
> Matthias


__________ Information from ESET Mail Security, version of virus signature database 10558 (20141014) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi Bernhard,

On 14.10.2014 07:36, Bernhard Ströbl wrote:
> Hi Matthias,
>
> thank you for your work!

Thank you for the review
> However I have some small issues and a bug [1]
> - I do not see any notification when not in edit mode but my action
> requires edit mode (edit mode is turned on, though, when clicking OK)

That was just fixed
> - shouldn't "create virtual field" be the default when layer is not in
> edit mode?

I think it's more predictable (and therefore increases usability) for
users if it's either always on or always off by default. Don't you think?

> - could the check box "create virtual field" be placed to the right of
> "create a new field"?

"Create a new field" is a group box.
Would you create another group box with all field type widgets? I doubt
it's easy to place it in the group box header as well. But I could
easily take it to the top, just below the header.

Best regards
Matthias

--
_______________________________________________
Help getting QGIS to the next level of quality before November 15!
http://blog.vitu.ch/10102014-1046/crowdfunding-initiative-automated-testing

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias,

Am 14.10.2014 09:15, schrieb Matthias Kuhn:

> Hi Bernhard,
>
> On 14.10.2014 07:36, Bernhard Ströbl wrote:
>> Hi Matthias,
>>
>> thank you for your work!
>
> Thank you for the review
>> However I have some small issues and a bug [1]
>> - I do not see any notification when not in edit mode but my action
>> requires edit mode (edit mode is turned on, though, when clicking OK)
>
> That was just fixed
>> - shouldn't "create virtual field" be the default when layer is not in
>> edit mode?
>
> I think it's more predictable (and therefore increases usability) for
> users if it's either always on or always off by default. Don't you think?

Ok, agreed, so I opt for "always on" because it will always work

>
>> - could the check box "create virtual field" be placed to the right of
>> "create a new field"?
>
> "Create a new field" is a group box.
> Would you create another group box with all field type widgets?

No of course not :-) I was not aware of the group box. I just had the
impression it should be there, so moving it on top seems adequate.

I doubt
> it's easy to place it in the group box header as well. But I could
> easily take it to the top, just below the header.
>
> Best regards
> Matthias

thanks

Bernhard



__________ Information from ESET Mail Security, version of virus signature database 10558 (20141014) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Matthias Kuhn
Hi Bernhard

>>> - shouldn't "create virtual field" be the default when layer is not in
>>> edit mode?
>>
>> I think it's more predictable (and therefore increases usability) for
>> users if it's either always on or always off by default. Don't you
>> think?
>
> Ok, agreed, so I opt for "always on" because it will always work

It should be "always on" for providers that do not allow to add
attributes. For others both options always work and I prefer to keep the
previous behavior (without broad agreement that this should be changed,
if you convince some people I may change my mind ;-) ).

>
>>
>>> - could the check box "create virtual field" be placed to the right of
>>> "create a new field"?
>>
>> "Create a new field" is a group box.
>> Would you create another group box with all field type widgets?
>
> No of course not :-) I was not aware of the group box. I just had the
> impression it should be there, so moving it on top seems adequate.

Done!

Cheers
Matthias

--
Help getting QGIS to the next level of quality before November 15!
http://blog.vitu.ch/10102014-1046/crowdfunding-initiative-automated-testing

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Virtual Fields - Allow adding fields out of edit mode

Bernhard Ströbl
Hi Matthias,

Am 14.10.2014 09:56, schrieb Matthias Kuhn:

> Hi Bernhard
>
>>>> - shouldn't "create virtual field" be the default when layer is not in
>>>> edit mode?
>>>
>>> I think it's more predictable (and therefore increases usability) for
>>> users if it's either always on or always off by default. Don't you
>>> think?
>>
>> Ok, agreed, so I opt for "always on" because it will always work
>
> It should be "always on" for providers that do not allow to add
> attributes.

But thus the behaviour is not predictable either (from a user's point of
view, who is just loading data into his/her project). Virtual field will
_always_ work, no matter which provider.

For others both options always work and I prefer to keep the
> previous behavior (without broad agreement that this should be changed,
> if you convince some people I may change my mind ;-) ).

Anybody has an opinion on this?

Bernhard

>
>>
>>>
>>>> - could the check box "create virtual field" be placed to the right of
>>>> "create a new field"?
>>>
>>> "Create a new field" is a group box.
>>> Would you create another group box with all field type widgets?
>>
>> No of course not :-) I was not aware of the group box. I just had the
>> impression it should be there, so moving it on top seems adequate.
>
> Done!
>
> Cheers
> Matthias
>



__________ Information from ESET Mail Security, version of virus signature database 10558 (20141014) __________

The message was checked by ESET Mail Security.
http://www.eset.com


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer