minor improvement of last commit

This commit is contained in:
thrust26 2017-10-03 20:42:02 +02:00
parent 9ac4a57498
commit 0839bcb8d7
3 changed files with 11 additions and 10 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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;