This fixes the bug where the Wine app-usage dialog can't be closed with its 'OK' button.
This commit moves on_response() up to the 'Dialog' base class and override it in a few places where this is required.
'response' is how dialogs close, 'delete-event' doesn't even fire for them, so I've removed this event handler from the dialogs.
This is a bit baroque, and maybe we should just not just the TrashPortal for runners. But it is an 'uninstall' and I don't want to be too much of a crazy axe murderer with deletions.
The problem is that the UI updates must wait until the runner folder is gone, because that is was triggers self.is_installed to become false; if we emit early the UI see no change and does not change itself.
So, this defers the signal via a callback given to TrashPortal. The UI does not try to update until the folder is gone, and all is well.
This log message is excessive, but may help with troubleshooting #5174. Need to back this off before release. I'd use the debug flag here, but it's not initialized soon enough.
There are several places where we need the directory deleted now, not asynchronously, because we are about to replace it. I think these are in places where deletion is okay - stuff like installing runtime updates.
Also, I put deletion of temp directories back on the deletion plan. I don't think anyone wants to see our temp files in the trash.
It can't tell if the folder was deleted without blocking for it, but no users of it actually care about this.
Also, beef of TrashPortal error handling so exceptions (from say opening the file) don't crash Lutris.
Also, also, add callback functions so if we do need to do something with errors or after deletion is complete, it's possible to do that.
There's a spacing of 12 px from the base class, we'll use that alone, and it all lines up nicely. It also makes it a little bit tighter; not a bad thing since the updates box doesn't fit vertically.
Also some spelling and warnings.
By tracking the names of the updaters that are running, we can make sure we never enqueue any one twice at the same time.
But you can start checking for Wine updates while runtime updates are running, if it's not in the queue already. Or vice versa.
We can use @lru_cache to make the relevant get_gpu_info() cache the gpu data, and then call that when we need the data. It need not be passed through 4 stack frames and an object.
I still call get_drivers() for the logging it does, but its result does not seem to be used anywhere.
Mostly this is to make flatpak work, but better to be on the safe side here. These are often things that would have crashed on NoneType, but could be made to tolerate the condition.
I think it's a really nice UI for that, so of course I'm going to steal it.
The 'can't start downloading' already error is still an ErrorDialog since that keeps the button available for when the existing download ends.
Freudian bug, this.
It would reset to the 'Stable' channel whenever you visit the preferences, because 'toggled' would fire during the initialization code.
I was over-thinking this; we can just separate the completion and error functions, and then we never pass None to the error function at all.
Doing this to AsyncCall can wait, but I think it would work.
That's title case for buttons (but sentence case for radio buttons)
"Sentence case almost everywhere" is the Windows Vista standard. You don't want to be Vista, do you?