From b1b39e5e7ebd35165613f777cd65d213bd48580f Mon Sep 17 00:00:00 2001 From: Mark Watkins <jedimark@users.sourceforge.net> Date: Sat, 7 Jan 2012 17:02:23 +1000 Subject: [PATCH] Fix a very stupid crash. Enable New profile calendar popups. Fixed a spelling mistake in release notes --- SleepLib/session.cpp | 46 +++++++++++++++++++++++++++++++---------- docs/release_notes.html | 2 +- mainwindow.cpp | 5 +++++ newprofile.ui | 14 ++++++++++--- 4 files changed, 52 insertions(+), 15 deletions(-) diff --git a/SleepLib/session.cpp b/SleepLib/session.cpp index 187ca96b..a67ccabe 100644 --- a/SleepLib/session.cpp +++ b/SleepLib/session.cpp @@ -649,27 +649,51 @@ void Session::updateCountSummary(ChannelID code) EventList & e=*(ev.value()[i]); start=e.first(); cnt=e.count(); - tptr=e.rawTime(); dptr=e.rawData(); + qint64 rate=0; + if (e.type()==EVL_Event) + tptr=e.rawTime(); + else tptr=NULL; + m_gain[code]=e.gain(); //bool first=false; - lasttime=start + *tptr; lastraw=*dptr; + if (tptr) { + lasttime=start + *tptr; + // Event version + for (int j=0;j<cnt;j++) { + time=start + *tptr++; + raw=*dptr++; - for (int j=0;j<cnt;j++) { - time=start + *tptr++; - raw=*dptr++; + valsum[raw]++; - valsum[raw]++; + // elapsed time in seconds since last event + len=(time-lasttime) / 1000L; - // elapsed time in seconds since last event - len=(time-lasttime) / 1000L; + timesum[lastraw]+=len; - timesum[lastraw]+=len; + lastraw=raw; + lasttime=time; + } + } else { + QHash<EventStoreType, quint64> timesum2; - lastraw=raw; - lasttime=time; + // Waveform version + rate=e.rate(); + time=start; + for (int j=0;j<cnt;j++) { + raw=*dptr++; + valsum[raw]++; + timesum2[lastraw]+=rate; + lastraw=raw; + lasttime=time; + time+=rate; + } + + for (QHash<EventStoreType, quint64>::iterator it=timesum2.begin(); it!=timesum2.end(); it++) { + timesum[it.key()]+=it.value()/1000.0; + } } } if (valsum.size()==0) return; diff --git a/docs/release_notes.html b/docs/release_notes.html index f9d410b2..c44d9faa 100644 --- a/docs/release_notes.html +++ b/docs/release_notes.html @@ -42,7 +42,7 @@ The hard stuffs done, and everything needs time to settle and have the bugs knoc <i>But mostly we are talking serious bug smashing time!!!</i> </p> <p><b>Problems & Stuff?</b><br/> -SourceForge is still the best place to report bugs, and this is especially important now we have reached beta. If your following GIT source, they mailing list is still a quicker way of getting my attention.</p> +SourceForge is still the best place to report bugs, and this is especially important now we have reached beta. If your following GIT source, the mailing list is still a quicker way of getting my attention.</p> <p><b>Thanks</b><br/> Thanks to all of you for the wonderful support you've given, by testing the software, reporting bugs, sharing your data, giving kind words of encouragement, monetary donations, and all the cool suggestions on how to make this project even better. </p> <p>Special thanks to James M. (BreatheJimbo), who has been a huge help in getting things solid, espescially for Apple Mac users.</p> diff --git a/mainwindow.cpp b/mainwindow.cpp index 9c7dc0bd..dfc23143 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -79,6 +79,11 @@ MainWindow::MainWindow(QWidget *parent) : this->setWindowTitle(tr("SleepyHead")+QString(" v%1 (Profile: %2)").arg(version).arg(PREF[STR_GEN_Profile].toString())); //ui->tabWidget->setCurrentIndex(1); + // Disable Screenshot on Mac Platform,as it doesn't work, and the system provides this functionality anyway. +#ifdef Q_WS_MAC + ui->action_Screenshot->setVisible(false); +#endif + overview=NULL; daily=NULL; oximetry=NULL; diff --git a/newprofile.ui b/newprofile.ui index 49b79496..22de30ef 100644 --- a/newprofile.ui +++ b/newprofile.ui @@ -28,7 +28,7 @@ <item> <widget class="QStackedWidget" name="stackedWidget"> <property name="currentIndex"> - <number>4</number> + <number>2</number> </property> <widget class="QWidget" name="welcomePage"> <layout class="QVBoxLayout" name="verticalLayout_8"> @@ -364,7 +364,11 @@ p, li { white-space: pre-wrap; } <item row="2" column="1"> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QDateEdit" name="dobEdit"/> + <widget class="QDateEdit" name="dobEdit"> + <property name="calendarPopup"> + <bool>true</bool> + </property> + </widget> </item> <item> <widget class="QLabel" name="label_8"> @@ -585,7 +589,11 @@ p, li { white-space: pre-wrap; } </widget> </item> <item row="0" column="1"> - <widget class="QDateEdit" name="dateDiagnosedEdit"/> + <widget class="QDateEdit" name="dateDiagnosedEdit"> + <property name="calendarPopup"> + <bool>true</bool> + </property> + </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="label_4">