From 591b73e7f37d899aa1f28d89c32efe185c93aaf6 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 2 Oct 2011 14:23:17 +1000 Subject: [PATCH] Removed Profile tab from Preferences --- preferencesdialog.cpp | 56 +---- preferencesdialog.ui | 524 +++++++++++------------------------------- 2 files changed, 145 insertions(+), 435 deletions(-) diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index ad34d7eb..df474e63 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -11,36 +11,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : { ui->setupUi(this); Q_ASSERT(profile!=NULL); - ui->firstNameEdit->setText((*profile)["FirstName"].toString()); - 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()); - } + ui->tabWidget->setCurrentIndex(0); int i=ui->unitCombo->findText((*profile)["UnitSystem"].toString()); if (i<0) i=0; ui->unitCombo->setCurrentIndex(i); - i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString()); - ui->timeZoneCombo->setCurrentIndex(i); + //i=ui->timeZoneCombo->findText((*profile)["TimeZone"].toString()); + //ui->timeZoneCombo->setCurrentIndex(i); QTime t=pref["DaySplitTime"].toTime(); ui->timeEdit->setTime(t); @@ -97,23 +74,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : row++; } } - QLocale locale=QLocale::system(); +/* QLocale locale=QLocale::system(); QString shortformat=locale.dateFormat(QLocale::ShortFormat); if (!shortformat.toLower().contains("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() { - (*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)["TimeZone"]=ui->timeZoneCombo->currentText(); + //(*profile)["TimeZone"]=ui->timeZoneCombo->currentText(); pref["CombineCloserSessions"]=ui->combineSlider->value(); pref["IgnoreShorterSessions"]=ui->IgnoreSlider->value(); diff --git a/preferencesdialog.ui b/preferencesdialog.ui index 6a02c2e6..8802aec6 100644 --- a/preferencesdialog.ui +++ b/preferencesdialog.ui @@ -9,8 +9,8 @@ 0 0 - 491 - 299 + 477 + 264 @@ -29,269 +29,151 @@ - 2 + 0 - + - &Profile + &CPAP/Visual - - - - - - - Address: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Phone: - - - - - - - - - - - - - 1 - 0 - - - - - - - - - - - - - First Name: - - - - - - - - - - Email: - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - true - - - - + + + + + + 0 + 0 + + + + Intentional Leak + + - - - - - - Gender: - - + + + + + 0 + 0 + + + + Overlay Flags + + + + + + + + 0 + 0 + + + + Unit System + + + + + + + + 0 + 0 + + + + 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. + + + Graph Snapshots + + + + + + + + 0 + 0 + + + + Intentional Leak value for your Mask type in Litres/Minute. +(ResMed machines only report unintentional leaks and don't need this) + + + + + + + + + + + The visual method of displaying waveform overlay flags. + + + + Standard Bars + - - - - - - - 1 - 0 - - - - Male - - - - - - - - 1 - 0 - - - - Female - - - - + + + Top & Bottom Markers + - - - - D.O.B.: - - + + + + + + Reduces the jagged edges on lines a little. + + + Use Anti-Aliasing + + + + + + + + Metric + - - - - - 1 - 0 - - - - You don't have to if you don't want. Some nifty calculations may need it. - - - d/MM/yyyy - - + + + Dark Ages + - - - - Height: - - - - - - - - 1 - 0 - - - - Used in BMI calculations. Americans, please us decimal inches here, unless you speak metric. - - - 0.000000000000000 - - - 299.990000000000009 - - - - - - - - - - 1 - 0 - - - - - - - - - - Last Name: - - - - - - - - The Moon - - - - - Jupiter - - - - - Ursa Minor - - - - - Yo Momma! - - - - - - - - Time Zone: - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Metric - - - - - Dark Ages - - - - - - - - Unit System: - - - - + + + + + + You may need to disable this if your experiencing crashes. +It has no effect on single cpu machines. + + + Use Multi-Threading + + + + + + + Qt::Vertical + + + + 264 + 108 + + + @@ -514,134 +396,6 @@ p, li { white-space: pre-wrap; } - - - &CPAP/Visual - - - - - - - - - 0 - 0 - - - - Intentional Leak - - - - - - - Intentional Leak value for your Mask type in Litres/Minute. -(ResMed machines only report unintentional leaks and don't need this) - - - - - - - - - - - - - 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. - - - Graph Snapshots - - - - - - - - - - 0 - 0 - - - - Overlay Flags - - - - - - - The visual method of displaying waveform overlay flags. - - - - Standard Bars - - - - - Top & Bottom Markers - - - - - - - - - - Reduces the jagged edges on lines a little. - - - Use Anti-Aliasing - - - - - - - Qt::Vertical - - - - 264 - 108 - - - - - - - - Qt::Vertical - - - - 185 - 108 - - - - - - - - You may need to disable this if your experiencing crashes. -It has no effect on single cpu machines. - - - Use Multi-Threading - - - - - &Events