Removed Profile tab from Preferences

This commit is contained in:
Mark Watkins 2011-10-02 14:23:17 +10:00
parent eed9aea63a
commit 591b73e7f3
2 changed files with 145 additions and 435 deletions

View File

@ -11,36 +11,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
{ {
ui->setupUi(this); ui->setupUi(this);
Q_ASSERT(profile!=NULL); Q_ASSERT(profile!=NULL);
ui->firstNameEdit->setText((*profile)["FirstName"].toString()); ui->tabWidget->setCurrentIndex(0);
ui->lastNameEdit->setText((*profile)["LastName"].toString());
ui->addressEdit->clear();
ui->addressEdit->appendPlainText((*profile)["Address"].toString());
ui->emailEdit->setText((*profile)["EmailAddress"].toString());
ui->phoneEdit->setText((*profile)["Phone"].toString());
QString gender;
if ((*profile).Exists("Gender")) {
gender=(*profile)["Gender"].toString().toLower();
} else gender="male";
// I know this looks sexist.. This was originally a boolean.. :)
if ((gender=="male") || (gender=="true")) ui->genderMale->setChecked(true);
else if ((gender=="female") || (gender=="false")) ui->genderFemale->setChecked(true);
bool ok;
ui->heightEdit->setValue((*profile)["Height"].toDouble(&ok));
if (!(*profile).Exists("DOB")) {
ui->dobEdit->setDate(QDate(1970,1,1));
} else {
ui->dobEdit->setDate((*profile)["DOB"].toDate());
}
int i=ui->unitCombo->findText((*profile)["UnitSystem"].toString()); int i=ui->unitCombo->findText((*profile)["UnitSystem"].toString());
if (i<0) i=0; if (i<0) i=0;
ui->unitCombo->setCurrentIndex(i); ui->unitCombo->setCurrentIndex(i);
i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString()); //i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString());
ui->timeZoneCombo->setCurrentIndex(i); //ui->timeZoneCombo->setCurrentIndex(i);
QTime t=pref["DaySplitTime"].toTime(); QTime t=pref["DaySplitTime"].toTime();
ui->timeEdit->setTime(t); ui->timeEdit->setTime(t);
@ -97,23 +74,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
row++; row++;
} }
} }
QLocale locale=QLocale::system(); /* QLocale locale=QLocale::system();
QString shortformat=locale.dateFormat(QLocale::ShortFormat); QString shortformat=locale.dateFormat(QLocale::ShortFormat);
if (!shortformat.toLower().contains("yyyy")) { if (!shortformat.toLower().contains("yyyy")) {
shortformat.replace("yy","yyyy"); shortformat.replace("yy","yyyy");
} }*/
ui->dobEdit->setDisplayFormat(shortformat);
ui->profileTab->setTabOrder(ui->firstNameEdit,ui->lastNameEdit);
ui->profileTab->setTabOrder(ui->lastNameEdit,ui->addressEdit);
ui->profileTab->setTabOrder(ui->addressEdit,ui->genderMale);
ui->profileTab->setTabOrder(ui->genderMale,ui->genderFemale);
ui->profileTab->setTabOrder(ui->genderFemale,ui->dobEdit);
ui->profileTab->setTabOrder(ui->dobEdit,ui->heightEdit);
ui->profileTab->setTabOrder(ui->heightEdit,ui->phoneEdit);
ui->profileTab->setTabOrder(ui->phoneEdit,ui->timeZoneCombo);
ui->profileTab->setTabOrder(ui->timeZoneCombo,ui->emailEdit);
ui->profileTab->setTabOrder(ui->emailEdit,ui->unitCombo);
} }
@ -145,18 +111,8 @@ void PreferencesDialog::on_eventTable_doubleClicked(const QModelIndex &index)
void PreferencesDialog::Save() void PreferencesDialog::Save()
{ {
(*profile)["FirstName"]=ui->firstNameEdit->text();
(*profile)["LastName"]=ui->lastNameEdit->text();
if (ui->genderMale->isChecked())
(*profile)["Gender"]="male";
else (*profile)["Gender"]="female";
(*profile)["Height"]=ui->heightEdit->value();
(*profile)["DOB"]=ui->dobEdit->date();
(*profile)["EmailAddress"]=ui->emailEdit->text();
(*profile)["Phone"]=ui->phoneEdit->text();
(*profile)["Address"]=ui->addressEdit->toPlainText();
(*profile)["UnitSystem"]=ui->unitCombo->currentText(); (*profile)["UnitSystem"]=ui->unitCombo->currentText();
(*profile)["TimeZone"]=ui->timeZoneCombo->currentText(); //(*profile)["TimeZone"]=ui->timeZoneCombo->currentText();
pref["CombineCloserSessions"]=ui->combineSlider->value(); pref["CombineCloserSessions"]=ui->combineSlider->value();
pref["IgnoreShorterSessions"]=ui->IgnoreSlider->value(); pref["IgnoreShorterSessions"]=ui->IgnoreSlider->value();

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>491</width> <width>477</width>
<height>299</height> <height>264</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -29,269 +29,151 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="profileTab"> <widget class="QWidget" name="tab_3">
<attribute name="title"> <attribute name="title">
<string>&amp;Profile</string> <string>&amp;CPAP/Visual</string>
</attribute> </attribute>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2"> <widget class="QLabel" name="label_17">
<item row="1" column="0"> <property name="sizePolicy">
<widget class="QLabel" name="label_8"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<string>Address:</string> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="alignment"> </property>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <property name="text">
</property> <string>Intentional Leak</string>
</widget> </property>
</item> </widget>
<item row="2" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Phone:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="phoneEdit"/>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLineEdit" name="firstNameEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>First Name:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="emailEdit"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Email:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_3">
<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="1" column="1">
<widget class="QPlainTextEdit" name="addressEdit">
<property name="tabChangesFocus">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item row="4" column="0">
<layout class="QGridLayout" name="gridLayout"> <widget class="QLabel" name="label_18">
<item row="1" column="0" colspan="2"> <property name="sizePolicy">
<widget class="QLabel" name="label_12"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<string>Gender:</string> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
<property name="text">
<string>Overlay Flags</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Unit System</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="useGraphSnapshots">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The Pie Chart in the Daily Views left panel.
This takes extra space, and has been known to cause problems on certain computer configurations, hence it's turned off by default.</string>
</property>
<property name="text">
<string>Graph Snapshots</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="intentionalLeakEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Intentional Leak value for your Mask type in Litres/Minute.
(ResMed machines only report unintentional leaks and don't need this)
</string>
</property>
<property name="suffix">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="overlayFlagsCombo">
<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>
<item row="1" column="2"> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <property name="text">
<item> <string>Top &amp; Bottom Markers</string>
<widget class="QRadioButton" name="genderMale"> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Male</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="genderFemale">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Female</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="2" column="0"> </widget>
<widget class="QLabel" name="label_10"> </item>
<property name="text"> <item row="4" column="3">
<string>D.O.B.:</string> <widget class="QCheckBox" name="useAntiAliasing">
</property> <property name="toolTip">
</widget> <string>Reduces the jagged edges on lines a little.</string>
</property>
<property name="text">
<string>Use Anti-Aliasing</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="unitCombo">
<item>
<property name="text">
<string>Metric</string>
</property>
</item> </item>
<item row="2" column="2"> <item>
<widget class="QDateEdit" name="dobEdit"> <property name="text">
<property name="sizePolicy"> <string>Dark Ages</string>
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> </property>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>You don't have to if you don't want. Some nifty calculations may need it.</string>
</property>
<property name="displayFormat">
<string>d/MM/yyyy</string>
</property>
</widget>
</item> </item>
<item row="3" column="0"> </widget>
<widget class="QLabel" name="label_11"> </item>
<property name="text"> <item row="6" column="3">
<string>Height:</string> <widget class="QCheckBox" name="useMultithreading">
</property> <property name="toolTip">
</widget> <string>You may need to disable this if your experiencing crashes.
</item> It has no effect on single cpu machines.</string>
<item row="3" column="2"> </property>
<widget class="QDoubleSpinBox" name="heightEdit"> <property name="text">
<property name="sizePolicy"> <string>Use Multi-Threading</string>
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> </property>
<horstretch>1</horstretch> </widget>
<verstretch>0</verstretch> </item>
</sizepolicy> <item row="8" column="0" colspan="4">
</property> <spacer name="verticalSpacer_4">
<property name="toolTip"> <property name="orientation">
<string>Used in BMI calculations. Americans, please us decimal inches here, unless you speak metric.</string> <enum>Qt::Vertical</enum>
</property> </property>
<property name="minimum"> <property name="sizeHint" stdset="0">
<double>0.000000000000000</double> <size>
</property> <width>264</width>
<property name="maximum"> <height>108</height>
<double>299.990000000000009</double> </size>
</property> </property>
</widget> </spacer>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLineEdit" name="lastNameEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Last Name:</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QComboBox" name="timeZoneCombo">
<item>
<property name="text">
<string>The Moon</string>
</property>
</item>
<item>
<property name="text">
<string>Jupiter</string>
</property>
</item>
<item>
<property name="text">
<string>Ursa Minor</string>
</property>
</item>
<item>
<property name="text">
<string>Yo Momma!</string>
</property>
</item>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Time Zone:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<spacer name="verticalSpacer_2">
<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="5" column="2">
<widget class="QComboBox" name="unitCombo">
<property name="toolTip">
<string/>
</property>
<item>
<property name="text">
<string>Metric</string>
</property>
</item>
<item>
<property name="text">
<string>Dark Ages</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Unit System:</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -514,134 +396,6 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>&amp;CPAP/Visual</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Intentional Leak</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="intentionalLeakEdit">
<property name="toolTip">
<string>Intentional Leak value for your Mask type in Litres/Minute.
(ResMed machines only report unintentional leaks and don't need this)
</string>
</property>
<property name="suffix">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="useGraphSnapshots">
<property name="toolTip">
<string>The Pie Chart in the Daily Views left panel.
This takes extra space, and has been known to cause problems on certain computer configurations, hence it's turned off by default.</string>
</property>
<property name="text">
<string>Graph Snapshots</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Overlay Flags</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="overlayFlagsCombo">
<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 &amp; Bottom Markers</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="useAntiAliasing">
<property name="toolTip">
<string>Reduces the jagged edges on lines a little.</string>
</property>
<property name="text">
<string>Use Anti-Aliasing</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>264</width>
<height>108</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>185</width>
<height>108</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="useMultithreading">
<property name="toolTip">
<string>You may need to disable this if your experiencing crashes.
It has no effect on single cpu machines.</string>
</property>
<property name="text">
<string>Use Multi-Threading</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2"> <widget class="QWidget" name="tab_2">
<attribute name="title"> <attribute name="title">
<string>&amp;Events</string> <string>&amp;Events</string>