Add confirmation dialog before installing or uninstalling #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 boxrespond
signal, properties must be set on the originalGtk.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 wholemockInstall
function in a conditional, to ensure that the dialog isn’t shown twice.