/* Funcion: GetAddressData() * ------------------------- * Extrae la direccion ip y el puerto de una determinada * linea del archivo csv. */ static int GetAddressData(char * aux, address_t * add) { char * token; token = strtok(aux, ";"); if(token==NULL){ return 0; } /* Direccion de ip */ if(!IsValidIp(token)){ return 0; } strcpy(add->ip, token); token = strtok(NULL,";"); if(token == NULL){ return 0; } /* Puerto */ if(!IsValidPort(token)){ return 0; } strcpy(add->port, token); return 1; }
QString Scr_Settings::GetDns(QLineEdit * dns) { QString d; if (!dns->text().isEmpty()) if (IsValidIp(dns->text())) d = dns->text(); return d; }
void Scr_Settings::SaveDns(QLineEdit * dns, const char * name, QSettings & settings) { bool er = false; if (!dns->text().isEmpty()) er = !IsValidIp(dns->text()); if (!er) settings.setValue(name, dns->text()); }
bool Scr_Settings::Vlidate_e_ip(QLineEdit * eb) { bool error = false; if (!eb->text().isEmpty()) error = !IsValidIp(eb->text()); if (error) eb->setStyleSheet(gs_sErrStyle); else eb->setStyleSheet(gs_sNormStyle); return error; }