Added tooltip timeout slider in Appearance Preferences, removed empty preferences page.

This commit is contained in:
Mark Watkins 2012-05-17 03:04:22 +10:00
parent a47559f9ba
commit a1a52b8625
5 changed files with 48 additions and 11 deletions

View File

@ -2978,7 +2978,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
if (i<count) {
ChannelID code=fg->visibleLayers()[i]->code();
QString ttip=schema::channel[code].description();
m_tooltip->display(ttip,x,y-20,800);
m_tooltip->display(ttip,x,y-20,p_profile->general->tooltipTimeout());
redraw();
//qDebug() << code << ttip;
}
@ -2989,7 +2989,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
}
} else {
if (!m_graphs[i]->units().isEmpty()) {
m_tooltip->display(m_graphs[i]->units(),x,y-20,800);
m_tooltip->display(m_graphs[i]->units(),x,y-20,p_profile->general->tooltipTimeout());
redraw();
}
}

View File

@ -842,11 +842,11 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
}
graph->ToolTip(z,x,y-15,2200);
graph->ToolTip(z,x,y-15,p_profile->general->tooltipTimeout());
return true;
} else {
QString z=dt.toString(Qt::SystemLocaleShortDate)+"\r\nNo Data";
graph->ToolTip(z,x,y-15,2200);
graph->ToolTip(z,x,y-15,p_profile->general->tooltipTimeout());
return true;
}
}

View File

@ -240,6 +240,7 @@ const QString STR_US_ShowSerialNumbers="ShowSerialNumbers";
const QString STR_US_PrefCalcMiddle="PrefCalcMiddle";
const QString STR_US_PrefCalcPercentile="PrefCalcPercentile";
const QString STR_US_PrefCalcMax="PrefCalcMax";
const QString STR_US_TooltipTimeout="TooltipTimeout";
class DoctorInfo
@ -584,6 +585,7 @@ public:
if (!m_profile->contains(STR_US_PrefCalcMiddle)) (*m_profile)[STR_US_PrefCalcMiddle]=(int)0;
if (!m_profile->contains(STR_US_PrefCalcPercentile)) (*m_profile)[STR_US_PrefCalcPercentile]=(double)95.0;
if (!m_profile->contains(STR_US_PrefCalcMax)) (*m_profile)[STR_US_PrefCalcMax]=(int)0;
if (!m_profile->contains(STR_US_TooltipTimeout)) (*m_profile)[STR_US_TooltipTimeout]=(int)2500;
}
~UserSettings() {}
@ -600,6 +602,7 @@ public:
int prefCalcMiddle() { return (*m_profile)[STR_US_PrefCalcMiddle].toInt(); }
double prefCalcPercentile() { return (*m_profile)[STR_US_PrefCalcPercentile].toDouble(); }
int prefCalcMax() { return (*m_profile)[STR_US_PrefCalcMax].toInt(); }
int tooltipTimeout() { return (*m_profile)[STR_US_TooltipTimeout].toInt(); }
void setUnitSystem(UnitSystem us) { (*m_profile)[STR_US_UnitSystem]=(int)us; }
@ -613,6 +616,7 @@ public:
void setPrefCalcMiddle(int i) { (*m_profile)[STR_US_PrefCalcMiddle]=i; }
void setPrefCalcPercentile(double p) { (*m_profile)[STR_US_PrefCalcPercentile]=p; }
void setPrefCalcMax(int i) { (*m_profile)[STR_US_PrefCalcMax]=i; }
void setTooltipTimeout(int i) { (*m_profile)[STR_US_TooltipTimeout]=i; }
Profile *m_profile;
};

View File

@ -175,6 +175,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
float f=profile->general->prefCalcPercentile();
ui->prefCalcPercentile->setValue(f);
ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout());
bool bcd=profile->session->backupCardData();
ui->createSDBackups->setChecked(bcd);
@ -346,6 +347,8 @@ bool PreferencesDialog::Save()
profile->appearance->setSquareWavePlots(ui->useSquareWavePlots->isChecked());
profile->appearance->setGraphSnapshots(ui->enableGraphSnapshots->isChecked());
profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked());
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value());
profile->session->setMultithreading(ui->enableMultithreading->isChecked());
profile->session->setCacheSessions(ui->cacheSessionData->isChecked());
profile->cpap->setMaskDescription(ui->maskDescription->text());

View File

@ -42,7 +42,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>6</number>
</property>
<widget class="QWidget" name="importTab">
<attribute name="title">
@ -1794,11 +1794,6 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Page</string>
</attribute>
</widget>
<widget class="QWidget" name="appearanceTab">
<attribute name="title">
<string>&amp;Appearance</string>
@ -1887,7 +1882,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -1900,6 +1895,41 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QSlider" name="tooltipTimeoutSlider">
<property name="toolTip">
<string>How long you want the tooltips to stay visible.</string>
</property>
<property name="minimum">
<number>250</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>250</number>
</property>
<property name="pageStep">
<number>1000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>250</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_45">
<property name="text">
<string>Tooltip Timeout</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>