diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index dc15da4d..bad5133d 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -23,7 +23,7 @@ // Disable this to cut excess debug messages -#define DEBUG_IMPORTER +//#define DEBUG_IMPORTER //const int PRS1_MAGIC_NUMBER = 2; //const int PRS1_SUMMARY_FILE=1; diff --git a/sleepyhead/mainwindow.cpp b/sleepyhead/mainwindow.cpp index 5706414b..8655702e 100644 --- a/sleepyhead/mainwindow.cpp +++ b/sleepyhead/mainwindow.cpp @@ -1814,6 +1814,14 @@ void MainWindow::on_action_Rebuild_Oximetry_Index_triggered() daily->LoadDate(getDaily()->getDate()); overview->ReloadGraphs(); } +void MainWindow::reloadProfile() +{ + QString username = p_profile->user->userName(); + int tabidx = ui->tabWidget->currentIndex(); + CloseProfile(); + OpenProfile(username); + ui->tabWidget->setCurrentIndex(tabidx); +} void MainWindow::RestartApplication(bool force_login, QString cmdline) { diff --git a/sleepyhead/mainwindow.h b/sleepyhead/mainwindow.h index 34b1c218..19a6bae5 100644 --- a/sleepyhead/mainwindow.h +++ b/sleepyhead/mainwindow.h @@ -339,6 +339,8 @@ class MainWindow : public QMainWindow void on_profilesButton_clicked(); + void reloadProfile(); + private: void importCPAPBackups(); void finishCPAPImport(); diff --git a/sleepyhead/preferencesdialog.cpp b/sleepyhead/preferencesdialog.cpp index 07a93655..b9049393 100644 --- a/sleepyhead/preferencesdialog.cpp +++ b/sleepyhead/preferencesdialog.cpp @@ -740,13 +740,13 @@ bool PreferencesDialog::Save() return false; } } else { recalc_events = false; } - } else if (needs_restart) { + } /*else if (needs_restart) { if (QMessageBox::question(this, tr("Restart Required"), tr("One or more of the changes you have made will require this application to be restarted,\nin order for these changes to come into effect.\n\nWould you like do this now?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) { return false; } - } + }*/ schema::channel[OXI_SPO2].setLowerThreshold(ui->oxiDesaturationThreshold->value()); schema::channel[OXI_Pulse].setLowerThreshold(ui->flagPulseBelow->value()); @@ -911,8 +911,9 @@ bool PreferencesDialog::Save() // send a signal instead? mainwin->reprocessEvents(needs_restart); } else if (needs_restart) { - profile->removeLock(); - mainwin->RestartApplication(); + QTimer::singleShot(0, mainwin, SLOT(reloadProfile())); +// profile->removeLock(); +// mainwin->RestartApplication(); } else { mainwin->getDaily()->LoadDate(mainwin->getDaily()->getDate()); // Save early.. just in case..