def check_ok_button(self):
        """Helper to enable or not the OK button."""
        login = self.login.text()
        password = self.password.text()
        url = self.url.text()
        if self.layers.count() >= 1 and login and password and url:
            self.ok_button.setEnabled(True)
        else:
            self.ok_button.setEnabled(False)
Helper to enable or not the OK button.