Don't try and import when no valid cms50i sessions

This commit is contained in:
Mark Watkins 2014-09-18 13:16:14 +10:00
parent f63905be52
commit 1ea167268d

View File

@ -287,6 +287,13 @@ void OximeterImport::on_directImportButton_clicked()
void OximeterImport::doImport()
{
if (oximodule->commandDriven()) {
if (chosen_sessions.size() == 0) {
ui->connectLabel->setText("<h2>"+tr("Nothing to import for %1").arg(oximodule->loaderName())+"</h2>");
ui->logBox->appendPlainText(tr("Could not find any valid sessions on your oximeter."));
updateStatus(tr("Your oximeter did not have any valid sessions"));
return;
}
ui->connectLabel->setText("<h2>"+tr("Waiting for %1 to start").arg(oximodule->loaderName())+"</h2>");
updateStatus(tr("Waiting for the device to start the upload process..."));
} else {
@ -301,10 +308,7 @@ void OximeterImport::doImport()
oximodule->Open("import");
if (oximodule->commandDriven()) {
int chosen = 0;
if (chosen_sessions.size() > 0) {
chosen = chosen_sessions.takeFirst();
}
int chosen = chosen_sessions.takeFirst();
oximodule->getSessionData(chosen);
}