diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index 73a69626f..f6fddc884 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -392,7 +392,7 @@ void GameInfoDialog::loadConfig() } } - updateStates(); + updateControllerStates(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -498,8 +498,8 @@ void GameInfoDialog::saveConfig() // Controller properties myGameProperties.set(Controller_Left, myP0Controller->getSelectedTag().toString()); myGameProperties.set(Controller_Right, myP1Controller->getSelectedTag().toString()); - myGameProperties.set(Console_SwapPorts, mySwapPorts->getState() ? "YES" : "NO"); - myGameProperties.set(Controller_SwapPaddles, mySwapPaddles->getState() ? "YES" : "NO"); + myGameProperties.set(Console_SwapPorts, (mySwapPorts->isEnabled() && mySwapPorts->getState()) ? "YES" : "NO"); + myGameProperties.set(Controller_SwapPaddles, (mySwapPaddles->isEnabled() && mySwapPaddles->getState()) ? "YES" : "NO"); // MouseAxis property (potentially contains 'range' information) string mcontrol = myMouseControl->getSelectedTag().toString(); @@ -546,7 +546,7 @@ void GameInfoDialog::setDefaults() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void GameInfoDialog::updateStates(int cmd) +void GameInfoDialog::updateControllerStates(int cmd) { string contrP0 = myP0Controller->getSelectedTag().toString(); string contrP1 = myP1Controller->getSelectedTag().toString(); @@ -583,11 +583,11 @@ void GameInfoDialog::updateStates(int cmd) } mySwapPorts->setEnabled(enableSwapPorts); - if(!enableSwapPaddles) - mySwapPorts->setState(false); + //if(!enableSwapPaddles) + // mySwapPorts->setState(false); mySwapPaddles->setEnabled(enableSwapPaddles); - if(!enableSwapPaddles) - mySwapPaddles->setState(false); + //if(!enableSwapPaddles) + // mySwapPaddles->setState(false); myEraseEEPROMLabel->setEnabled(enableEEEraseButton); myEraseEEPROMButton->setEnabled(enableEEEraseButton); @@ -630,7 +630,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd, case kLeftCChanged: case kRightCChanged: - updateStates(cmd); + updateControllerStates(cmd); break; case kEEButtonPressed: diff --git a/src/gui/GameInfoDialog.hxx b/src/gui/GameInfoDialog.hxx index bf4d55e2e..d214e8be3 100644 --- a/src/gui/GameInfoDialog.hxx +++ b/src/gui/GameInfoDialog.hxx @@ -45,7 +45,7 @@ class GameInfoDialog : public Dialog, public CommandSender void setDefaults() override; void loadView(); - void updateStates(int cmd = 0); + void updateControllerStates(int cmd = 0); void eraseEEPROM(); private: diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 211dd4b8a..1f7cf2c91 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -186,6 +186,7 @@ class StaticTextWidget : public Widget void setLabel(const string& label); void setAlign(TextAlignment align) { _align = align; } const string& getLabel() const { return _label; } + bool isEditable() const { return _editable; } protected: void drawWidget(bool hilite) override;