void DiveLogImportDialog::on_knownImports_currentIndexChanged(int index) { if (specialCSV.contains(index)) { ui->groupBox_3->setEnabled(false); } else { ui->groupBox_3->setEnabled(true); } if (index == 0) return; ui->CSVTime->blockSignals(true); ui->CSVDepth->blockSignals(true); ui->CSVTime->setValue(CSVApps[index].time); ui->CSVDepth->setValue(CSVApps[index].depth); ui->CSVTime->blockSignals(false); ui->CSVDepth->blockSignals(false); SET_VALUE_AND_CHECKBOX(CSVTemperature, temperatureCheckBox, CSVApps[index].temperature); SET_VALUE_AND_CHECKBOX(CSVpo2, po2CheckBox, CSVApps[index].po2); SET_VALUE_AND_CHECKBOX(CSVcns, cnsCheckBox, CSVApps[index].cns); SET_VALUE_AND_CHECKBOX(CSVstopdepth, stopdepthCheckBox, CSVApps[index].stopdepth); ui->CSVSeparator->blockSignals(true); int separator_index = ui->CSVSeparator->findText(CSVApps[index].separator); if (separator_index != -1) ui->CSVSeparator->setCurrentIndex(separator_index); ui->CSVSeparator->blockSignals(false); }
void CSVImportDialog::on_knownImports_currentIndexChanged(int index) { if (index == 0) return; ui->CSVTime->blockSignals(true); ui->CSVDepth->blockSignals(true); ui->CSVTime->setValue(CSVApps[index].time); ui->CSVDepth->setValue(CSVApps[index].depth); ui->CSVTime->blockSignals(false); ui->CSVDepth->blockSignals(false); SET_VALUE_AND_CHECKBOX(CSVTemperature, temperatureCheckBox, CSVApps[index].temperature); SET_VALUE_AND_CHECKBOX(CSVpo2, po2CheckBox, CSVApps[index].po2); SET_VALUE_AND_CHECKBOX(CSVcns, cnsCheckBox, CSVApps[index].cns); SET_VALUE_AND_CHECKBOX(CSVstopdepth, stopdepthCheckBox, CSVApps[index].stopdepth); }