Fix unitChanged(int) signal in preferences

.. needed to be reconnected across pages to ensure the
   weight/height fields et al changed units when the user
   changed metric/imperial preferences.
This commit is contained in:
Mark Liversedge
2015-10-05 10:04:36 +01:00
parent 3b5fde4158
commit 1f567a7d30
4 changed files with 5 additions and 6 deletions

View File

@@ -131,6 +131,9 @@ ConfigDialog::ConfigDialog(QDir _home, Zones *_zones, Context *context) :
athlete->setWhatsThis(athleteHelp->getWhatsThisText(HelpWhatsThis::Preferences_Athlete_About));
pagesWidget->addWidget(athlete);
// units change on general affects units used on entry in athlete pages
connect (general->generalPage->unitCombo, SIGNAL(currentIndexChanged(int)), athlete->athletePage, SLOT(unitChanged(int)));
password = new PasswordConfig(_home, _zones, context);
HelpWhatsThis *passwordHelp = new HelpWhatsThis(password);
password->setWhatsThis(passwordHelp->getWhatsThisText(HelpWhatsThis::Preferences_Passwords));

View File

@@ -62,6 +62,7 @@ class AthleteConfig : public QWidget
public:
AthleteConfig(QDir home, Zones *zones, Context *context);
RiderPage *athletePage;
public slots:
qint32 saveClicked();
@@ -72,7 +73,6 @@ class AthleteConfig : public QWidget
Context *context;
// about me, power ones and hr zones
RiderPage *athletePage;
ZonePage *zonePage;
HrZonePage *hrZonePage;
PaceZonePage *paceZonePage;

View File

@@ -105,9 +105,6 @@ GeneralPage::GeneralPage(Context *context) : context(context)
configLayout->addWidget(unitlabel, 1,0, Qt::AlignRight);
configLayout->addWidget(unitCombo, 1,1, Qt::AlignLeft);
connect (unitCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));
//
// Garmin crap
//

View File

@@ -77,6 +77,7 @@ class GeneralPage : public QWidget
qint32 saveClicked();
QString athleteWAS; // remember what we started with !
QComboBox *unitCombo;
public slots:
void browseWorkoutDir();
@@ -98,8 +99,6 @@ class GeneralPage : public QWidget
QLineEdit *workoutDirectory;
QPushButton *workoutBrowseButton;
QPushButton *athleteBrowseButton;
QComboBox *unitCombo;
QLabel *langLabel;
QLabel *warningLabel;