Opened 6 years ago

Last modified 8 months ago

#2203 new enhancement

wxGUI module dialogs should provide "reset to default value" for each of parameters

Reported by: marisn Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: wxGUI Version: unspecified
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

Some of autogenerated module dialog input options contain their default value. Current implementation has two downsides:

  • there is no way how to get back "default" value if it has been changed (a wish for a new feature)
  • once value has been changed, it gets added to the command parameters list (nice). The problem - if it's a number field (represented by a spiner control), there is no way how to remove it from the module parameter list (a bug)

Potential solution: Autogenerate a button for each of input fields "reset to default". If default value is not specified, it should just clear the input field. If the default value is provided, it should just reset to default value. In both of cases it should remove parameter from module parameter list.

Steps to reproduce: run g.region, change cols or rows parameter, change your mind and try to NOT provide cols or rows parameter. In current wxGUI form it is NOT possible to NOT use cols or rows parameter as soon as you have touched those input controls.

Change History (11)

comment:1 in reply to:  description ; Changed 6 years ago by annakrat

Type: defectenhancement

Replying to marisn:

Some of autogenerated module dialog input options contain their default value. Current implementation has two downsides:

  • there is no way how to get back "default" value if it has been changed (a wish for a new feature)
  • once value has been changed, it gets added to the command parameters list (nice). The problem - if it's a number field (represented by a spiner control), there is no way how to remove it from the module parameter list (a bug)

Potential solution: Autogenerate a button for each of input fields "reset to default". If default value is not specified, it should just clear the input field. If the default value is provided, it should just reset to default value. In both of cases it should remove parameter from module parameter list.

In my opinion, the dialog would be too cluttered with all these buttons and we can't use for example context menu because we want to keep the system context menu. There could be one button to reset all fields but this probably doesn't make any sense.

Steps to reproduce: run g.region, change cols or rows parameter, change your mind and try to NOT provide cols or rows parameter. In current wxGUI form it is NOT possible to NOT use cols or rows parameter as soon as you have touched those input controls.

There is already #1048, so let's keep discussion on this g.region problem there.

comment:2 in reply to:  1 ; Changed 4 years ago by mlennert

Replying to annakrat:

Replying to marisn:

Some of autogenerated module dialog input options contain their default value. Current implementation has two downsides:

  • there is no way how to get back "default" value if it has been changed (a wish for a new feature)
  • once value has been changed, it gets added to the command parameters list (nice). The problem - if it's a number field (represented by a spiner control), there is no way how to remove it from the module parameter list (a bug)

Potential solution: Autogenerate a button for each of input fields "reset to default". If default value is not specified, it should just clear the input field. If the default value is provided, it should just reset to default value. In both of cases it should remove parameter from module parameter list.

In my opinion, the dialog would be too cluttered with all these buttons and we can't use for example context menu because we want to keep the system context menu. There could be one button to reset all fields but this probably doesn't make any sense.

I've very little knowledge of wx and am just brainstorming here, but I see that spin.ctrl has an option 'initial='. Couldn't this be set to some specific value (e.g. -1) and the parser interpret this value to mean that this parameter should be ignored ?

comment:3 in reply to:  2 Changed 4 years ago by annakrat

Replying to mlennert:

I've very little knowledge of wx and am just brainstorming here, but I see that spin.ctrl has an option 'initial='. Couldn't this be set to some specific value (e.g. -1) and the parser interpret this value to mean that this parameter should be ignored ?

This seems unnecessary complicated. The easiest solution is to use wx.TextCtrl? instead of wx.SpinCtrl?.

comment:4 Changed 4 years ago by martinl

Milestone: 7.0.07.0.5

comment:5 Changed 3 years ago by martinl

Milestone: 7.0.57.3.0

comment:6 Changed 3 years ago by martinl

Milestone: 7.3.07.4.0

Milestone renamed

comment:7 Changed 22 months ago by neteler

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:8 Changed 18 months ago by neteler

Milestone: 7.4.17.4.2

comment:9 Changed 14 months ago by martinl

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:10 Changed 10 months ago by martinl

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:11 Changed 8 months ago by martinl

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.