mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Handle ugly 'restarts' in preferences by gracefully reloading profile instead
This commit is contained in:
parent
cf72406ee6
commit
b9e1af63da
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -339,6 +339,8 @@ class MainWindow : public QMainWindow
|
||||
|
||||
void on_profilesButton_clicked();
|
||||
|
||||
void reloadProfile();
|
||||
|
||||
private:
|
||||
void importCPAPBackups();
|
||||
void finishCPAPImport();
|
||||
|
@ -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..
|
||||
|
Loading…
Reference in New Issue
Block a user