Fix zorder error messages, more session hiding related stuff

This commit is contained in:
Mark Watkins 2011-12-29 00:03:09 +10:00
parent bd9213bc1c
commit da952deba0
7 changed files with 75 additions and 22 deletions

View File

@ -271,6 +271,18 @@ qint64 Day::total_time()
}
return d_totaltime;
}
bool Day::hasEnabledSessions()
{
bool b=false;
for (QVector<Session *>::iterator s=begin();s!=end();s++) {
if ((*s)->enabled()) {
b=true;
break;
}
}
return b;
}
/*EventDataType Day::percentile(ChannelID code,double percent)
{
double val=0;

View File

@ -107,6 +107,9 @@ public:
//! \brief Returns the total time in milliseconds for this day
qint64 total_time();
//! \brief Returns true if this day has enabled sessions
bool hasEnabledSessions();
//! \brief Return the total time in decimal hours for this day
EventDataType hours() { return double(total_time())/3600000.0; }

View File

@ -404,7 +404,7 @@ void Daily::Link_clicked(const QUrl &url)
if (day) {
Session *sess=day->machine->sessionlist[sid];
if (sess) {
if (sess && sess->enabled()) {
GraphView->SetXBounds(sess->first(),sess->last());
}
}
@ -629,7 +629,7 @@ void Daily::Load(QDate date)
}
}
if (cpap && oxi) {
if ((cpap && oxi) && oxi->hasEnabledSessions()) {
int gr;
if (qAbs(cpap->first() - oxi->first())>30000) {
@ -911,7 +911,7 @@ void Daily::Load(QDate date)
html+="<tr><td colspan=5>&nbsp;</td></tr>\n";
}
if (oxi) {
if (oxi && oxi->hasEnabledSessions()) {
html+="<tr><td colspan=5 align=center>&nbsp;</td></tr>";
html+=QString("<tr><td colspan=5 align=center><b>%1</b></td></tr>\n").arg(tr("Oximeter Information"));
html+="<tr><td colspan=5 align=center><hr/></td></tr>";

View File

@ -158,6 +158,7 @@ MainWindow::MainWindow(QWidget *parent) :
"background: #9090ee;"
"color: white; }"
);
//"font-weight: bold; "
//"border-top-left-radius: 8px;"
//"border-top-right-radius: 8px;"
@ -1074,15 +1075,15 @@ void MainWindow::on_summaryButton_clicked()
}
void MainWindow::updateFavourites()
{
ui->favouritesList->blockSignals(true);
ui->favouritesList->clear();
QDate date=PROFILE.LastGoodDay();
QDate date=PROFILE.LastDay(MT_JOURNAL);
if (!date.isValid())
return;
ui->favouritesList->blockSignals(true);
ui->favouritesList->clear();
do {
Day * journal=PROFILE.GetGoodDay(date,MT_JOURNAL);
Day * journal=PROFILE.GetDay(date,MT_JOURNAL);
if (journal) {
if (journal->size()>0) {
Session *sess=(*journal)[0];
@ -1107,7 +1108,7 @@ void MainWindow::updateFavourites()
}
date=date.addDays(-1);
} while (date>=PROFILE.FirstGoodDay());
} while (date>=PROFILE.FirstDay(MT_JOURNAL));
ui->favouritesList->blockSignals(false);
}
@ -2152,7 +2153,7 @@ void MainWindow::on_favouritesList_itemSelectionChanged()
}
}
void MainWindow::on_favouritesList_itemClicked(QListWidgetItem *item)
/*void MainWindow::on_favouritesList_itemClicked(QListWidgetItem *item)
{
if (!item) return;
QDate date=item->data(Qt::UserRole).toDate();
@ -2163,7 +2164,7 @@ void MainWindow::on_favouritesList_itemClicked(QListWidgetItem *item)
daily->graphView()->redraw();
}
}
}
}*/
void MainWindow::on_webView_statusBarMessage(const QString &text)
{

View File

@ -86,7 +86,7 @@ public:
void CheckForUpdates();
//! \brief Refresh the statistics page
void refreshStatistics() { on_summaryButton_clicked(); updateFavourites(); }
void refreshStatistics() { on_summaryButton_clicked(); }
/*! \fn Notify(QString s,int ms=5000, QString title="SleepyHead v"+VersionString());
@ -265,7 +265,7 @@ private slots:
void on_favouritesList_itemSelectionChanged();
void on_favouritesList_itemClicked(QListWidgetItem *item);
//void on_favouritesList_itemClicked(QListWidgetItem *item);
void on_webView_statusBarMessage(const QString &text);

View File

@ -405,7 +405,7 @@
<number>1</number>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<property name="tabSpacing">
<number>0</number>
@ -737,13 +737,6 @@
</spacer>
</item>
</layout>
<zorder>dailyButton</zorder>
<zorder>overviewButton</zorder>
<zorder>verticalSpacer</zorder>
<zorder>oximetryButton</zorder>
<zorder>summaryButton_2</zorder>
<zorder>importButton</zorder>
<zorder>helpButton</zorder>
</widget>
<widget class="QWidget" name="page_2">
<property name="geometry">
@ -785,6 +778,15 @@
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>170</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
@ -796,6 +798,15 @@
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>170</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
@ -807,6 +818,15 @@
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>85</red>
<green>170</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
@ -815,6 +835,24 @@
<pointsize>10</pointsize>
</font>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
</widget>
</item>
</layout>

View File

@ -28,7 +28,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<zorder>frame</zorder>
</widget>
</item>
<item>