Enable buttons and tabs if machine data is available

This commit is contained in:
Phil Olynyk 2019-03-25 17:37:26 -04:00
parent cb025431e5
commit 6213819fa5

View File

@ -32,9 +32,14 @@ Welcome::~Welcome()
void Welcome::refreshPage()
{
const auto & mlist = p_profile->GetMachines(MT_CPAP);
bool b;
if (p_profile != nullptr) {
const auto & mlist = p_profile->GetMachines(MT_CPAP);
b = mlist.size() > 0;
} else
b = false;
bool b = mlist.size() > 0;
bool showCardWarning = !b;
@ -52,9 +57,9 @@ void Welcome::refreshPage()
ui->dailyButton->setEnabled(b);
ui->overviewButton->setEnabled(b);
ui->statisticsButton->setEnabled(b);
// ui->tabWidget->setTabEnabled(2, b);
// ui->tabWidget->setTabEnabled(3, b);
// ui->tabWidget->setTabEnabled(4, b);
ui->tabWidget->setTabEnabled(2, b);
ui->tabWidget->setTabEnabled(3, b);
ui->tabWidget->setTabEnabled(4, b);
ui->cpapInfo->setHtml(GenerateCPAPHTML());
ui->oxiInfo->setHtml(GenerateOxiHTML());