mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
More Profile and String Cleanups
This commit is contained in:
parent
a776b7a1f0
commit
10bf80f741
@ -44,19 +44,19 @@ void InitGraphs()
|
|||||||
{
|
{
|
||||||
if (!_graph_init) {
|
if (!_graph_init) {
|
||||||
|
|
||||||
if (!PREF.Exists("Fonts_Graph_Name")) {
|
if (!PREF.contains("Fonts_Graph_Name")) {
|
||||||
PREF["Fonts_Graph_Name"]="Sans Serif";
|
PREF["Fonts_Graph_Name"]="Sans Serif";
|
||||||
PREF["Fonts_Graph_Size"]=10;
|
PREF["Fonts_Graph_Size"]=10;
|
||||||
PREF["Fonts_Graph_Bold"]=false;
|
PREF["Fonts_Graph_Bold"]=false;
|
||||||
PREF["Fonts_Graph_Italic"]=false;
|
PREF["Fonts_Graph_Italic"]=false;
|
||||||
}
|
}
|
||||||
if (!PREF.Exists("Fonts_Title_Name")) {
|
if (!PREF.contains("Fonts_Title_Name")) {
|
||||||
PREF["Fonts_Title_Name"]="Serif";
|
PREF["Fonts_Title_Name"]="Serif";
|
||||||
PREF["Fonts_Title_Size"]=11;
|
PREF["Fonts_Title_Size"]=11;
|
||||||
PREF["Fonts_Title_Bold"]=true;
|
PREF["Fonts_Title_Bold"]=true;
|
||||||
PREF["Fonts_Title_Italic"]=false;
|
PREF["Fonts_Title_Italic"]=false;
|
||||||
}
|
}
|
||||||
if (!PREF.Exists("Fonts_Big_Name")) {
|
if (!PREF.contains("Fonts_Big_Name")) {
|
||||||
PREF["Fonts_Big_Name"]="Serif";
|
PREF["Fonts_Big_Name"]="Serif";
|
||||||
PREF["Fonts_Big_Size"]=35;
|
PREF["Fonts_Big_Size"]=35;
|
||||||
PREF["Fonts_Big_Bold"]=false;
|
PREF["Fonts_Big_Bold"]=false;
|
||||||
@ -2518,7 +2518,7 @@ void gGraphView::paintGL()
|
|||||||
if (m_fadingOut) {
|
if (m_fadingOut) {
|
||||||
// bindTexture(previous_day_snapshot);
|
// bindTexture(previous_day_snapshot);
|
||||||
} else if (m_fadingIn) {
|
} else if (m_fadingIn) {
|
||||||
int offset,offset2;
|
//int offset,offset2;
|
||||||
float aphase;
|
float aphase;
|
||||||
aphase=1.0-phase;
|
aphase=1.0-phase;
|
||||||
/*if (m_fadedir) { // forwards
|
/*if (m_fadedir) { // forwards
|
||||||
@ -2532,7 +2532,7 @@ void gGraphView::paintGL()
|
|||||||
//offset=-width();
|
//offset=-width();
|
||||||
//offset2=0;//-width();
|
//offset2=0;//-width();
|
||||||
}*/
|
}*/
|
||||||
offset=0; offset2=0;
|
//offset=0; offset2=0;
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
@ -2733,7 +2733,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
m_graphs[i]->mouseMoveEvent(&e);
|
m_graphs[i]->mouseMoveEvent(&e);
|
||||||
if (!m_button_down && (x<=titleWidth+(gYAxis::Margin-5))) {
|
if (!m_button_down && (x<=titleWidth+(gYAxis::Margin-5))) {
|
||||||
//qDebug() << "Hovering over" << m_graphs[i]->title();
|
//qDebug() << "Hovering over" << m_graphs[i]->title();
|
||||||
if (m_graphsbytitle["Event Flags"]==m_graphs[i]) {
|
if (m_graphsbytitle[STR_TR_EventFlags]==m_graphs[i]) {
|
||||||
QVector<Layer *> & layers=m_graphs[i]->layers();
|
QVector<Layer *> & layers=m_graphs[i]->layers();
|
||||||
gFlagsGroup *fg;
|
gFlagsGroup *fg;
|
||||||
for (int i=0;i<layers.size();i++) {
|
for (int i=0;i<layers.size();i++) {
|
||||||
|
@ -504,7 +504,7 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
|
|||||||
case ST_MAX: b="Max"; break;
|
case ST_MAX: b="Max"; break;
|
||||||
case ST_CPH: b=""; break;
|
case ST_CPH: b=""; break;
|
||||||
case ST_SPH: b="%"; break;
|
case ST_SPH: b="%"; break;
|
||||||
case ST_HOURS: b="Hours"; break;
|
case ST_HOURS: b=STR_UNIT_Hours; break;
|
||||||
case ST_SESSIONS: b="Sessions"; break;
|
case ST_SESSIONS: b="Sessions"; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -692,7 +692,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
|
|||||||
case ST_MAX: a="Max"; break;
|
case ST_MAX: a="Max"; break;
|
||||||
case ST_CPH: a=""; break;
|
case ST_CPH: a=""; break;
|
||||||
case ST_SPH: a="%"; break;
|
case ST_SPH: a="%"; break;
|
||||||
case ST_HOURS: a="Hours"; break;
|
case ST_HOURS: a=STR_UNIT_Hours; break;
|
||||||
case ST_SESSIONS: a="Sessions"; break;
|
case ST_SESSIONS: a="Sessions"; break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -271,5 +271,6 @@ const QString gYAxisTime::Format(EventDataType v, int dp)
|
|||||||
|
|
||||||
const QString gYAxisWeight::Format(EventDataType v, int dp)
|
const QString gYAxisWeight::Format(EventDataType v, int dp)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(dp)
|
||||||
return weightString(v,m_unitsystem);
|
return weightString(v,m_unitsystem);
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ int filterFlow(Session *session, EventList *in, EventList *out, EventList *tv, E
|
|||||||
int calcRespRate(Session *session)
|
int calcRespRate(Session *session)
|
||||||
{
|
{
|
||||||
if (session->machine()->GetType()!=MT_CPAP) return 0;
|
if (session->machine()->GetType()!=MT_CPAP) return 0;
|
||||||
if (session->machine()->GetClass()!="PRS1") return 0;
|
if (session->machine()->GetClass()!=STR_MACH_PRS1) return 0;
|
||||||
if (!session->eventlist.contains(CPAP_FlowRate))
|
if (!session->eventlist.contains(CPAP_FlowRate))
|
||||||
return 0; //need flow waveform
|
return 0; //need flow waveform
|
||||||
|
|
||||||
@ -511,7 +511,6 @@ int calcPulseChange(Session *session)
|
|||||||
|
|
||||||
EventDataType val,val2,change,tmp;
|
EventDataType val,val2,change,tmp;
|
||||||
qint64 time,time2;
|
qint64 time,time2;
|
||||||
bool ok;
|
|
||||||
qint64 window=PROFILE.oxi->pulseChangeDuration();
|
qint64 window=PROFILE.oxi->pulseChangeDuration();
|
||||||
window*=1000;
|
window*=1000;
|
||||||
|
|
||||||
@ -579,7 +578,6 @@ int calcSPO2Drop(Session *session)
|
|||||||
|
|
||||||
EventDataType val,val2,change,tmp;
|
EventDataType val,val2,change,tmp;
|
||||||
qint64 time,time2;
|
qint64 time,time2;
|
||||||
bool ok;
|
|
||||||
qint64 window=PROFILE.oxi->spO2DropDuration();
|
qint64 window=PROFILE.oxi->spO2DropDuration();
|
||||||
window*=1000;
|
window*=1000;
|
||||||
change=PROFILE.oxi->spO2DropPercentage();
|
change=PROFILE.oxi->spO2DropPercentage();
|
||||||
|
@ -17,10 +17,43 @@ const QString STR_UNIT_FOOT=QObject::tr("ft");
|
|||||||
const QString STR_UNIT_POUND=QObject::tr("lb");
|
const QString STR_UNIT_POUND=QObject::tr("lb");
|
||||||
const QString STR_UNIT_OUNCE=QObject::tr("oz");
|
const QString STR_UNIT_OUNCE=QObject::tr("oz");
|
||||||
const QString STR_UNIT_KG=QObject::tr("Kg");
|
const QString STR_UNIT_KG=QObject::tr("Kg");
|
||||||
|
const QString STR_UNIT_CMH2O=QObject::tr("cmH2O");
|
||||||
|
const QString STR_UNIT_Hours=QObject::tr("Hours");
|
||||||
|
|
||||||
const QString STR_MESSAGE_ERROR=QObject::tr("Error");
|
const QString STR_MESSAGE_ERROR=QObject::tr("Error");
|
||||||
const QString STR_MESSAGE_WARNING=QObject::tr("Warning");
|
const QString STR_MESSAGE_WARNING=QObject::tr("Warning");
|
||||||
|
|
||||||
|
const QString STR_GEN_Profile="Profile";
|
||||||
|
const QString STR_GEN_SkipLogin="SkipLoginScreen";
|
||||||
|
const QString STR_GEN_UpdatesLastChecked="UpdatesLastChecked";
|
||||||
|
const QString STR_GEN_UpdatesAutoCheck="Updates_AutoCheck";
|
||||||
|
const QString STR_GEN_UpdateCheckFrequency="Updates_CheckFrequency";
|
||||||
|
const QString STR_GEN_DataFolder="DataFolder";
|
||||||
|
|
||||||
|
const QString STR_GEN_On=QObject::tr("On");
|
||||||
|
const QString STR_GEN_Off=QObject::tr("Off");
|
||||||
|
|
||||||
|
const QString STR_PROP_Brand="Brand";
|
||||||
|
const QString STR_PROP_Model="Model";
|
||||||
|
const QString STR_PROP_ModelNumber="ModelNumber";
|
||||||
|
const QString STR_PROP_SubModel="SubModel";
|
||||||
|
const QString STR_PROP_Serial="Serial";
|
||||||
|
const QString STR_PROP_DataVersion="DataVersion";
|
||||||
|
|
||||||
|
const QString STR_MACH_ResMed="ResMed";
|
||||||
|
const QString STR_MACH_PRS1="PRS1";
|
||||||
|
const QString STR_MACH_Journal="Journal";
|
||||||
|
const QString STR_MACH_Intellipap="Intellipap";
|
||||||
|
const QString STR_MACH_CMS50="CMS50";
|
||||||
|
const QString STR_MACH_ZEO="Zeo";
|
||||||
|
|
||||||
|
const QString STR_TR_BMI=QObject::tr("BMI");
|
||||||
|
const QString STR_TR_Weight=QObject::tr("Weight");
|
||||||
|
|
||||||
|
const QString STR_TR_Daily=QObject::tr("Daily");
|
||||||
|
const QString STR_TR_Overview=QObject::tr("Overview");
|
||||||
|
const QString STR_TR_Oximetry=QObject::tr("Oximetry");
|
||||||
|
|
||||||
|
const QString STR_TR_EventFlags=QObject::tr("Event Flags");
|
||||||
|
|
||||||
#endif // COMMON_H
|
#endif // COMMON_H
|
||||||
|
@ -322,11 +322,11 @@ Machine *CMS50Loader::CreateMachine(Profile *profile)
|
|||||||
|
|
||||||
Machine *m=new Oximeter(profile,0);
|
Machine *m=new Oximeter(profile,0);
|
||||||
m->SetClass(cms50_class_name);
|
m->SetClass(cms50_class_name);
|
||||||
m->properties["Brand"]="Contec";
|
m->properties[STR_PROP_Brand]="Contec";
|
||||||
m->properties["Model"]="CMS50X";
|
m->properties[STR_PROP_Model]="CMS50X";
|
||||||
QString a;
|
QString a;
|
||||||
a.sprintf("%i",cms50_data_version);
|
a.sprintf("%i",cms50_data_version);
|
||||||
m->properties["DataVersion"]=a;
|
m->properties[STR_PROP_DataVersion]=a;
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
@ -21,8 +21,8 @@ Intellipap::Intellipap(Profile *p,MachineID id)
|
|||||||
:CPAP(p,id)
|
:CPAP(p,id)
|
||||||
{
|
{
|
||||||
m_class=intellipap_class_name;
|
m_class=intellipap_class_name;
|
||||||
properties["Brand"]="DeVilbiss";
|
properties[STR_PROP_Brand]="DeVilbiss";
|
||||||
properties["Model"]="Intellipap";
|
properties[STR_PROP_Model]=STR_MACH_Intellipap;
|
||||||
}
|
}
|
||||||
|
|
||||||
Intellipap::~Intellipap()
|
Intellipap::~Intellipap()
|
||||||
@ -67,8 +67,8 @@ int IntellipapLoader::Open(QString & path,Profile *profile)
|
|||||||
QTextStream tstream(&f);
|
QTextStream tstream(&f);
|
||||||
|
|
||||||
QHash<QString,QString> lookup;
|
QHash<QString,QString> lookup;
|
||||||
lookup["Sn"]="Serial";
|
lookup["Sn"]=STR_PROP_Serial;
|
||||||
lookup["Mn"]="Model";
|
lookup["Mn"]=STR_PROP_Model;
|
||||||
lookup["Mo"]="PAPMode"; // 0=cpap, 1=auto
|
lookup["Mo"]="PAPMode"; // 0=cpap, 1=auto
|
||||||
//lookup["Pn"]="Pn";
|
//lookup["Pn"]="Pn";
|
||||||
lookup["Pu"]="MaxPressure";
|
lookup["Pu"]="MaxPressure";
|
||||||
@ -125,8 +125,8 @@ int IntellipapLoader::Open(QString & path,Profile *profile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Machine *mach=NULL;
|
Machine *mach=NULL;
|
||||||
if (set1.contains("Serial")) {
|
if (set1.contains(STR_PROP_Serial)) {
|
||||||
mach=CreateMachine(set1["Serial"],profile);
|
mach=CreateMachine(set1[STR_PROP_Serial],profile);
|
||||||
}
|
}
|
||||||
if (!mach) {
|
if (!mach) {
|
||||||
qDebug() << "Couldn't get Intellipap machine record";
|
qDebug() << "Couldn't get Intellipap machine record";
|
||||||
@ -332,7 +332,7 @@ int IntellipapLoader::Open(QString & path,Profile *profile)
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mach->properties["DataVersion"]=QString().sprintf("%i",intellipap_data_version);
|
mach->properties[STR_PROP_DataVersion]=QString().sprintf("%i",intellipap_data_version);
|
||||||
|
|
||||||
mach->Save();
|
mach->Save();
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ Machine *IntellipapLoader::CreateMachine(QString serial,Profile *profile)
|
|||||||
bool found=false;
|
bool found=false;
|
||||||
QList<Machine *>::iterator i;
|
QList<Machine *>::iterator i;
|
||||||
for (i=ml.begin(); i!=ml.end(); i++) {
|
for (i=ml.begin(); i!=ml.end(); i++) {
|
||||||
if (((*i)->GetClass()==intellipap_class_name) && ((*i)->properties["Serial"]==serial)) {
|
if (((*i)->GetClass()==intellipap_class_name) && ((*i)->properties[STR_PROP_Serial]==serial)) {
|
||||||
MachList[serial]=*i; //static_cast<CPAP *>(*i);
|
MachList[serial]=*i; //static_cast<CPAP *>(*i);
|
||||||
found=true;
|
found=true;
|
||||||
break;
|
break;
|
||||||
@ -368,7 +368,7 @@ Machine *IntellipapLoader::CreateMachine(QString serial,Profile *profile)
|
|||||||
MachList[serial]=m;
|
MachList[serial]=m;
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
m->properties["Serial"]=serial;
|
m->properties[STR_PROP_Serial]=serial;
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
const int intellipap_load_buffer_size=1024*1024;
|
const int intellipap_load_buffer_size=1024*1024;
|
||||||
|
|
||||||
|
|
||||||
const QString intellipap_class_name="Intellipap";
|
const QString intellipap_class_name=STR_MACH_Intellipap;
|
||||||
|
|
||||||
/*! \class IntellipapLoader
|
/*! \class IntellipapLoader
|
||||||
\brief Loader for DeVilbiss Intellipap Auto data
|
\brief Loader for DeVilbiss Intellipap Auto data
|
||||||
|
@ -96,8 +96,8 @@ crc_t CRC16(const unsigned char *data, size_t data_len)
|
|||||||
PRS1::PRS1(Profile *p,MachineID id):CPAP(p,id)
|
PRS1::PRS1(Profile *p,MachineID id):CPAP(p,id)
|
||||||
{
|
{
|
||||||
m_class=prs1_class_name;
|
m_class=prs1_class_name;
|
||||||
properties["Brand"]="Philips Respironics";
|
properties[STR_PROP_Brand]="Philips Respironics";
|
||||||
properties["Model"]="System One";
|
properties[STR_PROP_Model]="System One";
|
||||||
|
|
||||||
}
|
}
|
||||||
PRS1::~PRS1()
|
PRS1::~PRS1()
|
||||||
@ -137,7 +137,7 @@ Machine *PRS1Loader::CreateMachine(QString serial,Profile *profile)
|
|||||||
bool found=false;
|
bool found=false;
|
||||||
QList<Machine *>::iterator i;
|
QList<Machine *>::iterator i;
|
||||||
for (i=ml.begin(); i!=ml.end(); i++) {
|
for (i=ml.begin(); i!=ml.end(); i++) {
|
||||||
if (((*i)->GetClass()=="PRS1") && ((*i)->properties["Serial"]==serial)) {
|
if (((*i)->GetClass()==STR_MACH_PRS1) && ((*i)->properties[STR_PROP_Serial]==serial)) {
|
||||||
PRS1List[serial]=*i; //static_cast<CPAP *>(*i);
|
PRS1List[serial]=*i; //static_cast<CPAP *>(*i);
|
||||||
found=true;
|
found=true;
|
||||||
break;
|
break;
|
||||||
@ -151,7 +151,7 @@ Machine *PRS1Loader::CreateMachine(QString serial,Profile *profile)
|
|||||||
PRS1List[serial]=m;
|
PRS1List[serial]=m;
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
m->properties["Serial"]=serial;
|
m->properties[STR_PROP_Serial]=serial;
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
bool isdigit(QChar c)
|
bool isdigit(QChar c)
|
||||||
@ -250,10 +250,10 @@ bool PRS1Loader::ParseProperties(Machine *m,QString filename)
|
|||||||
int i=pt.toInt(&ok,16);
|
int i=pt.toInt(&ok,16);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (ModelMap.find(i)!=ModelMap.end()) {
|
if (ModelMap.find(i)!=ModelMap.end()) {
|
||||||
m->properties["SubModel"]=ModelMap[i];
|
m->properties[STR_PROP_SubModel]=ModelMap[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (prop["SerialNumber"]!=m->properties["Serial"]) {
|
if (prop["SerialNumber"]!=m->properties[STR_PROP_Serial]) {
|
||||||
qDebug() << "Serial Number in PRS1 properties.txt doesn't match directory structure";
|
qDebug() << "Serial Number in PRS1 properties.txt doesn't match directory structure";
|
||||||
} else prop.erase(prop.find("SerialNumber")); // already got it stored.
|
} else prop.erase(prop.find("SerialNumber")); // already got it stored.
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ int PRS1Loader::OpenMachine(Machine *m,QString path,Profile *profile)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m->properties["DataVersion"]=QString().sprintf("%i",prs1_data_version);
|
m->properties[STR_PROP_DataVersion]=QString().sprintf("%i",prs1_data_version);
|
||||||
m->properties["LastImported"]=QDateTime::currentDateTime().toString(Qt::ISODate);
|
m->properties["LastImported"]=QDateTime::currentDateTime().toString(Qt::ISODate);
|
||||||
m->Save(); // Save any new sessions to disk in our format
|
m->Save(); // Save any new sessions to disk in our format
|
||||||
if (qprogress) qprogress->setValue(100);
|
if (qprogress) qprogress->setValue(100);
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
const int max_load_buffer_size=1024*1024;
|
const int max_load_buffer_size=1024*1024;
|
||||||
|
|
||||||
|
|
||||||
const QString prs1_class_name="PRS1";
|
const QString prs1_class_name=STR_MACH_PRS1;
|
||||||
|
|
||||||
/*! \class PRS1Loader
|
/*! \class PRS1Loader
|
||||||
\brief Philips Respironics System One Loader Module
|
\brief Philips Respironics System One Loader Module
|
||||||
|
@ -222,7 +222,7 @@ Machine *ResmedLoader::CreateMachine(QString serial,Profile *profile)
|
|||||||
bool found=false;
|
bool found=false;
|
||||||
QList<Machine *>::iterator i;
|
QList<Machine *>::iterator i;
|
||||||
for (i=ml.begin(); i!=ml.end(); i++) {
|
for (i=ml.begin(); i!=ml.end(); i++) {
|
||||||
if (((*i)->GetClass()==resmed_class_name) && ((*i)->properties["Serial"]==serial)) {
|
if (((*i)->GetClass()==resmed_class_name) && ((*i)->properties[STR_PROP_Serial]==serial)) {
|
||||||
ResmedList[serial]=*i; //static_cast<CPAP *>(*i);
|
ResmedList[serial]=*i; //static_cast<CPAP *>(*i);
|
||||||
found=true;
|
found=true;
|
||||||
break;
|
break;
|
||||||
@ -237,11 +237,11 @@ Machine *ResmedLoader::CreateMachine(QString serial,Profile *profile)
|
|||||||
ResmedList[serial]=m;
|
ResmedList[serial]=m;
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
m->properties["Serial"]=serial;
|
m->properties[STR_PROP_Serial]=serial;
|
||||||
m->properties["Brand"]="ResMed";
|
m->properties[STR_PROP_Brand]=STR_MACH_ResMed;
|
||||||
QString a;
|
QString a;
|
||||||
a.sprintf("%i",resmed_data_version);
|
a.sprintf("%i",resmed_data_version);
|
||||||
m->properties["DataVersion"]=a;
|
m->properties[STR_PROP_DataVersion]=a;
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
|
||||||
@ -375,12 +375,12 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
qDebug() << "edf Serial number doesn't match STR.edf!";
|
qDebug() << "edf Serial number doesn't match STR.edf!";
|
||||||
}
|
}
|
||||||
} else if (i.key()=="PNA") {
|
} else if (i.key()=="PNA") {
|
||||||
//m->properties["Model"]=""; //i.value();
|
//m->properties[STR_PROP_Model]=""; //i.value();
|
||||||
} else if (i.key()=="PCD") {
|
} else if (i.key()=="PCD") {
|
||||||
bool ok;
|
bool ok;
|
||||||
int j=i.value().toInt(&ok);
|
int j=i.value().toInt(&ok);
|
||||||
if (RMS9ModelMap.find(j)!=RMS9ModelMap.end()) {
|
if (RMS9ModelMap.find(j)!=RMS9ModelMap.end()) {
|
||||||
m->properties["Model"]=RMS9ModelMap[j];
|
m->properties[STR_PROP_Model]=RMS9ModelMap[j];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m->properties[i.key()]=i.value();
|
m->properties[i.key()]=i.value();
|
||||||
@ -424,19 +424,19 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
} else mode=0;
|
} else mode=0;
|
||||||
|
|
||||||
// AutoSV machines don't have both fields
|
// AutoSV machines don't have both fields
|
||||||
sig=stredf.lookupSignal("EPR");
|
sig=stredf.lookupSignal(RMS9_EPR);
|
||||||
if (sig) {
|
if (sig) {
|
||||||
sess->settings[RMS9_EPR]=sig->data[dn];
|
sess->settings[RMS9_EPR]=sig->data[dn];
|
||||||
}
|
}
|
||||||
|
|
||||||
sig=stredf.lookupSignal("EPRLevel");
|
sig=stredf.lookupSignal(RMS9_EPRSet);
|
||||||
if (sig) {
|
if (sig) {
|
||||||
sess->settings[RMS9_EPRSet]=sig->data[dn];
|
sess->settings[RMS9_EPRSet]=sig->data[dn];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode==0) {
|
if (mode==0) {
|
||||||
sess->settings[CPAP_Mode]=MODE_CPAP;
|
sess->settings[CPAP_Mode]=MODE_CPAP;
|
||||||
sig=stredf.lookupSignal("Set Pressure");
|
sig=stredf.lookupSignal("Set Pressure"); // ?? What's meant by Set Pressure?
|
||||||
if (sig) {
|
if (sig) {
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
sess->settings[CPAP_PressureMin]=pressure;
|
sess->settings[CPAP_PressureMin]=pressure;
|
||||||
@ -453,13 +453,13 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
sess->settings[CPAP_Mode]=MODE_APAP;
|
sess->settings[CPAP_Mode]=MODE_APAP;
|
||||||
|
|
||||||
}
|
}
|
||||||
sig=stredf.lookupSignal("Min Pressure");
|
sig=stredf.lookupSignal(CPAP_PressureMin);
|
||||||
if (sig) {
|
if (sig) {
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
sess->settings[CPAP_PressureMin]=pressure;
|
sess->settings[CPAP_PressureMin]=pressure;
|
||||||
sess->setMin(CPAP_Pressure,pressure);
|
sess->setMin(CPAP_Pressure,pressure);
|
||||||
}
|
}
|
||||||
sig=stredf.lookupSignal("Max Pressure");
|
sig=stredf.lookupSignal(CPAP_PressureMax);
|
||||||
if (sig) {
|
if (sig) {
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
sess->settings[CPAP_PressureMax]=pressure;
|
sess->settings[CPAP_PressureMax]=pressure;
|
||||||
@ -882,10 +882,10 @@ void ResInitModelMap()
|
|||||||
resmed_codes["Set Pressure"].push_back("Eingest. Druck");
|
resmed_codes["Set Pressure"].push_back("Eingest. Druck");
|
||||||
resmed_codes["Set Pressure"].push_back("Set Pressure"); // Prescription
|
resmed_codes["Set Pressure"].push_back("Set Pressure"); // Prescription
|
||||||
resmed_codes["Set Pressure"].push_back("Pres. prescrite");
|
resmed_codes["Set Pressure"].push_back("Pres. prescrite");
|
||||||
resmed_codes["EPR"].push_back("EPR");
|
resmed_codes[RMS9_EPR].push_back("EPR");
|
||||||
resmed_codes["EPRLevel"].push_back("EPR Level");
|
resmed_codes[RMS9_EPRSet].push_back("EPR Level");
|
||||||
resmed_codes["EPRLevel"].push_back("EPR-Stufe");
|
resmed_codes[RMS9_EPRSet].push_back("EPR-Stufe");
|
||||||
resmed_codes["EPRLevel"].push_back("Niveau EPR");
|
resmed_codes[RMS9_EPRSet].push_back("Niveau EPR");
|
||||||
resmed_codes[CPAP_PressureMax].push_back("Max Pressure");
|
resmed_codes[CPAP_PressureMax].push_back("Max Pressure");
|
||||||
resmed_codes[CPAP_PressureMax].push_back("Max. Druck");
|
resmed_codes[CPAP_PressureMax].push_back("Max. Druck");
|
||||||
resmed_codes[CPAP_PressureMax].push_back("Pression max.");
|
resmed_codes[CPAP_PressureMax].push_back("Pression max.");
|
||||||
|
@ -24,7 +24,7 @@ const int resmed_data_version=5;
|
|||||||
//
|
//
|
||||||
//********************************************************************************************
|
//********************************************************************************************
|
||||||
|
|
||||||
const QString resmed_class_name="ResMed";
|
const QString resmed_class_name=STR_MACH_ResMed;
|
||||||
|
|
||||||
/*! \struct EDFHeader
|
/*! \struct EDFHeader
|
||||||
\brief Represents the EDF+ header structure, used as a place holder while processing the text data.
|
\brief Represents the EDF+ header structure, used as a place holder while processing the text data.
|
||||||
|
@ -73,11 +73,11 @@ Machine *ZEOLoader::CreateMachine(Profile *profile)
|
|||||||
|
|
||||||
Machine *m=new SleepStage(profile,0);
|
Machine *m=new SleepStage(profile,0);
|
||||||
m->SetClass(zeo_class_name);
|
m->SetClass(zeo_class_name);
|
||||||
m->properties["Brand"]="ZEO";
|
m->properties[STR_PROP_Brand]="ZEO";
|
||||||
m->properties["Model"]="Personal Sleep Coach";
|
m->properties[STR_PROP_Model]="Personal Sleep Coach";
|
||||||
QString s;
|
QString s;
|
||||||
s.sprintf("%i",zeo_data_version);
|
s.sprintf("%i",zeo_data_version);
|
||||||
m->properties["DataVersion"]=s;
|
m->properties[STR_PROP_DataVersion]=s;
|
||||||
|
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ bool Machine::Purge(int secret)
|
|||||||
|
|
||||||
|
|
||||||
// It would be joyous if this function screwed up..
|
// It would be joyous if this function screwed up..
|
||||||
QString path=profile->Get("DataFolder")+"/"+hexid();
|
QString path=profile->Get(STR_GEN_DataFolder)+"/"+hexid();
|
||||||
|
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ const quint32 channel_version=1;
|
|||||||
|
|
||||||
bool Machine::Load()
|
bool Machine::Load()
|
||||||
{
|
{
|
||||||
QString path=profile->Get("DataFolder")+"/"+hexid();
|
QString path=profile->Get(STR_GEN_DataFolder)+"/"+hexid();
|
||||||
|
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
qDebug() << "Loading " << path;
|
qDebug() << "Loading " << path;
|
||||||
@ -272,7 +272,7 @@ bool Machine::Load()
|
|||||||
}
|
}
|
||||||
bool Machine::SaveSession(Session *sess)
|
bool Machine::SaveSession(Session *sess)
|
||||||
{
|
{
|
||||||
QString path=profile->Get("DataFolder")+"/"+hexid();
|
QString path=profile->Get(STR_GEN_DataFolder)+"/"+hexid();
|
||||||
if (sess->IsChanged()) sess->Store(path);
|
if (sess->IsChanged()) sess->Store(path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ bool Machine::Save()
|
|||||||
//int size;
|
//int size;
|
||||||
int cnt=0;
|
int cnt=0;
|
||||||
|
|
||||||
QString path=profile->Get("DataFolder")+"/"+hexid();
|
QString path=profile->Get(STR_GEN_DataFolder)+"/"+hexid();
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
dir.mkdir(path);
|
dir.mkdir(path);
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Returns true if preference 'name' exists
|
//! \brief Returns true if preference 'name' exists
|
||||||
bool Exists(QString name) {
|
bool contains(QString name) {
|
||||||
return (p_preferences.contains(name));
|
return (p_preferences.contains(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ Profile * p_profile;
|
|||||||
Profile::Profile()
|
Profile::Profile()
|
||||||
:Preferences(),is_first_day(true)
|
:Preferences(),is_first_day(true)
|
||||||
{
|
{
|
||||||
p_name="Profile";
|
p_name=STR_GEN_Profile;
|
||||||
p_path=PREF.Get("{home}/Profiles");
|
p_path=PREF.Get("{home}/Profiles");
|
||||||
machlist.clear();
|
machlist.clear();
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ Profile::Profile(QString path)
|
|||||||
:Preferences(),is_first_day(true)
|
:Preferences(),is_first_day(true)
|
||||||
{
|
{
|
||||||
const QString xmlext=".xml";
|
const QString xmlext=".xml";
|
||||||
p_name="Profile";
|
p_name=STR_GEN_Profile;
|
||||||
if (path.isEmpty()) p_path=GetAppRoot();
|
if (path.isEmpty()) p_path=GetAppRoot();
|
||||||
else p_path=path;
|
else p_path=path;
|
||||||
(*this)["DataFolder"]=p_path;
|
(*this)[STR_GEN_DataFolder]=p_path;
|
||||||
if (!p_path.endsWith("/")) p_path+="/";
|
if (!p_path.endsWith("/")) p_path+="/";
|
||||||
p_filename=p_path+p_name+xmlext;
|
p_filename=p_path+p_name+xmlext;
|
||||||
machlist.clear();
|
machlist.clear();
|
||||||
@ -123,7 +123,7 @@ Profile::~Profile()
|
|||||||
void Profile::DataFormatError(Machine *m)
|
void Profile::DataFormatError(Machine *m)
|
||||||
{
|
{
|
||||||
QString msg=QObject::tr("Software changes have been made that require the reimporting of the following machines data:\n\n");
|
QString msg=QObject::tr("Software changes have been made that require the reimporting of the following machines data:\n\n");
|
||||||
msg=msg+m->properties["Brand"]+" "+m->properties["Model"]+" "+m->properties["Serial"];
|
msg=msg+m->properties[STR_PROP_Brand]+" "+m->properties[STR_PROP_Model]+" "+m->properties[STR_PROP_Serial];
|
||||||
msg=msg+QObject::tr("\n\nThis is still only alpha software and these changes are sometimes necessary.\n\n");
|
msg=msg+QObject::tr("\n\nThis is still only alpha software and these changes are sometimes necessary.\n\n");
|
||||||
msg=msg+QObject::tr("I can automatically purge this data for you, or you can cancel now and continue to run in a previous version.\n\n");
|
msg=msg+QObject::tr("I can automatically purge this data for you, or you can cancel now and continue to run in a previous version.\n\n");
|
||||||
msg=msg+QObject::tr("Would you like me to purge this data this for you so you can run the new version?");
|
msg=msg+QObject::tr("Would you like me to purge this data this for you so you can run the new version?");
|
||||||
@ -132,7 +132,7 @@ void Profile::DataFormatError(Machine *m)
|
|||||||
|
|
||||||
if (!m->Purge(3478216)) { // Do not copy this line without thinking.. You will be eaten by a Grue if you do
|
if (!m->Purge(3478216)) { // Do not copy this line without thinking.. You will be eaten by a Grue if you do
|
||||||
|
|
||||||
QMessageBox::critical(NULL,QObject::tr("Purge Failed"),QObject::tr("Sorry, I could not purge this data, which means this version of SleepyHead can't start.. SleepyHead's Data folder needs to be removed manually\n\nThis folder currently resides at the following location:\n")+PREF["DataFolder"].toString(),QMessageBox::Ok);
|
QMessageBox::critical(NULL,QObject::tr("Purge Failed"),QObject::tr("Sorry, I could not purge this data, which means this version of SleepyHead can't start.. SleepyHead's Data folder needs to be removed manually\n\nThis folder currently resides at the following location:\n")+PREF[STR_GEN_DataFolder].toString(),QMessageBox::Ok);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -175,17 +175,17 @@ void Profile::LoadMachineData()
|
|||||||
if (loader) {
|
if (loader) {
|
||||||
long v=loader->Version();
|
long v=loader->Version();
|
||||||
long cv=0;
|
long cv=0;
|
||||||
if (m->properties.find("DataVersion")==m->properties.end()) {
|
if (m->properties.find(STR_PROP_DataVersion)==m->properties.end()) {
|
||||||
m->properties["DataVersion"]="0";
|
m->properties[STR_PROP_DataVersion]="0";
|
||||||
}
|
}
|
||||||
bool ok;
|
bool ok;
|
||||||
cv=m->properties["DataVersion"].toLong(&ok);
|
cv=m->properties[STR_PROP_DataVersion].toLong(&ok);
|
||||||
if (!ok || cv<v) {
|
if (!ok || cv<v) {
|
||||||
DataFormatError(m);
|
DataFormatError(m);
|
||||||
// It may exit above and not return here..
|
// It may exit above and not return here..
|
||||||
QString s;
|
QString s;
|
||||||
s.sprintf("%li",v);
|
s.sprintf("%li",v);
|
||||||
m->properties["DataVersion"]=s; // Dont need to nag again if they are too lazy.
|
m->properties[STR_PROP_DataVersion]=s; // Dont need to nag again if they are too lazy.
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
m->Load();
|
m->Load();
|
||||||
@ -466,14 +466,14 @@ Profile *Create(QString name)
|
|||||||
Profile *prof=new Profile(path);
|
Profile *prof=new Profile(path);
|
||||||
prof->Open();
|
prof->Open();
|
||||||
profiles[name]=prof;
|
profiles[name]=prof;
|
||||||
prof->Set("Username",name);
|
prof->user->setUserName(name);
|
||||||
//prof->Set("Realname",realname);
|
//prof->Set("Realname",realname);
|
||||||
//if (!password.isEmpty()) prof->Set("Password",SHA1(password));
|
//if (!password.isEmpty()) prof.user->setPassword(password);
|
||||||
prof->Set("DataFolder","{home}/Profiles/{Username}");
|
prof->Set(STR_GEN_DataFolder,"{home}/Profiles/{Username}");
|
||||||
|
|
||||||
Machine *m=new Machine(prof,0);
|
Machine *m=new Machine(prof,0);
|
||||||
m->SetClass("Journal");
|
m->SetClass("Journal");
|
||||||
m->properties["Brand"]="Virtual";
|
m->properties[STR_PROP_Brand]="Virtual";
|
||||||
m->SetType(MT_JOURNAL);
|
m->SetType(MT_JOURNAL);
|
||||||
prof->AddMachine(m);
|
prof->AddMachine(m);
|
||||||
|
|
||||||
|
@ -242,6 +242,9 @@ public:
|
|||||||
void setLanguage(QString language) { (*m_profile)[UI_STR_Language]=language; }
|
void setLanguage(QString language) { (*m_profile)[UI_STR_Language]=language; }
|
||||||
void setDaylightSaving(bool ds) { (*m_profile)[UI_STR_DST]=ds; }
|
void setDaylightSaving(bool ds) { (*m_profile)[UI_STR_DST]=ds; }
|
||||||
|
|
||||||
|
bool hasPassword() {
|
||||||
|
return !((*m_profile)[UI_STR_Password].toString().isEmpty());
|
||||||
|
}
|
||||||
bool checkPassword(QString password) {
|
bool checkPassword(QString password) {
|
||||||
QByteArray ba=password.toUtf8();
|
QByteArray ba=password.toUtf8();
|
||||||
return ((*m_profile)[UI_STR_Password].toString()==QString(QCryptographicHash::hash(ba,QCryptographicHash::Sha1).toHex()));
|
return ((*m_profile)[UI_STR_Password].toString()==QString(QCryptographicHash::hash(ba,QCryptographicHash::Sha1).toHex()));
|
||||||
|
@ -123,7 +123,7 @@ void UpdaterWindow::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
|
|||||||
ui->tableWidget->item(current_row,2)->setText(QString::number(bytesTotal/1048576.0,'f',3)+"MB");
|
ui->tableWidget->item(current_row,2)->setText(QString::number(bytesTotal/1048576.0,'f',3)+"MB");
|
||||||
}
|
}
|
||||||
//ui->progressBar->setValue(f);
|
//ui->progressBar->setValue(f);
|
||||||
int elapsed=dltime.elapsed();
|
// int elapsed=dltime.elapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdaterWindow::requestFile()
|
void UpdaterWindow::requestFile()
|
||||||
@ -473,7 +473,7 @@ void UpdaterWindow::upgradeNext()
|
|||||||
ui->downloadTitle->setText(tr("Update Complete!"));
|
ui->downloadTitle->setText(tr("Update Complete!"));
|
||||||
ui->FinishedButton->setVisible(true);
|
ui->FinishedButton->setVisible(true);
|
||||||
ui->downloadLabel->setText(tr("Updates Complete. SleepyHead needs to restart now, click Finished to do so."));
|
ui->downloadLabel->setText(tr("Updates Complete. SleepyHead needs to restart now, click Finished to do so."));
|
||||||
PREF["Updates_LastChecked"]=QDateTime::currentDateTime();
|
PREF[STR_GEN_UpdatesLastChecked]=QDateTime::currentDateTime();
|
||||||
} else {
|
} else {
|
||||||
ui->downloadTitle->setText(tr("Update Failed :("));
|
ui->downloadTitle->setText(tr("Update Failed :("));
|
||||||
success=false;
|
success=false;
|
||||||
|
50
daily.cpp
50
daily.cpp
@ -89,7 +89,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
|||||||
layout->addWidget(scrollbar,0);
|
layout->addWidget(scrollbar,0);
|
||||||
|
|
||||||
int default_height=PROFILE.appearance->graphHeight();
|
int default_height=PROFILE.appearance->graphHeight();
|
||||||
SF=new gGraph(GraphView,tr("Event Flags"),tr("Event Flags"),default_height);
|
SF=new gGraph(GraphView,STR_TR_EventFlags,STR_TR_EventFlags,default_height);
|
||||||
FRW=new gGraph(GraphView,tr("Flow Rate"),schema::channel[CPAP_FlowRate].description()+"\n("+schema::channel[CPAP_FlowRate].units()+")",default_height);
|
FRW=new gGraph(GraphView,tr("Flow Rate"),schema::channel[CPAP_FlowRate].description()+"\n("+schema::channel[CPAP_FlowRate].units()+")",default_height);
|
||||||
AHI=new gGraph(GraphView,tr("AHI"),schema::channel[CPAP_AHI].description()+"\n("+schema::channel[CPAP_AHI].units()+")",default_height);
|
AHI=new gGraph(GraphView,tr("AHI"),schema::channel[CPAP_AHI].description()+"\n("+schema::channel[CPAP_AHI].units()+")",default_height);
|
||||||
MP=new gGraph(GraphView,tr("Mask Pressure"),schema::channel[CPAP_MaskPressure].description()+"\n("+schema::channel[CPAP_MaskPressure].units()+")",default_height);
|
MP=new gGraph(GraphView,tr("Mask Pressure"),schema::channel[CPAP_MaskPressure].description()+"\n("+schema::channel[CPAP_MaskPressure].units()+")",default_height);
|
||||||
@ -114,7 +114,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
|||||||
|
|
||||||
// Event Pie Chart (for snapshot purposes)
|
// Event Pie Chart (for snapshot purposes)
|
||||||
// TODO: Convert snapGV to generic for snapshotting multiple graphs (like reports does)
|
// TODO: Convert snapGV to generic for snapshotting multiple graphs (like reports does)
|
||||||
// TAP=new gGraph(GraphView,"Time@Pressure","cmH2O",100);
|
// TAP=new gGraph(GraphView,"Time@Pressure",STR_UNIT_CMH2O,100);
|
||||||
// TAP->showTitle(false);
|
// TAP->showTitle(false);
|
||||||
// gTAPGraph * tap=new gTAPGraph(CPAP_Pressure,GST_Line);
|
// gTAPGraph * tap=new gTAPGraph(CPAP_Pressure,GST_Line);
|
||||||
// TAP->AddLayer(AddCPAP(tap));
|
// TAP->AddLayer(AddCPAP(tap));
|
||||||
@ -679,26 +679,26 @@ void Daily::Load(QDate date)
|
|||||||
QString submodel; //=tr("Unknown Model");
|
QString submodel; //=tr("Unknown Model");
|
||||||
|
|
||||||
//html+="<tr><td colspan=4 align=center><i>"+tr("Machine Information")+"</i></td></tr>\n";
|
//html+="<tr><td colspan=4 align=center><i>"+tr("Machine Information")+"</i></td></tr>\n";
|
||||||
if (cpap->machine->properties.find("SubModel")!=cpap->machine->properties.end())
|
if (cpap->machine->properties.find(STR_PROP_SubModel)!=cpap->machine->properties.end())
|
||||||
submodel=" <br/>"+cpap->machine->properties["SubModel"];
|
submodel=" <br/>"+cpap->machine->properties[STR_PROP_SubModel];
|
||||||
html+="<tr><td colspan=4 align=center><b>"+cpap->machine->properties["Brand"]+"</b> <br>"+cpap->machine->properties["Model"]+" "+cpap->machine->properties["ModelNumber"]+submodel+"</td></tr>\n";
|
html+="<tr><td colspan=4 align=center><b>"+cpap->machine->properties[STR_PROP_Brand]+"</b> <br>"+cpap->machine->properties[STR_PROP_Model]+" "+cpap->machine->properties[STR_PROP_ModelNumber]+submodel+"</td></tr>\n";
|
||||||
if (PROFILE.session->showSerialNumbers()) {
|
if (PROFILE.session->showSerialNumbers()) {
|
||||||
html+="<tr><td colspan=4 align=center>"+cpap->machine->properties["Serial"]+"</td></tr>\n";
|
html+="<tr><td colspan=4 align=center>"+cpap->machine->properties[STR_PROP_Serial]+"</td></tr>\n";
|
||||||
}
|
}
|
||||||
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
||||||
html+="<tr><td colspan=4 align=center>Mode: ";
|
html+="<tr><td colspan=4 align=center>Mode: ";
|
||||||
|
|
||||||
EventDataType min=cpap->settings_min(CPAP_PressureMin);
|
EventDataType min=cpap->settings_min(CPAP_PressureMin);
|
||||||
EventDataType max=cpap->settings_max(CPAP_PressureMax);
|
EventDataType max=cpap->settings_max(CPAP_PressureMax);
|
||||||
if (mode==MODE_CPAP) html+=tr("CPAP")+" "+QString::number(min)+tr("cmH2O");
|
if (mode==MODE_CPAP) html+=tr("CPAP")+" "+QString::number(min)+STR_UNIT_CMH2O;
|
||||||
else if (mode==MODE_APAP) html+=tr("APAP")+" "+QString::number(min)+"-"+QString::number(max)+tr("cmH2O");
|
else if (mode==MODE_APAP) html+=tr("APAP")+" "+QString::number(min)+"-"+QString::number(max)+STR_UNIT_CMH2O;
|
||||||
else if (mode==MODE_BIPAP) html+=tr("Bi-Level");
|
else if (mode==MODE_BIPAP) html+=tr("Bi-Level");
|
||||||
else if (mode==MODE_ASV) html+=tr("ASV");
|
else if (mode==MODE_ASV) html+=tr("ASV");
|
||||||
else html+=tr("Unknown");
|
else html+=tr("Unknown");
|
||||||
html+="</td></tr>\n";
|
html+="</td></tr>\n";
|
||||||
|
|
||||||
|
|
||||||
html+="<tr><td align='center'><b>"+tr("Date")+"</b></td><td align='center'><b>"+tr("Sleep")+"</b></td><td align='center'><b>"+tr("Wake")+"</b></td><td align='center'><b>"+tr("Hours")+"</b></td></tr>";
|
html+="<tr><td align='center'><b>"+tr("Date")+"</b></td><td align='center'><b>"+tr("Sleep")+"</b></td><td align='center'><b>"+tr("Wake")+"</b></td><td align='center'><b>"+STR_UNIT_Hours+"</b></td></tr>";
|
||||||
int tt=qint64(cpap->total_time())/1000L;
|
int tt=qint64(cpap->total_time())/1000L;
|
||||||
QDateTime date=QDateTime::fromTime_t(cpap->first()/1000L);
|
QDateTime date=QDateTime::fromTime_t(cpap->first()/1000L);
|
||||||
QDateTime date2=QDateTime::fromTime_t(cpap->last()/1000L);
|
QDateTime date2=QDateTime::fromTime_t(cpap->last()/1000L);
|
||||||
@ -715,27 +715,27 @@ void Daily::Load(QDate date)
|
|||||||
|
|
||||||
QString cs;
|
QString cs;
|
||||||
if (!isBrick) {
|
if (!isBrick) {
|
||||||
if (cpap->machine->GetClass()=="ResMed") {
|
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
cs="4 width='100%' align=center>";
|
cs="4 width='100%' align=center>";
|
||||||
} else cs="2 width='50%'>";
|
} else cs="2 width='50%'>";
|
||||||
html+="<tr><td colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>"
|
html+="<tr><td colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>"
|
||||||
"<tr><td align='right' bgcolor='#F88017'><b><font color='black'><a href='nothing' title='"+schema::channel[CPAP_AHI].description()+"'>"+tr("AHI")+"</a></font></b></td><td width=20% bgcolor='#F88017'><b><font color='black'>"+QString().sprintf("%.2f",ahi)+"</font></b></td></tr>\n"
|
"<tr><td align='right' bgcolor='#F88017'><b><font color='black'><a href='nothing' title='"+schema::channel[CPAP_AHI].description()+"'>"+tr("AHI")+"</a></font></b></td><td width=20% bgcolor='#F88017'><b><font color='black'>"+QString().sprintf("%.2f",ahi)+"</font></b></td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#4040ff'><b><font color='white'> <a href='event="+CPAP_Hypopnea+"' title='"+schema::channel[CPAP_Hypopnea].description()+"'>"+tr("Hypopnea")+"</a></font></b></td><td bgcolor='#4040ff'><font color='white'>"+QString().sprintf("%.2f",hi)+"</font></td></tr>\n";
|
"<tr><td align='right' bgcolor='#4040ff'><b><font color='white'> <a href='event="+CPAP_Hypopnea+"' title='"+schema::channel[CPAP_Hypopnea].description()+"'>"+tr("Hypopnea")+"</a></font></b></td><td bgcolor='#4040ff'><font color='white'>"+QString().sprintf("%.2f",hi)+"</font></td></tr>\n";
|
||||||
if (cpap->machine->GetClass()=="ResMed") {
|
if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
html+="<tr><td align='right' bgcolor='#208020'><b> <a href='event="+CPAP_Apnea+"' title='"+schema::channel[CPAP_Apnea].description()+"'>"+tr("Unspecified Apnea")+"</a></b></td><td bgcolor='#208020'>"+QString().sprintf("%.2f",uai)+"</td></tr>\n";
|
html+="<tr><td align='right' bgcolor='#208020'><b> <a href='event="+CPAP_Apnea+"' title='"+schema::channel[CPAP_Apnea].description()+"'>"+tr("Unspecified Apnea")+"</a></b></td><td bgcolor='#208020'>"+QString().sprintf("%.2f",uai)+"</td></tr>\n";
|
||||||
}
|
}
|
||||||
html+="<tr><td align='right' bgcolor='#40afbf'><b> <a href='event="+CPAP_Obstructive+"' title='"+schema::channel[CPAP_Obstructive].description()+"'>"+tr("Obstructive")+"</a></b></td><td bgcolor='#40afbf'>"+QString().sprintf("%.2f",oai)+"</td></tr>\n"
|
html+="<tr><td align='right' bgcolor='#40afbf'><b> <a href='event="+CPAP_Obstructive+"' title='"+schema::channel[CPAP_Obstructive].description()+"'>"+tr("Obstructive")+"</a></b></td><td bgcolor='#40afbf'>"+QString().sprintf("%.2f",oai)+"</td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#b254cd'><b> <a href='event="+CPAP_ClearAirway+"' title='"+schema::channel[CPAP_ClearAirway].description()+"'>"+tr("Clear Airway")+"</a></b></td><td bgcolor='#b254cd'>"+QString().sprintf("%.2f",cai)+"</td></tr>\n"
|
"<tr><td align='right' bgcolor='#b254cd'><b> <a href='event="+CPAP_ClearAirway+"' title='"+schema::channel[CPAP_ClearAirway].description()+"'>"+tr("Clear Airway")+"</a></b></td><td bgcolor='#b254cd'>"+QString().sprintf("%.2f",cai)+"</td></tr>\n"
|
||||||
"</table></td>";
|
"</table></td>";
|
||||||
|
|
||||||
if (cpap->machine->GetClass()=="PRS1") {
|
if (cpap->machine->GetClass()==STR_MACH_PRS1) {
|
||||||
html+="<td colspan=2><table cellspacing=0 cellpadding=1 border=0 width='100%'>"
|
html+="<td colspan=2><table cellspacing=0 cellpadding=1 border=0 width='100%'>"
|
||||||
"<tr><td align='right' bgcolor='#ffff80'><b> <a href='event="+CPAP_RERA+"' title='"+schema::channel[CPAP_RERA].description()+"'>"+tr("RERA")+"</a></b></td><td width=20% bgcolor='#ffff80'>"+QString().sprintf("%.2f",rei)+"</td></tr>\n"
|
"<tr><td align='right' bgcolor='#ffff80'><b> <a href='event="+CPAP_RERA+"' title='"+schema::channel[CPAP_RERA].description()+"'>"+tr("RERA")+"</a></b></td><td width=20% bgcolor='#ffff80'>"+QString().sprintf("%.2f",rei)+"</td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#404040'><b> <font color='white'><a href='event="+CPAP_FlowLimit+"' title='"+schema::channel[CPAP_FlowLimit].description()+"'>"+tr("Flow Limit")+"</a></font></b></td><td bgcolor='#404040'><font color='white'>"+a.sprintf("%.2f",fli)+"</font></td></tr>\n"
|
"<tr><td align='right' bgcolor='#404040'><b> <font color='white'><a href='event="+CPAP_FlowLimit+"' title='"+schema::channel[CPAP_FlowLimit].description()+"'>"+tr("Flow Limit")+"</a></font></b></td><td bgcolor='#404040'><font color='white'>"+a.sprintf("%.2f",fli)+"</font></td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#ff4040'><b> <a href='event="+CPAP_VSnore+"'title=' "+schema::channel[CPAP_VSnore].description()+"'>"+tr("Vsnore")+"</a></b></td><td bgcolor='#ff4040'>"+QString().sprintf("%.2f",vsi)+"</td></tr>\n"
|
"<tr><td align='right' bgcolor='#ff4040'><b> <a href='event="+CPAP_VSnore+"'title=' "+schema::channel[CPAP_VSnore].description()+"'>"+tr("Vsnore")+"</a></b></td><td bgcolor='#ff4040'>"+QString().sprintf("%.2f",vsi)+"</td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#80ff80'><b> <a href='event="+CPAP_CSR+"' title='"+schema::channel[CPAP_CSR].description()+"'>"+tr("PB/CSR")+"</a></b></td><td bgcolor='#80ff80'>"+QString().sprintf("%.2f",csr)+"%</td></tr>\n"
|
"<tr><td align='right' bgcolor='#80ff80'><b> <a href='event="+CPAP_CSR+"' title='"+schema::channel[CPAP_CSR].description()+"'>"+tr("PB/CSR")+"</a></b></td><td bgcolor='#80ff80'>"+QString().sprintf("%.2f",csr)+"%</td></tr>\n"
|
||||||
"</table></td>";
|
"</table></td>";
|
||||||
} else if (cpap->machine->GetClass()=="Intellipap") {
|
} else if (cpap->machine->GetClass()==STR_MACH_Intellipap) {
|
||||||
html+="<td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>"
|
html+="<td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>"
|
||||||
"<tr><td align='right' bgcolor='#ffff80'><b> <a href='event="+CPAP_NRI+"'>"+tr("NRI")+"</a></b></td><td width=20% bgcolor='#ffff80'>"+QString().sprintf("%.2f",nri)+"</td></tr>\n"
|
"<tr><td align='right' bgcolor='#ffff80'><b> <a href='event="+CPAP_NRI+"'>"+tr("NRI")+"</a></b></td><td width=20% bgcolor='#ffff80'>"+QString().sprintf("%.2f",nri)+"</td></tr>\n"
|
||||||
"<tr><td align='right' bgcolor='#404040'><b> <font color='white'><a href='event="+CPAP_Leak+"'>"+tr("Leak Idx")+"</a></font></b></td><td bgcolor='#404040'><font color='white'>"+a.sprintf("%.2f",lki)+"</font></td></tr>\n"
|
"<tr><td align='right' bgcolor='#404040'><b> <font color='white'><a href='event="+CPAP_Leak+"'>"+tr("Leak Idx")+"</a></font></b></td><td bgcolor='#404040'><font color='white'>"+a.sprintf("%.2f",lki)+"</font></td></tr>\n"
|
||||||
@ -858,7 +858,7 @@ void Daily::Load(QDate date)
|
|||||||
html+="<tr><td colspan=4 align=center><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"></td></tr>\n";
|
html+="<tr><td colspan=4 align=center><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"></td></tr>\n";
|
||||||
} */
|
} */
|
||||||
html+="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
html+="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
||||||
if (cpap->machine->GetClass()=="PRS1") {
|
if (cpap->machine->GetClass()==STR_MACH_PRS1) {
|
||||||
int i=cpap->settings_max(PRS1_FlexMode);
|
int i=cpap->settings_max(PRS1_FlexMode);
|
||||||
int j=cpap->settings_max(PRS1_FlexSet);
|
int j=cpap->settings_max(PRS1_FlexSet);
|
||||||
QString flexstr=(i>1) ? schema::channel[PRS1_FlexMode].option(i)+" "+schema::channel[PRS1_FlexSet].option(j) : "None";
|
QString flexstr=(i>1) ? schema::channel[PRS1_FlexMode].option(i)+" "+schema::channel[PRS1_FlexSet].option(j) : "None";
|
||||||
@ -866,11 +866,11 @@ void Daily::Load(QDate date)
|
|||||||
html+="<tr><td colspan=4>"+tr("Pressure Relief:")+" "+flexstr+"</td></tr>";
|
html+="<tr><td colspan=4>"+tr("Pressure Relief:")+" "+flexstr+"</td></tr>";
|
||||||
|
|
||||||
i=cpap->settings_max(PRS1_HumidSetting);
|
i=cpap->settings_max(PRS1_HumidSetting);
|
||||||
QString humid=(i==0) ? tr("Off") : "x"+QString::number(i);
|
QString humid=(i==0) ? STR_GEN_Off : "x"+QString::number(i);
|
||||||
html+="<tr><td colspan=4>"+tr("Humidifier Setting:")+" "+humid+"</td></tr>";
|
html+="<tr><td colspan=4>"+tr("Humidifier Setting:")+" "+humid+"</td></tr>";
|
||||||
} else if (cpap->machine->GetClass()=="ResMed") {
|
} else if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
int epr=cpap->settings_max("EPR");
|
int epr=cpap->settings_max(RMS9_EPR);
|
||||||
int epr2=cpap->settings_max("EPRSet");
|
int epr2=cpap->settings_max(RMS9_EPRSet);
|
||||||
html+="<tr><td colspan=4>"+tr("EPR Setting:")+" "+QString::number(epr)+" / "+QString::number(epr2)+"</td></tr>";
|
html+="<tr><td colspan=4>"+tr("EPR Setting:")+" "+QString::number(epr)+" / "+QString::number(epr2)+"</td></tr>";
|
||||||
//epr=schema::channel[PRS1_FlexSet].optionString(pr)+QString(" x%1").arg((int)cpap->settings_max(PRS1_FlexSet));
|
//epr=schema::channel[PRS1_FlexSet].optionString(pr)+QString(" x%1").arg((int)cpap->settings_max(PRS1_FlexSet));
|
||||||
|
|
||||||
@ -1174,7 +1174,7 @@ Session * Daily::CreateJournalSession(QDate date)
|
|||||||
if (!m) {
|
if (!m) {
|
||||||
m=new Machine(p_profile,0);
|
m=new Machine(p_profile,0);
|
||||||
m->SetClass("Journal");
|
m->SetClass("Journal");
|
||||||
m->properties["Brand"]="Virtual";
|
m->properties[STR_PROP_Brand]="Virtual";
|
||||||
m->SetType(MT_JOURNAL);
|
m->SetType(MT_JOURNAL);
|
||||||
PROFILE.AddMachine(m);
|
PROFILE.AddMachine(m);
|
||||||
}
|
}
|
||||||
@ -1239,7 +1239,7 @@ void Daily::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
|||||||
|
|
||||||
double st=qint64((d.addSecs(-(winsize/2))).toTime_t())*1000L;
|
double st=qint64((d.addSecs(-(winsize/2))).toTime_t())*1000L;
|
||||||
double et=qint64((d.addSecs(winsize/2)).toTime_t())*1000L;
|
double et=qint64((d.addSecs(winsize/2)).toTime_t())*1000L;
|
||||||
gGraph *g=GraphView->findGraph(tr("Event Flags"));
|
gGraph *g=GraphView->findGraph(STR_TR_EventFlags);
|
||||||
if (!g) return;
|
if (!g) return;
|
||||||
if (st<g->rmin_x) {
|
if (st<g->rmin_x) {
|
||||||
st=g->rmin_x;
|
st=g->rmin_x;
|
||||||
@ -1331,7 +1331,7 @@ void Daily::on_evViewSlider_valueChanged(int value)
|
|||||||
|
|
||||||
int winsize=value*60;
|
int winsize=value*60;
|
||||||
|
|
||||||
gGraph *g=GraphView->findGraph("Event Flags");
|
gGraph *g=GraphView->findGraph(STR_TR_EventFlags);
|
||||||
if (!g) return;
|
if (!g) return;
|
||||||
qint64 st=g->min_x;
|
qint64 st=g->min_x;
|
||||||
qint64 et=g->max_x;
|
qint64 et=g->max_x;
|
||||||
@ -1463,7 +1463,7 @@ void Daily::on_weightSpinBox_valueChanged(double arg1)
|
|||||||
gGraphView *gv=mainwin->getOverview()->graphView();
|
gGraphView *gv=mainwin->getOverview()->graphView();
|
||||||
gGraph *g;
|
gGraph *g;
|
||||||
if (gv) {
|
if (gv) {
|
||||||
g=gv->findGraph(tr("Weight"));
|
g=gv->findGraph(STR_TR_Weight);
|
||||||
if (g) g->setDay(NULL);
|
if (g) g->setDay(NULL);
|
||||||
}
|
}
|
||||||
if ((height>0) && (kg>0)) {
|
if ((height>0) && (kg>0)) {
|
||||||
@ -1472,7 +1472,7 @@ void Daily::on_weightSpinBox_valueChanged(double arg1)
|
|||||||
ui->BMI->setVisible(true);
|
ui->BMI->setVisible(true);
|
||||||
journal->settings[Journal_BMI]=bmi;
|
journal->settings[Journal_BMI]=bmi;
|
||||||
if (gv) {
|
if (gv) {
|
||||||
g=gv->findGraph(tr("BMI"));
|
g=gv->findGraph(STR_TR_BMI);
|
||||||
if (g) g->setDay(NULL);
|
if (g) g->setDay(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1491,7 +1491,7 @@ void Daily::on_ouncesSpinBox_valueChanged(int arg1)
|
|||||||
|
|
||||||
gGraph *g;
|
gGraph *g;
|
||||||
if (mainwin->getOverview()) {
|
if (mainwin->getOverview()) {
|
||||||
g=mainwin->getOverview()->graphView()->findGraph(tr("Weight"));
|
g=mainwin->getOverview()->graphView()->findGraph(STR_TR_Weight);
|
||||||
if (g) g->setDay(NULL);
|
if (g) g->setDay(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1502,7 +1502,7 @@ void Daily::on_ouncesSpinBox_valueChanged(int arg1)
|
|||||||
|
|
||||||
journal->settings[Journal_BMI]=bmi;
|
journal->settings[Journal_BMI]=bmi;
|
||||||
if (mainwin->getOverview()) {
|
if (mainwin->getOverview()) {
|
||||||
g=mainwin->getOverview()->graphView()->findGraph(tr("BMI"));
|
g=mainwin->getOverview()->graphView()->findGraph(STR_TR_BMI);
|
||||||
if (g) g->setDay(NULL);
|
if (g) g->setDay(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
main.cpp
26
main.cpp
@ -117,24 +117,24 @@ int main(int argc, char *argv[])
|
|||||||
if (force_login_screen) skip_login=false;
|
if (force_login_screen) skip_login=false;
|
||||||
|
|
||||||
QDateTime lastchecked, today=QDateTime::currentDateTime();
|
QDateTime lastchecked, today=QDateTime::currentDateTime();
|
||||||
if (!PREF.Exists("Updates_AutoCheck")) {
|
if (!PREF.contains(STR_GEN_UpdatesAutoCheck)) {
|
||||||
PREF["Updates_AutoCheck"]=true;
|
PREF[STR_GEN_UpdatesAutoCheck]=true;
|
||||||
PREF["Updates_CheckFrequency"]=7;
|
PREF[STR_GEN_UpdateCheckFrequency]=7;
|
||||||
}
|
}
|
||||||
bool check_updates=false;
|
bool check_updates=false;
|
||||||
if (PREF["Updates_AutoCheck"].toBool()) {
|
if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) {
|
||||||
int update_frequency=PREF["Updates_CheckFrequency"].toInt();
|
int update_frequency=PREF[STR_GEN_UpdateCheckFrequency].toInt();
|
||||||
int days=1000;
|
int days=1000;
|
||||||
// p_pref ->Get
|
// p_pref ->Get
|
||||||
lastchecked=PREF["Updates_LastChecked"].toDateTime();
|
lastchecked=PREF[STR_GEN_UpdatesLastChecked].toDateTime();
|
||||||
if (PREF.Exists("Updates_LastChecked")) {
|
if (PREF.contains(STR_GEN_UpdatesLastChecked)) {
|
||||||
days=lastchecked.secsTo(today);
|
days=lastchecked.secsTo(today);
|
||||||
days/=86400;
|
days/=86400;
|
||||||
};
|
};
|
||||||
if (days>update_frequency) {
|
if (days>update_frequency) {
|
||||||
//QMessageBox::information(NULL,"Check for updates","Placeholder. Would automatically check for updates here.",QMessageBox::Ok);
|
//QMessageBox::information(NULL,"Check for updates","Placeholder. Would automatically check for updates here.",QMessageBox::Ok);
|
||||||
check_updates=true;
|
check_updates=true;
|
||||||
//PREF["Updates_LastChecked"]=today;
|
//PREF[STR_GEN_UpdatesLastChecked]=today;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Show New User wizard..
|
// Show New User wizard..
|
||||||
} else {
|
} else {
|
||||||
if (PREF.Exists("VersionString")) {
|
if (PREF.contains("VersionString")) {
|
||||||
QString V=PREF["VersionString"].toString();
|
QString V=PREF["VersionString"].toString();
|
||||||
if (VersionString()>V) {
|
if (VersionString()>V) {
|
||||||
release_notes();
|
release_notes();
|
||||||
@ -160,7 +160,7 @@ int main(int argc, char *argv[])
|
|||||||
if (profsel.result()==ProfileSelect::Rejected) {
|
if (profsel.result()==ProfileSelect::Rejected) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
p_profile=Profiles::Get(PREF["Profile"].toString());
|
p_profile=Profiles::Get(PREF[STR_GEN_Profile].toString());
|
||||||
} else p_profile=NULL;
|
} else p_profile=NULL;
|
||||||
if (!p_profile) {
|
if (!p_profile) {
|
||||||
if (profsel.exec()==ProfileSelect::Rejected) {
|
if (profsel.exec()==ProfileSelect::Rejected) {
|
||||||
@ -170,9 +170,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
PREF["VersionString"]=VersionString();
|
PREF["VersionString"]=VersionString();
|
||||||
|
|
||||||
p_profile=Profiles::Get(PREF["Profile"].toString());
|
p_profile=Profiles::Get(PREF[STR_GEN_Profile].toString());
|
||||||
|
|
||||||
//if (!PREF.Exists("Profile")) PREF["Profile"]=getUserName();
|
//if (!PREF.Exists(STR_GEN_Profile)) PREF[STR_GEN_Profile]=getUserName();
|
||||||
|
|
||||||
//int id=QFontDatabase::addApplicationFont(":/fonts/FreeSans.ttf");
|
//int id=QFontDatabase::addApplicationFont(":/fonts/FreeSans.ttf");
|
||||||
/* QFontDatabase fdb;
|
/* QFontDatabase fdb;
|
||||||
@ -181,7 +181,7 @@ int main(int argc, char *argv[])
|
|||||||
qDebug() << "Loaded Font: " << (*i);
|
qDebug() << "Loaded Font: " << (*i);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
if (!PREF.Exists("Fonts_Application_Name")) {
|
if (!PREF.contains("Fonts_Application_Name")) {
|
||||||
PREF["Fonts_Application_Name"]="Sans Serif";
|
PREF["Fonts_Application_Name"]="Sans Serif";
|
||||||
PREF["Fonts_Application_Size"]=10;
|
PREF["Fonts_Application_Size"]=10;
|
||||||
PREF["Fonts_Application_Bold"]=false;
|
PREF["Fonts_Application_Bold"]=false;
|
||||||
|
@ -74,7 +74,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
QString version=VersionString();
|
QString version=VersionString();
|
||||||
if (QString(GIT_BRANCH)!="master") version+=QString(" ")+QString(GIT_BRANCH);
|
if (QString(GIT_BRANCH)!="master") version+=QString(" ")+QString(GIT_BRANCH);
|
||||||
this->setWindowTitle(tr("SleepyHead")+QString(" v%1 (Profile: %2)").arg(version).arg(PREF["Profile"].toString()));
|
this->setWindowTitle(tr("SleepyHead")+QString(" v%1 (Profile: %2)").arg(version).arg(PREF[STR_GEN_Profile].toString()));
|
||||||
ui->tabWidget->setCurrentIndex(0);
|
ui->tabWidget->setCurrentIndex(0);
|
||||||
|
|
||||||
overview=NULL;
|
overview=NULL;
|
||||||
@ -195,13 +195,13 @@ void MainWindow::Startup()
|
|||||||
SnapshotGraph->hide();
|
SnapshotGraph->hide();
|
||||||
|
|
||||||
daily=new Daily(ui->tabWidget,NULL);
|
daily=new Daily(ui->tabWidget,NULL);
|
||||||
ui->tabWidget->insertTab(1,daily,tr("Daily"));
|
ui->tabWidget->insertTab(1,daily,STR_TR_Daily);
|
||||||
|
|
||||||
overview=new Overview(ui->tabWidget,daily->graphView());
|
overview=new Overview(ui->tabWidget,daily->graphView());
|
||||||
ui->tabWidget->insertTab(2,overview,tr("Overview"));
|
ui->tabWidget->insertTab(2,overview,STR_TR_Overview);
|
||||||
if (PROFILE.oxi->oximetryEnabled()) {
|
if (PROFILE.oxi->oximetryEnabled()) {
|
||||||
oximetry=new Oximetry(ui->tabWidget,daily->graphView());
|
oximetry=new Oximetry(ui->tabWidget,daily->graphView());
|
||||||
ui->tabWidget->insertTab(3,oximetry,tr("Oximetry"));
|
ui->tabWidget->insertTab(3,oximetry,STR_TR_Oximetry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -374,7 +374,7 @@ void MainWindow::on_dailyButton_clicked()
|
|||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(daily);
|
ui->tabWidget->setCurrentWidget(daily);
|
||||||
daily->RedrawGraphs();
|
daily->RedrawGraphs();
|
||||||
qstatus2->setText("Daily");
|
qstatus2->setText(STR_TR_Daily);
|
||||||
}
|
}
|
||||||
void MainWindow::JumpDaily()
|
void MainWindow::JumpDaily()
|
||||||
{
|
{
|
||||||
@ -384,7 +384,7 @@ void MainWindow::JumpDaily()
|
|||||||
void MainWindow::on_overviewButton_clicked()
|
void MainWindow::on_overviewButton_clicked()
|
||||||
{
|
{
|
||||||
ui->tabWidget->setCurrentWidget(overview);
|
ui->tabWidget->setCurrentWidget(overview);
|
||||||
qstatus2->setText("Overview");
|
qstatus2->setText(STR_TR_Overview);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_webView_loadFinished(bool arg1)
|
void MainWindow::on_webView_loadFinished(bool arg1)
|
||||||
@ -435,7 +435,7 @@ void MainWindow::on_action_About_triggered()
|
|||||||
|
|
||||||
void MainWindow::on_actionDebug_toggled(bool checked)
|
void MainWindow::on_actionDebug_toggled(bool checked)
|
||||||
{
|
{
|
||||||
PROFILE["ShowDebug"]=checked;
|
PROFILE.general->setShowDebug(checked);
|
||||||
if (checked) {
|
if (checked) {
|
||||||
ui->logText->show();
|
ui->logText->show();
|
||||||
} else {
|
} else {
|
||||||
@ -476,17 +476,17 @@ void MainWindow::on_oximetryButton_clicked()
|
|||||||
{
|
{
|
||||||
bool first=false;
|
bool first=false;
|
||||||
if (!oximetry) {
|
if (!oximetry) {
|
||||||
if (!PROFILE.Exists("EnableOximetry") || !PROFILE["EnableOximetry"].toBool()) {
|
if (!PROFILE.oxi->oximetryEnabled()) {
|
||||||
if (QMessageBox::question(this,"Question","Do you have a CMS50[x] Oximeter?\nOne is required to use this section.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::No) return;
|
if (QMessageBox::question(this,"Question","Do you have a CMS50[x] Oximeter?\nOne is required to use this section.",QMessageBox::Yes,QMessageBox::No)==QMessageBox::No) return;
|
||||||
PROFILE["EnableOximetry"]=true;
|
PROFILE.oxi->setOximetryEnabled(true);
|
||||||
}
|
}
|
||||||
oximetry=new Oximetry(ui->tabWidget,daily->graphView());
|
oximetry=new Oximetry(ui->tabWidget,daily->graphView());
|
||||||
ui->tabWidget->insertTab(3,oximetry,tr("Oximetry"));
|
ui->tabWidget->insertTab(3,oximetry,STR_TR_Oximetry);
|
||||||
first=true;
|
first=true;
|
||||||
}
|
}
|
||||||
ui->tabWidget->setCurrentWidget(oximetry);
|
ui->tabWidget->setCurrentWidget(oximetry);
|
||||||
if (!first) oximetry->RedrawGraphs();
|
if (!first) oximetry->RedrawGraphs();
|
||||||
qstatus2->setText("Oximetry");
|
qstatus2->setText(STR_TR_Oximetry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::CheckForUpdates()
|
void MainWindow::CheckForUpdates()
|
||||||
@ -542,12 +542,12 @@ void MainWindow::updatestatusBarMessage (const QString & text)
|
|||||||
void MainWindow::on_actionPrint_Report_triggered()
|
void MainWindow::on_actionPrint_Report_triggered()
|
||||||
{
|
{
|
||||||
if (ui->tabWidget->currentWidget()==overview) {
|
if (ui->tabWidget->currentWidget()==overview) {
|
||||||
PrintReport(overview->graphView(),tr("Overview"));
|
PrintReport(overview->graphView(),STR_TR_Overview);
|
||||||
} else if (ui->tabWidget->currentWidget()==daily) {
|
} else if (ui->tabWidget->currentWidget()==daily) {
|
||||||
PrintReport(daily->graphView(),tr("Daily"),daily->getDate());
|
PrintReport(daily->graphView(),STR_TR_Daily,daily->getDate());
|
||||||
} else if (ui->tabWidget->currentWidget()==oximetry) {
|
} else if (ui->tabWidget->currentWidget()==oximetry) {
|
||||||
if (oximetry)
|
if (oximetry)
|
||||||
PrintReport(oximetry->graphView(),tr("Oximetry"));
|
PrintReport(oximetry->graphView(),STR_TR_Oximetry);
|
||||||
} else {
|
} else {
|
||||||
//QPrinter printer();
|
//QPrinter printer();
|
||||||
//ui->webView->print(printer)
|
//ui->webView->print(printer)
|
||||||
@ -558,7 +558,7 @@ void MainWindow::on_actionPrint_Report_triggered()
|
|||||||
void MainWindow::on_action_Edit_Profile_triggered()
|
void MainWindow::on_action_Edit_Profile_triggered()
|
||||||
{
|
{
|
||||||
NewProfile newprof(this);
|
NewProfile newprof(this);
|
||||||
newprof.edit(PREF["Profile"].toString());
|
newprof.edit(PREF[STR_GEN_Profile].toString());
|
||||||
newprof.exec();
|
newprof.exec();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ EventList *packEventList(EventList *ev)
|
|||||||
EventList *nev=new EventList(EVL_Event);
|
EventList *nev=new EventList(EVL_Event);
|
||||||
|
|
||||||
EventDataType val,lastval=0;
|
EventDataType val,lastval=0;
|
||||||
qint64 time,lasttime=0,lasttime2=0;
|
qint64 time,lasttime=0;//,lasttime2=0;
|
||||||
|
|
||||||
lastval=ev->data(0);
|
lastval=ev->data(0);
|
||||||
lasttime=ev->time(0);
|
lasttime=ev->time(0);
|
||||||
@ -614,7 +614,7 @@ EventList *packEventList(EventList *ev)
|
|||||||
time=ev->time(i);
|
time=ev->time(i);
|
||||||
if (val!=lastval) {
|
if (val!=lastval) {
|
||||||
nev->AddEvent(time,val);
|
nev->AddEvent(time,val);
|
||||||
lasttime2=time;
|
//lasttime2=time;
|
||||||
}
|
}
|
||||||
lastval=val;
|
lastval=val;
|
||||||
lasttime=time;
|
lasttime=time;
|
||||||
@ -640,7 +640,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
QString username=PROFILE.Get("_{Username}_");
|
QString username=PROFILE.Get("_{Username}_");
|
||||||
|
|
||||||
bool print_bookmarks=false;
|
bool print_bookmarks=false;
|
||||||
if (name=="Daily") {
|
if (name==STR_TR_Daily) {
|
||||||
QVariantList book_start;
|
QVariantList book_start;
|
||||||
journal=getDaily()->GetJournalSession(getDaily()->getDate());
|
journal=getDaily()->GetJournalSession(getDaily()->getDate());
|
||||||
if (journal && journal->settings.contains(Bookmark_Start)) {
|
if (journal && journal->settings.contains(Bookmark_Start)) {
|
||||||
@ -655,28 +655,28 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
|
|
||||||
QPrinter * printer;
|
QPrinter * printer;
|
||||||
|
|
||||||
bool highres;
|
//bool highres;
|
||||||
bool aa_setting=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
bool aa_setting=PROFILE.appearance->antiAliasing();
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
PROFILE["HighResPrinting"]=true; // forced on
|
PROFILE.appearance->setHighResPrinting(true); // forced on
|
||||||
// bool force_antialiasing=true;
|
// bool force_antialiasing=true;
|
||||||
//#else
|
//#else
|
||||||
#endif
|
#endif
|
||||||
bool force_antialiasing=PROFILE.ExistsAndTrue("UseAntiAliasing");
|
bool force_antialiasing=aa_setting;
|
||||||
|
|
||||||
if (PROFILE.ExistsAndTrue("HighResPrinting")) {
|
if (PROFILE.appearance->highResPrinting()) {
|
||||||
printer=new QPrinter(QPrinter::HighResolution);
|
printer=new QPrinter(QPrinter::HighResolution);
|
||||||
highres=true;
|
//highres=true;
|
||||||
} else {
|
} else {
|
||||||
printer=new QPrinter(QPrinter::ScreenResolution);
|
printer=new QPrinter(QPrinter::ScreenResolution);
|
||||||
highres=false;
|
//highres=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
printer->setPrinterName("Print to File (PDF)");
|
printer->setPrinterName("Print to File (PDF)");
|
||||||
printer->setOutputFormat(QPrinter::PdfFormat);
|
printer->setOutputFormat(QPrinter::PdfFormat);
|
||||||
QString filename=PREF.Get("{home}/"+name+username+date.toString(Qt::ISODate)+".pdf");//QFileDialog::getSaveFileName(this,"Select filename to save PDF report to",,"PDF Files (*.pdf)");
|
QString filename=PREF.Get("{home}/"+name+username+date.toString(Qt::ISODate)+".pdf");
|
||||||
|
|
||||||
printer->setOutputFileName(filename);
|
printer->setOutputFileName(filename);
|
||||||
#endif
|
#endif
|
||||||
@ -740,12 +740,12 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
painter.setFont(report_font);
|
painter.setFont(report_font);
|
||||||
|
|
||||||
int maxy=0;
|
int maxy=0;
|
||||||
if (!PROFILE["FirstName"].toString().isEmpty()) {
|
if (!PROFILE.user->firstName().isEmpty()) {
|
||||||
QString userinfo=tr("Name:\t %1, %2\n").arg(PROFILE["LastName"].toString()).arg(PROFILE["FirstName"].toString());
|
QString userinfo=tr("Name:\t %1, %2\n").arg(PROFILE.user->lastName()).arg(PROFILE.user->firstName());
|
||||||
userinfo+=tr("DOB:\t%1\n").arg(PROFILE["DOB"].toString());
|
userinfo+=tr("DOB:\t%1\n").arg(PROFILE.user->DOB().toString(Qt::SystemLocaleShortDate));
|
||||||
userinfo+=tr("Phone:\t%1\n").arg(PROFILE["Phone"].toString());
|
userinfo+=tr("Phone:\t%1\n").arg(PROFILE.user->phone());
|
||||||
userinfo+=tr("Email:\t%1\n").arg(PROFILE["EmailAddress"].toString());
|
userinfo+=tr("Email:\t%1\n").arg(PROFILE.user->email());
|
||||||
if (!PROFILE["Address"].toString().isEmpty()) userinfo+=tr("\nAddress:\n%1").arg(PROFILE["Address"].toString());
|
if (!PROFILE.user->address().isEmpty()) userinfo+=tr("\nAddress:\n%1").arg(PROFILE.user->address());
|
||||||
|
|
||||||
QRectF bounds=painter.boundingRect(QRectF(0,top,virt_width,0),userinfo,QTextOption(Qt::AlignLeft | Qt::AlignTop));
|
QRectF bounds=painter.boundingRect(QRectF(0,top,virt_width,0),userinfo,QTextOption(Qt::AlignLeft | Qt::AlignTop));
|
||||||
painter.drawText(bounds,userinfo,QTextOption(Qt::AlignLeft | Qt::AlignTop));
|
painter.drawText(bounds,userinfo,QTextOption(Qt::AlignLeft | Qt::AlignTop));
|
||||||
@ -753,7 +753,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int graph_slots=0;
|
int graph_slots=0;
|
||||||
if (name==tr("Daily")) {
|
if (name==STR_TR_Daily) {
|
||||||
Day *cpap=PROFILE.GetDay(date,MT_CPAP);
|
Day *cpap=PROFILE.GetDay(date,MT_CPAP);
|
||||||
QString cpapinfo=date.toString(Qt::SystemLocaleLongDate)+"\n\n";
|
QString cpapinfo=date.toString(Qt::SystemLocaleLongDate)+"\n\n";
|
||||||
if (cpap) {
|
if (cpap) {
|
||||||
@ -769,9 +769,9 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
cpapinfo+=tr("Wake-up: ")+QDateTime::fromTime_t(l).time().toString("HH:mm:ss")+"\n\n";
|
cpapinfo+=tr("Wake-up: ")+QDateTime::fromTime_t(l).time().toString("HH:mm:ss")+"\n\n";
|
||||||
QString submodel;
|
QString submodel;
|
||||||
cpapinfo+=tr("Machine: ");
|
cpapinfo+=tr("Machine: ");
|
||||||
if (cpap->machine->properties.find("SubModel")!=cpap->machine->properties.end())
|
if (cpap->machine->properties.find(STR_PROP_SubModel)!=cpap->machine->properties.end())
|
||||||
submodel="\n"+cpap->machine->properties["SubModel"];
|
submodel="\n"+cpap->machine->properties[STR_PROP_SubModel];
|
||||||
cpapinfo+=cpap->machine->properties["Brand"]+" "+cpap->machine->properties["Model"]+submodel;
|
cpapinfo+=cpap->machine->properties[STR_PROP_Brand]+" "+cpap->machine->properties[STR_PROP_Model]+submodel;
|
||||||
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
CPAPMode mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);
|
||||||
cpapinfo+=tr("\nMode: ");
|
cpapinfo+=tr("\nMode: ");
|
||||||
|
|
||||||
@ -823,13 +823,13 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
int ttop=bounds.height();
|
int ttop=bounds.height();
|
||||||
|
|
||||||
stats=tr("AI=%1 HI=%2 CAI=%3 ").arg(oai,0,'f',2).arg(hi,0,'f',2).arg(cai,0,'f',2);
|
stats=tr("AI=%1 HI=%2 CAI=%3 ").arg(oai,0,'f',2).arg(hi,0,'f',2).arg(cai,0,'f',2);
|
||||||
if (cpap->machine->GetClass()=="PRS1") {
|
if (cpap->machine->GetClass()==STR_MACH_PRS1) {
|
||||||
stats+=tr("REI=%1 VSI=%2 FLI=%3 PB/CSR=%4\%")
|
stats+=tr("REI=%1 VSI=%2 FLI=%3 PB/CSR=%4\%")
|
||||||
.arg(rei,0,'f',2).arg(vsi,0,'f',2)
|
.arg(rei,0,'f',2).arg(vsi,0,'f',2)
|
||||||
.arg(fli,0,'f',2).arg(csr,0,'f',2);
|
.arg(fli,0,'f',2).arg(csr,0,'f',2);
|
||||||
} else if (cpap->machine->GetClass()=="ResMed") {
|
} else if (cpap->machine->GetClass()==STR_MACH_ResMed) {
|
||||||
stats+=tr("UAI=%1 ").arg(uai,0,'f',2);
|
stats+=tr("UAI=%1 ").arg(uai,0,'f',2);
|
||||||
} else if (cpap->machine->GetClass()=="Intellipap") {
|
} else if (cpap->machine->GetClass()==STR_MACH_Intellipap) {
|
||||||
stats+=tr("NRI=%1 LKI=%2 EPI=%3").arg(nri,0,'f',2).arg(lki,0,'f',2).arg(exp,0,'f',2);
|
stats+=tr("NRI=%1 LKI=%2 EPI=%3").arg(nri,0,'f',2).arg(lki,0,'f',2).arg(exp,0,'f',2);
|
||||||
}
|
}
|
||||||
bounds=painter.boundingRect(QRectF(0,top+ttop,virt_width,0),stats,QTextOption(Qt::AlignCenter));
|
bounds=painter.boundingRect(QRectF(0,top+ttop,virt_width,0),stats,QTextOption(Qt::AlignCenter));
|
||||||
@ -844,7 +844,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
}
|
}
|
||||||
|
|
||||||
graph_slots=2;
|
graph_slots=2;
|
||||||
} else if (name==tr("Overview")) {
|
} else if (name==STR_TR_Overview) {
|
||||||
QDateTime first=QDateTime::fromTime_t((*gv)[0]->min_x/1000L);
|
QDateTime first=QDateTime::fromTime_t((*gv)[0]->min_x/1000L);
|
||||||
QDateTime last=QDateTime::fromTime_t((*gv)[0]->max_x/1000L);
|
QDateTime last=QDateTime::fromTime_t((*gv)[0]->max_x/1000L);
|
||||||
QString ovinfo=tr("Reporting from %1 to %2").arg(first.date().toString(Qt::SystemLocaleShortDate)).arg(last.date().toString(Qt::SystemLocaleShortDate));
|
QString ovinfo=tr("Reporting from %1 to %2").arg(first.date().toString(Qt::SystemLocaleShortDate)).arg(last.date().toString(Qt::SystemLocaleShortDate));
|
||||||
@ -853,7 +853,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
|
|
||||||
if (bounds.height()>maxy) maxy=bounds.height();
|
if (bounds.height()>maxy) maxy=bounds.height();
|
||||||
graph_slots=1;
|
graph_slots=1;
|
||||||
} else if (name==tr("Oximetry")) {
|
} else if (name==STR_TR_Oximetry) {
|
||||||
QString ovinfo=tr("Reporting data goes here");
|
QString ovinfo=tr("Reporting data goes here");
|
||||||
QRectF bounds=painter.boundingRect(QRectF(0,top,virt_width,0),ovinfo,QTextOption(Qt::AlignCenter));
|
QRectF bounds=painter.boundingRect(QRectF(0,top,virt_width,0),ovinfo,QTextOption(Qt::AlignCenter));
|
||||||
painter.drawText(bounds,ovinfo,QTextOption(Qt::AlignCenter));
|
painter.drawText(bounds,ovinfo,QTextOption(Qt::AlignCenter));
|
||||||
@ -952,7 +952,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
top+=normal_height;
|
top+=normal_height;
|
||||||
} else top+=normal_height/2;
|
} else top+=normal_height/2;
|
||||||
|
|
||||||
PROFILE["UseAntiAliasing"]=force_antialiasing;
|
PROFILE.appearance->setAntiAliasing(force_antialiasing);
|
||||||
int tmb=g->m_marginbottom;
|
int tmb=g->m_marginbottom;
|
||||||
g->m_marginbottom=0;
|
g->m_marginbottom=0;
|
||||||
|
|
||||||
@ -961,7 +961,7 @@ void MainWindow::PrintReport(gGraphView *gv,QString name, QDate date)
|
|||||||
//g->showTitle(true);
|
//g->showTitle(true);
|
||||||
|
|
||||||
g->m_marginbottom=tmb;
|
g->m_marginbottom=tmb;
|
||||||
PROFILE["UseAntiAliasing"]=aa_setting;
|
PROFILE.appearance->setAntiAliasing(aa_setting);
|
||||||
|
|
||||||
painter.drawPixmap(0,top,virt_width,full_graph_height-normal_height,pm);
|
painter.drawPixmap(0,top,virt_width,full_graph_height-normal_height,pm);
|
||||||
top+=full_graph_height;
|
top+=full_graph_height;
|
||||||
@ -992,9 +992,7 @@ void MainWindow::on_action_Rebuild_Oximetry_Index_triggered()
|
|||||||
|
|
||||||
QList<Machine *> machines=PROFILE.GetMachines(MT_OXIMETER);
|
QList<Machine *> machines=PROFILE.GetMachines(MT_OXIMETER);
|
||||||
|
|
||||||
bool ok;
|
int discard_threshold=PROFILE.oxi->oxiDiscardThreshold();
|
||||||
int discard_threshold=PROFILE["OxiDiscardThreshold"].toInt(&ok);
|
|
||||||
if (!ok) discard_threshold=10;
|
|
||||||
Machine *m;
|
Machine *m;
|
||||||
for (int z=0;z<machines.size();z++) {
|
for (int z=0;z<machines.size();z++) {
|
||||||
m=machines.at(z);
|
m=machines.at(z);
|
||||||
@ -1114,7 +1112,7 @@ void MainWindow::on_actionPurge_Current_Day_triggered()
|
|||||||
Machine *m;
|
Machine *m;
|
||||||
if (day) {
|
if (day) {
|
||||||
m=day->machine;
|
m=day->machine;
|
||||||
QString path=PROFILE.Get("DataFolder")+QDir::separator()+m->hexid()+QDir::separator();
|
QString path=PROFILE.Get(STR_GEN_DataFolder)+QDir::separator()+m->hexid()+QDir::separator();
|
||||||
|
|
||||||
QVector<Session *>::iterator s;
|
QVector<Session *>::iterator s;
|
||||||
|
|
||||||
@ -1152,7 +1150,7 @@ void MainWindow::on_actionAll_Data_for_current_CPAP_machine_triggered()
|
|||||||
qDebug() << "Gah!! no machine to purge";
|
qDebug() << "Gah!! no machine to purge";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (QMessageBox::question(this,tr("Are you sure?"),tr("Are you sure you want to purge all CPAP data for the following machine:\n")+m->properties["Brand"]+" "+m->properties["Model"]+" "+m->properties["ModelNumber"]+" ("+m->properties["Serial"]+")",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) {
|
if (QMessageBox::question(this,tr("Are you sure?"),tr("Are you sure you want to purge all CPAP data for the following machine:\n")+m->properties[STR_PROP_Brand]+" "+m->properties[STR_PROP_Model]+" "+m->properties[STR_PROP_ModelNumber]+" ("+m->properties[STR_PROP_Serial]+")",QMessageBox::Yes,QMessageBox::No)==QMessageBox::Yes) {
|
||||||
m->Purge(3478216);
|
m->Purge(3478216);
|
||||||
RestartApplication();
|
RestartApplication();
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ void NewProfile::on_nextButton_clicked()
|
|||||||
profile->user->setHeight(v);
|
profile->user->setHeight(v);
|
||||||
|
|
||||||
//profile->user->setUserName(ui->userNameEdit->text());??
|
//profile->user->setUserName(ui->userNameEdit->text());??
|
||||||
PREF["Profile"]=ui->userNameEdit->text();
|
PREF[STR_GEN_Profile]=ui->userNameEdit->text();
|
||||||
|
|
||||||
|
|
||||||
this->accept();
|
this->accept();
|
||||||
@ -243,7 +243,7 @@ void NewProfile::edit(const QString name)
|
|||||||
ui->userNameEdit->setReadOnly(true);
|
ui->userNameEdit->setReadOnly(true);
|
||||||
ui->firstNameEdit->setText(profile->user->firstName());
|
ui->firstNameEdit->setText(profile->user->firstName());
|
||||||
ui->lastNameEdit->setText(profile->user->lastName());
|
ui->lastNameEdit->setText(profile->user->lastName());
|
||||||
if (profile->Exists(UI_STR_Password)) {
|
if (profile->contains(UI_STR_Password)) {
|
||||||
// leave the password box blank..
|
// leave the password box blank..
|
||||||
QString a="******";
|
QString a="******";
|
||||||
ui->passwordEdit1->setText(a);
|
ui->passwordEdit1->setText(a);
|
||||||
|
16
overview.cpp
16
overview.cpp
@ -108,8 +108,8 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
PULSE=createGraph(tr("Pulse Rate"),tr("Pulse Rate\n(bpm)"));
|
PULSE=createGraph(tr("Pulse Rate"),tr("Pulse Rate\n(bpm)"));
|
||||||
SPO2=createGraph(tr("SpO2"),tr("Oxygen Saturation\n(%)"));
|
SPO2=createGraph(tr("SpO2"),tr("Oxygen Saturation\n(%)"));
|
||||||
|
|
||||||
WEIGHT=createGraph(tr("Weight"),tr("Weight"),YT_Weight);
|
WEIGHT=createGraph(STR_TR_Weight,STR_TR_Weight,YT_Weight);
|
||||||
BMI=createGraph(tr("BMI"),tr("Body\nMass\nIndex"));
|
BMI=createGraph(STR_TR_BMI,tr("Body\nMass\nIndex"));
|
||||||
ZOMBIE=createGraph(tr("Zombie"),tr("How you felt\n(0-10)"));
|
ZOMBIE=createGraph(tr("Zombie"),tr("How you felt\n(0-10)"));
|
||||||
|
|
||||||
ahihr=new SummaryChart(tr("AHI/Hr"),GT_LINE);
|
ahihr=new SummaryChart(tr("AHI/Hr"),GT_LINE);
|
||||||
@ -117,12 +117,12 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
ahihr->addSlice(CPAP_AHI,QColor("orange"),ST_WAVG,false);
|
ahihr->addSlice(CPAP_AHI,QColor("orange"),ST_WAVG,false);
|
||||||
AHIHR->AddLayer(ahihr);
|
AHIHR->AddLayer(ahihr);
|
||||||
|
|
||||||
weight=new SummaryChart(tr("Weight"),GT_LINE);
|
weight=new SummaryChart(STR_TR_Weight,GT_LINE);
|
||||||
weight->setMachineType(MT_JOURNAL);
|
weight->setMachineType(MT_JOURNAL);
|
||||||
weight->addSlice(Journal_Weight,QColor("black"),ST_SETAVG,true);
|
weight->addSlice(Journal_Weight,QColor("black"),ST_SETAVG,true);
|
||||||
WEIGHT->AddLayer(weight);
|
WEIGHT->AddLayer(weight);
|
||||||
|
|
||||||
bmi=new SummaryChart(tr("BMI"),GT_LINE);
|
bmi=new SummaryChart(STR_TR_BMI,GT_LINE);
|
||||||
bmi->setMachineType(MT_JOURNAL);
|
bmi->setMachineType(MT_JOURNAL);
|
||||||
bmi->addSlice(Journal_BMI,QColor("dark blue"),ST_SETAVG,true);
|
bmi->addSlice(Journal_BMI,QColor("dark blue"),ST_SETAVG,true);
|
||||||
BMI->AddLayer(bmi);
|
BMI->AddLayer(bmi);
|
||||||
@ -146,11 +146,11 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
spo2->addSlice(OXI_SPO2,QColor("blue"),ST_MIN,true);
|
spo2->addSlice(OXI_SPO2,QColor("blue"),ST_MIN,true);
|
||||||
SPO2->AddLayer(spo2);
|
SPO2->AddLayer(spo2);
|
||||||
|
|
||||||
uc=new SummaryChart(tr("Hours"),GT_BAR);
|
uc=new SummaryChart(STR_UNIT_Hours,GT_BAR);
|
||||||
uc->addSlice("",QColor("green"),ST_HOURS,true);
|
uc->addSlice("",QColor("green"),ST_HOURS,true);
|
||||||
UC->AddLayer(uc);
|
UC->AddLayer(uc);
|
||||||
|
|
||||||
us=new SummaryChart(tr("Hours"),GT_SESSIONS);
|
us=new SummaryChart(STR_UNIT_Hours,GT_SESSIONS);
|
||||||
us->addSlice("",QColor("dark blue"),ST_HOURS,true);
|
us->addSlice("",QColor("dark blue"),ST_HOURS,true);
|
||||||
us->addSlice("",QColor("blue"),ST_SESSIONS,true);
|
us->addSlice("",QColor("blue"),ST_SESSIONS,true);
|
||||||
US->AddLayer(us);
|
US->AddLayer(us);
|
||||||
@ -201,7 +201,7 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
|
|||||||
ptb->addSlice(CPAP_PTB,QColor("orange"),ST_WAVG,true);
|
ptb->addSlice(CPAP_PTB,QColor("orange"),ST_WAVG,true);
|
||||||
PTB->AddLayer(ptb);
|
PTB->AddLayer(ptb);
|
||||||
|
|
||||||
pr=new SummaryChart(tr("cmH2O"),GT_LINE);
|
pr=new SummaryChart(STR_UNIT_CMH2O,GT_LINE);
|
||||||
//PR->setRecMinY(4.0);
|
//PR->setRecMinY(4.0);
|
||||||
//PR->setRecMaxY(12.0);
|
//PR->setRecMaxY(12.0);
|
||||||
pr->addSlice(CPAP_Pressure,QColor("dark green"),ST_WAVG,true);
|
pr->addSlice(CPAP_Pressure,QColor("dark green"),ST_WAVG,true);
|
||||||
@ -350,7 +350,7 @@ void Overview::on_toolButton_clicked()
|
|||||||
|
|
||||||
void Overview::on_printButton_clicked()
|
void Overview::on_printButton_clicked()
|
||||||
{
|
{
|
||||||
mainwin->PrintReport(GraphView,tr("Overview")); // Must be translated the same as PrintReport checks.
|
mainwin->PrintReport(GraphView,STR_TR_Overview); // Must be translated the same as PrintReport checks.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overview::ResetGraphLayout()
|
void Overview::ResetGraphLayout()
|
||||||
|
@ -102,8 +102,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
//i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString());
|
//i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString());
|
||||||
//ui->timeZoneCombo->setCurrentIndex(i);
|
//ui->timeZoneCombo->setCurrentIndex(i);
|
||||||
|
|
||||||
bool ok;
|
|
||||||
double v;
|
|
||||||
ui->spo2Drop->setValue(profile->oxi->spO2DropPercentage());
|
ui->spo2Drop->setValue(profile->oxi->spO2DropPercentage());
|
||||||
ui->spo2DropTime->setValue(profile->oxi->spO2DropDuration());
|
ui->spo2DropTime->setValue(profile->oxi->spO2DropDuration());
|
||||||
ui->pulseChange->setValue(profile->oxi->pulseChangeBPM());
|
ui->pulseChange->setValue(profile->oxi->pulseChangeBPM());
|
||||||
@ -115,13 +113,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
ui->combineSlider->setValue(val);
|
ui->combineSlider->setValue(val);
|
||||||
if (val>0) {
|
if (val>0) {
|
||||||
ui->combineLCD->display(val);
|
ui->combineLCD->display(val);
|
||||||
} else ui->combineLCD->display(tr("OFF"));
|
} else ui->combineLCD->display(STR_GEN_Off);
|
||||||
|
|
||||||
val=profile->session->ignoreShortSessions();
|
val=profile->session->ignoreShortSessions();
|
||||||
ui->IgnoreSlider->setValue(val);
|
ui->IgnoreSlider->setValue(val);
|
||||||
if (val>0) {
|
if (val>0) {
|
||||||
ui->IgnoreLCD->display(val);
|
ui->IgnoreLCD->display(val);
|
||||||
} else ui->IgnoreLCD->display(tr("OFF"));
|
} else ui->IgnoreLCD->display(STR_GEN_Off);
|
||||||
|
|
||||||
ui->applicationFont->setCurrentFont(QApplication::font());
|
ui->applicationFont->setCurrentFont(QApplication::font());
|
||||||
//ui->applicationFont->setFont(QApplication::font());
|
//ui->applicationFont->setFont(QApplication::font());
|
||||||
@ -179,12 +177,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
|
|||||||
|
|
||||||
ui->graphHeight->setValue(profile->appearance->graphHeight());
|
ui->graphHeight->setValue(profile->appearance->graphHeight());
|
||||||
|
|
||||||
if (!PREF.Exists("Updates_AutoCheck")) PREF["Updates_AutoCheck"]=true;
|
if (!PREF.contains(STR_GEN_UpdatesAutoCheck)) PREF[STR_GEN_UpdatesAutoCheck]=true;
|
||||||
ui->automaticallyCheckUpdates->setChecked(PREF["Updates_AutoCheck"].toBool());
|
ui->automaticallyCheckUpdates->setChecked(PREF[STR_GEN_UpdatesAutoCheck].toBool());
|
||||||
|
|
||||||
if (!PREF.Exists("Updates_CheckFrequency")) PREF["Updates_CheckFrequency"]=3;
|
if (!PREF.contains(STR_GEN_UpdateCheckFrequency)) PREF[STR_GEN_UpdateCheckFrequency]=3;
|
||||||
ui->updateCheckEvery->setValue(PREF["Updates_CheckFrequency"].toInt());
|
ui->updateCheckEvery->setValue(PREF[STR_GEN_UpdateCheckFrequency].toInt());
|
||||||
if (PREF.Exists("Updates_LastChecked")) {
|
if (PREF.contains(STR_GEN_UpdatesLastChecked)) {
|
||||||
RefreshLastChecked();
|
RefreshLastChecked();
|
||||||
} else ui->updateLastChecked->setText("Never");
|
} else ui->updateLastChecked->setText("Never");
|
||||||
|
|
||||||
@ -335,10 +333,10 @@ void PreferencesDialog::Save()
|
|||||||
profile->oxi->setPulseChangeDuration(ui->pulseChangeTime->value());
|
profile->oxi->setPulseChangeDuration(ui->pulseChangeTime->value());
|
||||||
profile->oxi->setOxiDiscardThreshold(ui->oxiDiscardThreshold->value());
|
profile->oxi->setOxiDiscardThreshold(ui->oxiDiscardThreshold->value());
|
||||||
|
|
||||||
PREF["SkipLoginScreen"]=ui->skipLoginScreen->isChecked();
|
PREF[STR_GEN_SkipLogin]=ui->skipLoginScreen->isChecked();
|
||||||
|
|
||||||
PREF["Updates_AutoCheck"]=ui->automaticallyCheckUpdates->isChecked();
|
PREF[STR_GEN_UpdatesAutoCheck]=ui->automaticallyCheckUpdates->isChecked();
|
||||||
PREF["Updates_CheckFrequency"]=ui->updateCheckEvery->value();
|
PREF[STR_GEN_UpdateCheckFrequency]=ui->updateCheckEvery->value();
|
||||||
|
|
||||||
PREF["Fonts_Application_Name"]=ui->applicationFont->currentText();
|
PREF["Fonts_Application_Name"]=ui->applicationFont->currentText();
|
||||||
PREF["Fonts_Application_Size"]=ui->applicationFontSize->value();
|
PREF["Fonts_Application_Size"]=ui->applicationFontSize->value();
|
||||||
@ -418,27 +416,25 @@ void PreferencesDialog::on_combineSlider_valueChanged(int position)
|
|||||||
{
|
{
|
||||||
if (position>0) {
|
if (position>0) {
|
||||||
ui->combineLCD->display(position);
|
ui->combineLCD->display(position);
|
||||||
} else ui->combineLCD->display(tr("OFF"));
|
} else ui->combineLCD->display(STR_GEN_Off);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::on_IgnoreSlider_valueChanged(int position)
|
void PreferencesDialog::on_IgnoreSlider_valueChanged(int position)
|
||||||
{
|
{
|
||||||
if (position>0) {
|
if (position>0) {
|
||||||
ui->IgnoreLCD->display(position);
|
ui->IgnoreLCD->display(position);
|
||||||
} else ui->IgnoreLCD->display(tr("OFF"));
|
} else ui->IgnoreLCD->display(STR_GEN_Off);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
extern MainWindow * mainwin;
|
extern MainWindow * mainwin;
|
||||||
void PreferencesDialog::RefreshLastChecked()
|
void PreferencesDialog::RefreshLastChecked()
|
||||||
{
|
{
|
||||||
ui->updateLastChecked->setText(PREF["Updates_LastChecked"].toDateTime().toString(Qt::SystemLocaleLongDate));
|
ui->updateLastChecked->setText(PREF[STR_GEN_UpdatesLastChecked].toDateTime().toString(Qt::SystemLocaleLongDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDialog::on_checkForUpdatesButton_clicked()
|
void PreferencesDialog::on_checkForUpdatesButton_clicked()
|
||||||
{
|
{
|
||||||
//mainwin->statusBar()->showMessage("Checking for Updates");
|
|
||||||
//ui->updateLastChecked->setText("Checking for Updates");
|
|
||||||
mainwin->CheckForUpdates();
|
mainwin->CheckForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +591,7 @@ void PreferencesDialog::resetGraphModel()
|
|||||||
it->setData(i,Qt::UserRole+2);
|
it->setData(i,Qt::UserRole+2);
|
||||||
items.push_back(it);
|
items.push_back(it);
|
||||||
|
|
||||||
if (title!=tr("Event Flags")) { // ouchie.. Translations will cause problems here..
|
if (title!=STR_TR_EventFlags) {
|
||||||
|
|
||||||
it=new QStandardItem(QString::number((*gv)[i]->rec_miny,'f',1));
|
it=new QStandardItem(QString::number((*gv)[i]->rec_miny,'f',1));
|
||||||
it->setEditable(true);
|
it->setEditable(true);
|
||||||
|
@ -33,7 +33,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) :
|
|||||||
for (QHash<QString,Profile *>::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) {
|
for (QHash<QString,Profile *>::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) {
|
||||||
name=p.key();
|
name=p.key();
|
||||||
QStandardItem *item=new QStandardItem(*new QIcon(":/icons/moon.png"),name);
|
QStandardItem *item=new QStandardItem(*new QIcon(":/icons/moon.png"),name);
|
||||||
if (PREF.Exists("Profile") && (name==PREF["Profile"].toString())) {
|
if (PREF.contains(STR_GEN_Profile) && (name==PREF[STR_GEN_Profile].toString())) {
|
||||||
sel=i;
|
sel=i;
|
||||||
}
|
}
|
||||||
item->setData(p.key());
|
item->setData(p.key());
|
||||||
@ -53,7 +53,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) :
|
|||||||
/*PREF["SkipLogin"]=false;
|
/*PREF["SkipLogin"]=false;
|
||||||
if ((i==1) && PREF["SkipLogin"].toBool()) {
|
if ((i==1) && PREF["SkipLogin"].toBool()) {
|
||||||
if (!Profiles::profiles.contains(name))
|
if (!Profiles::profiles.contains(name))
|
||||||
PREF["Profile"]=name;
|
PREF[STR_GEN_Profile]=name;
|
||||||
QTimer::singleShot(0,this,SLOT(earlyExit()));
|
QTimer::singleShot(0,this,SLOT(earlyExit()));
|
||||||
hide();
|
hide();
|
||||||
} */
|
} */
|
||||||
@ -79,7 +79,7 @@ void ProfileSelect::editProfile()
|
|||||||
Profile *profile=Profiles::Get(name);
|
Profile *profile=Profiles::Get(name);
|
||||||
if (!profile) return;
|
if (!profile) return;
|
||||||
bool reallyEdit=false;
|
bool reallyEdit=false;
|
||||||
if (profile->Exists("Password")) {
|
if (profile->user->hasPassword()) {
|
||||||
QDialog dialog(this,Qt::Dialog);
|
QDialog dialog(this,Qt::Dialog);
|
||||||
QLineEdit *e=new QLineEdit(&dialog);
|
QLineEdit *e=new QLineEdit(&dialog);
|
||||||
e->setEchoMode(QLineEdit::Password);
|
e->setEchoMode(QLineEdit::Password);
|
||||||
@ -93,16 +93,15 @@ void ProfileSelect::editProfile()
|
|||||||
do {
|
do {
|
||||||
e->setText("");
|
e->setText("");
|
||||||
if (dialog.exec()!=QDialog::Accepted) break;
|
if (dialog.exec()!=QDialog::Accepted) break;
|
||||||
QByteArray ba=e->text().toUtf8();
|
|
||||||
tries++;
|
tries++;
|
||||||
if (QCryptographicHash::hash(ba,QCryptographicHash::Sha1).toHex()==(*profile)["Password"]) {
|
if (profile->user->checkPassword(e->text())) {
|
||||||
reallyEdit=true;
|
reallyEdit=true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (tries<3) {
|
if (tries<3) {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Incorrect Password"),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("Incorrect Password"),QMessageBox::Ok);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("You entered the password wrong too many times."),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("You entered the password wrong too many times."),QMessageBox::Ok);
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,7 +127,7 @@ void ProfileSelect::deleteProfile()
|
|||||||
QMessageBox::warning(this,tr("WTH???"),tr("If you can read this you need to delete this profile directory manually (It's under Your Documents folder -> SleepApp -> Profiles -> [profile_name])"),QMessageBox::Ok);
|
QMessageBox::warning(this,tr("WTH???"),tr("If you can read this you need to delete this profile directory manually (It's under Your Documents folder -> SleepApp -> Profiles -> [profile_name])"),QMessageBox::Ok);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (profile->Exists("Password")) {
|
if (profile->user->hasPassword()) {
|
||||||
QDialog dialog(this,Qt::Dialog);
|
QDialog dialog(this,Qt::Dialog);
|
||||||
QLineEdit *e=new QLineEdit(&dialog);
|
QLineEdit *e=new QLineEdit(&dialog);
|
||||||
e->setEchoMode(QLineEdit::Password);
|
e->setEchoMode(QLineEdit::Password);
|
||||||
@ -142,16 +141,15 @@ void ProfileSelect::deleteProfile()
|
|||||||
do {
|
do {
|
||||||
e->setText("");
|
e->setText("");
|
||||||
if (dialog.exec()!=QDialog::Accepted) break;
|
if (dialog.exec()!=QDialog::Accepted) break;
|
||||||
QByteArray ba=e->text().toUtf8();
|
|
||||||
tries++;
|
tries++;
|
||||||
if (QCryptographicHash::hash(ba,QCryptographicHash::Sha1).toHex()==(*profile)["Password"]) {
|
if (profile->user->checkPassword(e->text())) {
|
||||||
reallydelete=true;
|
reallydelete=true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (tries<3) {
|
if (tries<3) {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Incorrect Password"),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("Incorrect Password"),QMessageBox::Ok);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Meheh... If your trying to delete because you forgot the password, your going the wrong way about it. Read the docs.\n\nSigned: Nasty Programmer"),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("Meheh... If your trying to delete because you forgot the password, your going the wrong way about it. Read the docs.\n\nSigned: Nasty Programmer"),QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (tries<3);
|
} while (tries<3);
|
||||||
@ -198,9 +196,9 @@ void ProfileSelect::on_listView_activated(const QModelIndex &index)
|
|||||||
QString name=index.data().toString();
|
QString name=index.data().toString();
|
||||||
Profile *profile=Profiles::profiles[name];
|
Profile *profile=Profiles::profiles[name];
|
||||||
if (!profile) return;
|
if (!profile) return;
|
||||||
if (!profile->Exists("Password")) {
|
if (!profile->user->hasPassword()) {
|
||||||
m_selectedProfile=name;
|
m_selectedProfile=name;
|
||||||
PREF["Profile"]=name;
|
PREF[STR_GEN_Profile]=name;
|
||||||
accept();
|
accept();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -215,18 +213,17 @@ void ProfileSelect::on_listView_activated(const QModelIndex &index)
|
|||||||
dialog.setLayout(lay);
|
dialog.setLayout(lay);
|
||||||
lay->addWidget(e);
|
lay->addWidget(e);
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
QByteArray ba=e->text().toUtf8();
|
if (profile->user->checkPassword(e->text())) {
|
||||||
if (QCryptographicHash::hash(ba,QCryptographicHash::Sha1).toHex()==(*profile)["Password"]) {
|
|
||||||
m_selectedProfile=name;
|
m_selectedProfile=name;
|
||||||
PREF["Profile"]=name;
|
PREF[STR_GEN_Profile]=name;
|
||||||
accept();
|
accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tries++;
|
tries++;
|
||||||
if (tries<3) {
|
if (tries<3) {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("Incorrect Password"),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("Incorrect Password"),QMessageBox::Ok);
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::warning(this,tr("Error"),tr("You entered an Incorrect Password too many times. Exiting!"),QMessageBox::Ok);
|
QMessageBox::warning(this,STR_MESSAGE_ERROR,tr("You entered an Incorrect Password too many times. Exiting!"),QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
} while (tries<3);
|
} while (tries<3);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user