Reenable Journal

This commit is contained in:
Mark Watkins 2011-09-18 01:41:31 +10:00
parent b47572912e
commit caeaa4b199
2 changed files with 9 additions and 8 deletions

View File

@ -109,6 +109,7 @@ const QString OXI_SPO2Drop="SPO2Drop";
const QString OXI_Plethy="Plethy"; const QString OXI_Plethy="Plethy";
const QString CPAP_AHI="AHI"; const QString CPAP_AHI="AHI";
const QString Journal_Notes="Journal";
#endif // MACHINE_COMMON_H #endif // MACHINE_COMMON_H

View File

@ -603,27 +603,27 @@ void Daily::Load(QDate date)
ui->webView->setHtml(html); ui->webView->setHtml(html);
/*ui->JournalNotes->clear(); ui->JournalNotes->clear();
Session *journal=GetJournalSession(date); Session *journal=GetJournalSession(date);
if (journal) { if (journal) {
ui->JournalNotes->setHtml(journal->settings[JOURNAL_Notes].toString()); ui->JournalNotes->setHtml(journal->settings[Journal_Notes].toString());
}*/ }
} }
void Daily::Unload(QDate date) void Daily::Unload(QDate date)
{ {
/*Session *journal=GetJournalSession(date); Session *journal=GetJournalSession(date);
if (!ui->JournalNotes->toPlainText().isEmpty()) { if (!ui->JournalNotes->toPlainText().isEmpty()) {
QString jhtml=ui->JournalNotes->toHtml(); QString jhtml=ui->JournalNotes->toHtml();
if (journal) { if (journal) {
if (journal->settings[JOURNAL_Notes]!=jhtml) { if (journal->settings[Journal_Notes]!=jhtml) {
journal->settings[JOURNAL_Notes]=jhtml; journal->settings[Journal_Notes]=jhtml;
journal->SetChanged(true); journal->SetChanged(true);
} }
} else { } else {
journal=CreateJournalSession(date); journal=CreateJournalSession(date);
journal->settings[JOURNAL_Notes]=jhtml; journal->settings[Journal_Notes]=jhtml;
journal->SetChanged(true); journal->SetChanged(true);
} }
@ -631,7 +631,7 @@ void Daily::Unload(QDate date)
if (journal) { if (journal) {
Machine *jm=profile->GetMachine(MT_JOURNAL); Machine *jm=profile->GetMachine(MT_JOURNAL);
if (jm) jm->SaveSession(journal); if (jm) jm->SaveSession(journal);
} */ }
UpdateCalendarDay(date); UpdateCalendarDay(date);
} }