Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset widget to default value #941

Open
arthurhjorth opened this issue Feb 25, 2016 · 13 comments
Open

Reset widget to default value #941

arthurhjorth opened this issue Feb 25, 2016 · 13 comments

Comments

@arthurhjorth
Copy link
Member

In a meeting with Austin and he suggested something that I really like: adding a button to widgets that resets their value to whatever their default value is. I really like it. Does anyone else like it too?

@SethTisue
Copy link
Collaborator

or something to restore them all at once? I think @UriCCL has suggested this in the past

@mrerrormessage
Copy link
Contributor

I like this idea in general. We will need to hash out how the behavior is different than just reloading the model via File > Recent Files.

EDIT: sorry for the comment spam, GitHub flaked out on me and I ended up hitting the "Comment" button multiple times in frustration.

@arthurhjorth
Copy link
Member Author

I guess the easy way is to introduce reset-all-variables, and reset-variable <name>.

But what Austin (and I, now) really meant is for there to be a button on widgets that makes it easy for users to reset the value back to what it was. Being able to do this during runtime is (to me) enough of a different behavior and use case to make it worth it.

@Idloj
Copy link
Contributor

Idloj commented Feb 25, 2016

Is a menu-item for the popup-menu a sufficient solution?

@Idloj
Copy link
Contributor

Idloj commented Feb 25, 2016

I think I can take this feature on myself

@mrerrormessage
Copy link
Contributor

@arthurhjorth is the "default" variable value saved as part of the NetLogo model, or does the variable value in the model become the default? Would this mean that a model saved with a changed value used the new value as a default going forward? What if a user has edited a widget in a way that makes the default value illegal? I really like this idea, but I think we should work through these decisions carefully. Perhaps we could discuss at a devel meeting (or before/after)?

@Idloj , I appreciate the offer to work on this, but let's wait to start work until we have a full understanding of what needs to be done here. Arthur is proposing adding two primitives, I would also expect to see a menu item. I think your suggestion of a popup-menu also makes sense, but we may also want to put an option into the widget editors.

@Idloj
Copy link
Contributor

Idloj commented Feb 25, 2016

I initially thought of the default value as what you have in the "Value" field in sliders. It then occurred to me that sliders are the only widget that have a this "Value" field. I also noticed that this field changes as the slider changes, and I wondered what is the purpose of it.

@TheBizzle
Copy link
Member

Personally, I'm in favor of this idea, and I've always found it surprising that editing a widget's value directly, and then saving, leads to overwriting the default value for that widget.

Uri says that he sometimes adjusts the values in the interface and wants them saved, so he suggests that, on save, a dialog should maybe appear to ask you if you wanted to overwrite your widget defaults.

@TheBizzle
Copy link
Member

It then occurred to me that sliders are the only widget that have a this "Value" field.

If this task were taken on, I would propose changing that to being a "Default Value" field, and adding such a field to the editor UI for all of the "greens" (i.e. Sliders, Choosers, Switches, and Inputs).

@nicolaspayette
Copy link
Member

editing a widget's value directly, and then saving, leads to overwriting the default value for that widget.

This is source of annoyance when managing models: when getting a new version of a model where the widget values have changed, there is no way of knowing if it was a voluntary change or not (short of asking the author, of course).

@qiemem
Copy link
Member

qiemem commented Jul 12, 2017

An alternative would be to extend the interface tab undo functionality to cover parameter changes. This wouldn't require any UI reworking or anything, and I think would be pretty natural for people.

@arthurhjorth
Copy link
Member Author

arthurhjorth commented Jul 12, 2017

But that still wouldn't help set variables back to a default state, if they've been messed up and saved, then re-opened.

I really like @TheBizzle 's and @Idloj 's idea of adding a Value field to all interface widgets and having that be the default value. Closing NetLogo with a model open with observed-value != Value could open a prompt for reverting all changes, saving all changes, or saving some changes, in which case we could iterate over those widgets whose values are different from the Value field, and ask if the user wants to "transfer" the current value to the default value.

@qiemem
Copy link
Member

qiemem commented Jul 12, 2017

Just undo until you can't undo anymore ;) Again, I was just trying to come up with a way of accomplishing this without any UI overall or need modifications to the fileformat (though I don't think @TheBizzle would need to modify the fileformat).

That said, if we do want to be able to revert to default, I think a better way to go would be able to save configurations of parameters. One would be the default, but then we could store other ones of interest as well. I know I constantly come across interesting configurations that I want to remember and the only way to do it is write them down manually, create a button to restore them, or take a screenshot or whatever.

Though I suppose @TheBizzle is really pretty straightforward. So I think there's lots of good options here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants