mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Fix CPAP import regression
This commit is contained in:
parent
2f68d8e4b3
commit
c724c083fa
@ -701,7 +701,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
|
||||
|
||||
|
||||
double xx = max_x - min_x;
|
||||
double xmult = xx / w;
|
||||
double xmult = xx / double(w);
|
||||
|
||||
{
|
||||
xmult = (m_blockzoom ? (rmax_x - rmin_x) : (max_x - min_x)) / w;
|
||||
|
@ -270,12 +270,13 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
||||
}
|
||||
}
|
||||
|
||||
if (p_profile->appearance->lineCursorMode()) {
|
||||
qint64 time = w.currentTime();
|
||||
|
||||
// Display Line Cursor
|
||||
if (p_profile->appearance->lineCursorMode()) {
|
||||
double time = w.currentTime();
|
||||
|
||||
if ((time > minx) && (time < maxx)) {
|
||||
double xpos = (time - minx) * xmult;
|
||||
double xpos = (time - double(minx)) * xmult;
|
||||
painter.setPen(QPen(QBrush(QColor(0,255,0,255)),1));
|
||||
painter.drawLine(left+xpos, top-w.marginTop()-3, left+xpos, top+height+w.bottom-1);
|
||||
}
|
||||
|
@ -1117,10 +1117,12 @@ int calcAHIGraph(Session *session)
|
||||
}
|
||||
}
|
||||
|
||||
AHI->AddEvent(lastti, 0);
|
||||
//if (lastti > last) lastti = last;
|
||||
|
||||
AHI->AddEvent(last, 0);
|
||||
|
||||
if (calcrdi) {
|
||||
RDI->AddEvent(lastti, 0);
|
||||
RDI->AddEvent(last, 0);
|
||||
}
|
||||
|
||||
if (!cnt) {
|
||||
|
@ -86,7 +86,7 @@ int FPIconLoader::Open(QString path)
|
||||
QDir dir(newpath);
|
||||
|
||||
if ((!dir.exists() || !dir.isReadable())) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
dir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||
@ -128,8 +128,8 @@ int FPIconLoader::Open(QString path)
|
||||
Q_UNUSED(e)
|
||||
p_profile->DelMachine(m);
|
||||
MachList.erase(MachList.find(info.serial));
|
||||
QMessageBox::warning(nullptr, "Import Error",
|
||||
"This Machine Record cannot be imported in this profile.\nThe Day records overlap with already existing content.",
|
||||
QMessageBox::warning(nullptr, tr("Import Error"),
|
||||
tr("This Machine Record cannot be imported in this profile.")+"\n\n"+tr("The Day records overlap with already existing content."),
|
||||
QMessageBox::Ok);
|
||||
delete m;
|
||||
}
|
||||
@ -175,7 +175,7 @@ int FPIconLoader::OpenMachine(Machine *mach, QString &path)
|
||||
QDir dir(path);
|
||||
|
||||
if (!dir.exists() || (!dir.isReadable())) {
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
dir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||
@ -290,9 +290,10 @@ int FPIconLoader::OpenMachine(Machine *mach, QString &path)
|
||||
// qDebug() << chunk.file << ":" << i << zz << dur << "minutes" << (b ? "*" : "") << (c ? QDateTime::fromTime_t(zz).toString() : "");
|
||||
// }
|
||||
|
||||
int c = Sessions.size();
|
||||
mach->Save();
|
||||
|
||||
return 1;
|
||||
return c;
|
||||
}
|
||||
|
||||
// !\brief Convert F&P 32bit date format to 32bit UNIX Timestamp
|
||||
|
@ -68,7 +68,7 @@ int IntellipapLoader::Open(QString path)
|
||||
QString dirtag = "SL";
|
||||
|
||||
if (path.endsWith("/" + dirtag)) {
|
||||
return 0;
|
||||
return -1;
|
||||
//newpath=path;
|
||||
} else {
|
||||
newpath = path + "/" + dirtag;
|
||||
@ -82,7 +82,7 @@ int IntellipapLoader::Open(QString path)
|
||||
filename = newpath + "/SET1";
|
||||
QFile f(filename);
|
||||
|
||||
if (!f.exists()) { return 0; }
|
||||
if (!f.exists()) { return -1; }
|
||||
|
||||
f.open(QFile::ReadOnly);
|
||||
QTextStream tstream(&f);
|
||||
@ -228,7 +228,7 @@ int IntellipapLoader::Open(QString path)
|
||||
|
||||
if (!mach) {
|
||||
qDebug() << "Couldn't get Intellipap machine record";
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
QString backupPath = mach->getBackupPath();
|
||||
@ -253,7 +253,7 @@ int IntellipapLoader::Open(QString path)
|
||||
filename = newpath + "/U";
|
||||
f.setFileName(filename);
|
||||
|
||||
if (!f.exists()) { return 0; }
|
||||
if (!f.exists()) { return -1; }
|
||||
|
||||
QVector<quint32> SessionStart;
|
||||
QVector<quint32> SessionEnd;
|
||||
@ -287,7 +287,7 @@ int IntellipapLoader::Open(QString path)
|
||||
filename = newpath + "/L";
|
||||
f.setFileName(filename);
|
||||
|
||||
if (!f.exists()) { return 0; }
|
||||
if (!f.exists()) { return -1; }
|
||||
|
||||
f.open(QFile::ReadOnly);
|
||||
long size = f.size();
|
||||
@ -296,12 +296,13 @@ int IntellipapLoader::Open(QString path)
|
||||
|
||||
if (size != f.read((char *)m_buffer, size)) {
|
||||
qDebug() << "Couldn't read 'L' data" << filename;
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Session *sess;
|
||||
SessionID sid;
|
||||
QHash<SessionID,qint64> rampstart;
|
||||
QHash<SessionID,qint64> rampend;
|
||||
|
||||
for (int i = 0; i < SessionStart.size(); i++) {
|
||||
sid = SessionStart[i];
|
||||
@ -312,7 +313,12 @@ int IntellipapLoader::Open(QString path)
|
||||
SessionEnd[i] = 0;
|
||||
} else if (!Sessions.contains(sid)) {
|
||||
sess = Sessions[sid] = new Session(mach, sid);
|
||||
|
||||
sess->really_set_first(qint64(sid) * 1000L);
|
||||
// sess->really_set_last(qint64(SessionEnd[i]) * 1000L);
|
||||
|
||||
rampstart[sid] = 0;
|
||||
rampend[sid] = 0;
|
||||
sess->SetChanged(true);
|
||||
if (mode >= MODE_BILEVEL_FIXED) {
|
||||
sess->AddEventList(CPAP_IPAP, EVL_Event);
|
||||
@ -354,6 +360,8 @@ int IntellipapLoader::Open(QString path)
|
||||
|
||||
long pos = 0;
|
||||
int rampval = 0;
|
||||
sid = 0;
|
||||
SessionID lastsid = 0;
|
||||
|
||||
for (int i = 0; i < recs; i++) {
|
||||
// convert timestamp to real epoch
|
||||
@ -366,6 +374,7 @@ int IntellipapLoader::Open(QString path)
|
||||
|
||||
if ((ts1 >= (quint32)sid) && (ts1 <= SessionEnd[j])) {
|
||||
Session *sess = Sessions[sid];
|
||||
|
||||
qint64 time = quint64(ts1) * 1000L;
|
||||
sess->settings[CPAP_Mode] = mode;
|
||||
|
||||
@ -403,6 +412,7 @@ int IntellipapLoader::Open(QString path)
|
||||
if (!rs) {
|
||||
rampstart[sid] = time;
|
||||
}
|
||||
rampend[sid] = time;
|
||||
} else {
|
||||
if (rs > 0) {
|
||||
if (!sess->eventlist.contains(CPAP_Ramp)) {
|
||||
@ -412,6 +422,7 @@ int IntellipapLoader::Open(QString path)
|
||||
sess->eventlist[CPAP_Ramp][0]->AddEvent(time, duration);
|
||||
|
||||
rampstart[sid] = 0;
|
||||
//rampend[sid] = 0; // don't need to
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,12 +488,34 @@ int IntellipapLoader::Open(QString path)
|
||||
sess->eventlist[CPAP_MinuteVent][0]->AddEvent(time, mv / 1000.0);
|
||||
break;
|
||||
}
|
||||
|
||||
lastsid = sid;
|
||||
}
|
||||
|
||||
pos += 26;
|
||||
}
|
||||
|
||||
// Close any open ramps and store the event.
|
||||
QHash<SessionID,qint64>::iterator rit;
|
||||
QHash<SessionID,qint64>::iterator rit_end = rampstart.end();
|
||||
|
||||
for (rit = rampstart.begin(); rit != rit_end; ++rit) {
|
||||
qint64 rs = rit.value();
|
||||
SessionID sid = rit.key();
|
||||
if (rs > 0) {
|
||||
qint64 re = rampend[rit.key()];
|
||||
|
||||
Session *sess = Sessions[sid];
|
||||
if (!sess->eventlist.contains(CPAP_Ramp)) {
|
||||
sess->AddEventList(CPAP_Ramp, EVL_Event);
|
||||
}
|
||||
|
||||
int duration = (re - rs) / 1000L;
|
||||
sess->eventlist[CPAP_Ramp][0]->AddEvent(re, duration);
|
||||
rit.value() = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < SessionStart.size(); i++) {
|
||||
SessionID sid = SessionStart[i];
|
||||
|
||||
@ -544,7 +577,8 @@ int IntellipapLoader::Open(QString path)
|
||||
|
||||
f.close();
|
||||
|
||||
return 1;
|
||||
int c = Sessions.size();
|
||||
return c;
|
||||
}
|
||||
|
||||
bool intellipap_initialized = false;
|
||||
|
@ -75,7 +75,6 @@ class IntellipapLoader : public MachineLoader
|
||||
}
|
||||
protected:
|
||||
QString last;
|
||||
QHash<QString, Machine *> MachList;
|
||||
|
||||
unsigned char *m_buffer;
|
||||
};
|
||||
|
@ -197,7 +197,7 @@ int PRS1Loader::Open(QString path)
|
||||
QDir dir(newpath);
|
||||
|
||||
if ((!dir.exists() || !dir.isReadable())) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
dir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||
@ -233,19 +233,24 @@ int PRS1Loader::Open(QString path)
|
||||
}
|
||||
}
|
||||
|
||||
if (SerialNumbers.empty()) { return 0; }
|
||||
if (SerialNumbers.empty()) { return -1; }
|
||||
|
||||
m_buffer = new unsigned char [max_load_buffer_size]; //allocate once and reuse.
|
||||
Machine *m;
|
||||
|
||||
int c = 0;
|
||||
|
||||
for (sn = SerialNumbers.begin(); sn != SerialNumbers.end(); sn++) {
|
||||
if (*sn == last) {
|
||||
}
|
||||
|
||||
MachineInfo info = newInfo();
|
||||
info.serial = *sn;
|
||||
m = CreateMachine(info);
|
||||
|
||||
try {
|
||||
if (m) {
|
||||
OpenMachine(m, newpath + "/" + info.serial);
|
||||
c += OpenMachine(m, newpath + "/" + info.serial);
|
||||
}
|
||||
} catch (OneTypePerDay e) {
|
||||
Q_UNUSED(e)
|
||||
@ -259,7 +264,7 @@ int PRS1Loader::Open(QString path)
|
||||
}
|
||||
|
||||
delete [] m_buffer;
|
||||
return PRS1List.size();
|
||||
return c;
|
||||
}
|
||||
|
||||
bool PRS1Loader::ParseProperties(Machine *m, QString filename)
|
||||
|
@ -1061,7 +1061,7 @@ EDFduration getEDFDuration(QString filename)
|
||||
return dur;
|
||||
}
|
||||
|
||||
void ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
|
||||
int ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
|
||||
{
|
||||
QHash<QString, SessionID> skipfiles;
|
||||
|
||||
@ -1260,6 +1260,7 @@ void ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
|
||||
}
|
||||
|
||||
// Run the tasks...
|
||||
int c = countTasks();
|
||||
runTasks(p_profile->session->multithreading());
|
||||
|
||||
newSkipFiles.append(skipfiles.keys());
|
||||
@ -1278,6 +1279,7 @@ void ResmedLoader::scanFiles(Machine * mach, QString datalog_path)
|
||||
}
|
||||
impfile.close();
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
int ResmedLoader::Open(QString path)
|
||||
@ -1310,7 +1312,7 @@ int ResmedLoader::Open(QString path)
|
||||
|
||||
// Check DATALOG folder exists and is readable
|
||||
if (!QDir().exists(newpath)) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1321,7 +1323,7 @@ int ResmedLoader::Open(QString path)
|
||||
|
||||
// Abort if this file is dodgy..
|
||||
if (!f.exists() || !f.open(QIODevice::ReadOnly)) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
MachineInfo info = newInfo();
|
||||
|
||||
@ -1356,7 +1358,7 @@ int ResmedLoader::Open(QString path)
|
||||
// Abort if no serial number
|
||||
if (info.serial.isEmpty()) {
|
||||
qDebug() << "S9 Data card has no valid serial number in Indentification.tgt";
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Early check for STR.edf file, so we can early exit before creating faulty machine record.
|
||||
@ -1369,7 +1371,7 @@ int ResmedLoader::Open(QString path)
|
||||
|
||||
if (!f.exists()) {
|
||||
qDebug() << "Missing STR.edf file";
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1516,8 +1518,7 @@ int ResmedLoader::Open(QString path)
|
||||
p_profile->session->setIgnoreShortSessions(false);
|
||||
#endif
|
||||
|
||||
scanFiles(m, newpath);
|
||||
|
||||
int new_sessions = scanFiles(m, newpath);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// Now look for any new summary data that can be extracted from STR.edf records
|
||||
@ -1573,6 +1574,8 @@ int ResmedLoader::Open(QString path)
|
||||
|
||||
queTask(new ResmedImportStage2(this, R, m));
|
||||
}
|
||||
|
||||
new_sessions += countTasks();
|
||||
runTasks();
|
||||
|
||||
#ifdef DEBUG_EFFICIENCY
|
||||
@ -1609,7 +1612,7 @@ int ResmedLoader::Open(QString path)
|
||||
channel_time.clear();
|
||||
|
||||
qDebug() << "Total Events " << event_cnt;
|
||||
return 1;
|
||||
return new_sessions;
|
||||
}
|
||||
|
||||
|
||||
|
@ -385,7 +385,7 @@ protected:
|
||||
void ParseSTR(Machine *mach, QStringList strfiles);
|
||||
|
||||
//! \brief Scan for new files to import, group into sessions and add to task que
|
||||
void scanFiles(Machine * mach, QString datalog_path);
|
||||
int scanFiles(Machine * mach, QString datalog_path);
|
||||
|
||||
QString backup(QString file, QString backup_path);
|
||||
|
||||
|
@ -959,24 +959,37 @@ EventDataType Session::SearchValue(ChannelID code, qint64 time)
|
||||
quint32 *tptr;
|
||||
int cnt;
|
||||
|
||||
if (code == CPAP_FlowRate) {
|
||||
int i=5;
|
||||
}
|
||||
|
||||
EventDataType a,b,c,d,e;
|
||||
double;
|
||||
if (it != eventlist.end()) {
|
||||
int el_size=it.value().size();
|
||||
for (int i = 0; i < el_size; i++) {
|
||||
EventList *el = it.value()[i];
|
||||
if ((time >= el->first())
|
||||
&& (time < el->last())) {
|
||||
if ((time >= el->first()) && (time < el->last())) {
|
||||
cnt = el->count();
|
||||
|
||||
if (el->type() == EVL_Waveform) {
|
||||
qint64 tt = time - el->first();
|
||||
int i = tt / el->rate();
|
||||
return el->data(i);
|
||||
|
||||
double i = tt / el->rate();
|
||||
|
||||
int i1 = int(floor(i));
|
||||
int i2 = int(ceil(i));
|
||||
|
||||
a = el->data(i1);
|
||||
|
||||
if (i2 > cnt) { return a; }
|
||||
|
||||
qint64 t1 = i1 * el->rate();
|
||||
qint64 t2 = i2 * el->rate();
|
||||
|
||||
c = EventDataType(t2 - t1);
|
||||
d = EventDataType(t2 - tt);
|
||||
|
||||
e = d/c;
|
||||
b = el->data(i2);
|
||||
|
||||
return b + ((a-b) * e);
|
||||
|
||||
} else {
|
||||
start = el->first();
|
||||
tptr = el->rawTime();
|
||||
@ -994,11 +1007,9 @@ EventDataType Session::SearchValue(ChannelID code, qint64 time)
|
||||
b = el->data(j+1);
|
||||
if (a == b) {
|
||||
return a;
|
||||
} else { //if (a > b) {
|
||||
} else {
|
||||
return b + ((a-b) * e);
|
||||
}// else { // a < b
|
||||
// return a + ((b-a) * e);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -522,18 +522,42 @@ int MainWindow::importCPAP(ImportPath import, const QString &message)
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDialog popup(this, Qt::SplashScreen);
|
||||
QLabel waitmsg(message);
|
||||
QVBoxLayout waitlayout(&popup);
|
||||
waitlayout.addWidget(&waitmsg,1,Qt::AlignCenter);
|
||||
waitlayout.addWidget(qprogress,1);
|
||||
QDialog * popup = new QDialog(this, Qt::SplashScreen);
|
||||
QLabel * waitmsg = new QLabel(message);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||
|
||||
QLabel * imglabel = new QLabel(popup);
|
||||
QPixmap image(getCPAPPixmap(import.loader->loaderName()));
|
||||
image = image.scaled(64,64);
|
||||
imglabel->setPixmap(image);
|
||||
|
||||
|
||||
QVBoxLayout * vlayout = new QVBoxLayout;
|
||||
popup->setLayout(vlayout);
|
||||
vlayout->addLayout(hlayout);
|
||||
hlayout->addWidget(imglabel);
|
||||
hlayout->addWidget(waitmsg,1,Qt::AlignCenter);
|
||||
vlayout->addWidget(qprogress,1);
|
||||
|
||||
qprogress->setVisible(true);
|
||||
popup.show();
|
||||
int c=import.loader->Open(import.path);;
|
||||
popup.hide();
|
||||
popup->show();
|
||||
int c = import.loader->Open(import.path);
|
||||
|
||||
if (c > 0) {
|
||||
Notify(tr("Imported %1 CPAP session(s) from\n\n%2").arg(c).arg(import.path), tr("Import Success"));
|
||||
} else if (c == 0) {
|
||||
Notify(tr("Already up to date with CPAP data at\n\n%1").arg(import.path), tr("Up to date"));
|
||||
} else {
|
||||
Notify(tr("Couldn't find any valid Machine Data at\n\n%1").arg(import.path),tr("Import Problem"));
|
||||
}
|
||||
|
||||
popup->hide();
|
||||
vlayout->removeWidget(qprogress);
|
||||
ui->statusbar->insertWidget(2,qprogress,1);
|
||||
qprogress->setVisible(false);
|
||||
|
||||
delete popup;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -557,16 +581,11 @@ void MainWindow::importCPAPBackups()
|
||||
|
||||
if (paths.size() > 0) {
|
||||
int c=0;
|
||||
QString str=tr("Data successfully imported from the following locations:")+"\n\n";
|
||||
Q_FOREACH(ImportPath path, paths) {
|
||||
c+=importCPAP(path, tr("Please wait, importing from backup folder(s)..."));
|
||||
str.append(QDir::toNativeSeparators(path.path)+"\n");
|
||||
}
|
||||
if (c>0) {
|
||||
mainwin->Notify(str);
|
||||
finishCPAPImport();
|
||||
} else {
|
||||
mainwin->Notify(tr("Couldn't find any new Machine Data at the locations given."),tr("Import Problem"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -752,15 +771,13 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
int res = mbox.exec();
|
||||
|
||||
if (res == QMessageBox::Cancel) {
|
||||
// Give the communal progress bar back
|
||||
ui->statusbar->insertWidget(2,qprogress,1);
|
||||
return;
|
||||
} else if (res == QMessageBox::No) {
|
||||
waitmsg.setText(tr("Please wait, launching file dialog..."));
|
||||
datacards.clear();
|
||||
asknew = true;
|
||||
} else {
|
||||
// Give the communal progress bar back
|
||||
ui->statusbar->insertWidget(2,qprogress,1);
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -840,56 +857,51 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
int successful = false;
|
||||
bool newdata = false;
|
||||
|
||||
QStringList goodlocations;
|
||||
// QStringList goodlocations;
|
||||
|
||||
waitmsg.setText(tr("Please wait, SleepyHead is importing data..."));
|
||||
qprogress->setVisible(true);
|
||||
// waitmsg.setText(tr("Please wait, SleepyHead is importing data..."));
|
||||
// qprogress->setVisible(true);
|
||||
|
||||
popup.show();
|
||||
// popup.show();
|
||||
|
||||
int c = -1;
|
||||
for (int i = 0; i < datacards.size(); i++) {
|
||||
QString dir = datacards[i].path;
|
||||
MachineLoader * loader = datacards[i].loader;
|
||||
if (!loader) continue;
|
||||
|
||||
if (!dir.isEmpty()) {
|
||||
qprogress->setValue(0);
|
||||
qprogress->show();
|
||||
qstatus->setText(tr("Importing Data"));
|
||||
int c = loader->Open(dir);
|
||||
// qprogress->setValue(0);
|
||||
// qprogress->show();
|
||||
// qstatus->setText(tr("Importing Data"));
|
||||
c = importCPAP(datacards[i], tr("Importing Data"));
|
||||
qDebug() << "Finished Importing data" << c;
|
||||
|
||||
if (c) {
|
||||
goodlocations.push_back(dir);
|
||||
|
||||
if (c >= 0) {
|
||||
// goodlocations.push_back(dir);
|
||||
QDir d(dir.section("/",0,-2));
|
||||
(*p_profile)[STR_PREF_LastCPAPPath] = d.absolutePath();
|
||||
|
||||
successful = true;
|
||||
}
|
||||
|
||||
qstatus->setText("");
|
||||
qprogress->hide();
|
||||
if (c > 0) {
|
||||
newdata = true;
|
||||
}
|
||||
|
||||
// qstatus->setText("");
|
||||
// qprogress->hide();
|
||||
}
|
||||
}
|
||||
popup.hide();
|
||||
// popup.hide();
|
||||
|
||||
ui->statusbar->insertWidget(2,qprogress,1);
|
||||
// ui->statusbar->insertWidget(2, qprogress,1);
|
||||
|
||||
if (successful) {
|
||||
if (newdata) {
|
||||
finishCPAPImport();
|
||||
|
||||
QString str=tr("Data successfully imported from the following locations\n\n");
|
||||
for (int i=0; i<goodlocations.size(); i++) {
|
||||
str += goodlocations.at(i) + "\n";
|
||||
}
|
||||
mainwin->Notify(str);
|
||||
} else {
|
||||
mainwin->Notify(tr("Import Problem\n\nCouldn't find any new Machine Data at the locations given"));
|
||||
}
|
||||
PopulatePurgeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
QMenu *MainWindow::CreateMenu(QString title)
|
||||
{
|
||||
@ -1777,10 +1789,6 @@ void MainWindow::on_actionChange_User_triggered()
|
||||
RestartApplication(true);
|
||||
}
|
||||
|
||||
void purgeCPAPDay(QDate date)
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPurge_Current_Day_triggered()
|
||||
{
|
||||
QDate date = getDaily()->getDate();
|
||||
@ -1942,14 +1950,14 @@ void MainWindow::purgeMachine(Machine * mach)
|
||||
|
||||
|
||||
if (backups) {
|
||||
importCPAP(ImportPath(mach->getBackupPath(), lookupLoader(mach)), tr("Please wait, importing..."));
|
||||
importCPAP(ImportPath(mach->getBackupPath(), lookupLoader(mach)), tr("Please wait, importing from backup folder(s)..."));
|
||||
} else {
|
||||
if (QMessageBox::information(this, STR_MessageBox_Warning,
|
||||
tr("Because there are no internal backups to rebuild from, you will have to restore from your own.")+"\n\n"+
|
||||
tr("Would you like to import from your own backups now? (you will have no data visible for this machine until you do)"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) {
|
||||
} else {
|
||||
on_action_Import_Data_triggered();
|
||||
} else {
|
||||
}
|
||||
}
|
||||
if (overview) overview->ReloadGraphs();
|
||||
|
Loading…
Reference in New Issue
Block a user