mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-23 16:25:12 +03:00
Fix "Remember simulator switch values"
This commit is contained in:
parent
555438b7a7
commit
6232cebe00
1 changed files with 12 additions and 8 deletions
|
@ -680,12 +680,14 @@ void SimulatorWidget::setupJoysticks()
|
||||||
void SimulatorWidget::restoreRadioWidgetsState()
|
void SimulatorWidget::restoreRadioWidgetsState()
|
||||||
{
|
{
|
||||||
// All RadioWidgets
|
// All RadioWidgets
|
||||||
RadioWidget::RadioWidgetState state;
|
if (g.simuSW()) {
|
||||||
QList<QByteArray> states = g.profile[radioProfileId].simulatorOptions().controlsState;
|
RadioWidget::RadioWidgetState state;
|
||||||
foreach (QByteArray ba, states) {
|
QList<QByteArray> states = g.profile[radioProfileId].simulatorOptions().controlsState;
|
||||||
QDataStream stream(ba);
|
foreach (QByteArray ba, states) {
|
||||||
stream >> state;
|
QDataStream stream(ba);
|
||||||
emit widgetStateChange(state);
|
stream >> state;
|
||||||
|
emit widgetStateChange(state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set throttle stick down and locked, side depends on mode
|
// Set throttle stick down and locked, side depends on mode
|
||||||
|
@ -700,8 +702,10 @@ void SimulatorWidget::saveRadioWidgetsState(QList<QByteArray> & state)
|
||||||
{
|
{
|
||||||
if (m_radioWidgets.size()) {
|
if (m_radioWidgets.size()) {
|
||||||
state.clear();
|
state.clear();
|
||||||
foreach (RadioWidget * rw, m_radioWidgets)
|
if (g.simuSW()) {
|
||||||
state.append(rw->getStateData());
|
foreach (RadioWidget * rw, m_radioWidgets)
|
||||||
|
state.append(rw->getStateData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue