mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-21 15:25:12 +03:00
Simulator positions are always reloaded, setting controls whether they are saved or not
This commit is contained in:
parent
7caa79facd
commit
7f6d3f9e01
2 changed files with 169 additions and 150 deletions
|
@ -680,14 +680,12 @@ void SimulatorWidget::setupJoysticks()
|
|||
void SimulatorWidget::restoreRadioWidgetsState()
|
||||
{
|
||||
// All RadioWidgets
|
||||
if (g.simuSW()) {
|
||||
RadioWidget::RadioWidgetState state;
|
||||
QList<QByteArray> states = g.profile[radioProfileId].simulatorOptions().controlsState;
|
||||
foreach (QByteArray ba, states) {
|
||||
QDataStream stream(ba);
|
||||
stream >> state;
|
||||
emit widgetStateChange(state);
|
||||
}
|
||||
RadioWidget::RadioWidgetState state;
|
||||
QList<QByteArray> states = g.profile[radioProfileId].simulatorOptions().controlsState;
|
||||
foreach (QByteArray ba, states) {
|
||||
QDataStream stream(ba);
|
||||
stream >> state;
|
||||
emit widgetStateChange(state);
|
||||
}
|
||||
|
||||
// Set throttle stick down and locked, side depends on mode
|
||||
|
@ -701,8 +699,8 @@ void SimulatorWidget::restoreRadioWidgetsState()
|
|||
void SimulatorWidget::saveRadioWidgetsState(QList<QByteArray> & state)
|
||||
{
|
||||
if (m_radioWidgets.size()) {
|
||||
state.clear();
|
||||
if (g.simuSW()) {
|
||||
state.clear();
|
||||
foreach (RadioWidget * rw, m_radioWidgets)
|
||||
state.append(rw->getStateData());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue