We should show the current best practice for this kind of dialog, and use a headerbar with a window close button.
Replace manual signal connections with signal handlers declared in the ui file, where possible.
This example demonstrates property actions and object binding.