Convert Tooltip Timeout slider to seconds, extend limits

This commit is contained in:
Mark Watkins 2016-03-17 13:38:50 +10:00
parent f79f12be86
commit b6e4dfdad0
5 changed files with 253 additions and 220 deletions

View File

@ -129,6 +129,10 @@ QString STR_UNIT_CMH2O;
QString STR_UNIT_Hours;
QString STR_UNIT_Minutes;
QString STR_UNIT_Seconds;
QString STR_UNIT_h;
QString STR_UNIT_m;
QString STR_UNIT_s;
QString STR_UNIT_ms;
QString STR_UNIT_BPM; // Beats per Minute
QString STR_UNIT_LPM; // Litres per Minute
QString STR_UNIT_ml; // MilliLitres
@ -325,6 +329,10 @@ void initializeStrings()
STR_UNIT_Hours = QObject::tr("Hours");
STR_UNIT_Minutes = QObject::tr("Minutes");
STR_UNIT_Seconds = QObject::tr("Seconds");
STR_UNIT_h = QObject::tr("h"); // hours shortform
STR_UNIT_m = QObject::tr("m"); // minutes shortform
STR_UNIT_s = QObject::tr("s"); // seconds shortform
STR_UNIT_ms = QObject::tr("ms"); // milliseconds
STR_UNIT_EventsPerHour = QObject::tr("Events/hr"); // Events per hour
STR_UNIT_Percentage = QObject::tr("%");
STR_UNIT_Hz = QObject::tr("Hz"); // Hertz

View File

@ -159,6 +159,10 @@ extern QString STR_UNIT_CMH2O;
extern QString STR_UNIT_Hours;
extern QString STR_UNIT_Minutes;
extern QString STR_UNIT_Seconds;
extern QString STR_UNIT_h; // (h)ours, (m)inutes, (s)econds
extern QString STR_UNIT_m;
extern QString STR_UNIT_s;
extern QString STR_UNIT_ms;
extern QString STR_UNIT_BPM; // Beats per Minute
extern QString STR_UNIT_LPM; // Litres per Minute
extern QString STR_UNIT_ml; // millilitres

View File

@ -2102,6 +2102,8 @@ bool PRS1Import::ParseSummaryF5V2()
CPAPMode cpapmode = MODE_UNKNOWN;
summary_duration = data[0x18] | data[0x19] << 8;
return true;
}
bool PRS1Import::ParseSummaryF0V6()

View File

@ -173,14 +173,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
float f = profile->general->prefCalcPercentile();
ui->prefCalcPercentile->setValue(f);
ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout() / 50);
ui->tooltipMS->display(profile->general->tooltipTimeout());
ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout());
on_tooltipTimeoutSlider_valueChanged(ui->tooltipTimeoutSlider->value());
//ui->tooltipMS->display(profile->general->tooltipTimeout());
ui->scrollDampeningSlider->setValue(profile->general->scrollDampening() / 10);
if (profile->general->scrollDampening() > 0) {
ui->scrollDampDisplay->display(profile->general->scrollDampening());
} else { ui->scrollDampDisplay->display(STR_TR_Off); }
on_scrollDampeningSlider_valueChanged(ui->scrollDampeningSlider->value());
bool bcd = profile->session->backupCardData();
ui->createSDBackups->setChecked(bcd);
@ -723,7 +721,7 @@ bool PreferencesDialog::Save()
profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked());
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value() * 50);
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value());
profile->general->setScrollDampening(ui->scrollDampeningSlider->value() * 10);
profile->general->setShowUnknownFlags(ui->showUnknownFlags->isChecked());
@ -1068,13 +1066,13 @@ void PreferencesDialog::on_okButton_clicked()
void PreferencesDialog::on_scrollDampeningSlider_valueChanged(int value)
{
if (value > 0) {
ui->scrollDampDisplay->display(value * 10);
} else { ui->scrollDampDisplay->display(STR_TR_Off); }
ui->scrollDampDisplay->setText(QString("%1%2").arg(value * 10).arg(STR_UNIT_ms));
} else { ui->scrollDampDisplay->setText(STR_TR_Off); }
}
void PreferencesDialog::on_tooltipTimeoutSlider_valueChanged(int value)
{
ui->tooltipMS->display(value * 50);
ui->tooltipTimeoutDisplay->setText(QString("%1%2").arg(double(value)/1000.0,0,'f',1).arg(STR_UNIT_s));
}
void PreferencesDialog::on_resetChannelDefaults_clicked()

View File

@ -57,7 +57,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
<number>6</number>
</property>
<widget class="QWidget" name="importTab">
<attribute name="title">
@ -2146,215 +2146,6 @@ p, li { white-space: pre-wrap; }
<string>Graph Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="overviewLinecharts">
<item>
<property name="text">
<string>Bar Tops</string>
</property>
</item>
<item>
<property name="text">
<string>Line Chart</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_47">
<property name="text">
<string>Overview Linecharts</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QSlider" name="scrollDampeningSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This makes scrolling when zoomed in easier on sensitive bidirectional TouchPads&lt;/p&gt;&lt;p&gt;50ms is recommended value.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>25</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="scrollDampDisplay">
<property name="toolTip">
<string>milliseconds</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="digitCount">
<number>3</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QSlider" name="tooltipTimeoutSlider">
<property name="toolTip">
<string>How long you want the tooltips to stay visible.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>150</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>50</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="tooltipMS">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="digitCount">
<number>5</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_46">
<property name="text">
<string>Scroll Dampening</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_45">
<property name="text">
<string>Tooltip Timeout</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="graphHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Default display height of graphs in pixels</string>
</property>
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>180</number>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="graphTooltips">
<property name="text">
<string>Graph Tooltips</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.
</string>
</property>
<item>
<property name="text">
<string>Standard Bars</string>
</property>
</item>
<item>
<property name="text">
<string>Top Markers</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
@ -2391,6 +2182,30 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.
</string>
</property>
<item>
<property name="text">
<string>Standard Bars</string>
</property>
</item>
<item>
<property name="text">
<string>Top Markers</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
@ -2417,6 +2232,212 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_46">
<property name="text">
<string>Scroll Dampening</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QSlider" name="tooltipTimeoutSlider">
<property name="toolTip">
<string>How long you want the tooltips to stay visible.</string>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>30000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="pageStep">
<number>500</number>
</property>
<property name="value">
<number>5000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tooltipTimeoutDisplay">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_45">
<property name="text">
<string>Tooltip Timeout</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QSlider" name="scrollDampeningSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This makes scrolling when zoomed in easier on sensitive bidirectional TouchPads&lt;/p&gt;&lt;p&gt;50ms is recommended value.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>25</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scrollDampDisplay">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="graphHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Default display height of graphs in pixels</string>
</property>
<property name="minimum">
<number>50</number>
</property>
<property name="maximum">
<number>600</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>180</number>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="graphTooltips">
<property name="text">
<string>Graph Tooltips</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="overviewLinecharts">
<item>
<property name="text">
<string>Bar Tops</string>
</property>
</item>
<item>
<property name="text">
<string>Line Chart</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_47">
<property name="text">
<string>Overview Linecharts</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>