fix(cpn): QoL tweaks to joystick preferences (#3105)
* Add preference option to Companion to disable the 'Cannot open joystick, joystick disabled' popup warning when starting the simulator. * Don't erase joystick settings if user opens preferences dialog while joystick is not connected. Remove reference to "Ubuntu" font family for 'Radio Type' label in preferences dialog (generates warning on MacOS).
This commit is contained in:
@@ -78,6 +78,7 @@ void AppPreferencesDialog::accept()
|
||||
g.showSplash(ui->showSplash->isChecked());
|
||||
g.promptProfile(ui->chkPromptProfile->isChecked());
|
||||
g.simuSW(ui->simuSW->isChecked());
|
||||
g.disableJoystickWarning(ui->joystickWarningCB->isChecked());
|
||||
g.removeModelSlots(ui->opt_removeBlankSlots->isChecked());
|
||||
g.newModelAction((AppData::NewModelAction)ui->cboNewModelAction->currentIndex());
|
||||
g.historySize(ui->historySize->value());
|
||||
@@ -93,9 +94,11 @@ void AppPreferencesDialog::accept()
|
||||
g.appLogsDir(ui->appLogsDir->text());
|
||||
g.runAppInstaller(ui->chkPromptInstall->isChecked());
|
||||
|
||||
if (ui->joystickChkB ->isChecked() && ui->joystickCB->isEnabled()) {
|
||||
if (ui->joystickChkB ->isChecked()) {
|
||||
g.jsSupport(ui->joystickChkB ->isChecked());
|
||||
g.jsCtrl(ui->joystickCB ->currentIndex());
|
||||
// Don't overwrite selected joystick if not connected. Avoid surprising the user.
|
||||
if (ui->joystickCB->isEnabled())
|
||||
g.jsCtrl(ui->joystickCB ->currentIndex());
|
||||
}
|
||||
else {
|
||||
g.jsSupport(false);
|
||||
@@ -237,6 +240,7 @@ void AppPreferencesDialog::initSettings()
|
||||
}
|
||||
|
||||
ui->simuSW->setChecked(g.simuSW());
|
||||
ui->joystickWarningCB->setChecked(g.disableJoystickWarning());
|
||||
ui->opt_removeBlankSlots->setChecked(g.removeModelSlots());
|
||||
ui->cboNewModelAction->addItems(AppData::newModelActionsList());
|
||||
ui->cboNewModelAction->setCurrentIndex(g.newModelAction());
|
||||
|
||||
Reference in New Issue
Block a user