Change to QDialog and setup connection