diff --git a/oscar/mainwindow.h b/oscar/mainwindow.h index 659a03d0..f21aea5c 100644 --- a/oscar/mainwindow.h +++ b/oscar/mainwindow.h @@ -367,8 +367,6 @@ class MainWindow : public QMainWindow void on_profilesButton_clicked(); - void reloadProfile(); - void on_bookmarkView_anchorClicked(const QUrl &arg1); void on_recordsBox_anchorClicked(const QUrl &linkurl); @@ -377,6 +375,8 @@ class MainWindow : public QMainWindow void on_actionShowPersonalData_toggled(bool visible); +public slots: + void reloadProfile(); private: QString getMainWindowTitle(); diff --git a/oscar/preferencesdialog.cpp b/oscar/preferencesdialog.cpp index dcfc780e..b9aa89b1 100644 --- a/oscar/preferencesdialog.cpp +++ b/oscar/preferencesdialog.cpp @@ -55,9 +55,6 @@ QString PreferencesDialog::clinicalHelp() { <setIncludeSerial(ui->includeSerial->isChecked()); AppSetting->setMonochromePrinting(ui->monochromePrinting->isChecked()); p_profile->appearance->setEventFlagSessionBar(ui->eventFlagSessionBar->isChecked()); + + bool clicicalModeChanged = profile->cpap->clinicalMode() != ui->clinicalMode->isChecked() ; p_profile->cpap->setClinicalMode(ui->clinicalMode->isChecked()); + HighResolution::checkBox(true,ui->highResolution); AppSetting->setGraphTooltips(ui->graphTooltips->isChecked()); @@ -1014,6 +1014,12 @@ bool PreferencesDialog::Save() profile->Save(); profile->resetOxiChannelPref(); + if (clicicalModeChanged) { + // this fails - causing duplicate reload. + //QTimer::singleShot(0, mainwin, SLOT(reloadProfile())); + // while this one works. + mainwin->reloadProfile(); + } else if (recompress_events) { mainwin->recompressEvents(); } else if (recalc_events) { @@ -1022,7 +1028,7 @@ bool PreferencesDialog::Save() } else if (needs_reload) { QTimer::singleShot(0, mainwin, SLOT(reloadProfile())); } else if (needs_restart) { - mainwin->RestartApplication(); + mainwin->RestartApplication(true,"-l"); } else { mainwin->getDaily()->LoadDate(mainwin->getDaily()->getDate()); // Save early.. just in case..