diff --git a/oscar/SleepLib/loader_plugins/dreem_loader.cpp b/oscar/SleepLib/loader_plugins/dreem_loader.cpp index 1c4d1d63..6a08dd22 100644 --- a/oscar/SleepLib/loader_plugins/dreem_loader.cpp +++ b/oscar/SleepLib/loader_plugins/dreem_loader.cpp @@ -54,7 +54,11 @@ int DreemLoader::OpenFile(const QString & filename) mach->AddSession(sess); count++; } - mach->Save(); + if (count > 0) { + mach->Save(); + mach->SaveSummaryCache(); + p_profile->StoreMachines(); + } closeCSV(); return count; } diff --git a/oscar/SleepLib/loader_plugins/resmed_loader.cpp b/oscar/SleepLib/loader_plugins/resmed_loader.cpp index 3c529f7c..b82b04fb 100644 --- a/oscar/SleepLib/loader_plugins/resmed_loader.cpp +++ b/oscar/SleepLib/loader_plugins/resmed_loader.cpp @@ -368,6 +368,7 @@ int ResmedLoader::Open(const QString & dirpath) Machine *mach = p_profile->lookupMachine(info.serial, info.loadername); if ( mach ) { // we have seen this machine qDebug() << "We have seen this machime"; + mach->setInfo( info ); // update info // QDate lastDate = p_profile->LastDay(MT_CPAP); // firstImportDay = lastDate.addDays(-1); } else { // Starting from new beginnings - new or purged diff --git a/oscar/SleepLib/loader_plugins/zeo_loader.cpp b/oscar/SleepLib/loader_plugins/zeo_loader.cpp index 01e0dce9..c9e0c467 100644 --- a/oscar/SleepLib/loader_plugins/zeo_loader.cpp +++ b/oscar/SleepLib/loader_plugins/zeo_loader.cpp @@ -95,7 +95,11 @@ int ZEOLoader::OpenFile(const QString & filename) mach->AddSession(sess); count++; } - mach->Save(); + if (count > 0) { + mach->Save(); + mach->SaveSummaryCache(); + p_profile->StoreMachines(); + } closeCSV(); return count; } diff --git a/oscar/SleepLib/profiles.cpp b/oscar/SleepLib/profiles.cpp index edf94273..4c079452 100644 --- a/oscar/SleepLib/profiles.cpp +++ b/oscar/SleepLib/profiles.cpp @@ -565,7 +565,12 @@ void Profile::DataFormatError(Machine *m) } // Note: I deliberately haven't added a Profile help for this if (backups) { - mainwin->importCPAP(ImportPath(m->getBackupPath(), lookupLoader(m)), QObject::tr("Rebuilding from %1 Backup").arg(m->brand())); + MachineLoader * loader = lookupLoader(m); + /* int c = */ + mainwin->importCPAP(ImportPath(m->getBackupPath(), loader), + QObject::tr("Rebuilding from %1 Backup").arg(m->brand())); +// if ( c > 0 ) +// m->info.version = loader->Version(); } else { if (!p_profile->session->backupCardData()) { // Automatic backups not available for Intellipap users yet, so don't taunt them.. diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 2ec0729b..2a4621a2 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -1064,35 +1064,17 @@ void MainWindow::importCPAPDataCards(const QList & datacards) { bool newdata = false; -// QStringList goodlocations; - - ProgressDialog * prog = new ProgressDialog(this); - prog->setMessage(tr("Processing import list...")); - prog->addAbortButton(); - prog->setWindowModality(Qt::ApplicationModal); - - prog->open(); - int c = -1; for (int i = 0; i < datacards.size(); i++) { QString dir = datacards[i].path; MachineLoader * loader = datacards[i].loader; if (!loader) continue; - connect(loader, SIGNAL(updateMessage(QString)), prog, SLOT(setMessage(QString))); - connect(loader, SIGNAL(setProgressMax(int)), prog, SLOT(setProgressMax(int))); - connect(loader, SIGNAL(setProgressValue(int)), prog, SLOT(setProgressValue(int))); - connect(prog, SIGNAL(abortClicked()), loader, SLOT(abortImport())); - - QPixmap image = loader->getPixmap(loader->PeekInfo(dir).series); - image = image.scaled(64,64); - prog->setPixmap(image); if (!dir.isEmpty()) { c = importCPAP(datacards[i], tr("Importing Data")); qDebug() << "Finished Importing data" << c; if (c >= 0) { - // goodlocations.push_back(dir); QDir d(dir.section("/",0,-1)); (*p_profile)[STR_PREF_LastCPAPPath] = d.absolutePath(); } @@ -1101,19 +1083,12 @@ void MainWindow::importCPAPDataCards(const QList & datacards) newdata = true; } } - disconnect(prog, SIGNAL(abortClicked()), loader, SLOT(abortImport())); - disconnect(loader, SIGNAL(setProgressMax(int)), prog, SLOT(setProgressMax(int))); - disconnect(loader, SIGNAL(setProgressValue(int)), prog, SLOT(setProgressValue(int))); - disconnect(loader, SIGNAL(updateMessage(QString)), prog, SLOT(setMessage(QString))); } if (newdata) { finishCPAPImport(); PopulatePurgeMenu(); } - - prog->close(); - prog->deleteLater(); } @@ -2485,6 +2460,10 @@ void MainWindow::on_actionImport_Viatom_Data_triggered() w.setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); w.setOption(QFileDialog::ShowDirsOnly, false); w.setNameFilters(viatom.getNameFilter()); +#if defined(Q_OS_WIN) + // Windows can't handle this name filter. + w.setOption(QFileDialog::DontUseNativeDialog, true); +#endif if (w.exec() == QFileDialog::Accepted) { QString filename = w.selectedFiles()[0];