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

Add confirmation dialog before installing or uninstalling #7

Merged
merged 2 commits into from Jun 16, 2023

Conversation

bradrn
Copy link
Contributor

@bradrn bradrn commented May 25, 2023

Fixes #6.

Some nasty subtleties here… in particular, digging through the gi-gtk source reveals that the ?self implicit parameter gets disowned as soon as the callback returns. Thus, in the message box respond signal, properties must be set on the original Gtk.Switch object, rather than on the ?self pointer of the outer callback (even though they should in theory be the same), since that pointer gets disowned before the message box signal can run.

Another point is that setting the activity programmatically also triggers the stateSet signal. Blocking this is more difficult than it should be, since it requires the handler ID, which can’t be accessed until after the message box has been created! It’s easier to just wrap the whole mockInstall function in a conditional, to ensure that the dialog isn’t shown twice.

@Kleidukos
Copy link
Owner

@bradrn this is interesting. Definitely would be worth it to write that down somewhere to help guide others.

@bradrn
Copy link
Contributor Author

bradrn commented May 26, 2023

Yes, I definitely think it should be documented somewhere… but I’m not at all sure where. Maybe I’ll just open an issue on https://github.com/haskell-gi/haskell-gi.

(Also, do I need to worry about the failed CI?)

@Kleidukos
Copy link
Owner

(Also, do I need to worry about the failed CI?)

This is where a nix setup would be useful… The runners are still running on an Ubuntu LTS that has an old version of libadwaita, if I'm not mistaken

@bradrn
Copy link
Contributor Author

bradrn commented May 31, 2023

Further on ?self… thanks to @garetxe [ haskell-gi/haskell-gi#408 (comment) ], this issue is now fixed in haskell-gi-0.26.5. The freeze file pins us to haskell-gi-0.26.4, though, so probably it’s best to continue avoiding ?self for now.

@Kleidukos
Copy link
Owner

@bradrn you can update the freeze file, it's better if we bump the version 👍

Regarding the CI I'll merge the PR despite of the runner.

@bradrn bradrn mentioned this pull request May 31, 2023
@Kleidukos Kleidukos merged commit b66e93d into Kleidukos:main Jun 16, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add confirmation dialogs
2 participants