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

[Request] Optional confirmation dialog before executing custom UI button command #532

Closed
cakeller98 opened this issue Aug 7, 2014 · 8 comments
Labels
request Feature request

Comments

@cakeller98
Copy link

I just accidentally saved a smoothieboard ui config instead of loading it - so I overwrote the customized one with the DEFAULT... oops, I'm dumb! and maybe an M501 and 504 shouldn't be close to each other in my delta calibration version of octoprint. However because of this event, it got me thinking... would it be so difficult to add a boolean "confirm" where if set true you get a message box that asks you to confirm by repeating the UI text, and then the exact gcode, before submitting. and it would default to false so as not to change existing UI functionality.

If you need any further info - let me know. I think this is self explanatory, but just cuz it's clear in my own brain doesn't mean I've shared enough context. :) I'm happy to add a mock-up example. I'd code it if I had time.

@foosel
Copy link
Member

foosel commented Aug 7, 2014

You mean similar to what the System commands do?

@cakeller98
Copy link
Author

I'm not sure which system commands offer the confirmation dialog.

But similar to when you're about to format a hard drive, the system would say "this will erase all data. are you sure?"

See below... if I click the button in the red box, I'd like to have the option to get a dialog box to confirm OK/Cancel before executing the button. If you hit save instead of load, it could overwrite work. Alternatively, I can remove this and do it manually, but I have multiple hot-end carriages, and each requires a little bit of re-calibration - so... hence the Delta calibration UI I've got here.

image

Perhaps I missed a type of custom UI command that already has this functionality? --- I will go check the wiki

@foosel
Copy link
Member

foosel commented Aug 7, 2014

I meant something like this:

image

Which is e.g. in the example of the reboot system command, see the confirm statement:

system:
  actions:
  - action: reboot
    command: sudo reboot
    confirm: You are about to reboot the system
    name: Reboot

But something like this is not available yet for the configurable (GCODE) controls, just wanted to clarify if we think of the same thing, which it appears we do ;)

@cakeller98
Copy link
Author

you beat me too it!!! - YES YES !!! like just like that...

perhaps the confirm could include a standin so you could also have this:

  • commands:
    • M504 %(ext4)s
    • G28
      input:
    • default: null
      name: Extension (or none)
      parameter: ext4
      name: Save Overrides.
      confirm: Are you sure you want to execute the following?\n\n \nThis will overwrite the settings in the file with all current settings.
      type: parametric_commands

where would be the exact gcode commands... the user can see the exact command before running it?

Of course just having a confirm woudl be great...

@cakeller98
Copy link
Author

that would be so great!

and to clarify, it might be nice even just if the commands were listed out below the message. even if it's not a placeholder that the "customizing person" would use. ;)

I hadn't looked at the system commands before, except briefly, because they aren't compatible with Winders or Mac, which are what I'm using OP on. :)

@Booli
Copy link
Contributor

Booli commented Sep 18, 2014

I would like to +1 this request. Im using a quick load / unload sequence which I would like to be confirmed before starting. If pressed accidentally it could extrude large amounts on too high speed

@cakeller98
Copy link
Author

For GCodes, it would be nice to have it print the actual command to be executed. For debugging and sanity.

I have some that include the letter codes and some that use a number.
e.g. for a Z only adjustment the user doesn't need to enter the Z-5.042, only -5.042
However,
for trim, the user could adjust one, two, or all 3 of the trims in one command. it's problematic to use 3 separate variables for that as it would force adjustment of all three, and there's no way to read current and make the default be those. So better to use a single text variable, and have the user include the letter code. e.g. X-0.052, or X-0.053 Y-0.081,

so a confirmation of the GCode to be submitted would be great to show.

here's what you're going to do:
  G28
  GXXX X-0.053
  G28
Are you sure you want to do it?

Booli added a commit to Booli/OctoPrint that referenced this issue Sep 23, 2014
Syntax (and code) similar to System Command confirm. First commit,
please be gentle.
@foosel
Copy link
Member

foosel commented Sep 23, 2014

Now available in the devel branch thanks to the the work of @Booli (without the GCODE to be executed though). Closing for now

@foosel foosel closed this as completed Sep 23, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
request Feature request
Projects
None yet
Development

No branches or pull requests

3 participants