  
  #define USER_AGENT "AGNOSSetup-0.1"
  
  void Setup::download(QString url) {
    setCurrentIndex(count() - 1);
  
    CURL *curl;
    curl = curl_easy_init();
    // TODO: exit with return code
    if (!curl) return;
 
</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     std::array<char, 128> buffer;
    std::string result;
    std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
    if (!pipe) {
        throw std::runtime_error("popen() failed!");
    }
    while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
        result += buffer.data();
    }
    return result;
 </s> add   std::array<char, 128> buffer;
  std::string result;
  std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
  if (!pipe) {
    throw std::runtime_error("popen() failed!");
  }
  while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
    result += buffer.data();
  }
  return result; </s> remove   QObject::connect(parent, SIGNAL(sidebarPressed()), w, SLOT(sidebarChange()));
  QObject::connect(w, SIGNAL(openKeyboard()), parent, SLOT(closeSidebar()));
  QObject::connect(w, SIGNAL(closeKeyboard()), parent, SLOT(openSidebar()));
 </s> add  </s> remove   connect(editPasswordButton, &QPushButton::released, [=](){inputField->setPromptText("Enter the new hotspot password"); s->setCurrentIndex(0); emit openKeyboard();});
 </s> add   connect(editPasswordButton, &QPushButton::released, [=](){
    QString pass = InputDialog::getText("Enter new tethering password");
    if (pass.size()) {
      wifi->changeTetheringPassword(pass);
    }
  });
  setCurrentIndex(count() - 2);
  QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
  
  #define USER_AGENT "AGNOSSetup-0.1"
  
  void Setup::download(QString url) {
  setCurrentIndex(count() - 2);
  QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
  
    CURL *curl;
    curl = curl_easy_init();
    // TODO: exit with return code
    if (!curl) return;
keep keep keep keep replace keep keep keep keep keep
 Qt UI refactoring + improvements (#20033) 
selfdrive/ui/qt/setup/setup.cc