Outsources the init-method from MainWindow-constructor.