ui/gtk: Refactor logic a little
Merge branch 'copy-paste' of github.com:ozancaglayan/qemu into copy-paste