  void Networking::connectToNetwork(Network n) {
    if (n.security_type == SecurityType::OPEN) {
      wifi->connect(n);
    } else if (n.security_type == SecurityType::WPA) {
      inputField->setPromptText("Enter password for \"" + n.ssid + "\"");
      s->setCurrentIndex(0);
      selectedNetwork = n;
      emit openKeyboard();
    }
  }
  
  void Networking::abortTextInput(){
    s->setCurrentIndex(1);
 
</s> remove   if(s->currentIndex()==0){
    qDebug()<<"Wrong password, but we are already trying a new network";
    return;
  }
  if(s->currentIndex()==2){
    qDebug()<<"Wrong password, but we are in advanced settings";
    return;
  }
  if(!this->isVisible()){
    qDebug()<<"Wrong password, but we are not visible";
    return;

  }
 </s> add   return; // TODO: add this back
  /* </s> remove }

void Networking::successfulConnection(QString ssid) {
  //Maybe we will want to do something here in the future.
}

void Networking::sidebarChange(){
  if (s == nullptr || an == nullptr){
    return;
  }

  s->setCurrentIndex(1);
  an->s->setCurrentIndex(1);
  refresh();
 </s> add   */ </s> remove void Networking::abortTextInput(){
  s->setCurrentIndex(1);
    emit closeKeyboard();
}

void Networking::receiveText(QString text) {
  wifi->disconnect();
  wifi->connect(selectedNetwork, text);
  s->setCurrentIndex(1);
  emit closeKeyboard();
}

 </s> add  </s> remove     if (i == 1) {
 </s> add     if (vlayout->count() == 1) {
    QString pass = InputDialog::getText("Enter password for \"" + n.ssid + "\"");
    wifi->connect(n, pass);
  void Networking::connectToNetwork(Network n) {
    if (n.security_type == SecurityType::OPEN) {
      wifi->connect(n);
    } else if (n.security_type == SecurityType::WPA) {
    QString pass = InputDialog::getText("Enter password for \"" + n.ssid + "\"");
    wifi->connect(n, pass);
    QString pass = InputDialog::getText("Enter password for \"" + n.ssid + "\"");
    wifi->connect(n, pass);
    QString pass = InputDialog::getText("Enter password for \"" + n.ssid + "\"");
    wifi->connect(n, pass);
    QString pass = InputDialog::getText("Enter password for \"" + n.ssid + "\"");
    wifi->connect(n, pass);
    }
  }
  
  void Networking::abortTextInput(){
    s->setCurrentIndex(1);
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Qt UI refactoring + improvements (#20033) 
selfdrive/ui/qt/offroad/networking.cc