From 1e0f25ba4ef528205779f39d649120bb312fe40b Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 26 Dec 2011 02:56:22 +1000 Subject: [PATCH] Loading and empty data messages --- daily.cpp | 2 +- mainwindow.cpp | 11 ++++++++++- mainwindow.ui | 2 +- overview.cpp | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/daily.cpp b/daily.cpp index f0041c64..302633b7 100644 --- a/daily.cpp +++ b/daily.cpp @@ -325,7 +325,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) ui->weightSpinBox->setSuffix(STR_UNIT_KG); } GraphView->setCubeImage(images["sheep"]); - GraphView->setEmptyText(tr("Loading Data...")); + GraphView->setEmptyText(tr("No Data")); } Daily::~Daily() diff --git a/mainwindow.cpp b/mainwindow.cpp index 0079f183..743f57e8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -158,6 +158,8 @@ MainWindow::MainWindow(QWidget *parent) : //"border-top-left-radius: 8px;" //"border-top-right-radius: 8px;" + QString loadingtxt="

Loading...

"; + ui->summaryView->setHtml(loadingtxt); } extern MainWindow *mainwin; MainWindow::~MainWindow() @@ -532,6 +534,13 @@ void MainWindow::on_summaryButton_clicked() mach.append(oximeters); + if (mach.size()==0) { + html+=""; + html+="

Please Import Some Data


SleepyHead is pretty much useless without it.
"; + html+=htmlFooter(); + ui->summaryView->setHtml(html); + return; + } int cpapdays=PROFILE.countDays(MT_CPAP,firstcpap,lastcpap); CPAPMode cpapmode=(CPAPMode)p_profile->calcSettingsMax(CPAP_Mode,MT_CPAP,firstcpap,lastcpap); @@ -546,7 +555,7 @@ void MainWindow::on_summaryButton_clicked() html+="
"; html+=QString(""); if (cpapdays==0) { - //html+=""; + html+=""; } else { html+=QString("").arg(lastcpap.toString(Qt::SystemLocaleLongDate)); diff --git a/mainwindow.ui b/mainwindow.ui index 56d1003b..619fa341 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -78,7 +78,7 @@ QTabWidget::North - 1 + 0 false diff --git a/overview.cpp b/overview.cpp index 7eac28eb..36142411 100644 --- a/overview.cpp +++ b/overview.cpp @@ -72,7 +72,7 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : GraphView=new gGraphView(ui->graphArea,m_shared); GraphView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - GraphView->setEmptyText("Import some data!"); + GraphView->setEmptyText("No Data"); GraphView->setCubeImage(images["nodata"]); // Create the custom scrollbar and attach to GraphView
No Machine Data Imported
No CPAP Machine Data Imported
CPAP Statistics as of %1