diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-12-28 02:20:36 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-09 07:09:29 +0100 |
commit | 80b198f17a751e34d6c946172faf241e0c28f806 (patch) | |
tree | 6b0f42e0da8b5da05feddda61f11cb2ae06eb12c /src/gui/setup_joystick.cpp | |
parent | 8e0bc98ddf2e2c0810136d39141ee4f3de445131 (diff) | |
download | mana-80b198f17a751e34d6c946172faf241e0c28f806.tar.gz mana-80b198f17a751e34d6c946172faf241e0c28f806.tar.bz2 mana-80b198f17a751e34d6c946172faf241e0c28f806.tar.xz mana-80b198f17a751e34d6c946172faf241e0c28f806.zip |
Fix wrong logic in the enable joystick setup option.
I also renamed the badly named members to clarify it all.
Part of Mana-Mantis #420.
Reviewed-by: Ablu.
Diffstat (limited to 'src/gui/setup_joystick.cpp')
-rw-r--r-- | src/gui/setup_joystick.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index de5ddf3f..506b0c0e 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -36,20 +36,20 @@ extern Joystick *joystick; Setup_Joystick::Setup_Joystick(): mCalibrateLabel(new Label(_("Press the button to start calibration"))), mCalibrateButton(new Button(_("Calibrate"), "calibrate", this)), - mJoystickEnabled(new CheckBox(_("Enable joystick"))) + mJoystickCheckBox(new CheckBox(_("Enable joystick"))) { setName(_("Joystick")); - mOriginalJoystickEnabled = !config.getBoolValue("joystickEnabled"); - mJoystickEnabled->setSelected(mOriginalJoystickEnabled); + mJoystickEnabled = config.getBoolValue("joystickEnabled"); + mJoystickCheckBox->setSelected(mJoystickEnabled); - mJoystickEnabled->addActionListener(this); + mJoystickCheckBox->addActionListener(this); // Do the layout LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); - place(0, 0, mJoystickEnabled); + place(0, 0, mJoystickCheckBox); place(0, 1, mCalibrateLabel); place.getCell().matchColWidth(0, 0); place = h.getPlacer(0, 1); @@ -65,9 +65,9 @@ void Setup_Joystick::action(const gcn::ActionEvent &event) return; } - if (event.getSource() == mJoystickEnabled) + if (event.getSource() == mJoystickCheckBox) { - joystick->setEnabled(mJoystickEnabled->isSelected()); + joystick->setEnabled(mJoystickCheckBox->isSelected()); } else { @@ -91,9 +91,9 @@ void Setup_Joystick::cancel() { if (joystick) { - joystick->setEnabled(mOriginalJoystickEnabled); + joystick->setEnabled(mJoystickEnabled); } - mJoystickEnabled->setSelected(mOriginalJoystickEnabled); + mJoystickCheckBox->setSelected(mJoystickEnabled); } void Setup_Joystick::apply() |