Add public EnableTabs so refreshing welcome page does tabs too

This commit is contained in:
Phil Olynyk 2019-03-25 21:10:03 -04:00
parent 8cc6e57e45
commit 60d1460ef6
3 changed files with 15 additions and 6 deletions

View File

@ -290,6 +290,12 @@ void MainWindow::log(QString text)
logger->appendClean(text);
}
void MainWindow::EnableTabs(bool b)
{
ui->tabWidget->setTabEnabled(2, b);
ui->tabWidget->setTabEnabled(3, b);
ui->tabWidget->setTabEnabled(4, b);
}
void MainWindow::Notify(QString s, QString title, int ms)
{

View File

@ -103,6 +103,8 @@ class MainWindow : public QMainWindow
//! \brief Start the automatic update checker process
void CheckForUpdates();
void EnableTabs(bool b);
void CloseProfile();
bool OpenProfile(QString name, bool skippassword = false);

View File

@ -34,11 +34,11 @@ void Welcome::refreshPage()
{
bool b;
if (p_profile != nullptr) {
// if (p_profile != nullptr) {
const auto & mlist = p_profile->GetMachines(MT_CPAP);
b = mlist.size() > 0;
} else
b = false;
// } else
// b = false;
bool showCardWarning = !b;
@ -57,9 +57,10 @@ 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);
mainwin->EnableTabs(b);
/** MainWindow::ui->tabWidget->setTabEnabled(2, b);********* need to find some other way
*** MainWindow::ui->tabWidget->setTabEnabled(3, b);********* to enable these tabs ******
*** MainWindow::ui->tabWidget->setTabEnabled(4, b);************************************/
ui->cpapInfo->setHtml(GenerateCPAPHTML());
ui->oxiInfo->setHtml(GenerateOxiHTML());