code: def check_ok_button(self):
          
          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)
docs: Helper to enable or not the OK button.