Moved Event View size from Preferences to underneath Event tab

This commit is contained in:
Mark Watkins 2011-11-27 17:41:00 +10:00
parent 9bf2f5ce97
commit 13cf5229e6
5 changed files with 77 additions and 98 deletions

View File

@ -234,6 +234,12 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
ui->webView->settings()->setFontSize(QWebSettings::DefaultFontSize,QApplication::font().pointSize());
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(ui->webView,SIGNAL(linkClicked(QUrl)),this,SLOT(on_Link_clicked(QUrl)));
if (!PROFILE.Exists("EventViewSize")) PROFILE["EventViewSize"]=4;
int ews=PROFILE["EventViewSize"].toInt();
ui->evViewSlider->setValue(ews);
ui->evViewLCD->display(ews);
// TODO: Add preference to hide do this for Widget Haters..
//ui->calNavWidget->hide();
}
@ -907,7 +913,7 @@ void Daily::on_treeWidget_itemSelectionChanged()
QDateTime d;
if (!item->text(1).isEmpty()) {
d=d.fromString(item->text(1),"yyyy-MM-dd HH:mm:ss");
int winsize=PROFILE["EventWindowSize"].toInt()*60;
int winsize=PROFILE["EventViewSize"].toInt()*60;
double st=qint64((d.addSecs(-(winsize/2))).toTime_t())*1000L;
double et=qint64((d.addSecs(winsize/2)).toTime_t())*1000L;
@ -978,3 +984,9 @@ void Daily::on_todayButton_clicked()
LoadDate(d);
}
void Daily::on_evViewSlider_valueChanged(int value)
{
ui->evViewLCD->display(value);
PROFILE["EventViewSize"]=value;
}

View File

@ -66,6 +66,8 @@ private slots:
void on_todayButton_clicked();
void on_Link_clicked(const QUrl &url);
void on_evViewSlider_valueChanged(int value);
protected:
private:

View File

@ -251,7 +251,7 @@
</size>
</property>
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<property name="movable">
<bool>true</bool>
@ -291,7 +291,10 @@
<attribute name="title">
<string>Events</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
@ -319,6 +322,52 @@
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>View Size</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="evViewSlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="evViewLCD">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="numDigits">
<number>3</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="notes">

View File

@ -95,10 +95,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
if (!(*profile).Exists("SquareWavePlots")) (*profile)["SquareWavePlots"]=true;
ui->squareWavePlots->setChecked((*profile)["SquareWavePlots"].toBool());
if (!(*profile).Exists("EventWindowSize")) (*profile)["EventWindowSize"]=4;
ui->eventWindowSlider->setValue((*profile)["EventWindowSize"].toInt());
ui->eventWindowLCD->display((*profile)["EventWindowSize"].toInt());
if (!PREF.Exists("Updates_AutoCheck")) PREF["Updates_AutoCheck"]=true;
ui->automaticallyCheckUpdates->setChecked(PREF["Updates_AutoCheck"].toBool());
@ -239,8 +235,6 @@ void PreferencesDialog::Save()
PREF["SkipLoginScreen"]=ui->skipLoginScreen->isChecked();
(*profile)["EventWindowSize"]=ui->eventWindowSlider->value();
if (ui->squareWavePlots->isChecked() != (*profile)["SquareWavePlots"].toBool()) {
needs_restart=true;
}

View File

@ -45,7 +45,7 @@
<string>&amp;CPAP/Visual</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -58,7 +58,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -71,7 +71,7 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@ -84,7 +84,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="intentionalLeakEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -102,7 +102,7 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="6" column="1">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.</string>
@ -119,7 +119,7 @@
</item>
</widget>
</item>
<item row="9" column="1">
<item row="8" column="1">
<widget class="QComboBox" name="unitCombo">
<item>
<property name="text">
@ -133,7 +133,7 @@
</item>
</widget>
</item>
<item row="17" column="0" colspan="3">
<item row="16" column="0" colspan="3">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -146,7 +146,7 @@
</property>
</spacer>
</item>
<item row="3" column="2">
<item row="2" column="2">
<widget class="QCheckBox" name="useGraphSnapshots">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -163,7 +163,7 @@ This takes extra space, and has been known to cause problems on certain computer
</property>
</widget>
</item>
<item row="7" column="2">
<item row="6" column="2">
<widget class="QCheckBox" name="useAntiAliasing">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -179,76 +179,14 @@ This takes extra space, and has been known to cause problems on certain computer
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Event List View</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QSlider" name="eventWindowSlider">
<property name="toolTip">
<string>This adjusts how much surrounding data is shown when an event is selected in Daily Views Event tab.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>30</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::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_25">
<property name="text">
<string>(minutes)</string>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="eventWindowLCD">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="numDigits">
<number>2</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="2">
<item row="8" column="2">
<widget class="QCheckBox" name="squareWavePlots">
<property name="text">
<string>Square Wave Plots</string>
</property>
</widget>
</item>
<item row="12" column="2">
<item row="11" column="2">
<widget class="QCheckBox" name="skipEmptyDays">
<property name="toolTip">
<string>Skip empty days with Prev &amp; Next buttons above daily view calendar</string>
@ -1357,21 +1295,5 @@ It has no effect on single cpu machines.</string>
</hint>
</hints>
</connection>
<connection>
<sender>eventWindowSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>eventWindowLCD</receiver>
<slot>display(int)</slot>
<hints>
<hint type="sourcelabel">
<x>300</x>
<y>56</y>
</hint>
<hint type="destinationlabel">
<x>564</x>
<y>56</y>
</hint>
</hints>
</connection>
</connections>
</ui>