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

Alert/Warning after pressing SButton #27

Open
Grarak opened this issue Apr 20, 2014 · 15 comments
Open

Alert/Warning after pressing SButton #27

Grarak opened this issue Apr 20, 2014 · 15 comments

Comments

@Grarak
Copy link

Grarak commented Apr 20, 2014

You know Andrei

@osm0sis
Copy link

osm0sis commented Apr 21, 2014

If this is about adding a notify/listen to SButton, then yes please! 👍

@AndreiLux
Copy link
Owner

SButton already has notify listen capability (on the APPLY event). (All elements have capabilities, check the Wiki)

Grarak wanted to have a popup window with custom message yes/no accept/cancel bla/blubb before executing the action in the button, it's something separate.

@osm0sis
Copy link

osm0sis commented Apr 22, 2014

Okay I'll have to reread it. I wasn't sure tapping a button counted as an Apply. If I wanted to listen for a button trigger what would the to: be? I wasn't finding that part very clear.

Thanks again for your time and efforts.

@AndreiLux
Copy link
Owner

I listed all events of all elements in the Wiki and when they're triggered.

If you have an SButton with action:"poop here", you can define a listener in another element X and specify the to as to:"poop here", and the listener in X will fire off the do: event on X whenever you press the SButton.

Or you can do it the other way round and do a notify block inside of the button, with a to:X. It really depends on which variant is easier to define depending on the amount of targets.

@osm0sis
Copy link

osm0sis commented Apr 22, 2014

Haha perfect examples! And thank you for listening to my poop. :P

@AndreiLux
Copy link
Owner

Generally just follow the following sentences:

Notifier:

On my event, notify to target and do this to him.

Listener:

Listen to target for on event, and do this to myself.

Well you can rephrase is several ways, but you get the gist of it.

@osm0sis
Copy link

osm0sis commented Apr 22, 2014

Just sent you a FC report from trying my SOptionList refresh as a notify in the SButton. I identified the to: for the SOptionList by its action if that helps.

@AndreiLux
Copy link
Owner

I pushed out a new version which fixes the issue.

@osm0sis
Copy link

osm0sis commented Apr 23, 2014

Confirmed fixed. Thanks! Does a refresh only refer to the current choice of a SOptionList? I was hoping it would also refresh the available values list, but that doesn't seem to be happening.

@AndreiLux
Copy link
Owner

How can it refresh something which you define at boot in a separate script? No.

@osm0sis
Copy link

osm0sis commented Apr 23, 2014

There are usage cases where the values parsed for a SOptionList could change (read from a directory, for example); allowing them to be reread by a refresh event would be a powerful extension to Synapse. I understand your reservations however. Thanks for your consideration.

@AndreiLux
Copy link
Owner

It's not possible to "refresh" something like that because values are
populated by script of which the app is totally unaware of.

If you'd like an API for re-setting values at run-time then that would be
something different, we're no longer talking about simply refreshing here.

It's a bit far-fetched in terms of use-cases, what do you want to use it
for?
On 23 Apr 2014 15:58, "Chris Renshaw" [email protected] wrote:

There are usage cases where the values parsed for an SOptionList could
change and allowing them to be refreshed would be a powerful extension to
Synapse. I understand your reservations however. Thanks for your
consideration.


Reply to this email directly or view it on GitHub.

@osm0sis
Copy link

osm0sis commented Apr 23, 2014

It's probably a bit outside of the originally "intended" scope of Synapse, but I made kernel backup/restore functionality like Trickster and franco.Kernel updater allow. :D

It uses a SOptionList (reading a file list from a directory) to let the user choose a backup then SButtons to provide actions to perform on the selected kernel image, like Delete and Restore. The only problem is when creating or deleting a backup the SOptionList can't reread the directory to update its values.

I've worked around it by adding a button which removes the config.json, runs uci again and then restarts Synapse but obviously that's a huge hack and native support to refresh/rebuild SOptionList values on the fly would be more ideal, and powerful. :)

There is probably a more "normal" usage case that could make use of this functionality too, but this is the one I've got in front of me. Thanks again for your time and consideration. 👍

@AndreiLux
Copy link
Owner

I'll look into it.
On 23 Apr 2014 16:25, "Chris Renshaw" [email protected] wrote:

It's probably a bit outside of the originally intended scope of Synapse,
but I made kernel backup/restore functionality like Trickster and
franco.Kernel updater allow.

It uses a SOptionList (reading a file list from a directory) to let the
user choose a backup then SButtons to provide actions to perform on the
selected kernel image, like Delete and Restore. The only problem is when
creating or deleting a backup the SOptionList can't reread the directory to
update its values.

I've worked around it by adding a button which removes the config.json,
runs uci again and then restarts Synapse but obviously that's a huge hack
and native support to refresh/rebuild SOptionList values on the fly would
be more ideal, and powerful. :)

There is probably a more "normal" usage case that could make use of this
functionality too, but this is the one I've got in front of me. Thanks
again for your time and consideration.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-41166946
.

@osm0sis
Copy link

osm0sis commented Apr 23, 2014

Thanks! Also, sorry @Grarak for unintentionally hijacking your issue thread. 👍

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

3 participants