Add support for login window and loading mainwindow