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

Surge::UserInteractions::promptOKCancel handling #3435

Closed
baconpaul opened this issue Dec 15, 2020 · 6 comments
Closed

Surge::UserInteractions::promptOKCancel handling #3435

baconpaul opened this issue Dec 15, 2020 · 6 comments
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme
Milestone

Comments

@baconpaul
Copy link
Collaborator

This UI is used in one and only one place, which is SurgeSynthesizer when you save a patch which is there. There's a few problems with it

  1. Why is UI code in the Synth? that's dumb. You should have resolved this issue before you get to the synth
  2. If we do that (namely resolve the issue) can't we put this into SGE in native rather than a popup with all the problems?

So I propose we have a "SurgeStorage::patchExists" function or some such which tells us if we are going to overwrite. Rather than SGE calling save, SGE calls patchExists and if it gets a yess, prompts in SGE land for an OK cancel and save. Then Synth::save just always overwrites.

@baconpaul baconpaul added this to the 1.9.0 milestone Dec 15, 2020
@mkruselj
Copy link
Collaborator

I have also noticed if we save a patch and it already exists, the overwrite system dialog that shows up doesn't even play an asterisk sound (which happens normally for other programs I use). Weird?

@mkruselj mkruselj added the Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme label Dec 15, 2020
@baconpaul
Copy link
Collaborator Author

i mean, i wrote the windows code to show that dialog ,and i copied it from stack overflow. So 🤷

It should really be an in-UI gui anyway. That's the point here.

@mkruselj
Copy link
Collaborator

Aha so basically like miniedit but without textedit field. Easy enough!

@baconpaul
Copy link
Collaborator Author

bingo
but the real issue is: restructuring the code to call it from the UI code not the synth code.

@baconpaul
Copy link
Collaborator Author

Oh this is also used on tuning load path. Sigh. tricky.

@baconpaul
Copy link
Collaborator Author

I'm gonna leave this and restructure it in the XT codepath once we are in JUCE-only mode

@baconpaul baconpaul modified the milestones: 1.8.2, Surge XT Feb 5, 2021
baconpaul added a commit to baconpaul/surge that referenced this issue Apr 23, 2021
Addresses surge-synthesizer#4337
Closes surge-synthesizer#2671 surge-synthesizer#3435

Refactor/Remove the UserInteractions in favor of JUCE equivalents
and appropirate wrappers

- openURL -> juce::URL.lauch
- showHTML -> surgeguieditor builtin
- Remove openFileInFinder or whatnot for juce::URL(juce::File()).laucnh
- promptInfo removed; single use replaced with an Alert box
- Remove UserInteractions::promptError to be data driven
- promptOKCancel moved to a gui free function which can be replaced and
  is replaced in SGE
- promptFileOpen replaced with juce::FileChooser
- Finally, remove the old files which were no longer used
baconpaul added a commit that referenced this issue Apr 23, 2021
Addresses #4337
Closes #2671 #3435

Refactor/Remove the UserInteractions in favor of JUCE equivalents
and appropirate wrappers

- openURL -> juce::URL.lauch
- showHTML -> surgeguieditor builtin
- Remove openFileInFinder or whatnot for juce::URL(juce::File()).laucnh
- promptInfo removed; single use replaced with an Alert box
- Remove UserInteractions::promptError to be data driven
- promptOKCancel moved to a gui free function which can be replaced and
  is replaced in SGE
- promptFileOpen replaced with juce::FileChooser
- Finally, remove the old files which were no longer used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Refactoring General code refactoring and cleanup issues like names, unused variables, warnings, fixme
Projects
None yet
Development

No branches or pull requests

2 participants