mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-09 04:30:43 +00:00
Preferences fixes, plus font cleanup
This commit is contained in:
parent
79bd4946cf
commit
f00e18fb11
@ -104,7 +104,7 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
|
||||
if (xx<(1800.0/86400.0)) {
|
||||
GetTextExtent(label,x,y);
|
||||
DrawText(w,label,x1-(x/2),scry-(start_py+height-30+y));
|
||||
//w.renderText(x1-(x/2),start_py+height-30+y,label);
|
||||
//w.renderText(x1-(x/2),scry-(start_py+height-30+y),label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +186,7 @@ bool Preferences::Open(QString filename)
|
||||
TiXmlAttribute *attr=pElem->FirstAttribute();
|
||||
assert(attr!=NULL);
|
||||
QString type=attr->Value();
|
||||
type=type.toLower();
|
||||
QString pKey=pElem->Value();
|
||||
QString pText=pElem->GetText();
|
||||
bool ok;
|
||||
@ -204,11 +205,16 @@ bool Preferences::Open(QString filename)
|
||||
p_preferences[pKey]=d;
|
||||
} else if (type=="bool") {
|
||||
int d=pText.toInt(&ok);
|
||||
if (!ok)
|
||||
qDebug("String to number conversion error in Preferences::Open()");
|
||||
else
|
||||
if (!ok) {
|
||||
if (pText.toLower()=="true")
|
||||
p_preferences[pKey]=true;
|
||||
else if (pText.toLower()=="false")
|
||||
p_preferences[pKey]=false;
|
||||
else
|
||||
qDebug("String to number conversion error in Preferences::Open()");
|
||||
} else
|
||||
p_preferences[pKey]=(bool)d;
|
||||
} else if (type=="QDateTime") {
|
||||
} else if (type=="qdatetime") {
|
||||
QDateTime d;
|
||||
d.fromString("yyyy-MM-dd HH:mm:ss");
|
||||
if (d.isValid())
|
||||
|
98
daily.cpp
98
daily.cpp
@ -66,7 +66,7 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
AddCPAPData(flags[8]=new FlagData(PRS1_VSnore2,1));
|
||||
AddCPAPData(flags[9]=new FlagData(PRS1_Unknown0E,1));
|
||||
AddCPAPData(frw=new WaveData(CPAP_FlowRate));
|
||||
AddGraph(SF=new gGraphWindow(gSplitter,"Event Flags",(QGLWidget *)NULL));
|
||||
AddGraph(SF=new gGraphWindow(gSplitter,tr("Event Flags"),(QGLWidget *)NULL));
|
||||
int sfc=7;
|
||||
SF->SetLeftMargin(SF->GetLeftMargin()+gYAxis::Margin);
|
||||
SF->SetBlockZoom(true);
|
||||
@ -91,19 +91,19 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
AddCPAPData(pressure_iap=new EventData(CPAP_IAP));
|
||||
AddCPAPData(pressure_eap=new EventData(CPAP_EAP));
|
||||
AddCPAPData(prd=new EventData(CPAP_Pressure));
|
||||
AddGraph(PRD=new gGraphWindow(gSplitter,"Pressure",SF));
|
||||
AddGraph(PRD=new gGraphWindow(gSplitter,tr("Pressure"),SF));
|
||||
PRD->AddLayer(new gXAxis());
|
||||
PRD->AddLayer(new gYAxis());
|
||||
PRD->AddLayer(new gFooBar());
|
||||
PRD->AddLayer(new gLineChart(prd,QColor("dark green"),4096,false,false,true));
|
||||
PRD->AddLayer(new gLineChart(pressure_iap,QColor("blue"),4096,false,true,true));
|
||||
PRD->AddLayer(new gLineChart(pressure_eap,QColor("red"),4096,false,true,true));
|
||||
PRD->AddLayer(new gLineChart(pressure_iap,Qt::blue,4096,false,true,true));
|
||||
PRD->AddLayer(new gLineChart(pressure_eap,Qt::red,4096,false,true,true));
|
||||
PRD->setMinimumHeight(150);
|
||||
|
||||
AddCPAPData(leakdata=new EventData(CPAP_Leak,0));
|
||||
//leakdata->ForceMinY(0);
|
||||
//leakdata->ForceMaxY(120);
|
||||
AddGraph(LEAK=new gGraphWindow(gSplitter,"Leaks",SF));
|
||||
AddGraph(LEAK=new gGraphWindow(gSplitter,tr("Leaks"),SF));
|
||||
LEAK->AddLayer(new gXAxis());
|
||||
LEAK->AddLayer(new gYAxis());
|
||||
LEAK->AddLayer(new gFooBar());
|
||||
@ -112,12 +112,12 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
LEAK->setMinimumHeight(150);
|
||||
|
||||
|
||||
AddGraph(FRW=new gGraphWindow(gSplitter,"Flow Rate",SF));
|
||||
AddGraph(FRW=new gGraphWindow(gSplitter,tr("Flow Rate"),SF));
|
||||
FRW->AddLayer(new gFooBar());
|
||||
FRW->AddLayer(new gYAxis());
|
||||
FRW->AddLayer(new gXAxis());
|
||||
FRW->AddLayer(new gLineOverlayBar(flags[0],QColor("light green"),"CSR"));
|
||||
gLineChart *g=new gLineChart(frw,QColor("black"),200000,true);
|
||||
gLineChart *g=new gLineChart(frw,Qt::black,200000,true);
|
||||
g->ReportEmpty(true);
|
||||
|
||||
|
||||
@ -136,33 +136,33 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
AddCPAPData(snore=new EventData(CPAP_SnoreGraph,0));
|
||||
//snore->ForceMinY(0);
|
||||
//snore->ForceMaxY(15);
|
||||
AddGraph(SNORE=new gGraphWindow(gSplitter,"Snore",SF));
|
||||
AddGraph(SNORE=new gGraphWindow(gSplitter,tr("Snore"),SF));
|
||||
SNORE->AddLayer(new gXAxis());
|
||||
SNORE->AddLayer(new gYAxis());
|
||||
SNORE->AddLayer(new gFooBar());
|
||||
SNORE->AddLayer(new gLineChart(snore,QColor("black"),4096,false,false,true));
|
||||
SNORE->AddLayer(new gLineChart(snore,Qt::black,4096,false,false,true));
|
||||
|
||||
SNORE->setMinimumHeight(150);
|
||||
|
||||
AddOXIData(pulse=new EventData(OXI_Pulse,0,65536,true));
|
||||
//pulse->ForceMinY(40);
|
||||
//pulse->ForceMaxY(120);
|
||||
AddGraph(PULSE=new gGraphWindow(gSplitter,"Pulse",SF));
|
||||
AddGraph(PULSE=new gGraphWindow(gSplitter,tr("Pulse"),SF));
|
||||
PULSE->AddLayer(new gXAxis());
|
||||
PULSE->AddLayer(new gYAxis());
|
||||
PULSE->AddLayer(new gFooBar());
|
||||
PULSE->AddLayer(new gLineChart(pulse,QColor("red"),65536,false,false,true));
|
||||
PULSE->AddLayer(new gLineChart(pulse,Qt::red,65536,false,false,true));
|
||||
|
||||
PULSE->setMinimumHeight(150);
|
||||
|
||||
AddOXIData(spo2=new EventData(OXI_SPO2,0,65536,true));
|
||||
//spo2->ForceMinY(60);
|
||||
//spo2->ForceMaxY(100);
|
||||
AddGraph(SPO2=new gGraphWindow(gSplitter,"SpO2",SF));
|
||||
AddGraph(SPO2=new gGraphWindow(gSplitter,tr("SpO2"),SF));
|
||||
SPO2->AddLayer(new gXAxis());
|
||||
SPO2->AddLayer(new gYAxis());
|
||||
SPO2->AddLayer(new gFooBar());
|
||||
SPO2->AddLayer(new gLineChart(spo2,QColor("blue"),65536,false,false,true));
|
||||
SPO2->AddLayer(new gLineChart(spo2,Qt::blue,65536,false,false,true));
|
||||
SPO2->setMinimumHeight(150);
|
||||
SPO2->LinkZoom(PULSE);
|
||||
PULSE->LinkZoom(SPO2);
|
||||
@ -191,12 +191,12 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
G_AHI->SetMargins(0,0,0,0);
|
||||
AddCPAPData(g_ahi=new AHIData());
|
||||
gCandleStick *l=new gCandleStick(g_ahi);
|
||||
l->AddName("H");
|
||||
l->AddName("OA");
|
||||
l->AddName("CA");
|
||||
l->AddName("RE");
|
||||
l->AddName("FL");
|
||||
l->AddName("CSR");
|
||||
l->AddName(tr("H"));
|
||||
l->AddName(tr("OA"));
|
||||
l->AddName(tr("CA"));
|
||||
l->AddName(tr("RE"));
|
||||
l->AddName(tr("FL"));
|
||||
l->AddName(tr("CSR"));
|
||||
l->color.clear();
|
||||
l->color.push_back(QColor("blue"));
|
||||
l->color.push_back(QColor("aqua"));
|
||||
@ -207,9 +207,9 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
G_AHI->AddLayer(l);
|
||||
//G_AHI->setMaximumSize(2000,30);
|
||||
//TAP->setMaximumSize(2000,30);
|
||||
NoData=new QLabel("No CPAP Data",gSplitter);
|
||||
NoData=new QLabel(tr("No CPAP Data"),gSplitter);
|
||||
NoData->setAlignment(Qt::AlignCenter);
|
||||
QFont font("Times",20); //NoData->font();
|
||||
QFont font("FreeSans",20); //NoData->font();
|
||||
//font.setBold(true);
|
||||
NoData->setFont(font);
|
||||
NoData->hide();
|
||||
@ -252,16 +252,6 @@ Daily::Daily(QWidget *parent,QGLContext *context) :
|
||||
|
||||
ui->graphSizer->layout();
|
||||
|
||||
/*ui->graphLayout->addWidget(SF);
|
||||
ui->graphLayout->addWidget(FRW);
|
||||
ui->graphLayout->addWidget(PRD);
|
||||
ui->graphLayout->addWidget(LEAK);
|
||||
ui->graphLayout->addWidget(SNORE);
|
||||
ui->graphLayout->addWidget(PULSE);
|
||||
ui->graphLayout->addWidget(SPO2); */
|
||||
// ui->graphLayout->addWidget(G_AHI);
|
||||
//ui->graphLayout->addWidget(TAP);
|
||||
|
||||
QTextCharFormat format = ui->calendar->weekdayTextFormat(Qt::Saturday);
|
||||
format.setForeground(QBrush(Qt::black, Qt::SolidPattern));
|
||||
ui->calendar->setWeekdayTextFormat(Qt::Saturday, format);
|
||||
@ -443,7 +433,7 @@ void Daily::Load(QDate date)
|
||||
html=html+"<tr><td colspan=4 align=center>"+cpap->machine->properties["Serial"]+"</td></tr>\n";
|
||||
}
|
||||
|
||||
html=html+"<tr><td align='center'><b>Date</b></td><td align='center'><b>Sleep</b></td><td align='center'><b>Wake</b></td><td align='center'><b>Hours</b></td></tr>";
|
||||
html=html+"<tr><td align='center'><b>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>";
|
||||
int tt=cpap->total_time();
|
||||
html=html+"<tr><td align='center'>"+cpap->first().date().toString(Qt::SystemLocaleShortDate)+"</td><td align='center'>"+cpap->first().toString("HH:mm")+"</td><td align='center'>"+cpap->last().toString("HH:mm")+"</td><td align='center'>"+a.sprintf("%02i:%02i",tt/3600,tt%60)+"</td></tr>\n";
|
||||
html=html+"<tr><td colspan=4 align=center><hr></td></tr>\n";
|
||||
@ -490,7 +480,7 @@ void Daily::Load(QDate date)
|
||||
//html=html+wxT("<tr><td colspan=4 align=center><hr></td></tr>\n");
|
||||
|
||||
if (mode==MODE_BIPAP) {
|
||||
html=html+("<tr><td colspan=4 align='center'><i>")+tr("90% EPAP ")+a.sprintf("%.2f",eap90)+"cmH2O</td></tr>\n";
|
||||
html=html+("<tr><td colspan=4 align='center'><i>")+tr("90% EPAP ")+a.sprintf("%.2f",eap90)+tr("cmH2O")+"</td></tr>\n";
|
||||
html=html+("<tr><td colspan=4 align='center'><i>")+tr("90% IPAP ")+a.sprintf("%.2f",iap90)+"</td></tr>\n";
|
||||
} else if (mode==MODE_APAP) {
|
||||
html=html+("<tr><td colspan=4 align='center'><i>")+tr("90% Pressure ")+a.sprintf("%.2f",cpap->summary_weighted_avg(CPAP_PressurePercentValue))+("</i></td></tr>\n");
|
||||
@ -502,30 +492,30 @@ void Daily::Load(QDate date)
|
||||
html=html+("<tr><td> </td><td><b>Min</b></td><td><b>Avg</b></td><td><b>Max</b></td></tr>");
|
||||
|
||||
if (mode==MODE_APAP) {
|
||||
html=html+"<tr><td>Pressure</td><td>"+a.sprintf("%.2f",cpap->summary_min(CPAP_PressureMinAchieved));
|
||||
html=html+"<tr><td>"+tr("Pressure")+"</td><td>"+a.sprintf("%.2f",cpap->summary_min(CPAP_PressureMinAchieved));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_weighted_avg(CPAP_PressureAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_max(CPAP_PressureMaxAchieved))+("</td></tr>");
|
||||
|
||||
// html=html+wxT("<tr><td><b>")+_("90% Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%.1fcmH2O"),p90)+wxT("</td></tr>\n");
|
||||
} else if (mode==MODE_BIPAP) {
|
||||
html=html+("<tr><td>EPAP</td><td>")+a.sprintf("%.2f",cpap->summary_min(BIPAP_EAPMin));
|
||||
html=html+("<tr><td>"+tr("EPAP")+"</td><td>")+a.sprintf("%.2f",cpap->summary_min(BIPAP_EAPMin));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_weighted_avg(BIPAP_EAPAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_max(BIPAP_EAPMax))+("</td></tr>");
|
||||
|
||||
html=html+("<tr><td>IPAP</td><td>")+a.sprintf("%.2f",cpap->summary_min(BIPAP_IAPMin));
|
||||
html=html+("<tr><td>"+tr("IPAP")+"</td><td>")+a.sprintf("%.2f",cpap->summary_min(BIPAP_IAPMin));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_weighted_avg(BIPAP_IAPAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_max(BIPAP_IAPMax))+("</td></tr>");
|
||||
|
||||
}
|
||||
html=html+("<tr><td>Leak");
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_min(CPAP_LeakMinimum));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_weighted_avg(CPAP_LeakAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_max(CPAP_LeakMaximum))+("</td><tr>");
|
||||
html=html+"<tr><td>"+tr("Leak");
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_min(CPAP_LeakMinimum));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_weighted_avg(CPAP_LeakAverage));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_max(CPAP_LeakMaximum))+("</td><tr>");
|
||||
|
||||
html=html+("<tr><td>Snore");
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_min(CPAP_SnoreMinimum));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_avg(CPAP_SnoreAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f",cpap->summary_max(CPAP_SnoreMaximum))+("</td><tr>");
|
||||
html=html+"<tr><td>"+tr("Snore");
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_min(CPAP_SnoreMinimum));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_avg(CPAP_SnoreAverage));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f",cpap->summary_max(CPAP_SnoreMaximum))+("</td><tr>");
|
||||
FRW->show();
|
||||
PRD->show();
|
||||
LEAK->show();
|
||||
@ -545,15 +535,15 @@ void Daily::Load(QDate date)
|
||||
SNORE->hide();
|
||||
}
|
||||
if (oxi) {
|
||||
html=html+("<tr><td>Pulse");
|
||||
html=html+("</td><td>")+a.sprintf("%.2fbpm",oxi->summary_min(OXI_PulseMin));
|
||||
html=html+("</td><td>")+a.sprintf("%.2fbpm",oxi->summary_avg(OXI_PulseAverage));
|
||||
html=html+("</td><td>")+a.sprintf("%.2fbpm",oxi->summary_max(OXI_PulseMax))+"</td><tr>";
|
||||
html=html+"<tr><td>"+tr("Pulse");
|
||||
html=html+"</td><td>"+a.sprintf("%.2fbpm",oxi->summary_min(OXI_PulseMin));
|
||||
html=html+"</td><td>"+a.sprintf("%.2fbpm",oxi->summary_avg(OXI_PulseAverage));
|
||||
html=html+"</td><td>"+a.sprintf("%.2fbpm",oxi->summary_max(OXI_PulseMax))+"</td><tr>";
|
||||
|
||||
html=html+("<tr><td>SpO2");
|
||||
html=html+("</td><td>")+a.sprintf("%.2f%%",oxi->summary_min(OXI_SPO2Min));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f%%",oxi->summary_avg(OXI_SPO2Average));
|
||||
html=html+("</td><td>")+a.sprintf("%.2f%%",oxi->summary_max(OXI_SPO2Max))+"</td><tr>";
|
||||
html=html+"<tr><td>"+tr("SpO2");
|
||||
html=html+"</td><td>"+a.sprintf("%.2f%%",oxi->summary_min(OXI_SPO2Min));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f%%",oxi->summary_avg(OXI_SPO2Average));
|
||||
html=html+"</td><td>"+a.sprintf("%.2f%%",oxi->summary_max(OXI_SPO2Max))+"</td><tr>";
|
||||
|
||||
//html=html+wxT("<tr><td colspan=4> </td></tr>\n");
|
||||
|
||||
@ -564,7 +554,7 @@ void Daily::Load(QDate date)
|
||||
SPO2->hide();
|
||||
}
|
||||
if (!cpap && !oxi) {
|
||||
NoData->setText("No CPAP Data for "+date.toString(Qt::SystemLocaleLongDate));
|
||||
NoData->setText(tr("No CPAP Data for ")+date.toString(Qt::SystemLocaleLongDate));
|
||||
NoData->show();
|
||||
} else
|
||||
NoData->hide();
|
||||
@ -690,7 +680,7 @@ void Daily::on_JournalNotesFontsize_activated(int index)
|
||||
|
||||
void Daily::on_JournalNotesColour_clicked()
|
||||
{
|
||||
QColor col=QColorDialog::getColor(QColor("black"),this,tr("Pick a Colour")); //,QColorDialog::NoButtons);
|
||||
QColor col=QColorDialog::getColor(Qt::black,this,tr("Pick a Colour")); //,QColorDialog::NoButtons);
|
||||
if (!col.isValid()) return;
|
||||
|
||||
QTextCursor cursor = ui->JournalNotes->textCursor();
|
||||
|
2
daily.h
2
daily.h
@ -31,6 +31,7 @@ public:
|
||||
~Daily();
|
||||
void SetGLContext(QGLContext *context) { shared_context=context; };
|
||||
void ReloadGraphs();
|
||||
void RedrawGraphs();
|
||||
|
||||
private slots:
|
||||
|
||||
@ -67,7 +68,6 @@ private:
|
||||
void AddGraph(gGraphWindow *w) { Graphs.push_back(w); };
|
||||
void UpdateCPAPGraphs(Day *day);
|
||||
void UpdateOXIGraphs(Day *day);
|
||||
void RedrawGraphs();
|
||||
|
||||
gPointData *flags[10];
|
||||
|
||||
|
24
daily.ui
24
daily.ui
@ -60,6 +60,12 @@
|
||||
<height>180</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="firstDayOfWeek">
|
||||
<enum>Qt::Sunday</enum>
|
||||
</property>
|
||||
@ -77,6 +83,12 @@
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -96,6 +108,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWebView" name="webView">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
@ -121,6 +139,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeWidget">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
|
@ -26,7 +26,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowTitle("SleepyHead v0.8."+subversion);
|
||||
this->setWindowTitle(tr("SleepyHead")+QString(" v0.8.")+subversion);
|
||||
|
||||
QGLFormat fmt;
|
||||
fmt.setDepth(false);
|
||||
@ -51,11 +51,15 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
//loader_progress->Show();
|
||||
|
||||
//pref["Version"]=wxString(AutoVersion::_FULLVERSION_STRING,wxConvUTF8);
|
||||
pref["AppName"]="SleepyHead";
|
||||
pref["Profile"]=getUserName();
|
||||
pref["LinkGraphMovement"]=true;
|
||||
pref["fruitsalad"]=true;
|
||||
if (!pref.Exists("AppName")) pref["AppName"]="SleepyHead";
|
||||
if (!pref.Exists("Profile")) pref["Profile"]=getUserName();
|
||||
if (!pref.Exists("LinkGraphMovement")) pref["LinkGraphMovement"]=true;
|
||||
else ui->action_Link_Graphs->setChecked(pref["LinkGraphMovement"].toBool());
|
||||
|
||||
if (!pref.Exists("fruitsalad")) pref["fruitsalad"]=true;
|
||||
|
||||
if (!pref.Exists("UseAntiAliasing")) pref["UseAntiAliasing"]=false;
|
||||
else ui->actionUse_AntiAliasing->setChecked(pref["UseAntiAliasing"].toBool());
|
||||
first_load=true;
|
||||
}
|
||||
|
||||
@ -77,7 +81,7 @@ MainWindow::~MainWindow()
|
||||
void MainWindow::Startup()
|
||||
{
|
||||
|
||||
qstatus->setText("Loading Data");
|
||||
qstatus->setText(tr("Loading Data"));
|
||||
qprogress->show();
|
||||
|
||||
profile=Profiles::Get(pref["Profile"].toString());
|
||||
@ -85,11 +89,11 @@ void MainWindow::Startup()
|
||||
|
||||
daily=new Daily(ui->tabWidget,shared_context);
|
||||
overview=new Overview(ui->tabWidget,shared_context);
|
||||
ui->tabWidget->addTab(daily,"Daily");
|
||||
ui->tabWidget->addTab(overview,"Overview");
|
||||
ui->tabWidget->addTab(daily,tr("Daily"));
|
||||
ui->tabWidget->addTab(overview,tr("Overview"));
|
||||
|
||||
qprogress->hide();
|
||||
qstatus->setText("Ready");
|
||||
qstatus->setText(tr("Ready"));
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Import_Data_triggered()
|
||||
@ -102,7 +106,7 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
if (qfd.exec()) {
|
||||
qprogress->setValue(0);
|
||||
qprogress->show();
|
||||
qstatus->setText("Importing Data");
|
||||
qstatus->setText(tr("Importing Data"));
|
||||
dirNames=qfd.selectedFiles();
|
||||
for (int i=0;i<dirNames.size();i++) {
|
||||
profile->Import(dirNames[i]);
|
||||
@ -111,25 +115,15 @@ void MainWindow::on_action_Import_Data_triggered()
|
||||
daily->ReloadGraphs();
|
||||
overview->ReloadGraphs();
|
||||
overview->UpdateGraphs();
|
||||
qstatus->setText("Ready");
|
||||
qstatus->setText(tr("Ready"));
|
||||
qprogress->hide();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionView_Daily_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionView_Overview_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionView_Welcome_triggered()
|
||||
{
|
||||
|
||||
ui->tabWidget->setCurrentWidget(ui->welcome);
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Fullscreen_triggered()
|
||||
@ -141,12 +135,6 @@ void MainWindow::on_action_Fullscreen_triggered()
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUse_AntiAliasing_triggered()
|
||||
{
|
||||
pref["UseAntiAliasing"]=(bool)ui->actionUse_AntiAliasing->isChecked();
|
||||
if (daily) daily->update();
|
||||
}
|
||||
|
||||
void MainWindow::on_homeButton_clicked()
|
||||
{
|
||||
QString file="qrc:/docs/index.html";
|
||||
@ -197,7 +185,7 @@ void MainWindow::on_webView_loadFinished(bool arg1)
|
||||
QTimer::singleShot(0,this,SLOT(Startup()));
|
||||
first_load=false;
|
||||
} else {
|
||||
qstatus->setText("Ready");
|
||||
qstatus->setText(tr("Ready"));
|
||||
}
|
||||
ui->backButton->setEnabled(ui->webView->history()->canGoBack());
|
||||
ui->forwardButton->setEnabled(ui->webView->history()->canGoForward());
|
||||
@ -207,7 +195,7 @@ void MainWindow::on_webView_loadFinished(bool arg1)
|
||||
void MainWindow::on_webView_loadStarted()
|
||||
{
|
||||
if (!first_load) {
|
||||
qstatus->setText("Loading");
|
||||
qstatus->setText(tr("Loading"));
|
||||
qprogress->reset();
|
||||
qprogress->show();
|
||||
}
|
||||
@ -220,14 +208,26 @@ void MainWindow::on_webView_loadProgress(int progress)
|
||||
|
||||
void MainWindow::on_action_About_triggered()
|
||||
{
|
||||
QString msg="<html><body><div align='center'><h2>SleepyHead v0.8.0</h2><hr>\
|
||||
QString msg=tr("<html><body><div align='center'><h2>SleepyHead v0.8.0</h2><hr>\
|
||||
Copyright ©2011 Mark Watkins (jedimark) <br> \n\
|
||||
<a href='http://sleepyhead.sourceforge.net'>http://sleepyhead.sourceforge.net</a> <hr>\
|
||||
This software is released under the GNU Public License <hr> \
|
||||
<i>This software comes with absolutely no warranty, either express of implied. It comes with no guarantee of fitness for any particular purpose. No guarantees are made regarding the accuracy of any data this program displays.\
|
||||
</div></body></html>";
|
||||
QMessageBox msgbox(QMessageBox::Information,"About SleepyHead","",QMessageBox::Ok,this);
|
||||
</div></body></html>");
|
||||
QMessageBox msgbox(QMessageBox::Information,tr("About SleepyHead"),"",QMessageBox::Ok,this);
|
||||
msgbox.setTextFormat(Qt::RichText);
|
||||
msgbox.setText(msg);
|
||||
msgbox.exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Link_Graphs_triggered(bool checked)
|
||||
{
|
||||
pref["LinkGraphMovement"]=checked;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUse_AntiAliasing_triggered(bool checked)
|
||||
{
|
||||
pref["UseAntiAliasing"]=checked;
|
||||
if (daily) daily->RedrawGraphs();
|
||||
|
||||
}
|
||||
|
10
mainwindow.h
10
mainwindow.h
@ -28,16 +28,10 @@ public:
|
||||
private slots:
|
||||
void on_action_Import_Data_triggered();
|
||||
|
||||
void on_actionView_Daily_triggered();
|
||||
|
||||
void on_actionView_Overview_triggered();
|
||||
|
||||
void on_actionView_Welcome_triggered();
|
||||
|
||||
void on_action_Fullscreen_triggered();
|
||||
|
||||
void on_actionUse_AntiAliasing_triggered();
|
||||
|
||||
void on_homeButton_clicked();
|
||||
|
||||
void on_backButton_clicked();
|
||||
@ -62,6 +56,10 @@ private slots:
|
||||
|
||||
void Startup();
|
||||
|
||||
void on_action_Link_Graphs_triggered(bool checked);
|
||||
|
||||
void on_actionUse_AntiAliasing_triggered(bool checked);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
Daily * daily;
|
||||
|
@ -22,6 +22,12 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>SleepyHead</string>
|
||||
</property>
|
||||
@ -497,6 +503,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@ -513,7 +532,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1089</width>
|
||||
<height>29</height>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -669,5 +688,37 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionView_Daily</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>dailyButton</receiver>
|
||||
<slot>click()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>1020</x>
|
||||
<y>223</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>actionView_Overview</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>overviewButton</receiver>
|
||||
<slot>click()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>1020</x>
|
||||
<y>319</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
@ -45,7 +45,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
||||
gSplitter->setHandleWidth(3);
|
||||
ui->graphLayout->addWidget(gSplitter);
|
||||
|
||||
AHI=new gGraphWindow(ui->SummaryGraphWindow,"AHI",(QGLWidget *)NULL); // Not sure here..
|
||||
AHI=new gGraphWindow(ui->SummaryGraphWindow,tr("AHI"),(QGLWidget *)NULL); // Not sure here..
|
||||
AHI->SetTopMargin(10);
|
||||
AHI->SetBottomMargin(AHI->GetBottomMargin()+gXAxis::Margin+25);
|
||||
AHI->AddLayer(new gFooBar(7));
|
||||
@ -53,7 +53,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
||||
AHI->AddLayer(new gBarChart(ahidata,QColor("red")));
|
||||
AHI->setMinimumHeight(170);
|
||||
|
||||
PRESSURE=new gGraphWindow(ui->SummaryGraphWindow,"Pressure",AHI);
|
||||
PRESSURE=new gGraphWindow(ui->SummaryGraphWindow,tr("Pressure"),AHI);
|
||||
//PRESSURE->SetMargins(10,15,65,80);
|
||||
PRESSURE->AddLayer(new gYAxis());
|
||||
PRESSURE->AddLayer(new gXAxis());
|
||||
@ -66,7 +66,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
||||
PRESSURE->SetBottomMargin(PRESSURE->GetBottomMargin()+25);
|
||||
PRESSURE->setMinimumHeight(170);
|
||||
|
||||
LEAK=new gGraphWindow(ui->SummaryGraphWindow,"Leak",AHI);
|
||||
LEAK=new gGraphWindow(ui->SummaryGraphWindow,tr("Leak"),AHI);
|
||||
//LEAK->SetMargins(10,15,65,80);
|
||||
//LEAK->AddLayer(new gBarChart(leak,wxYELLOW));
|
||||
LEAK->AddLayer(new gXAxis());
|
||||
@ -76,7 +76,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
||||
LEAK->SetBottomMargin(LEAK->GetBottomMargin()+25);
|
||||
LEAK->setMinimumHeight(170);
|
||||
|
||||
USAGE=new gGraphWindow(ui->SummaryGraphWindow,"Usage (Hours)",AHI);
|
||||
USAGE=new gGraphWindow(ui->SummaryGraphWindow,tr("Usage (Hours)"),AHI);
|
||||
//USAGE->SetMargins(10,15,65,80);
|
||||
USAGE->AddLayer(new gFooBar(7));
|
||||
USAGE->AddLayer(new gYAxis());
|
||||
|
Loading…
Reference in New Issue
Block a user