mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Merge branch 'master' into prs1-native-modes
This commit is contained in:
commit
384aacc904
@ -529,7 +529,11 @@ bool MainWindow::OpenProfile(QString profileName, bool skippassword)
|
||||
AppSetting->setProfileName(p_profile->user->userName());
|
||||
setWindowTitle(STR_TR_OSCAR + QString(" %1 (" + tr("Profile") + ": %2)").arg(getBranchVersion()).arg(AppSetting->profileName()));
|
||||
|
||||
bool noMachines = (machines.isEmpty());
|
||||
QList<Machine *> oximachines = p_profile->GetMachines(MT_OXIMETER); // Machines of any type except Journal
|
||||
QList<Machine *> posmachines = p_profile->GetMachines(MT_POSITION);
|
||||
QList<Machine *> stgmachines = p_profile->GetMachines(MT_SLEEPSTAGE);
|
||||
bool noMachines = machines.isEmpty() && posmachines.isEmpty() && oximachines.isEmpty() && stgmachines.isEmpty();
|
||||
qDebug() << "OpenProfile: noMachines" << noMachines;
|
||||
ui->importButton->setDisabled(false);
|
||||
ui->oximetryButton->setDisabled(false);
|
||||
ui->dailyButton->setDisabled(noMachines);
|
||||
@ -537,7 +541,7 @@ bool MainWindow::OpenProfile(QString profileName, bool skippassword)
|
||||
ui->statisticsButton->setDisabled(noMachines);
|
||||
ui->tabWidget->setTabEnabled(2, !noMachines); // daily, STR_TR_Daily);
|
||||
ui->tabWidget->setTabEnabled(3, !noMachines); // overview, STR_TR_Overview);
|
||||
ui->tabWidget->setTabEnabled(4, !noMachines); // overview, STR_TR_Overview);
|
||||
ui->tabWidget->setTabEnabled(4, !noMachines); // statistics, STR_TR_Statistics);
|
||||
|
||||
int srm = 0;
|
||||
if (p_profile) {
|
||||
@ -1360,6 +1364,8 @@ void MainWindow::on_oximetryButton_clicked()
|
||||
if (p_profile) {
|
||||
OximeterImport oxiimp(this);
|
||||
oxiimp.exec();
|
||||
if (overview) overview->ReloadGraphs();
|
||||
if (welcome) welcome->refreshPage();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -911,6 +911,11 @@ QString Statistics::GenerateMachineList()
|
||||
}
|
||||
QString Statistics::GenerateRXChanges()
|
||||
{
|
||||
// Generate list only if there are CPAP machines
|
||||
QList<Machine *> cpap_machines = p_profile->GetMachines(MT_CPAP);
|
||||
if (cpap_machines.isEmpty())
|
||||
return "";
|
||||
|
||||
// do the actual data sorting...
|
||||
updateRXChanges();
|
||||
|
||||
|
@ -35,19 +35,22 @@ void Welcome::refreshPage()
|
||||
{
|
||||
bool b;
|
||||
|
||||
// if (p_profile != nullptr) {
|
||||
const auto & mlist = p_profile->GetMachines(MT_CPAP);
|
||||
b = mlist.size() > 0;
|
||||
// } else
|
||||
// b = false;
|
||||
const auto & mlist = p_profile->GetMachines(MT_CPAP);
|
||||
b = mlist.size() > 0;
|
||||
|
||||
bool showCardWarning = !b;
|
||||
QList<Machine *> oximachines = p_profile->GetMachines(MT_OXIMETER);
|
||||
QList<Machine *> posmachines = p_profile->GetMachines(MT_POSITION);
|
||||
QList<Machine *> stgmachines = p_profile->GetMachines(MT_SLEEPSTAGE);
|
||||
|
||||
bool noMachines = mlist.isEmpty() && posmachines.isEmpty() && oximachines.isEmpty() && stgmachines.isEmpty();
|
||||
|
||||
bool showCardWarning = !noMachines;
|
||||
|
||||
// The SDCard warning does not need to be seen anymore for people who DON'T use ResMed S9's.. show first import and only when S9 is present
|
||||
for (auto & mach :mlist) {
|
||||
if (mach->series().compare("S9") == 0) showCardWarning = true;
|
||||
}
|
||||
|
||||
ui->S9Warning->setVisible(showCardWarning);
|
||||
|
||||
if (!b) {
|
||||
@ -56,6 +59,10 @@ void Welcome::refreshPage()
|
||||
ui->cpapIcon->setPixmap(pixmap);
|
||||
}
|
||||
|
||||
b = !noMachines;
|
||||
|
||||
qDebug() << "Welcome::refreshPae b =" << b << "noMachines" << noMachines;
|
||||
|
||||
// Copy application font to tool buttons
|
||||
ui->importButton->setFont(QApplication::font());
|
||||
ui->dailyButton->setFont(QApplication::font());
|
||||
@ -63,10 +70,9 @@ void Welcome::refreshPage()
|
||||
ui->statisticsButton->setFont(QApplication::font());
|
||||
ui->oximetryButton->setFont(QApplication::font());
|
||||
|
||||
|
||||
// Enable buttons that might be disabled
|
||||
ui->dailyButton->setEnabled(b);
|
||||
ui->oximetryButton->setEnabled(b);
|
||||
ui->oximetryButton->setEnabled(true); // Import features always enabled
|
||||
ui->overviewButton->setEnabled(b);
|
||||
ui->statisticsButton->setEnabled(b);
|
||||
|
||||
@ -78,13 +84,8 @@ void Welcome::refreshPage()
|
||||
|
||||
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());
|
||||
// qDebug() << "CPAPhtml" << GenerateCPAPHTML();
|
||||
}
|
||||
|
||||
void Welcome::on_dailyButton_clicked()
|
||||
|
Loading…
Reference in New Issue
Block a user