ui: add closeEvent
saving app config before exiting
ui: restore last selected account